Document restoration method and device, computer equipment, readable storage medium and program product

By combining the document archiving method and operation history method in the collaborative document system, we can find and revise the physical history version of the logical history version, and solve the problems of high storage costs and low system performance caused by too many document history versions, and achieve efficient document restoration and optimization user experience.

CN119557276APending Publication Date: 2025-03-04CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411756008.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-03
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

In the field of history restoration of collaborative documents, the prior art mainly includes document archiving method and operation history method, but when there are too many historical versions of the document, it will lead to excessive storage costs and negatively affect system performance.

Method used

Provide a document restoration method. By receiving the client's restore request and finding the target logical history version without the corresponding physical history version, the most recent and corresponding logical history version is found in the sequence formed by the logical history version, as a reference logical history version, and the physical history version is revised according to the revision operation record differences to obtain the document corresponding to the target logical history version.

Benefits of technology

By combining the document archiving method and the operation history method, the number of inverse operations required for document restoration is reduced, computing resources is saved, system response speed is improved, and user experience is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557276A_ABST
    Figure CN119557276A_ABST
Patent Text Reader

Abstract

The invention relates to a document restoration method and device, computer equipment, a computer readable storage medium and a computer program product. The method comprises the following steps: receiving a restoration request sent by a client, and obtaining a target logic historical version requested to be restored by the restoration request; under the condition that the target logic historical version does not have the corresponding physical historical version, searching a logic historical version which is closest to the target logic historical version and corresponds to the physical historical version in a sequence formed by the logic historical versions, and taking the searched logic historical version as a reference logic historical version; and according to the revision operation difference between the revision operation record represented by the target logic historical version and the revision operation record represented by the reference logic historical version, revising the physical historical version to obtain a document corresponding to the target logic historical version, and returning the document to the client. By adopting the method, the computing resources of the document restoration operation can be saved, and the response speed of the system is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of document editing, and in particular to a document restoration method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Art

[0002] Collaborative documents are a document editing and management tool. Its core feature is that it allows multiple users to edit, modify and annotate the same document at the same time without worrying about version conflicts and data loss. In actual implementation, historical versions of documents will be needed.

[0003] In the field of collaborative document history restoration, existing technologies mainly include document archiving and operation history recording. However, when there are too many document history documents, a huge storage space is required, which will cause the cost of storing historical version documents to be too high. The operation history recording method records and processes a large amount of operation history, which may have a negative impact on system performance. Summary of the invention

[0004] Based on this, it is necessary to provide a document restoration method, apparatus, computer device, computer-readable storage medium and computer program product that can combine the document archiving method and the operation history recording method to address the above technical problems.

[0005] In a first aspect, the present application provides a document restoration method, comprising:

[0006] Receive a restore request sent by a client, and obtain a target logical historical version requested to be restored by the restore request;

[0007] In the case that the target logical historical version has no corresponding physical historical version, in the sequence formed by the logical historical versions, the logical historical version that is closest to the target logical historical version and has a corresponding physical historical version is searched, and the found logical historical version is used as the reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent the revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving the document formed according to the corresponding logical historical version;

[0008] According to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, the physical historical version corresponding to the reference logical historical version is revised, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0009] In one embodiment, searching, in a sequence formed by logical historical versions, a logical historical version that is closest to the target logical historical version and has a corresponding physical historical version includes:

[0010] In the sequence formed by the logical history versions, searching for the logical history version with the smallest version interval from the target logical history version and corresponding to the physical history version; or,

[0011] In the sequence formed by the logical history versions, searching for the logical history version with the least number of records of revision operations between the target logical history version and the corresponding physical history version; or,

[0012] In the sequence formed by the logical history versions, a logical history version having the shortest time interval with the target logical history version and corresponding to a physical history version is searched.

[0013] In one embodiment, revising the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version includes:

[0014] In the case where the reference logical historical version is a previous version of the target logical historical version, the physical historical version corresponding to the reference logical historical version is revised forward according to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version;

