Disclosure of Invention
The present disclosure provides a solution that enables efficient multi-version management.
According to a first aspect of an embodiment of the present disclosure, there is provided a file version management method, including: after receiving a file calling request sent by a first library, sending a specified version of a specified file stored in a second library to the first library so as to modify the specified version of the specified file in the first library to generate a feedback file; after the feedback file sent by the first library is received, the feedback file is stored in the second library, and the version number of the feedback file is updated, so that the updated version number of the feedback file is the latest version number of the specified file in the second library.
In some embodiments, storing the feedback file in the second library and updating the version number of the feedback file comprises: detecting whether the current version number of the feedback file is the same as the current latest version number of the specified file in the second library; if the current version number of the feedback file is the same as the current latest version number of the appointed file in the second library, further detecting whether the feedback file is modified; if the feedback file is modified, storing the feedback file in the second library, adding the current latest version number of the appointed file in the second library to a preset value, and taking the calculated result as the updated version number of the feedback file.
In some embodiments, if the feedback file is not modified, the feedback file is discarded.
In some embodiments, if the current version number of the feedback file is different from the current latest version number of the specified file in the second library, prompting the user whether to continue updating; if an instruction that the user needs to continue updating is received, the feedback file is stored in the second library, the current latest version number of the appointed file in the second library is added with a preset value, and a calculation result is used as the version number of the updated feedback file.
In some embodiments, the files in the first library and/or the second library are exported in a predetermined format; and/or importing files with a predetermined format into the first library and/or the second library.
In some embodiments, the specified versions of the specified files in the second library are processed accordingly according to the operation instructions sent by the first library.
In some embodiments, according to the operation instruction sent by the first library, performing corresponding processing on the specified version of the specified file in the second library includes: if a version inquiry instruction sent by a first library is received, inquiring all historical versions of the appointed files in the second library; and sending the query result to the first library.
In some embodiments, according to the operation instruction sent by the first library, performing corresponding processing on the specified version of the specified file in the second library includes: if a locking instruction sent by a first library is received, locking the appointed version of the appointed file in the second library so as to inhibit other users from updating the appointed version of the appointed file in the second library; and if an unlocking instruction sent by the first library is received, unlocking the appointed version of the appointed file in the second library.
In some embodiments, according to the operation instruction sent by the first library, performing corresponding processing on the specified version of the specified file in the second library includes: if a comparison instruction sent by a first library is received, comparing two appointed versions of the appointed file in the second library; and comparing the first library provided by the results.
In some embodiments, according to the operation instruction sent by the first library, performing corresponding processing on the specified version of the specified file in the second library includes: if a marking instruction sent by a first library is received, marking a specified version of a specified file in the second library; in some embodiments, if a delete marker indication sent by the first library is received, a marker of a specified version of a specified file in the second library is deleted.
In some embodiments, according to the operation instruction sent by the first library, performing corresponding processing on the specified version of the specified file in the second library includes: if an archiving instruction sent by a first library is received, migrating a designated version of a designated file in the second library to a third library; and if a reverse file instruction sent by the first library is received, migrating the appointed version of the appointed file from the third library to the second library.
In some embodiments, according to the operation instruction sent by the first library, performing corresponding processing on the specified version of the specified file in the second library includes: and if the deployment instruction sent by the first library is received, generating a strategy file according to the appointed version of the appointed file in the second library so as to deploy the strategy file.
According to a second aspect of the embodiments of the present disclosure, there is provided a file version management apparatus, including: the version providing module is configured to send a specified version of a specified file stored in the second library to the first library after receiving a file calling request sent by the first library so as to modify the specified version of the specified file in the first library to generate a feedback file; and the updating module is configured to store the feedback file in the second library after receiving the feedback file sent by the first library, and update the version number of the feedback file so that the updated version number of the feedback file is the latest version number of the specified file in the second library.
According to a third aspect of the embodiments of the present disclosure, there is provided a file version management apparatus, including: a memory configured to store instructions; a processor coupled to the memory, the processor configured to perform a method according to any of the embodiments described above based on instructions stored in the memory.
According to a fourth aspect of embodiments of the present disclosure, there is provided a file version management system, including the file version management apparatus according to any one of the embodiments described above, and a file processing apparatus configured to manage a corresponding first library, wherein a specified version of a specified file in a second library is written to the first library, so that the specified version of the specified file is modified in the first library to generate a feedback file, and the feedback file is sent to the first library.
In some embodiments, the file processing apparatus is further configured to send the policy template generated in the first library to a fourth library for storage.
In some embodiments, the file processing device is further configured to store the specified policy templates from the fourth library into the respective first libraries.
In some embodiments, the file processing apparatus is further configured to send policy content generated in the first repository to the fifth repository for storage.
In some embodiments, the file processing device is further configured to store specified policy content from the fifth library into the respective first library.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer readable storage medium, wherein the computer readable storage medium stores computer instructions which, when executed by a processor, implement a method as referred to in any of the embodiments above.
Other features of the present disclosure and its advantages will become apparent from the following detailed description of exemplary embodiments of the disclosure, which proceeds with reference to the accompanying drawings.
Detailed Description
The following description of the technical solutions in the embodiments of the present disclosure will be made clearly and completely with reference to the accompanying drawings in the embodiments of the present disclosure, and it is apparent that the described embodiments are only some embodiments of the present disclosure, not all embodiments. The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses. All other embodiments, which can be made by one of ordinary skill in the art without inventive effort, based on the embodiments in this disclosure are intended to be within the scope of this disclosure.
The relative arrangement of the components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless it is specifically stated otherwise.
Meanwhile, it should be understood that the sizes of the respective parts shown in the drawings are not drawn in actual scale for convenience of description.
Techniques, methods, and apparatus known to one of ordinary skill in the relevant art may not be discussed in detail, but should be considered part of the specification where appropriate.
In all examples shown and discussed herein, any specific values should be construed as merely illustrative, and not a limitation. Thus, other examples of the exemplary embodiments may have different values.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further discussion thereof is necessary in subsequent figures.
Fig. 1 is a flowchart illustrating a file version management method according to an embodiment of the disclosure. In some embodiments, the following file version management method steps are performed by the file version management apparatus.
In step 101, after receiving a file call request sent by the first library, a specified version of a specified file stored in the second library is sent to the first library, so that the specified version of the specified file is modified in the first library to generate a feedback file. The user is in communication with the first library.
For example, designating file A as having multiple versions, the user may make modifications to version A0. The modified file (i.e., the feedback file generated in the first library) will retain the modification status and the master number.
In some embodiments, the first library may be a temporary library (Temp DB) and the second library may be a formal library (Formal DB).
In some embodiments, corresponding rules may be set in the first library to modify the specified version of the specified file stored in the first library by itself when a condition is satisfied. For example, update rules of some versions are formulated in advance, and the corresponding versions are updated under the triggering of corresponding time or event.
In other embodiments, the user may modify the specified version of the specified file stored in the first library by operating in the first library. For convenience of user operation, corresponding first libraries can be set for different users, namely, the users and the first libraries are in one-to-one correspondence.
FIG. 2 is a schematic diagram of a file version management architecture according to one embodiment of the present disclosure.
As shown in fig. 2, each user may perform an operation process on a corresponding version of content through its corresponding first library. Only the content currently operated by the user is stored in the first library.
Returning to fig. 1. In step 102, after receiving the feedback file sent by the first library, the feedback file is stored in the second library, and the version number of the feedback file is updated such that the updated version number of the feedback file is the latest version number of the specified file in the second library.
In some embodiments, storing the feedback file in the second library and updating the version number of the feedback file includes: and detecting whether the current version number of the feedback file is the same as the current latest version number of the specified file in the second library. If the current version number of the feedback file is the same as the current latest version number of the specified file in the second library, further detecting whether the feedback file has been modified. If the feedback file is modified, the feedback file is stored in a second library, the current latest version number of the specified file in the second library is added with a preset value, and the calculated result is used as the updated version number of the feedback file. If the feedback file is not modified, the feedback file is discarded.
For example, the preset value may be 1. That is, the latest version number of the designated file is increased by 1, and the calculated result is used as the updated version number of the feedback file.
For example, if the user modifies version A0 through the first library, if the highest version of file a in the second library is also A0, it indicates that no other user is currently modifying file a. In this case, if the feedback file returned by the first library is modified, the version number of the feedback file is changed to A1. If the feedback file returned by the first library is not modified, indicating that the feedback file and version A0 in the second library are consistent, the feedback file is discarded in this case.
In some embodiments, if the current version number of the feedback file is not the same as the current latest version number of the specified file in the second library, the user is prompted as to whether or not to proceed with the update. If an instruction that the user needs to continue updating is received, the feedback file is stored in a second library, the current latest version number of the specified file in the second library is added with a preset value, and the calculated result is used as the updated version number of the feedback file.
For example, if the user modifies version A0 through the first library, if the highest version of file a in the second library is A1, it indicates that other users have modified file a currently. In this case, the user is prompted as to whether or not the update needs to be continued. If the user needs to continue updating, the version number of the feedback file is changed to A2. Therefore, the problem of version conflict caused by modification of the A0 version by different users can be effectively avoided. Thereby facilitating the collaborative work of multiple persons.
In some embodiments, in the above file version management architecture, the specified version of the specified file in the second library may be processed accordingly according to the operation instruction sent by the first library.
In some embodiments, if the second library receives the version query indication sent by the first library, then querying all historical versions of the specified files in the second library, and sending the query result to the first library. So that the user can realize the viewing operation.
In some embodiments, if the second library receives the lock indication sent by the first library, the specified version of the specified file in the second library is locked to prohibit other users from updating the specified version of the specified file in the second library. In addition, if an unlocking instruction sent by the first library is received, unlocking a designated version of the designated file in the second library. Thus, locking protection of file content of a specified version can be facilitated.
In some embodiments, if the second library receives the comparison instruction sent by the first library, the two specified versions of the specified file in the second library are compared, and the comparison result is provided by the first library. So that the user can implement the comparison operation.
In some embodiments, if the second library receives the indication of the flag sent by the first library, the second library is marked for the specified version of the specified file in the second library. In addition, if the second library receives the deletion flag indication sent by the first library, the flag of the specified version of the specified file in the second library is deleted. So that the user can implement the mark management.
FIG. 3 is a diagram illustrating a file version management architecture according to another embodiment of the present disclosure.
As shown in fig. 3, files in the first library and/or the second library may be exported in a predetermined format and/or files having a predetermined format may be imported into the first library and/or the second library. For example, the predetermined format may be XML (Extensible Markup Language ) to manage different versions of files.
Fig. 4 is a schematic diagram of a file version management architecture according to another embodiment of the present disclosure.
As shown in fig. 4, if the second library receives the archiving indication sent by the first library, the specified version of the specified file in the second library is migrated to the third library. In addition, if the second library receives the reverse file indication sent by the first library, the appointed version of the appointed file is migrated from the third library to the second library.
In some embodiments, the third library is an Archive DB.
For example, for some offline versions of files (e.g., particular versions of policy files), they may be saved to a third library where the second library no longer stores those offline versions of files. Thereby effectively improving the storage space utilization of the second library. In the case that some offline file versions need to be invoked, the corresponding file versions may also be extracted from the third library into the second library. Thereby ensuring that the data in the second library is clear and the corresponding historical data is traceable.
Fig. 5 is a schematic diagram of a file version management architecture according to another embodiment of the present disclosure.
As shown in fig. 5, if the second library receives the deployment instruction sent by the first library, a policy file is generated according to the specified version of the specified file in the second library, so as to deploy the policy file.
In some embodiments, the multi-version deployment may be implemented using the tags of the second library. For example, deployment may be performed by adding a tag 1 to version A0, or deployment may be performed by adding a tag 2 to version A0. Furthermore, deploying policy files is an irreversible process. Corresponding policy contents cannot be obtained from the deployed policy files so as to ensure information security.
For example, the policy file is obtained by processing the A1 version of the specified file with the one-way function F. After the malicious third method obtains the policy file again, the A1 version of file cannot be extracted from the policy file.
Fig. 6 is a schematic structural diagram of a file version management apparatus according to an embodiment of the present disclosure. As shown in fig. 6, the file version management apparatus includes a version providing module 61 and an updating module 62.
The version providing module 61 is configured to, upon receiving a file call request sent from the first library, send a specified version of a specified file stored in the second library to the first library so as to modify the specified version of the specified file in the first library to generate a feedback file.
For example, designating file A as having multiple versions, the user may make modifications to version A0. The modified file will retain the modification state and the original version number.
In some embodiments, the first library may be a temporary library (Temp DB) and the second library may be a formal library (Formal DB).
In some embodiments, corresponding logic rules may be set in the first library to automatically modify the specified version of the specified file stored in the first library when the condition is satisfied. In other embodiments, the user may modify the specified version of the specified file stored in the first library by operating in the first library. For convenience of user operation, corresponding first libraries can be set for different users, namely, the users and the first libraries are in one-to-one correspondence.
The update module 62 is configured to store the feedback file in the second library after receiving the feedback file sent by the first library, and update the version number of the feedback file such that the updated version number of the feedback file is the latest version number of the specified file in the second library.
In some embodiments, storing the feedback file in the second library and updating the version number of the feedback file includes: and detecting whether the current version number of the feedback file is the same as the current latest version number of the specified file in the second library. If the current version number of the feedback file is the same as the current latest version number of the specified file in the second library, further detecting whether the feedback file has been modified. If the feedback file is modified, the feedback file is stored in a second library, the current latest version number of the specified file in the second library is added with a preset value, and the calculated result is used as the updated version number of the feedback file. If the feedback file is not modified, the feedback file is discarded.
For example, the preset value may be 1. That is, the latest version number of the designated file is increased by 1, and the calculated result is used as the updated version number of the feedback file.
For example, if the user modifies version A0 through the first library, if the highest version of file a in the second library is also A0, it indicates that no other user is currently modifying file a. In this case, if the feedback file returned by the first library is modified, the version number of the feedback file is changed to A1. If the feedback file returned by the first library is not modified, indicating that the feedback file and version A0 in the second library are consistent, the feedback file is discarded in this case.
In some embodiments, if the current version number of the feedback file is not the same as the current latest version number of the specified file in the second library, the user is prompted as to whether or not to proceed with the update. If an instruction that the user needs to continue updating is received, the feedback file is stored in a second library, the current latest version number of the specified file in the second library is added with a preset value, and the calculated result is used as the updated version number of the feedback file.
For example, if the user modifies version A0 through the first library, if the highest version of file a in the second library is A1, it indicates that other users have modified file a currently. In this case, the user is prompted as to whether or not the update needs to be continued. If the user needs to continue updating, the version number of the feedback file is changed to A2. Therefore, the problem of version conflict caused by modification of the A0 version by different users can be effectively avoided. Thereby facilitating the collaborative work of multiple persons.
Fig. 7 is a schematic structural diagram of a file version management apparatus according to another embodiment of the present disclosure. In comparison with fig. 6, in the embodiment shown in fig. 7, the file version management apparatus further includes a management module 63.
The management module 63 may perform corresponding processing on the specified version of the specified file in the second library according to the operation instruction sent by the first library.
In some embodiments, if the second repository receives the version query indication sent by the first repository, the management module 63 queries all historical versions of the specified files in the second repository and sends the query results to the first repository. So that the user can realize the viewing operation.
In some embodiments, if the second library receives the lock indication sent by the first library, the management module 63 locks the specified version of the specified file in the second library to prohibit other users from updating the specified version of the specified file in the second library. In addition, if an unlocking instruction sent by the first library is received, unlocking a designated version of the designated file in the second library. Thus, locking protection of file content of a specified version can be facilitated.
In some embodiments, if the second library receives the comparison instruction sent by the first library, the management module 63 compares two specified versions of the specified file in the second library, and provides the comparison result to the first library. So that the user can implement the comparison operation.
In some embodiments, if the second library receives the indication of the flag sent by the first library, the management module 63 marks the specified version of the specified file in the second library. In addition, if the second library receives the deletion flag indication sent by the first library, the flag of the specified version of the specified file in the second library is deleted. So that the user can implement the mark management.
In some embodiments, as shown in fig. 3, the management module 63 may export files in the first library and/or the second library in a predetermined format and/or import files having a predetermined format into the first library and/or the second library. For example, the predetermined format may be XML in order to manage different versions of files.
In some embodiments, as shown in FIG. 4, if the second library receives an archive indication sent by the first library, the management module 63 migrates a specified version of the specified file in the second library to the third library. In addition, if the second library receives the reverse file indication sent by the first library, the appointed version of the appointed file is migrated from the third library to the second library.
In some embodiments, the third library is an Archive DB.
For example, for some offline versions of files (e.g., particular versions of policy files), they may be saved to a third library where the second library no longer stores those offline versions of files. Thereby effectively improving the storage space utilization of the second library. In the case that some offline file versions need to be invoked, the corresponding file versions may also be extracted from the third library into the second library. Thereby ensuring that the data in the second library is clear and the corresponding historical data is traceable.
In some embodiments, as shown in fig. 5, if the second library receives the deployment indication sent by the first library, the management module 63 generates a policy file according to the specified version of the specified file in the second library, so as to deploy the policy file.
In some embodiments, the multi-version deployment may be implemented using the tags of the second library. For example, deployment may be performed by adding a tag 1 to version A0, or deployment may be performed by adding a tag 2 to version A0. Furthermore, deploying policy files is an irreversible process. Corresponding policy contents cannot be obtained from the deployed policy files so as to ensure information security.
Fig. 8 is a schematic structural diagram of a file version management apparatus according to another embodiment of the present disclosure. As shown in fig. 8, the apparatus includes a memory 81 and a processor 82.
The memory 81 is for storing instructions and the processor 82 is coupled to the memory 81, the processor 82 being configured to perform a method as referred to in any of the embodiments of fig. 1 based on the instructions stored by the memory.
As shown in fig. 8, the apparatus further comprises a communication interface 83 for information interaction with other devices. Meanwhile, the device further comprises a bus 84, and the processor 82, the communication interface 83 and the memory 81 communicate with each other through the bus 84.
The memory 81 may comprise a high-speed RAM memory or may further comprise a non-volatile memory (non-volatile memory), such as at least one magnetic disk memory. The memory 81 may also be a memory array. The memory 81 may also be partitioned and the blocks may be combined into virtual volumes according to certain rules.
Further, the processor 82 may be a central processing unit CPU, or may be an application specific integrated circuit ASIC, or one or more integrated circuits configured to implement embodiments of the present disclosure.
The present disclosure also relates to a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement a method as referred to in any of the embodiments of fig. 1.
Fig. 9 is a schematic diagram of a file version management system according to an embodiment of the present disclosure. As shown in fig. 9, the file version management system includes a file version management apparatus 91 and a file processing apparatus 92. The file version management apparatus 91 is a file version management apparatus according to any one of the embodiments shown in fig. 6 or 8.
The file processing device 92 is configured to manage a corresponding first library, wherein a specified version of a specified file in the second library is written to the first library, such that the specified version of the specified file is modified in the first library to generate a feedback file, and the feedback file is sent to the first library.
In some embodiments, the file processing device 92 is further configured to send the policy templates generated in the first library to a fourth library for storage. Further, the file processing device 92 is further configured to store the specified policy templates from the fourth library into the respective first libraries.
In some embodiments, the fourth library is a Template library (Template DB).
FIG. 10 is a schematic diagram of a file version management architecture according to yet another embodiment of the present disclosure;
As described in fig. 10, a policy template is generated in the first library from the relevant content of the specified file. The file processing means 92 stores the policy template in a fourth library. In addition, the file processing device 92 may further extract a specified policy template from the fourth library according to the user's requirement, and store the specified policy template in the first library.
By designing the fourth library, it will be helpful to the policy content using the same template, both in version management and version comparison. The fourth library content may be managed by a time stamp, a tag, a user.
In some embodiments, the file processing device 92 is further configured to send the policy content generated in the first library to the fifth library for storage. Further, the file processing means 92 is further configured to store the specified policy content from said fifth library into the respective first library.
In some embodiments, the fifth library is a Knowledge base (knowledgedb).
FIG. 11 is a schematic diagram of a file version management architecture according to yet another embodiment of the present disclosure.
As shown in fig. 11, the relevant content of the specified file is processed into policy content in the first library. The file processing means 92 stores the policy content in a fifth library. In addition, the file processing device 92 may further extract the specified policy content from the fifth library and store the policy content in the first library according to the user's requirement.
The fifth library is designed to facilitate the policy personnel and policy deployment personnel to quickly learn the policy content and policy version iteration process. In the process of operating the first library, the policy content can be refined into a fifth library content and stored in the fifth library, so that a user can conveniently check and learn, and the validity of the policy and the validity of version updating are ensured. The contents of the fifth library may be managed by a time stamp, a tag, a user.
In some embodiments, the functional unit blocks described above may be implemented as general purpose processors, programmable logic controllers (Programmable Logic Controller, abbreviated as PLCs), digital signal processors (DIGITAL SIGNAL processors, abbreviated as DSPs), application Specific Integrated Circuits (ASICs), field-Programmable gate arrays (Field-Programmable GATE ARRAY, abbreviated as FPGAs), or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or any suitable combination thereof for performing the functions described in the present disclosure.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program for instructing relevant hardware, where the program may be stored in a computer readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The description of the present disclosure has been presented for purposes of illustration and description, and is not intended to be exhaustive or limited to the disclosure in the form disclosed. Many modifications and variations will be apparent to those of ordinary skill in the art. The embodiments were chosen and described in order to best explain the principles of the disclosure and the practical application, and to enable others of ordinary skill in the art to understand the disclosure for various embodiments with various modifications as are suited to the particular use contemplated.