[ invention ]
In order to solve the above problems in the prior art, the present invention provides a file management method, which can support subsequent file management centered on a user through the storage of the file read-write operation centered on the user, thereby saving the storage space of the user to the maximum extent, improving the storage utilization rate of intelligent equipment, reducing the energy consumption of the whole system, and achieving the purposes of energy saving and environmental protection, and the method comprises the following steps:
s1: acquiring the read-write operation of a current user on a file;
s2: and carrying out two-dimensional association storage on the read-write information and the current user information.
Further, in step S2, when a read-write operation of a current user on a file occurs, an identifier of the current user and a type of the read-write operation are obtained, the current user identifier and the type of the read-write operation thereof and the file are stored in an associated manner, the associated storage is stored as a first associated file, the file identifier and the type of the read-write operation thereof and the current user identifier are stored in an associated manner, and the associated storage is stored as a second associated file.
Further, the storing the current user identifier and the read-write operation type thereof in association with the file specifically includes: storing the current user identifier and the type of the read-write operation thereof in a time sequence and the file association, storing the association storage aiming at each file in a distinguished storage space, and storing the current user identifier, the read-write operation thereof and the time of the read-write operation thereof in the storage space in a time sequence in a form of triples.
Further, the step S2 further includes: and carrying out hash mapping on the current user identifier and the type of the read-write operation thereof to obtain a key value.
Further, the key value, the current user identifier, the read-write operation and the occurrence time of the read-write operation are stored in the storage space in a four-element mode according to time sequence.
Further, the key values are stored in a key value sequence table from small to large according to the size of the key values, and when the key values are searched, the searching speed can be improved through a quick searching algorithm.
Further, the fast search algorithm is a dichotomy.
Further, the time when the read-write operation occurs and the type of the read-write operation are stored together.
Further, the common storage is stored in the same table record.
Further, the types of the read-write operation include: and (3) a read operation and a write operation.
The beneficial effects of the invention include: by storing the file read-write operation with the user as the center, the subsequent file management with the user as the center can be supported, so that the storage space of the user is saved to the greatest extent, the storage utilization rate of the intelligent equipment is improved, the energy consumption of the whole system is reduced, and the purposes of energy conservation and environmental protection are achieved.
[ detailed description ] of the invention
The present invention will now be described in detail with reference to the drawings and the specific embodiments thereof, wherein the exemplary embodiments and the description are for the purpose of illustrating the invention only and are not to be construed as limiting the invention.
A file management method applied to the present invention will be described in detail, and the method includes the following steps:
s1: acquiring the read-write operation of a current user on a file, and carrying out two-dimensional association storage on the read-write information and the current user information; specific: when the read-write operation of a current user on a file occurs, acquiring an identifier of the current user and a read-write operation type, storing the current user identifier, the read-write operation type and the file in an associated mode, storing the associated mode as a first associated file, storing the file identifier, the read-write operation type and the current user identifier in an associated mode, and storing the associated mode as a second associated file;
the association storage of the current user identifier and the type of the read-write operation thereof with the file is specifically as follows: storing the current user identifier and the type of the read-write operation thereof in a time sequence and the file association, storing the association storage aiming at each file in a distinguished storage space, and storing the current user identifier, the read-write operation thereof and the time of the read-write operation thereof in the storage space in a time sequence in a form of triples; the hash mapping is carried out on the current user identifier and the type of the read-write operation thereof to obtain a key value, and when the associated storage is searched, the key value can be used for searching, so that the occurrence time of the read-write operation and the aimed file can be rapidly found;
preferably: storing the key value, the current user identifier, the read-write operation thereof and the occurrence time of the read-write operation in the storage space in a four-tuple form according to the time sequence;
preferably: storing the key values in a key value sequence table from small to large according to the size of the key values, improving the searching speed through a quick searching algorithm when searching the key values, acquiring the positions of the key values in the sequence table after quickly searching the key values, and quickly acquiring the positions of the triples or the quadruples in the associated storage according to the positions;
preferably: the quick search algorithm is a dichotomy or the like;
the association storage of the file identifier, the type of the read-write operation of the file identifier and the current user is specifically as follows: storing the associated storage aiming at each user in a distinguished storage space, and storing the file identification, the type of the read-write operation and the time of the read-write operation in the storage space in a time sequence in a form of triples; the subsequent file management with the user as the center can be supported through the storage of the file read-write operation with the user as the center; the independent associated storage space is stored for the current user;
preferably: the time of the occurrence of the read-write operation and the type of the read-write operation are stored together; preferably: the common storage is stored in the same table record;
the types of the read-write operation include: a read operation, a write operation;
s2: authority auditing is carried out on the file read-write operation initiated by the current user; specific: when a current user initiates a read-write operation on a file, a first associated file and a second associated file are obtained, a first authority audit is conducted based on the first associated file, and a second authority audit is conducted based on the second associated file;
the first authority auditing based on the first association file specifically comprises the following steps: acquiring the types of the read-write operations of the current user, acquiring the number of the read-write operation types of the current user from a first associated file, acquiring a history user set from which the read-write operation types of the current user are initiated if the number is greater than or equal to 1, determining whether a history user exists in the history user set so that the authority of the user is greater than that of the history user, if so, enabling the first authority to pass the audit, and if not, prompting the current user to initiate online or offline audit of the read-write operation types of the current user on the file; in such a way, the number of times that the user performs online or offline auditing is reduced, and auditing efficiency is improved;
preferably: the first authority auditing method further comprises the steps of obtaining the operation time of the historical user on the file, obtaining the latest operation time if a plurality of operation times exist, judging whether the operation time and the operation time of the current user meet time constraint or not, and if so, enabling the first authority auditing to pass;
preferably: the time constraint is a preset value, and the preset value is set by an administrator;
the online or offline auditing method specifically comprises the following steps: initiating read-write operation audit to an administrator in an online or offline mode by filling in an audit form; allowing the file read-write operation of the type of the read-write operation of the user after the administrator passes the audit;
and carrying out second authority auditing based on the second association file, wherein the second authority auditing comprises the following specific steps: acquiring the read-write operation type of the current user, acquiring the proportion of the current user operation type from a second associated file, determining whether a file identifier with the same authority as the file exists or not based on the file identifier in the second associated file if the proportion is larger than a first proportion threshold, and checking the second authority if the file identifier with the same authority as the file exists; otherwise, prompting the current user to initiate online or offline auditing of the read-write operation type of the current user aiming at the file; if the ratio is greater than a second ratio threshold, prompting the user to initiate online or offline auditing of the read-write operation type of the current user for the file;
when the authority of the file is set, distinguishing through the height of the authority and distinguishing through the type;
preferably: the first proportion threshold value and the second proportion threshold value are preset values;
the accuracy of authority verification is improved through two times of verification; the two audits start from different dimensions, so that the auditing efficiency is improved while the auditing diversity is improved;
s3: auditing a file encryption request initiated by a current user; specific: checking the file encryption request based on the first associated file, providing an encryption mode based on the second associated file after the checking is passed, and selecting the encryption mode from the provided encryption modes by a user for encryption;
wherein: the first associated file is used for associating and storing a file identifier, a history read-write operation user, a type of read-write operation and time of occurrence of the read-write operation; the second associated file is used for storing a file identifier, a type of read-write operation and time of occurrence of the read-write operation, which are aimed at by a user and the historical read-write operation;
the auditing of the file encryption request based on the first associated file specifically comprises the following steps: acquiring the number N1 of users performing a first type operation on the file, acquiring the number N2 of users performing a second type operation on the file, acquiring the historical user rights of performing the first type operation on the file, rejecting the operation of the current user if one historical user right is higher than the current user right, otherwise, judging whether N1/N2 is smaller than a second proportion threshold value and N1 is smaller than a second number threshold value, if so, allowing the operation of the current user, otherwise rejecting the operation of the current user,
preferably: the first type of operation is a write operation; the second type of operation is a read operation;
the providing of the encryption mode based on the second association file specifically comprises the following steps: acquiring a file and a read-write operation type of the file, which are aimed at by the current user by the latest operation, from a second associated file, providing a third set of encryption modes for the current user to select if the number N3 of the first type operations on the file is larger than or equal to a third number threshold, otherwise providing a fourth set of encryption modes for the current user to select if the number N3 of the first type operations on the file is smaller than the third number threshold and larger than a fourth number threshold, otherwise providing a fifth set of encryption modes for the current user to select;
wherein: the third set is greater than the fourth set, which is greater than the fifth set;
preferably: the third quantity threshold value and the fourth quantity threshold value are preset values;
preferably: the encryption mode in the third set is more complex than the encryption mode in the fourth set, and the encryption mode in the fourth set is more complex than the encryption mode in the fifth set;
preferably: the type of the read-write operation of the file which is obtained by the user recently is the type of the read-write operation of the file which is obtained by 10 times recently;
s4: processing a file viewing request initiated by a current user; specific: determining whether to present the file based on the first associated file by taking the user as a main line, and if so, presenting the file based on the second associated file by taking the user as the main line;
wherein: the first associated file is used for associating and storing a file identifier, a history operation user, a type of read-write operation and time of occurrence of the read-write operation; the second association file is used for associating and storing file identifications, types and occurrence time of read-write operations aimed at by users and historical read-write operations;
the determining whether to take the user as a main line for presenting the file specifically comprises the following steps: acquiring files to be checked one by one, acquiring a user set of which the files to be checked are subjected to first type operation based on the file identification, and if the number of users in the user set, the authority of which exceeds the current users, is smaller than a fifth number threshold, presenting the files to be checked by taking the files to be checked as a main line; if so, acquiring the user with the highest authority in the user set, if the user with the highest authority belongs to the second user set, presenting the file by taking the current file as a main line, otherwise, determining to present the file by taking the user as the main line; preferably: the second user set is a high user authority set;
the presenting of the file by taking the current file as a main line specifically comprises the following steps: acquiring a historical user identifier and an operation type thereof aiming at a file to be checked based on a first associated file, and presenting the historical user identifier and the operation type combination thereof around the file to be checked according to a time sequence;
preferably: presenting corresponding file operation time near the historical user identification and the operation type combination thereof;
preferably: the presentation in time sequence around the file is specifically as follows: presenting according to a time axis;
preferably: surrounding the file is an independent presentation area different from the presentation area of the file to be checked;
the file presentation based on the second association file using the user as a main line specifically comprises the following steps: acquiring a file and an operation type thereof which are aimed at by the latest operation of the user based on a second associated file, and presenting the file and the operation type thereof which are aimed at by the latest operation of the current user in an associated mode around the current file;
the presentation in the associated mode is specifically as follows: the method comprises the steps that the combination of each file and the operation type of each file aiming at the latest operation of a current user is associated in an associated line mode, and the files are presented according to the operation time sequence;
the method specifically comprises the following steps of: associating each file for which the previous user has recently operated and a combination of operation types thereof to the current file in an associated line manner;
preferably: continuously carrying out file presentation on each file and the file to be presented in the combination formed by the operation types of the files according to the user setting by taking the user as a main line or carrying out file presentation on the file as the main line;
preferably: when the user main line is selected for file presentation, the associated line presents a tree structure;
preferably: when the file is selected to be displayed by taking the file as a main line, the associated line is in a net structure;
s5: determining whether a subsequent operation for the file is closed; specific: determining whether a subsequent operation on the file is closed based on the first associated file, and determining whether the subsequent operation on the file by the user is closed based on the second associated file;
the determining whether the subsequent operation for the file is closed based on the first association file is specifically that: acquiring a first associated file, and determining to close subsequent operations for the file when the number of operations of a first type of the file exceeds a sixth number threshold or the number of operations of a second type of the file exceeds a seventh number threshold;
the determining whether the subsequent operation of the user on the file is closed based on the second associated file specifically comprises the following steps: acquiring a second associated file, and determining to close subsequent operations of the user on the file when the number of operations of the user on the first type of the file exceeds an eighth number threshold or the number of operations of the user on the second type of the file exceeds a ninth number threshold;
the subsequent operation of closing the user on the file is specifically as follows: when a file subsequently initiates an operation request for the file, the operation request is not allowed;
it will be apparent that the described embodiments are some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is illustrative of the present invention and is not to be construed as limiting thereof, but rather as providing for the use of additional embodiments and advantages of all such modifications, equivalents, improvements and similar to the present invention are intended to be included within the scope of the present invention as defined by the appended claims.