[0015] In the case that the reference logical historical version is a later version of the target logical historical version, the physical historical version corresponding to the reference logical historical version is rolled back and revised according to the revision operation difference.

[0016] In one embodiment, the method further comprises:

[0017] For two adjacent logical history versions in the sequence, the revision operations experienced between the previous logical history version and the next logical history version are simplified.

[0018] In one embodiment, the corresponding preservation process of the physical history version includes:

[0019] In the process of revising a document, the document formed by the logical historical version obtained at the corresponding time is saved at every preset time interval to obtain the corresponding physical historical version; or

[0020] In the process of revising a document, the number of records of the document revision operation is accumulated. Whenever the preset number is reached, the document formed by the logical historical version obtained at the corresponding time is saved, the corresponding physical historical version is obtained, and the accumulated number is cleared.

[0021] In one embodiment, the method further comprises:

[0022] Before revising the physical historical version corresponding to the reference logical historical version, the revision function of the document is locked and the current document is recorded as a current logical historical version. After the document corresponding to the target logical historical version is returned to the client, the document corresponding to the target logical historical version is restored to the document corresponding to the current logical historical version.

[0023] In a second aspect, the present application also provides a document restoration device, comprising:

[0024] A receiving module, used for receiving a restore request sent by a client, and obtaining a target logical historical version requested to be restored by the restore request;

[0025] A search module is used for searching, in the sequence formed by the logical historical versions, a logical historical version that is closest to the target logical historical version and has a corresponding physical historical version when the target logical historical version has no corresponding physical historical version, and using the found logical historical version as a reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent a revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving a document formed according to the corresponding logical historical version;

[0026] A revision module is used to revise the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version, obtain the document corresponding to the target logical history version and return it to the client.

[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0028] A receiving module, used for receiving a restore request sent by a client, and obtaining a target logical historical version requested to be restored by the restore request;

[0029] A search module is used for searching, in the sequence formed by the logical historical versions, a logical historical version that is closest to the target logical historical version and has a corresponding physical historical version when the target logical historical version has no corresponding physical historical version, and using the found logical historical version as a reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent a revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving a document formed according to the corresponding logical historical version;

[0030] A revision module is used to revise the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version, obtain the document corresponding to the target logical history version and return it to the client.

[0031] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0032] A receiving module, used for receiving a restore request sent by a client, and obtaining a target logical historical version requested to be restored by the restore request;

[0033] A search module is used for searching, in the sequence formed by the logical historical versions, a logical historical version that is closest to the target logical historical version and has a corresponding physical historical version when the target logical historical version has no corresponding physical historical version, and using the found logical historical version as a reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent a revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving a document formed according to the corresponding logical historical version;

[0034] A revision module is used to revise the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version, obtain the document corresponding to the target logical history version and return it to the client.

[0035] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0036] A receiving module, used for receiving a restore request sent by a client, and obtaining a target logical historical version requested to be restored by the restore request;

[0037] A search module is used for searching, in the sequence formed by the logical historical versions, a logical historical version that is closest to the target logical historical version and has a corresponding physical historical version when the target logical historical version has no corresponding physical historical version, and using the found logical historical version as a reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent a revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving a document formed according to the corresponding logical historical version;

[0038] A revision module is used to revise the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version, obtain the document corresponding to the target logical history version and return it to the client.

[0039] The document restoration method, device, computer equipment, computer-readable storage medium and computer program product described above first receive a restoration request sent by a client, and obtain the target logical historical version requested to be restored by the restoration request; when the target logical historical version does not have a corresponding physical historical version, in the sequence formed by the logical historical versions, find the logical historical version that is closest to the target logical historical version and has a corresponding physical historical version, and use the found logical historical version as the reference logical historical version; according to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, revise the physical historical version corresponding to the reference logical historical version, obtain the document corresponding to the target logical historical version and return it to the client. In this way, by combining the file archiving method with the operation history record method, and setting the potential restoration starting point in the form of a physical historical version, the number of (reverse) operations required for document restoration is effectively reduced, the computing resources for the restoration operation are saved, the response speed of the system is improved, and the user experience is optimized. BRIEF DESCRIPTION OF THE DRAWINGS

[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0041] FIG1 is an application environment diagram of a document restoration method in one embodiment;

[0042] FIG2 is a schematic diagram of a process flow of a document restoration method in one embodiment;

[0043] FIG3 is a simplified schematic diagram of a revision operation in one embodiment;

[0044] FIG4 is a schematic diagram of a flow chart of a document restoration method in another embodiment;

[0045] FIG5 is a diagram showing a reference logic history version search structure in one embodiment;

[0046] FIG6 is a structural block diagram of a document restoration device in one embodiment;

[0047] FIG. 7 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0049] The document restoration method provided in the embodiment of the present application can be applied in the application environment shown in Figure 1. Among them, the client 102 communicates with the server 104 through the network. The data storage system can store the logical historical version data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. Among them, the client 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car devices, projection devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The server 104 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0050] In an exemplary embodiment, as shown in FIG. 2 , a document restoration method is provided, which is described by taking the method applied to the server 104 in FIG. 1 as an example, and includes the following steps 202 to 206. Among them:

[0051] Step 202: Receive a restore request sent by the client, and obtain the target logical historical version requested to be restored by the restore request.

[0052] Among them, the logical historical version refers to a version that does not store the file in the local disk in the form of a file, but directly records its version information.

[0053] In some embodiments, a restore request sent by a client is received, wherein the restore request includes an identifier of a target logical historical version to be restored, and the target logical historical version is obtained according to the restore request.

[0054] Specifically, when the user performs a save operation on the client, the server will save a logical history version h i .

[0055] Step 206, when the target logical history version has no corresponding physical history version, search for the logical history version that is closest to the target logical history version and has a corresponding physical history version in the sequence formed by the logical history versions, and use the found logical history version as the reference logical history version.

[0056] Among them, the latter logical history version of two adjacent logical history versions is used to represent the revision operation record made compared with the previous logical history version, and the physical history version is a historical document formed after saving the document formed according to the corresponding logical history version.

[0057] In some embodiments, when the target logical history version does not have a corresponding physical history version, a logical history version that is closest to the target logical history version and has a corresponding physical history version will be searched in the sequence of logical history versions, and the found logical history version will be used as a reference logical history version.

[0058] Specifically, the reference logic history version may be before the target logic history version or after the target logic history version.

[0059] In another embodiment, when the target logical historical version has a corresponding physical historical version, the physical historical version corresponding to the target logical historical version is directly returned to the client.

[0060] Step 206, based on the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, revise the physical historical version corresponding to the reference logical historical version, obtain the document corresponding to the target logical historical version and return it to the client.

[0061] In some embodiments, when the reference logical historical version is before the target logical historical version, the physical historical version corresponding to the reference logical historical version is revised forward based on the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation represented by the reference logical historical version, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0062] When the reference logical historical version is later than the target logical historical version, the physical historical version corresponding to the reference logical historical version is rolled back and revised based on the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation represented by the reference logical historical version, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0063] In the above document restoration method, a restoration request sent by a client is received, and the target logical historical version requested to be restored by the restoration request is obtained; when the target logical historical version does not have a corresponding physical historical version, the logical historical version that is closest to the target logical historical version and has a corresponding physical historical version is searched in the sequence formed by the logical historical versions, and the found logical historical version is used as the reference logical historical version; according to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, the physical historical version corresponding to the reference logical historical version is revised, and the document corresponding to the target logical historical version is obtained and returned to the client. In this way, by combining the file archiving method with the operation history record method and setting the potential restoration starting point in the form of a physical historical version, the number of (reverse) operations required for document restoration is effectively reduced, the computing resources for the restoration operation are saved, the response speed of the system is improved, and the user experience is optimized.

[0064] In an exemplary embodiment, in a sequence formed by logical historical versions, searching for a logical historical version that is closest to a target logical historical version and that corresponds to a physical historical version includes: searching for a logical historical version that has the smallest version interval with the target logical historical version and that corresponds to a physical historical version in the sequence formed by logical historical versions; or searching for a logical historical version that has the least number of records of revision operations with the target logical historical version and that corresponds to a physical historical version in the sequence formed by logical historical versions; or searching for a logical historical version that has the shortest time interval with the target logical historical version and that corresponds to a physical historical version in the sequence formed by logical historical versions.

[0065] In actual implementation, the version of the target logical history version is determined, and in the sequence formed by the logical history versions, the logical history version with the smallest interval between the version of the target logical history version and the corresponding physical history version is searched; or,

[0066] In the sequence formed by the logical history versions, find the logical history version with the least number of records of revision operations between the target logical history version and the corresponding physical history version; or,

[0067] Determine the storage time point of the target logical historical version, and search for the logical historical version with the shortest time interval with the target logical historical version in the sequence formed by the logical historical versions and the corresponding physical historical version.

[0068] In the above embodiment, a logical history version that is closest to the target logical history version and corresponds to a physical history version can be searched in a variety of different ways, so that the document restoration method has a wider application range.

[0069] In an exemplary embodiment, the physical history version corresponding to the reference logical history version is revised according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version, including: when the reference logical history version is a previous version of the target logical history version, the physical history version corresponding to the reference logical history version is revised forward according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version; when the reference logical history version is a later version of the target logical history version, the physical history version corresponding to the reference logical history version is revised back according to the revision operation difference.

[0070] In some embodiments, when the reference logical history version is before the target logical history version, the physical history version corresponding to the reference logical history version is revised forward based on the revision operation difference between the revision operation record represented by the target logical history version and the revision operation represented by the reference logical history version to obtain the document corresponding to the target logical history version.

[0071] When the reference logical historical version is after the target logical historical version, the physical historical version corresponding to the reference logical historical version is revised backwards according to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation represented by the reference logical historical version to obtain the document corresponding to the target logical historical version.

[0072] In the above embodiment, by referring to the forward or backward revision operation of the physical history version in two cases where the logical history version is before or after the target logical history version, all situations are included, making the document restoration more efficient.

[0073] In an exemplary embodiment, the document restoration method further includes: for two adjacent logical history versions in the sequence, simplifying the revision operations experienced between the previous logical history version and the next logical history version.

[0074] In actual implementation, each revision behavior of the user will form a historical revision operation record. The latter logical historical version is used to represent the revision operation record made compared with the previous logical historical version. The revision operation record includes one or more historical revision operation records.

[0075] Furthermore, multiple historical revision operation records are simplified into two basic operations: adding and deleting.

[0076] For example, as shown in FIG3 , the user changes the string "acabb" in the first line of the logical history version h1 to "acbbd" in the logical history version h2 through [(delete, line 1, Acabb), (add, line 1, Aabbb), (delete, line 1, position 5, b) (add, line 1, position 5, d), (delete, line 1, position 2, a) (add, line 1, position 2, c)]. By simplifying the operation, the above operation can be simplified to [(delete, line 1, acabb), (add, line 1, acbbd)].

[0077] In the above embodiment, by simplifying multiple revision operations into basic operations, the amount of data processing in the document restoration process is reduced, and the efficiency of the document restoration method is improved.

[0078] In an exemplary embodiment, the corresponding preservation process of the physical history version includes: in the process of revising the document, at every preset time interval, the document formed by the logical history version obtained at the corresponding time is saved to obtain the corresponding physical history version; or, in the process of revising the document, the number of records of the revision operation of the document is accumulated, and whenever the accumulated number reaches a preset number, the document formed by the logical history version obtained at the corresponding time is saved to obtain the corresponding physical history version, and the accumulated number is cleared to zero.

[0079] In actual implementation, in the process of revising a document, the document formed by the logical historical version obtained at the corresponding time is saved at each preset time interval to obtain the corresponding physical historical version.

[0080] In another embodiment, in the process of revising a document, the number of records of the document revision operation is accumulated, and whenever the accumulated number reaches a preset number, the document formed by the logical historical version obtained at the corresponding time is saved, the corresponding physical historical version is obtained, and the accumulated number is cleared.

[0081] In the above embodiment, the physical history version is saved in various situations, thereby ensuring that there is no unnecessary workload due to too many versions between the logical history versions corresponding to the physical history versions.

[0082] In an exemplary embodiment, the method also includes: before revising the physical history version corresponding to the reference logical history version, locking the revision function of the document and recording the current document as a current logical history version, and after returning the document corresponding to the target logical history version to the client, restoring the document corresponding to the target logical history version to the document corresponding to the current logical history version.

[0083] In one embodiment, before revising the physical history version corresponding to the reference logical history version, the revision function of the document is locked so that other users cannot revise the document, and the current document is recorded as a current logical history version. After the document corresponding to the target logical history version is returned to the client, the client sends a notification to the user that "the document has been restored, please refresh and reload". After the document page is reloaded, the document corresponding to the target logical history version is restored to the document corresponding to the current logical history version.

[0084] In the above embodiment, by storing the current logical historical version of the document, after the document is restored, the document can be revised continuously at the original progress, thus ensuring the real-time nature of the document revision process.

[0085] To explain the document restoration method in the present application in detail, an embodiment is used for explanation below. The specific flow chart is shown in FIG4 . By way of example, the present application is explained with a document restoration method in a specific collaborative document editing scenario.

[0086] First, a restore request sent by a client is received, wherein the restore request includes an identifier of a target logical historical version to be restored, and the target logical historical version is obtained according to the restore request.

[0087] Determine the version of the target logical history version, and search for the logical history version with the smallest interval between the target logical history version and the corresponding physical history version in the sequence formed by the logical history versions; or,

[0088] In the sequence formed by the logical history versions, find the logical history version with the least number of records of revision operations between the target logical history version and the corresponding physical history version; or,

[0089] Determine the storage time point of the target logical history version, and in the sequence formed by the logical history versions, search for the logical history version with the shortest interval with the target logical history version and the corresponding physical history version. The specific search structure diagram is shown in Figure 5.

[0090] When the reference logical historical version is before the target logical historical version, the physical historical version corresponding to the reference logical historical version is revised forward based on the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation represented by the reference logical historical version, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0091] When the reference logical historical version is after the target logical historical version, the physical historical version corresponding to the reference logical historical version is revised backwards based on the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation represented by the reference logical historical version, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0092] After returning the document corresponding to the target logical historical version to the client, the client sends a notification to the user that "the document has been restored, please refresh and reload". After the document page is reloaded, the document corresponding to the target logical historical version is restored to the document corresponding to the current logical historical version.

[0093] This application optimizes the file archiving method in the collaborative editing scenario by combining logical historical versions with physical historical versions, and solves the problem of too many version files being saved and occupying too many service resources. In addition, the difference algorithm is used to simplify the number of operations between two logical historical record versions, effectively alleviating the problem of too many user operation history records in the collaborative editing scenario.

[0094] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0095] Based on the same inventive concept, the embodiment of the present application also provides a document restoration device for implementing the document restoration method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more document restoration device embodiments provided below can refer to the limitations on the document restoration method above, and will not be repeated here.

[0096] In an exemplary embodiment, as shown in FIG6 , a document restoration device is provided, comprising: a receiving module 601, a searching module 602 and a revising module 603, wherein:

[0097] The receiving module is used to receive a restore request sent by a client and obtain a target logical historical version requested to be restored by the restore request.

[0098] A search module is used to search for a logical history version that is closest to the target logical history version and has a corresponding physical history version in a sequence formed by logical history versions when there is no corresponding physical history version of the target logical history version, and use the found logical history version as a reference logical history version; wherein the latter of two adjacent logical history versions is used to represent a revision operation record compared with the previous logical history version, and the physical history version is a historical document formed by saving a document formed according to the corresponding logical history version.

[0099] A revision module is used to revise the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version, obtain the document corresponding to the target logical history version and return it to the client.

[0100] In some embodiments, the above-mentioned search module is also used to search, in a sequence formed by logical historical versions, for a logical historical version that has the smallest version interval with a target logical historical version and has a corresponding physical historical version; or, in a sequence formed by logical historical versions, for a logical historical version that has the smallest number of records of revision operations with a target logical historical version and has a corresponding physical historical version; or, in a sequence formed by logical historical versions, for a logical historical version that has the shortest time interval with a target logical historical version and has a corresponding physical historical version.

[0101] In some embodiments, the above-mentioned revision module is also used to revise forward the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version when the reference logical history version is a previous version of the target logical history version; and to revise back the physical history version corresponding to the reference logical history version according to the revision operation difference when the reference logical history version is a later version of the target logical history version.

[0102] In some embodiments, the apparatus further includes a simplification module for simplifying, for two adjacent logic history versions in a sequence, revision operations experienced between a previous logic history version and a subsequent logic history version.

[0103] In some embodiments, the device also includes a saving module, which is used to save the document formed by the logical historical version obtained at the corresponding time at every preset time interval during the process of revising the document, and obtain the corresponding physical historical version; or, in the process of revising the document, accumulate the number of records of the document revision operation, and whenever the accumulated number reaches a preset number, save the document formed by the logical historical version obtained at the corresponding time, obtain the corresponding physical historical version, and clear the accumulated number.

[0104] In some embodiments, the device also includes a locking module for locking the revision function of the document before revising the physical history version corresponding to the reference logical history version, and recording the current document as a current logical history version. After returning the document corresponding to the target logical history version to the client, the document corresponding to the target logical history version is restored to the document corresponding to the current logical history version.

[0105] Each module in the above document restoration device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.

[0106] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG7. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface, a display unit and an input device. The processor, the memory and the input / output interface are connected via a system bus, and the communication interface, the display unit and the input device are connected to the system bus via the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store physical historical version document data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a document restoration method is implemented.

[0107] The display unit of the computer device is used to form a visually visible picture, and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball, or touchpad provided on the computer device housing, or an external keyboard, touchpad, or mouse, etc.

[0108] Those skilled in the art will understand that the structure shown in FIG. 7 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0109] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0110] Receive a restore request sent by a client, and obtain a target logical historical version requested to be restored by the restore request;

[0111] In the case that the target logical historical version has no corresponding physical historical version, in the sequence formed by the logical historical versions, the logical historical version that is closest to the target logical historical version and has a corresponding physical historical version is searched, and the found logical historical version is used as the reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent the revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving the document formed according to the corresponding logical historical version;

[0112] According to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, the physical historical version corresponding to the reference logical historical version is revised, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0113] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0114] Receive a restore request sent by a client, and obtain a target logical historical version requested to be restored by the restore request;

[0115] In the case that the target logical historical version has no corresponding physical historical version, in the sequence formed by the logical historical versions, the logical historical version that is closest to the target logical historical version and has a corresponding physical historical version is searched, and the found logical historical version is used as the reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent the revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving the document formed according to the corresponding logical historical version;

[0116] According to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, the physical historical version corresponding to the reference logical historical version is revised, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0117] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0118] Receive a restore request sent by a client, and obtain a target logical historical version requested to be restored by the restore request;

[0119] In the case that the target logical historical version has no corresponding physical historical version, in the sequence formed by the logical historical versions, the logical historical version that is closest to the target logical historical version and has a corresponding physical historical version is searched, and the found logical historical version is used as the reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent the revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving the document formed according to the corresponding logical historical version;

[0120] According to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, the physical historical version corresponding to the reference logical historical version is revised, and the document corresponding to the target logical historical version is obtained and returned to the client.

[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0122] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0123] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0124] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A document restoration method, characterized in that: The method comprises: Receive a restore request sent by a client, and obtain a target logical historical version requested to be restored by the restore request; In the case that the target logical historical version has no corresponding physical historical version, in the sequence formed by the logical historical versions, the logical historical version that is closest to the target logical historical version and has a corresponding physical historical version is searched, and the found logical historical version is used as the reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent the revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving the document formed according to the corresponding logical historical version; According to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version, the physical historical version corresponding to the reference logical historical version is revised, and the document corresponding to the target logical historical version is obtained and returned to the client.

2. The method according to claim 1, characterized in that The searching, in the sequence formed by the logical historical versions, for a logical historical version that is closest to the target logical historical version and has a corresponding physical historical version comprises: In the sequence formed by the logical history versions, searching for the logical history version with the smallest version interval from the target logical history version and corresponding to the physical history version; or, In the sequence formed by the logical history versions, searching for the logical history version with the least number of records of revision operations between the target logical history version and the corresponding physical history version; or, In the sequence formed by the logical history versions, a logical history version having the shortest time interval with the target logical history version and corresponding to a physical history version is searched.

3. The method according to claim 1, characterized in that The revising the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version includes: In the case where the reference logical historical version is a previous version of the target logical historical version, the physical historical version corresponding to the reference logical historical version is revised forward according to the revision operation difference between the revision operation record represented by the target logical historical version and the revision operation record represented by the reference logical historical version; In the case that the reference logical historical version is a later version of the target logical historical version, the physical historical version corresponding to the reference logical historical version is rolled back and revised according to the revision operation difference.

4. The method according to claim 1, characterized in that: The method further comprises: For two adjacent logical history versions in the sequence, the revision operations experienced between the previous logical history version and the next logical history version are simplified.

5. The method according to claim 1, characterized in that The corresponding preservation process of the physical history version includes: In the process of revising a document, the document formed by the logical historical version obtained at the corresponding time is saved at every preset time interval to obtain the corresponding physical historical version; or In the process of revising a document, the number of records of the document revision operation is accumulated. Whenever the preset number is reached, the document formed by the logical historical version obtained at the corresponding time is saved, the corresponding physical historical version is obtained, and the accumulated number is cleared.

6. The method according to claim 1, characterized in that The method further comprises: Before revising the physical historical version corresponding to the reference logical historical version, the revision function of the document is locked and the current document is recorded as a current logical historical version. After the document corresponding to the target logical historical version is returned to the client, the document corresponding to the target logical historical version is restored to the document corresponding to the current logical historical version.

7. A document restoration device, characterized in that: The device comprises: A receiving module, used for receiving a restore request sent by a client, and obtaining a target logical historical version requested to be restored by the restore request; A search module is used for searching, in the sequence formed by the logical historical versions, a logical historical version that is closest to the target logical historical version and has a corresponding physical historical version when the target logical historical version has no corresponding physical historical version, and using the found logical historical version as a reference logical historical version; wherein the latter of two adjacent logical historical versions is used to represent a revision operation record made compared with the previous logical historical version, and the physical historical version is a historical document formed by saving a document formed according to the corresponding logical historical version; A revision module is used to revise the physical history version corresponding to the reference logical history version according to the revision operation difference between the revision operation record represented by the target logical history version and the revision operation record represented by the reference logical history version, obtain the document corresponding to the target logical history version and return it to the client.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.