Document consistency checking method and system

By storing operation data in time-series blocks on the server side and generating update data block identifiers, and then verifying the data on the client side, the problem of document inconsistency in multi-person collaborative documents is solved, and the efficiency and accuracy of document data consistency verification are improved.

CN116450595BActive Publication Date: 2026-03-31BEIJING KANYUN SOFTWARE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-18
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In collaborative document processing, inconsistencies in document data on the client side are prone to occur due to network instability and system vulnerabilities, leading to lost content or document errors. Existing full comparison hash values ​​schemes have high computational overhead and inaccurate results.

Method used

The server stores operation data in time-series blocks and generates update data block identifiers. The client performs verification based on the update data block identifier and the current data block identifier recorded locally, reducing the amount of verification data and improving the efficiency of consistency verification.

Benefits of technology

It implements automatic verification of client-side document data consistency, promptly detects and reports inconsistencies, avoids user operation errors, and improves the accuracy of document data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116450595B_ABST
    Figure CN116450595B_ABST
Patent Text Reader

Abstract

The application provides a document consistency checking method and system, wherein the method comprises the following steps: receiving document update information of a target document sent by a server, wherein the document update information comprises a target document identifier and an update data block identifier of the server, and the update data block identifier is obtained by the server according to the operation data of the client on the target document and stored in time sequence; obtaining document record information corresponding to the client locally according to the target document identifier, wherein the document record information comprises a locally recorded current data block identifier; checking the current target document of the client according to the update data block identifier and the current data block identifier, and obtaining a checking result of the target document. By checking the current target document of the client according to the update data block identifier and the locally recorded current data block identifier, the amount of checking data can be reduced, the data consistency checking efficiency can be improved, the user can be prevented from operating based on the wrong document, and the accuracy of the document data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a method for document consistency verification. This application also relates to a document consistency verification system, a document consistency verification device, a computing device, and a computer-readable storage medium. Background Technology

[0002] With the development of electronic information technology, collaborative documents are becoming increasingly common in offices. Unlike traditional single-person documents, collaborative documents allow multiple authors to work together on a document and support simultaneous editing by multiple people, greatly facilitating team collaboration.

[0003] However, due to the instability of network connections between the server and various office workers' clients, the same document may display different content on different clients, which can easily lead to the loss of user-edited content or document errors. Summary of the Invention

[0004] In view of this, embodiments of this application provide a document consistency verification method. This application also relates to a document consistency verification system, a document consistency verification device, a computing device, and a computer-readable storage medium, to solve the aforementioned problems existing in the prior art.

[0005] According to a first aspect of the embodiments of this application, a document consistency verification method is provided, applied to a client, including:

[0006] Receive document update information of the target document sent by the server. The document update information includes the target document identifier and the server's update data block identifier. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks.

[0007] Obtain the corresponding document record information on the client's local machine based on the target document identifier. The document record information includes the current data block identifier of the local record.

[0008] Based on the updated data block identifier and the current data block identifier, the target document on the client is validated to obtain the validation result of the target document.

[0009] According to a second aspect of the embodiments of this application, a document consistency verification method is provided, applied to a server, including:

[0010] Receive at least one operation data sent by the client for the target document, wherein the at least one operation data carries the target document identifier;

[0011] Obtain the target data block identifier from the server, where the target data block identifier is the identifier of the last data block in the server's data block chain;

[0012] For at least one operation data, store it in blocks to obtain an updated data block, and configure the corresponding updated data block identifier for the updated data block according to the current data block identifier on the server.

[0013] Based on the target document identifier and the updated data block identifier, corresponding document update information is generated and sent to each client. The document update information is used to instruct each client to verify the current target document.

[0014] According to a third aspect of the embodiments of this application, a document consistency verification system is provided, including a server and a client:

[0015] The server is configured to receive at least one operation data sent by the client for a target document, wherein the at least one operation data carries a target document identifier; obtain the target data block identifier from the server, wherein the target data block identifier is the identifier of the last data block in the server's data block chain; obtain an updated data block by storing the at least one operation data in blocks, and configure a corresponding updated data block identifier for the updated data block according to the server's current data block identifier; generate corresponding document update information according to the target document identifier and the updated data block identifier, and send the document update information to each client, wherein the document update information is used to instruct each client to verify the current target document;

[0016] The client is configured to receive document update information for a target document sent by the server. This document update information includes a target document identifier and an update data block identifier from the server. The update data block identifier is obtained by the server through time-series storage of the client's operation data on the target document. The client also retrieves the corresponding document record information locally based on the target document identifier. This document record information includes the current data block identifier of the local record. Finally, the client verifies the current target document based on the update data block identifier and the current data block identifier to obtain the verification result of the target document.

[0017] According to a fourth aspect of the embodiments of this application, a document consistency verification device is provided, applied to a client, comprising:

[0018] The first receiving module is configured to receive document update information of the target document sent by the server. The document update information includes the target document identifier and the server's update data block identifier. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks.

[0019] The first acquisition module is configured to acquire the corresponding document record information on the client's local machine based on the target document identifier, wherein the document record information includes the current data block identifier of the local record;

[0020] The verification module is configured to verify the current target document on the client based on the updated data block identifier and the current data block identifier, and obtain the verification result of the target document.

[0021] According to a fifth aspect of the embodiments of this application, a document consistency verification device is provided, applied on a server, comprising:

[0022] The second receiving module is configured to receive at least one operation data sent by the client for the target document, wherein the at least one operation data carries the target document identifier;

[0023] The second acquisition module is configured to acquire the target data block identifier of the server, wherein the target data block identifier is the identifier of the last data block in the data block chain of the server;

[0024] The storage module is configured to store at least one operation data block to obtain an updated data block, and to configure a corresponding updated data block identifier for the updated data block according to the current data block identifier of the server.

[0025] The generation module is configured to generate corresponding document update information based on the target document identifier and the update data block identifier, and then send the document update information to each client. The document update information is used to instruct each client to verify the current target document.

[0026] According to a sixth aspect of the present application, a computing device is provided, including a memory, a processor, and computer instructions stored in the memory and executable on the processor, wherein the processor executes the computer instructions to implement the steps of the document consistency verification method.

[0027] According to a seventh aspect of the present application, a computer-readable storage medium is provided that stores computer instructions which, when executed by a processor, implement the steps of the document consistency verification method.

[0028] The document consistency verification method provided in this application receives document update information of a target document sent by a server. The document update information includes a target document identifier and an update data block identifier of the server. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks. The method then obtains the corresponding document record information on the client's local machine based on the target document identifier. The document record information includes the current data block identifier of the local record. Finally, the method verifies the current target document on the client based on the update data block identifier and the current data block identifier to obtain the verification result of the target document.

[0029] Thus, by verifying the corresponding document record information on the client's local machine based on the document update information of the target document sent by the server, the client can automatically verify the consistency of document data. By updating the data block identifier and the current data block identifier recorded locally on the client, the client can verify the current target document, which can reduce the amount of verification data and improve the efficiency of data consistency verification. This allows for timely alerts when document data inconsistency is detected, preventing users from operating on incorrect documents, avoiding loss of client operation data, and ultimately improving the accuracy of document data. Attached Figure Description

[0030] Figure 1 This is an architecture diagram of a document consistency verification system provided in one embodiment of this application;

[0031] Figure 2 This is a flowchart of a document consistency verification method provided in an embodiment of this application;

[0032] Figure 3 This is a flowchart of a document consistency verification method provided in an embodiment of this application;

[0033] Figure 4 This is a flowchart illustrating a document consistency verification method for collaborative design documents by multiple users, provided in one embodiment of this application.

[0034] Figure 5 This is a schematic diagram of the structure of a document consistency verification device provided in one embodiment of this application;

[0035] Figure 6 This is a schematic diagram of the structure of a document consistency verification device provided in one embodiment of this application;

[0036] Figure 7 This is a structural block diagram of a computing device provided in one embodiment of this application. Detailed Implementation

[0037] Many specific details are set forth in the following description to provide a full understanding of this application. However, this application can be implemented in many other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this application; therefore, this application is not limited to the specific embodiments disclosed below.

[0038] The terminology used in one or more embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this application. The singular forms “a,” “the,” and “the” used in one or more embodiments of this application and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” used in one or more embodiments of this application refers to and includes any or all possible combinations of one or more associated listed items.

[0039] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this application, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this application, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0040] 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, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0041] First, the terms and concepts involved in one or more embodiments of this application will be explained.

[0042] A hash algorithm is a digest algorithm that converts a piece of data into a fixed-size output (such as a 64-bit integer). It can be used for digital signatures and verifying data integrity. In other words, if the hashes of two pieces of data are inconsistent, it can be concluded that they are not the same. Conversely, if the hashes of two pieces of data are consistent, it generally means that the two pieces of data are the same.

[0043] With the development of electronic information technology, collaborative documents are becoming increasingly common in offices. Unlike traditional single-person documents, collaborative documents allow multiple creators to design and create a document together, and support simultaneous editing by multiple people, greatly facilitating team collaboration.

[0044] Currently, most UI design tools that support collaborative editing allow multiple users to connect to the server simultaneously and collaboratively edit the same document. To support efficient user operations, each client needs to maintain a complete copy of the data locally, while the server manages the document data stored locally by each client. Therefore, both the server and each client need to maintain a copy of the same data.

[0045] Because multiple users may send logically conflicting data to the server during the editing process, depending on their individual habits and processing methods, this could lead to conflicting edits on the same part of the document or the use of identical names for different parts. The server typically uses the CRDT (Content Conflict Resolution Table) protocol to ensure document data consistency. As a framework for conflict resolution, CRDT helps clients handle complex conflicts, correcting conflicting operations and ensuring that the data displayed by all clients is consistent. This prevents issues such as documents becoming unopenable due to errors, garbled text, or lost user-edited data.

[0046] However, after correcting conflicting user operation data through the CRDT protocol, the server also needs to send the corrected data to each client. During the process of the server sending data and updating the documents stored on the client, due to network fluctuations, system vulnerabilities, and other reasons, the data may not be sent correctly, resulting in inconsistent data among the clients.

[0047] In practical applications, users may keep a document editing window open for weeks at a time. During this process, the client and server may disconnect and then resynchronize. The server may also restart, causing some data to be sent repeatedly. Due to the complexity of the process and the massive amount of data, problems at any stage can lead to inconsistencies in data across different clients. For example:

[0048] Suppose clients A and B are already connected to the server. A new client C joins the server. At this time, a client submits some new operations to the server. Due to the timing of the server's processing, client C misses the synchronization of the latest operation data. As a result, client C's document data becomes inconsistent with that of other clients.

[0049] For example, suppose clients A and B connect to a server. During the connection process, the server restarts, and due to a system vulnerability, the logic before and after the server restarts is inconsistent. For the same operation, client A retrieves data from the server before the restart, while client B retrieves data from the server after the restart. Therefore, the document data for clients A and B will be inconsistent.

[0050] To improve the reliability of collaborative editing tools and provide users with a better experience, the accuracy of user data should be prioritized. It should be ensured that the document copies saved on each client are exactly the same; otherwise, there is a risk of document errors, which may lead to the loss of user-edited data.

[0051] Currently, the consistency of document data is often verified by comparing all document data. Specifically, the server can calculate the hash value corresponding to the complete document data content stored on the server, then obtain the hash value corresponding to the current document content on each client, compare the hash values ​​of the two ends, and determine whether the document data is consistent based on the comparison result.

[0052] The following drawbacks exist in this scheme: (1) The programming languages ​​and memory data models of the client and server may not be consistent, so the data format for calculating hash values ​​may be inconsistent, making the calculation results unsuitable for direct comparison. (2) During continuous editing, the local content of the client may be inconsistent with that of the server. Therefore, a simple comparison with the hash value issued by the server may result in false alarms due to inconsistent comparison results. (3) Both the server and client scan the entire document and calculate the global hash value, which will result in a very high computational overhead for the system, making it impossible to effectively utilize server resources and affecting document processing efficiency. Due to the above drawbacks, this scheme is difficult to implement, and the data consistency verification results are not accurate enough.

[0053] Based on this, one embodiment of this application provides a document consistency verification method, which receives document update information of a target document sent by a server, wherein the document update information includes a target document identifier and an update data block identifier of the server, the update data block identifier being obtained by the server in time-series block storage based on the client's operation data on the target document; obtains the corresponding document record information locally on the client based on the target document identifier, wherein the document record information includes the current data block identifier of the locally recorded document; and verifies the current target document on the client based on the update data block identifier and the current data block identifier to obtain the verification result of the target document.

[0054] In this way, by verifying the corresponding document record information on the client's local machine based on the document update information of the target document sent by the server, the client can automatically verify the consistency of document data. By updating the data block identifier and the current data block identifier recorded locally on the client, the client can verify the current target document, which can reduce the amount of verification data and improve the efficiency of data consistency verification. This allows for timely alerts when document data inconsistency is detected. Regardless of the cause of the data inconsistency, it will be detected and reported immediately, preventing users from operating on incorrect documents, reducing the possibility of client operation data loss, and thus improving the accuracy of document data.

[0055] This application provides a document consistency verification method, and also relates to a document consistency verification system, a document consistency verification device, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0056] Figure 1 This is an architecture diagram of a document consistency verification system provided in one embodiment of this application. The system specifically includes a server 102 and multiple clients 104. The server 102 and the multiple clients 104 interact via signals, and a network connection can be established between the server 102 and the multiple clients 104 via the Internet or a local area network.

[0057] Server 102 is configured to receive at least one operation data sent by client 104 for a target document, wherein the at least one operation data carries a target document identifier; obtain the target data block identifier of server 102, wherein the target data block identifier is the identifier of the last data block in the data block chain of server 102; obtain an updated data block by storing the at least one operation data in blocks, and configure a corresponding updated data block identifier for the updated data block according to the current data block identifier of server 102; generate corresponding document update information according to the target document identifier and the updated data block identifier, and send the document update information to each client 104, wherein the document update information is used to instruct each client 104 to verify the current target document.

[0058] In practical applications, server 102 can establish connections with multiple clients 104 and receive operation data for the target document sent by each client 104. Server 102 can store the operation data in chronological order according to the time sequence of receipt, then divide the operation data into data blocks, verify the newly generated data blocks according to preset rules, generate updated data blocks, and store the updated data blocks in the data block chain corresponding to the target document; alternatively, it can generate a data block corresponding to each received operation data in chronological order, verify it according to preset rules, generate updated data blocks, and store the updated data blocks in the data block chain corresponding to the target document.

[0059] To reduce the data processing pressure on the server, decrease the amount of data during data transmission between the server and the client, and improve data transmission efficiency and data consistency verification efficiency, in one or more embodiments of this application, the server 102 can store the document content of the target document in the form of a data block chain according to the data blocks corresponding to the operation data. For details of the specific storage method, please refer to the following formula (1).

[0060] DOCn = TX1 + TX2 + TX3 + TX4 + ... + TXn (1)

[0061] Among them, DOC n This can be understood as the document content corresponding to the target document, TX1 to TX. n This can be understood as a series of continuous modification operations on the target document.

[0062] In practical applications, server 102 can store each generated update data block in the data block chain corresponding to the target document. For example, if the target document is currently a newly created blank document, then the data block chain corresponding to DOC0 is currently empty. When client 104 submits operation data, server 102 receives this operation data and can generate update data block TX1 based on it, then store TX1 in the data block chain. At this point, the data block chain corresponding to the target document can be DOC1 = TX1. Server 102 can also cache the generated update data blocks in sequence, and then store the cached data blocks in the data block chain corresponding to the target document according to their sequential identifiers. The specific method can be determined according to the actual situation, and this specification does not impose any limitations on this.

[0063] It should be noted that the server 102 generates update data blocks, and can generate document update information corresponding to the target document based on the update data blocks. This document update information is then sent to each client 104 so that each client 104 can verify and update the locally stored document copy based on the document update information. The steps of storing the update data blocks into the data block chain corresponding to the target document, generating document update information, and sending the document update information to each client 104 can be executed synchronously or asynchronously; this specification does not impose any restrictions on this.

[0064] In one or more embodiments of this application, the server receives operation data for a target document sent by each client, generates update data blocks based on the operation data, stores the update data blocks in the data block chain corresponding to the target document, and sends the document update information corresponding to the update data blocks to each client. This enables the server to update and store the target document content on the server side, as well as send the update data. The server does not need to be aware of the local storage status of the target document on each client, does not need to verify and judge the data consistency of each client, and can reduce the amount of data sent for each update, thereby greatly improving the server's data processing efficiency and performance.

[0065] Client 104 is configured to receive document update information of a target document sent by server 102. The document update information includes a target document identifier and an update data block identifier of server 102. The update data block identifier is obtained by server 102 based on the operation data of client 104 on the target document, stored in time-series blocks. Client 104 also retrieves the corresponding document record information locally based on the target document identifier. The document record information includes the current data block identifier of the local record. Based on the update data block identifier and the current data block identifier, client 104 verifies the target document and obtains the verification result of the target document.

[0066] In practical applications, multiple clients 104 can exist. During the process of a user editing a document on a client 104, the connection status between the client 104 and the server 102 can be either connected or disconnected. That is, the document can be either online or offline. When the document is in online editing mode, the client 104 can automatically identify the user's operations according to pre-set data submission rules and upload the operation data to the server 102. When the document is in offline editing mode, the client 104 can store the operation data edited by the user in the offline state. After the client and server 102 establish a network connection, the offline operation data can be uploaded to the server 102 as a whole, or the offline operation data can be submitted sequentially according to the order of the operation steps.

[0067] When client 104 receives document update information from server 102, it can retrieve the current record information of the target document locally on client 104 based on the target document identifier included in the document update information. It then verifies the current record information against the document update information and determines whether the document data currently stored on the client is consistent with that on the server based on the verification result. Each client 104 can align its document data with the document data stored on the server based on the document update information, thereby ensuring that the document data stored locally on each client 104 is consistent with each other and improving document accuracy.

[0068] One embodiment of this application provides a document consistency verification method, which receives document update information of a target document sent by a server. The document update information includes a target document identifier and an update data block identifier of the server. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks. The method also obtains the corresponding document record information locally on the client based on the target document identifier. The document record information includes the current data block identifier of the locally recorded document. Finally, the method verifies the current target document on the client based on the update data block identifier and the current data block identifier to obtain the verification result of the target document.

[0069] In this way, by verifying the corresponding document record information on the client's local machine based on the document update information of the target document sent by the server, the client can automatically verify the consistency of document data. By updating the data block identifier and the current data block identifier recorded locally on the client, the client can verify the current target document, which can reduce the amount of verification data and improve the efficiency of data consistency verification. This allows for timely alerts when document data inconsistency is detected. Regardless of the cause of the data inconsistency, it will be detected and reported immediately, preventing users from operating on incorrect documents, reducing the possibility of client operation data loss, and thus improving the accuracy of document data.

[0070] Figure 2 The flowchart illustrates a document consistency verification method according to an embodiment of this application, applied to a client, and specifically includes the following steps:

[0071] Step 202: Receive the document update information of the target document sent by the server. The document update information includes the target document identifier and the server's update data block identifier. The update data block identifier is obtained by the server based on the client's operation data on the target document, which is stored in blocks according to time sequence.

[0072] In practical applications, users can edit target documents using UI design software, document editors, and other tools on the client. The client can record a series of operations performed by the user on the target document and submit the operation data to the server in chronological order. Specifically, the client can automatically identify the user's editing operations on the target document. Each time the user completes an editing operation, the client can save the corresponding operation data and submit it to the server. When the client and server are disconnected, the client can store the user's editing operations in sequence during the disconnection period. When the client and server reconnect, the client can upload the stored operation data as a whole to the server, or submit the operation data to the server in the order of each operation. In one or more embodiments of this application, the client's document editing interface can be equipped with a selection control, allowing the user to choose whether the client automatically uploads the operation data or the user manually submits the operation data. The client's document editing interface can also be equipped with a submission control, allowing the user to click the submission control to trigger the client to submit the user's edited operation data to the server according to actual needs.

[0073] While maintaining a connection between the client and the server, the client can receive document update information for the target document sent by the server and perform consistency verification on the document data corresponding to the target document on the client's local machine based on the document update information.

[0074] Specifically, the target document can be a document that the user is currently interacting with, or a document stored in the client's backend. Document update information can be understood as information issued by the server to enable the client to verify the document data corresponding to the current target document in its local storage. Document update information may include the target document identifier and the server's updated data block identifier. The target document identifier is used to identify the document for data consistency verification, and the server's updated data block identifier can be understood as the identifier of a newly added data block in the server's data block chain corresponding to the target document. The updated data block identifier is obtained by the server based on the client's operation data on the target document, stored in time-series blocks.

[0075] It should be noted that there can be one or more update data blocks, which can be determined based on the number of update data blocks stored in the target document data block chain on the server. The update data block identifier is the identifier corresponding to the first update data block. For example, the server updates data block TX. 11 TX 12 TX 13 Simultaneously stored in the target document data block chain, and according to TX 11 TX 12 TX 13 If document update information is generated, the updated data block identifier is 11.

[0076] For example, the data block chain of the target document currently stored on the server is DOC. 10 =TX1+TX2+TX3+TX4+TX5+TX6+TX7+TX8+TX9+TX 10 The server generates an update data block TX based on the new operation data submitted by each client. 11 Then the updated data block chain of the target document on the server side is DOC. 11 =TX1+TX2+TX3+TX4+TX5+TX6+TX7+TX8+TX9+TX 10 +TX 11 At this point, the data block identifier is updated to 11.

[0077] To improve data consistency verification efficiency and reduce the computational burden on the client and server, one or more embodiments of this application receive document update information of the target document sent by the server, and verify the current target document stored locally on the client according to the target document identifier and the server's update data block identifier included in the document update information. This enables each client to perform consistency verification on its local document data based on the update information issued by the server, reducing the amount of data in the interaction process and the amount of verification data, thereby improving verification efficiency.

[0078] Instead of the server acquiring and verifying the document data of each client, each client performs consistency checks on its local document data. This shifts the data processing burden from the server to each client, and each client only needs to verify the target document on its local machine. This greatly improves data verification efficiency and reduces the data processing burden on the server.

[0079] Step 204: Obtain the corresponding document record information on the client's local machine based on the target document identifier. The document record information includes the current data block identifier of the local record.

[0080] In practical applications, the client can obtain the corresponding document record information on the client's local machine based on the target document identifier in the document update information.

[0081] Specifically, document record information can be understood as the current information of the target document recorded locally by the client. Since the server sends the update operation data to each client in the form of update data blocks, the client can record the data block identifier corresponding to the most recently sent update data block by the server locally.

[0082] For example, after the server completes the update of the data block chain of the target document and sends the updated data blocks to the client, if the document data on the client and the server are consistent, and the server's data block chain is DOC... 10 =TX1+TX2+TX3+TX4+TX5+TX6+TX7+TX8+TX9+TX 10 If so, the current data block identifier recorded locally on the client should be 10, and the current target document content on the client should be consistent with that on the server.

[0083] In practical applications, the client uses update data blocks issued by the server to update the target document locally. The client can record only the identifier corresponding to the last update data block in the update data block to obtain document record information. The document record information is used to record the current data block identifier stored locally on the client. For example, the client uses the TX block issued by the server... 11 TX 12 TX 13If the target document on the local machine is updated, the current data block identifier in the document record information should be 13 after the update.

[0084] By obtaining the current data block identifier of the client's local record based on the target document identifier, the storage status of the target document on the client's local machine can be determined. By judging whether the document data is consistent based on the current data block identifier, the amount of data for data consistency verification can be reduced, and the efficiency of client data verification can be improved. Regardless of the cause of client data inconsistency, it can be detected and alerted immediately, thereby improving the accuracy of document content.

[0085] Step 206: Based on the updated data block identifier and the current data block identifier, verify the current target document on the client and obtain the verification result of the target document.

[0086] In practical applications, the client can verify the current target document by using the updated data block identifier and the current data block identifier, and obtain the verification result of the target document.

[0087] Specifically, the current data block identifier can be verified based on the updated data block identifier, thereby enabling the verification of the current target document on the client.

[0088] In one or more embodiments of this application, verifying the current target document of the client based on the updated data block identifier and the current data block identifier may include the following steps:

[0089] Increment the current data block identifier by 1 to obtain the verification identifier;

[0090] The updated data block identifier is compared with the verification identifier to obtain the comparison result;

[0091] Based on the comparison results, the verification result of the target document is obtained.

[0092] Specifically, the current data block identifier recorded locally on the client can be understood as which specific data block issued by the server is currently stored on the client. For example, if the current data block identifier is 1, it can be understood that the client currently only stores data block 1 issued by the server; if the current data block identifier is 10, it can be understood that the client currently stores data blocks 1 to 10 issued by the server.

[0093] It's easy to understand that if the client's data is consistent with the server's data, then the updated data block identifier received by the client should be the current data block identifier plus 1. For example, if the current data block identifier is 10, then if the updated data block identifier is 11, it means that the data currently stored on the client is consistent with the data on the server.

[0094] Therefore, by verifying the current data block identifier based on the updated data block identifier, it can be determined whether the target document data on the client and the target document data on the server are consistent.

[0095] Specifically, the current data block identifier is incremented by 1 to obtain the verification identifier, and the updated data block identifier is compared with the verification identifier to obtain the comparison result.

[0096] It's easy to understand that comparing the updated data block identifier with the check identifier can yield three possible results: the updated data block identifier is equal to the check identifier, the updated data block identifier is greater than the check identifier, or the updated data block identifier is less than the check identifier.

[0097] Based on these three comparison results, the data consistency of the target document on the client's local machine can be further verified, thereby improving the accuracy of the verification results.

[0098] In one or more embodiments of this application, the document update information may further include a first content code of the updated data block and a second content code of the preceding data block of the updated data block; correspondingly, obtaining the verification result of the target document based on the comparison result may include the following steps:

[0099] If the comparison result shows that the updated data block identifier is greater than the verification identifier, the verification result of the target document is determined to be verification failure.

[0100] If the comparison result shows that the updated data block identifier is not greater than the verification identifier, the verification result of the target document is determined by combining the first content code or the second content code.

[0101] Specifically, the first content encoding of the updated data block is the encoding calculated by the server for the updated data block, and the second content encoding of the preceding data block is the encoding calculated by the server for the preceding data block. For example, the updated data block is TX. 11 Then update the previous data block of the data block to TX. 10 According to TX 11 The calculated code is the first content code, based on TX. 10 The calculated code is the second content code. The content code can be calculated using a hash algorithm. To ensure document security, encoding methods such as message digest algorithms can also be used to encrypt the content within the data block.

[0102] It should be noted that if the comparison result shows that the updated data block identifier is greater than the verification identifier, it means that the updated data block identifier issued by the server is greater than the identifier of the next data block that the client should receive. In other words, the client is currently missing a data block. In this case, the client's target document is missing operation data, therefore the data is inconsistent with the server's, and the verification result can be determined as verification failure.

[0103] If the comparison result shows that the updated data block identifier is less than or equal to the verification identifier (i.e., the updated data block identifier is not greater than the verification identifier), a quick verification method is as follows: If the updated data block identifier is equal to the verification identifier, it can be assumed that the identifier of the next data block to be received by the client is the updated data block identifier sent by the server. Therefore, it can be assumed that the client's current target document is consistent with the server's data, and the verification result is determined to be successful. If the updated data block identifier is less than the verification identifier, it can be assumed that the server has repeatedly sent the previously sent data block. Therefore, the client can ignore the document update information sent by the server this time, and the verification result is determined to be ignoring this verification.

[0104] To improve the accuracy of the verification results and ensure that the document content of the target document is consistent across all clients, one or more embodiments of this application further verify the corresponding document record information on the client's local machine through a first content encoding or a second content encoding.

[0105] Accordingly, determining the verification result of the target document by combining the first content code or the second content code may include the following steps:

[0106] If the updated data block identifier is equal to the verification identifier, then obtain the third content encoding of the current data block on the client's local machine; compare the second content encoding and the third content encoding to obtain the verification result of the target document;

[0107] If the updated data block identifier is less than the verification identifier, then it is determined whether the current data block identifier and the updated data block identifier are equal, and the verification result of the target document is determined based on the judgment result.

[0108] Specifically, if the comparison result between the updated data block identifier and the verification identifier is that the updated data block identifier is equal to the verification identifier, it means that the identifier of the next data block to be received by the client is the updated data block identifier issued by the server. At this time, the third content encoding of the current data block on the client's local machine can also be verified by the second content encoding of the previous data block stored on the server.

[0109] Since, under the condition of data consistency, the previous data block updated on the server should be consistent with the current data block content on the client, the second content code of the previous data block is compared with the third content code of the current data block. If the second content code and the third content code are equal, it can be considered that the target document data on the client and the target document data on the server are consistent, and the verification result is determined to be verification passed. If the second content code and the third content code are not equal, it can be considered that the target document data on the client and the target document data on the server are inconsistent, and the verification result is determined to be verification failed.

[0110] If the comparison between the updated data block identifier and the verification identifier shows that the updated data block identifier is less than the verification identifier, it indicates that the server may have duplicated the current data block stored on the client, or it may have duplicated an earlier data block. It is necessary to first determine whether it is a duplicate of the current data block or a duplicate of an earlier data block, and then further determine the verification result of the target document based on the determination result.

[0111] In one or more embodiments of this application, determining the verification result of the target document based on the judgment result may include the following steps:

[0112] If they are equal, obtain the third content encoding of the current data block on the client's local machine, compare the first content encoding and the third content encoding, and obtain the verification result of the target document;

[0113] If they are not equal, the verification result of the target document is determined to be to ignore this verification.

[0114] Specifically, if the current data block identifier and the updated data block identifier are equal, it means that the current data block on the client is being reissued. If the current data block identifier and the updated data block identifier are not equal, it means that a data block earlier than the current data block is being reissued. If the reissued data block is earlier than the current data block, it can be assumed that these data blocks have already passed verification and have been updated on the client in chronological order. Therefore, no verification is needed, and the verification result can be determined as ignoring this verification.

[0115] If the current data block of the target document on the client is repeatedly sent, in order to further improve the consistency of document data, one or more embodiments of this application can obtain the third content code of the current data block on the client's local machine, compare the first content code and the third content code, and obtain the verification result of the target document.

[0116] Accordingly, comparing the first content encoding and the third content encoding to obtain the verification result of the target document can include the following steps:

[0117] If the first content code and the third content code are the same, then the verification result of the target document is determined to be to ignore this verification.

[0118] If the first content code and the third content code are different, then the verification result of the target document is determined to be verification failure.

[0119] Specifically, the third content code of the current data block on the client's local machine is obtained based on the data storage sent by the service. If the third content code is the same as the first content code, it means that the updated data block repeatedly sent by the server is consistent with the content of the current data block on the client's local machine, the client document data is consistent with the server document data, no error has occurred, and therefore the verification result can be determined to ignore this verification.

[0120] If the third content code is different from the first content code, it means that the updated data block repeatedly sent by the server is inconsistent with the current data block content on the client's local machine, the client's document data is inconsistent with the server's document data, the client's target document has an error, and the verification result is determined to be verification failure.

[0121] Optionally, if the verification result is to ignore this verification, the client does not need to respond to the document update information sent by the server and can simply ignore the document update information sent by the server.

[0122] By verifying the current data block identifier and third content code of the client using the received updated data block identifier, first content code, and second content code, more accurate data consistency verification results can be obtained even with a small amount of verification data, greatly improving the efficiency of data consistency verification and the accuracy of document data.

[0123] Optionally, when the verification result is that the verification fails, one or more embodiments of this application may further include the following steps after obtaining the verification result of the target document:

[0124] Issue an alarm message, which is used to prompt the client user to stop operating on the target document;

[0125] Reload the target document.

[0126] Specifically, if a verification failure is detected, an alarm message is issued. The alarm message can be a pop-up window displaying an error message, or it can be sent to the user via document shaking, sound alerts, or other methods. Regardless of the cause of the data inconsistency, it can be detected immediately and the user will be alerted, effectively preventing the user from continuing to operate on the erroneous document and reducing the possibility of data loss.

[0127] After issuing an alarm message, the client can wait for the user to click on the interactive control to reload the target document, or it can automatically reload or close the target document within a preset time after issuing the alarm message to prevent the user from continuing to edit the document that has already reported an error.

[0128] Optionally, the document update information may also include update data blocks from the server. When the verification result is successful, one or more embodiments of this application may further include the following steps after obtaining the verification result of the target document:

[0129] Use the update data block to update the current target document on the client.

[0130] Update the current data block identifier based on the updated data block identifier.

[0131] In practical applications, the document update information of the target document sent by the server may include the server's update data block. If the verification result is successful, the client can directly use the update data block to update the client's current target document, so that the client's target document data is consistent with the target document data in the server.

[0132] Optionally, in order to improve data transmission efficiency and save data processing resources, the document update information may not include the server-side update data block. Instead, after the client receives the verification result that has passed the verification, the client sends a request to the server to obtain the update data block.

[0133] It should be noted that after the client updates the target document using the update data block, it can also update the current data block identifier included in the corresponding document record information on the client's local machine to the update data block identifier, and can use the first content code corresponding to the update data block to update the third content code of the current data block on the client's local machine.

[0134] One embodiment of this application provides a document consistency verification method that receives document update information of a target document sent by a server. The document update information includes a target document identifier and an update data block identifier of the server. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks. The method then obtains the corresponding document record information locally on the client based on the target document identifier. The document record information includes the current data block identifier of the locally recorded document. Finally, the method verifies the current target document on the client based on the update data block identifier and the current data block identifier to obtain the verification result of the target document.

[0135] Thus, by verifying the corresponding document record information on the client's local machine based on the document update information of the target document sent by the server, the client can automatically verify the consistency of document data. By updating the data block identifier and the current data block identifier recorded locally on the client, the client can verify the current target document, which can reduce the amount of verification data and improve the efficiency of data consistency verification. This allows for timely alerts when document data inconsistency is detected, preventing users from operating on incorrect documents, avoiding loss of client operation data, and ultimately improving the accuracy of document data.

[0136] Figure 3 The flowchart illustrates a document consistency verification method according to an embodiment of this application, applied to a server, and specifically includes the following steps:

[0137] Step 302: Receive at least one operation data sent by the client for the target document, wherein the at least one operation data carries the target document identifier.

[0138] In practical applications, the server can receive operation data for a target document from multiple clients. The server can store the operation data according to the order in which it is received.

[0139] If the server receives at least one operation data from the client for the target document, it means that the server needs to update the data block chain corresponding to the target document. Therefore, it needs to obtain the data block chain corresponding to the target document.

[0140] Step 304: Obtain the target data block identifier from the server, where the target data block identifier is the identifier of the last data block in the server's data block chain.

[0141] In practical applications, since the server needs to add the updated data block obtained based on at least one operation data to the data block chain, it is necessary to obtain the target data block identifier from the server.

[0142] Specifically, the target data block identifier is the identifier corresponding to the last data block in the data chain of the target document.

[0143] In one or more embodiments of this specification, obtaining the target data block identifier of the server may include the following steps:

[0144] Based on the target document identifier, obtain the data block chain corresponding to the target document;

[0145] Determine the last data block in the data block chain as the target data block;

[0146] Based on the target data block, obtain the target data block identifier from the server.

[0147] In practical applications, the target document identifier can be carried in the operation data to obtain the data block chain corresponding to the target document, determine the last data block on the data block chain as the target data block, and obtain the target data block identifier based on the identifier of the target data block.

[0148] It should be noted that, in the data block chain corresponding to the target document, the data block identifier of each data block can be understood as the sequence number of each data block in the data block chain.

[0149] Step 306: Obtain updated data blocks by storing at least one operation data block, and configure the corresponding updated data block identifier for the updated data block according to the current data block identifier of the server.

[0150] In one or more embodiments of this specification, the server can store at least one operation data in blocks to obtain an updated data block, and configure a corresponding updated data block identifier for the updated data block according to the server's current data block identifier.

[0151] Specifically, obtaining an updated data block by storing at least one operational data block may include the following steps:

[0152] Divide at least one piece of operational data into blocks to generate an initial data block;

[0153] The content of the initial data block is validated according to preset rules to obtain the validation result of the initial data block;

[0154] Based on the verification results of the initial data block, determine and store the updated data block.

[0155] In one or more embodiments of this specification, at least one operation data can be divided into blocks according to the timing of the server receiving at least one operation data. For example, multiple operation data received within 0.05 seconds can be divided into one data block to generate an initial data block; alternatively, the operation data corresponding to a received change operation can be used as an initial data block, or the operation data corresponding to a change can be divided into multiple data blocks. Furthermore, dividing the operation data corresponding to a change into multiple data blocks can be done randomly or based on the logical relationship between the operation data. Each time the client submits operation data to the server, it can be considered a change operation. A change operation can include a single editing operation of the target document by the user, or it can include multiple editing operations of the target document by the user.

[0156] To avoid conflicts between the data in the initial data block and the original data in the data block chain of the target document on the server, the server can validate the content of the initial data block according to preset rules and obtain the validation result of the initial data block. Specifically, the preset rules may include validation rules that may lead to document content anomalies, such as not allowing updated data to conflict with the original data in naming, not allowing updated data to conflict with the original data in sequence number, and not allowing updated data to have circular dependencies on nodes with the original data.

[0157] Accordingly, determining and storing the updated data block based on the verification result of the initial data block may include the following steps:

[0158] If the verification result of the initial data block meets the preset rules, then the initial data block is determined to be an update data block and stored.

[0159] If the verification result of the initial data block does not conform to the preset rules, the content of the initial data block is adjusted according to the preset rules to generate corrected data. An updated data block is generated based on the initial data block and the corrected data and then stored.

[0160] In one or more embodiments of this specification, if the verification result of the initial data block conforms to the preset rules, it means that the operation data in the initial data block will not conflict with the original data in the data block chain, and the initial data block can be determined as the update data block and stored.

[0161] If the initial data block's validation result does not conform to the preset rules, it indicates a conflict between the operational data in the initial data block and the original data in the data block chain. The server needs to modify and adjust the operational data in the initial data block, generating additional corrective data based on the operational data to avoid document content conflicts. Therefore, when the initial data block's validation result does not conform to the preset rules, the content of the initial data block can be adjusted according to the preset rules to generate corrective data, which is then added to the initial data block to obtain an updated data block for storage.

[0162] Step 308: Generate corresponding document update information based on the target document identifier and the update data block identifier, and send the document update information to each client. The document update information is used to instruct each client to verify the current target document.

[0163] In practical applications, after the server generates the update data block and configures the corresponding update data block identifier for the update data block, it can send the document update information corresponding to the target document to each client, so as to instruct each client to verify the current target document on its local machine according to the document update information.

[0164] In one or more embodiments of this application, generating corresponding document update information based on the target document identifier and the update data block identifier may include the following steps:

[0165] Obtain the second content encoding of the target data block corresponding to the target data block identifier;

[0166] Based on the second content encoding, generate the first content encoding of the updated data block;

[0167] Add the first content code, the second content code, the updated data block identifier, and the target document identifier to the document update information.

[0168] Specifically, the second content code of the target data block corresponding to the target data block identifier can be obtained, and the first content code of the updated data block can be generated based on the second content code and the operation data in the updated data block; or, if the updated data block includes correction data corresponding to the operation data, the first content code of the updated data block can be generated based on the second content code, the operation data in the updated data block, and the correction data corresponding to the operation data.

[0169] The specific method for generating the first content code of the updated data block based on the second content code, the operation data in the updated data block, and the correction data corresponding to the operation data can be found in the following formula (2).

[0170] hash(TX n = hash(hash(TX) n-1 ), payload, serverPayload) (2)

[0171] Among them, TX n It updates the data block, hash(TX) n ) is the first content encoding corresponding to the updated data block, TX n-1 It is the target data block, hash(TX) n-1 ) is the second content encoding corresponding to the target data block, payload is the operation data in the updated data block, and serverPayload is the correction data corresponding to the operation data in the updated data block.

[0172] In one or more embodiments of this application, a first content code, a second content code, an updated data block identifier, and a target document identifier are added to the document update information to generate document update information that can be used to perform data consistency verification on the current target document on each client's local machine.

[0173] Optionally, to further improve server efficiency and reduce server computing costs, the client can also perform content encoding calculations for the operation data. Each time a client completes an editing operation, it can generate an update data block based on the operation data corresponding to the editing operation and calculate the content encoding of the update data block. The content encoding is then sent to the server. The server receives at least one update data block and its corresponding content encoding from each client. It can check whether there are any conflicts between the update data blocks according to the receiving sequence and preset rules. If there are any conflicts, the server adjusts the conflicting operation data, recalculates the encoding value, and then sends the adjusted update data block to each client to instruct each client to perform data consistency verification on the update data information corresponding to the update data block.

[0174] One embodiment of this application provides a document consistency verification method, which receives at least one operation data sent by a client for a target document, wherein the at least one operation data carries a target document identifier; obtains a target data block identifier from the server, wherein the target data block identifier is the identifier of the last data block in the server's data block chain; stores the at least one operation data in blocks to obtain an updated data block, and configures a corresponding updated data block identifier for the updated data block according to the server's current data block identifier; generates corresponding document update information according to the target document identifier and the updated data block identifier, and sends the document update information to each client, wherein the document update information is used to instruct each client to verify the current target document.

[0175] In this way, by receiving operation data for the target document from each client on the server side, generating update data blocks based on the operation data, storing the update data blocks in the data block chain corresponding to the target document, and sending the document update information corresponding to the update data blocks to each client, the server can complete the update and storage of the target document content and the distribution of update data. The server does not need to be aware of the local storage status of the target document on each client, does not need to verify and judge the data consistency of each client, and can reduce the amount of data distributed in each update, thereby greatly improving the server's data processing efficiency and performance.

[0176] The following is in conjunction with the appendix Figure 4 Taking the document consistency verification method provided in this application as an example of its application in collaborative design documents by multiple users, the document consistency verification method will be further explained. Among other things, Figure 4 The diagram illustrates a process flowchart of a document consistency verification method for collaborative design documents provided in an embodiment of this application, specifically including the following steps:

[0177] Step 402: The server receives a change operation payload submitted by client A.

[0178] Step 404: The server validates the payload according to preset rules. If the validation result does not conform to the preset rules, an additional serverPayload is generated for the payload, and an update data block TX is generated based on the payload and serverPayload.

[0179] Step 406: The server obtains the target data block identifier. 10 and based on the target data block identifier 10 Configure the update data block identifier for the update data block TX. 11 The target data block identifier is the identifier of the last data block in the server's data block chain.

[0180] Step 408: The server uses the hash value of the target data block, remotePrevHash(TX), to... 10 The payload and serverPayload generate the hash value remoteHash (TX) of the updated data block. 11 ), and remotePrevHash(TX) 10 remoteHash(TX) 11 Update data block identifier 11 And add the target document identifier to the document update information.

[0181] Step 410: The server sends the document update information to each client.

[0182] Step 412: Client B receives the document update information and obtains the corresponding current data block identifier on its local machine based on the target document identifier. 10 and the current data block hash value localHash(TX) 10 ).

[0183] Step 414: Client B increments the current data block identifier by 1 to obtain the verification identifier. 11 .

[0184] Step 416: Client B will update the data block identifier. 11 With verification identifier 11 The comparison showed that they were equal.

[0185] Step 418: Client B will use remotePrevHash(TX) 10 ) and localHash(TX 10 The comparison results showed that they were not equal.

[0186] Step 420: Client B sends an alarm message, indicating that the current target document is inconsistent with the data on the server.

[0187] Optionally, the target document on the client can be validated based on the updated data block identifier and the current data block identifier, which can be implemented using the following pseudocode. Here, `remoteTxId` is the updated data block identifier issued by the server, `localTxId` is the current data block identifier on the client, `remotePrevHash` is the hash value of the target data block issued by the server, `localHash` is the hash value of the current data block on the client, and `remoteHash` is the hash value of the updated data block issued by the server.

[0188] if(remoteTxId==localTxId+1){

[0189] / / The changes issued should be subsequent changes to the local data. The hash of the last remote change should be consistent with the local hash.

[0190] assert("hash check inconsistent", remotePrevHash == localHash)

[0191] / / Local application remotely changes and updates hash

[0192] localTxId = remoteTxId

[0193] localHash = remoteHash

[0194] }else if(remoteTxId==localTxId){

[0195] / / Reissue the latest TX data and verify that the data's hash matches the local hash.

[0196] assert(“hash check is inconsistent”, remoteHash == localHash)

[0197] }else if(remoteTxId<localTxId){

[0198] / / Duplicate data is being sent, which can be ignored.

[0199] }else{

[0200] throw exception(“There is a missing transaction”).

[0201] }

[0202] One embodiment of this application provides a document consistency verification method that receives document update information of a target document sent by a server. The document update information includes a target document identifier and an update data block identifier of the server. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks. The method then obtains the corresponding document record information locally on the client based on the target document identifier. The document record information includes the current data block identifier of the locally recorded document. Finally, the method verifies the current target document on the client based on the update data block identifier and the current data block identifier to obtain the verification result of the target document.

[0203] Thus, by verifying the corresponding document record information on the client's local machine based on the document update information of the target document sent by the server, the client can automatically verify the consistency of document data. By updating the data block identifier and the current data block identifier recorded locally on the client, the client can verify the current target document, which can reduce the amount of verification data and improve the efficiency of data consistency verification. This allows for timely alerts when document data inconsistency is detected, preventing users from operating on incorrect documents, avoiding loss of client operation data, and ultimately improving the accuracy of document data.

[0204] Corresponding to the above method embodiments, this application also provides an embodiment of a document consistency verification device. Figure 5 This illustration shows a structural schematic diagram of a document consistency verification device according to an embodiment of this application, applied to a client. For example... Figure 5 As shown, the device includes:

[0205] The first receiving module 502 is configured to receive document update information of the target document sent by the server. The document update information includes the target document identifier and the server's update data block identifier. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks.

[0206] The first acquisition module 504 is configured to acquire the corresponding document record information on the client's local machine based on the target document identifier, wherein the document record information includes the current data block identifier of the local record;

[0207] The verification module 506 is configured to verify the current target document of the client based on the updated data block identifier and the current data block identifier, and obtain the verification result of the target document.

[0208] Optionally, the verification module 506 is further configured as follows:

[0209] Increment the current data block identifier by 1 to obtain the verification identifier;

[0210] The updated data block identifier is compared with the verification identifier to obtain the comparison result;

[0211] Based on the comparison results, the verification result of the target document is obtained.

[0212] Optionally, the document update information may also include the first content code of the updated data block and the second content code of the data block preceding the updated data block;

[0213] Accordingly, the verification module 506 is further configured as follows:

[0214] If the comparison result shows that the updated data block identifier is greater than the verification identifier, the verification result of the target document is determined to be verification failure.

[0215] If the comparison result shows that the updated data block identifier is not greater than the verification identifier, the verification result of the target document is determined by combining the first content code or the second content code.

[0216] Optionally, the verification module 506 is further configured as follows:

[0217] If the updated data block identifier is equal to the verification identifier, then obtain the third content encoding of the current data block on the client's local machine; compare the second content encoding and the third content encoding to obtain the verification result of the target document;

[0218] If the updated data block identifier is less than the verification identifier, then it is determined whether the current data block identifier and the updated data block identifier are equal, and the verification result of the target document is determined based on the judgment result.

[0219] Optionally, the verification module 506 is further configured as follows:

[0220] If they are equal, obtain the third content encoding of the current data block on the client's local machine, compare the first content encoding and the third content encoding, and obtain the verification result of the target document;

[0221] If they are not equal, the verification result of the target document is determined to be to ignore this verification.

[0222] Optionally, the verification module 506 is further configured as follows:

[0223] If the first content code and the third content code are the same, then the verification result of the target document is determined to be to ignore this verification.

[0224] If the first content code and the third content code are different, then the verification result of the target document is determined to be verification failure.

[0225] Optionally, the verification result may include verification failure;

[0226] Accordingly, the document consistency verification device also includes an alarm module, which is configured to issue alarm information, wherein the alarm information is used to prompt the client user to stop operating on the target document;

[0227] Reload the target document.

[0228] Optionally, the verification result includes verification passed, and the document update information also includes the update data block from the server.

[0229] Accordingly, the document consistency verification device also includes an update module, which is configured to update the current target document on the client using update data blocks;

[0230] Update the current data block identifier based on the updated data block identifier.

[0231] One embodiment of this application provides a document consistency verification method that receives document update information of a target document sent by a server. The document update information includes a target document identifier and an update data block identifier of the server. The update data block identifier is obtained by the server by storing the client's operation data on the target document in time-series blocks. The method then obtains the corresponding document record information locally on the client based on the target document identifier. The document record information includes the current data block identifier of the locally recorded document. Finally, the method verifies the current target document on the client based on the update data block identifier and the current data block identifier to obtain the verification result of the target document.

[0232] Thus, by verifying the corresponding document record information on the client's local machine based on the document update information of the target document sent by the server, the client can automatically verify the consistency of document data. By updating the data block identifier and the current data block identifier recorded locally on the client, the client can verify the current target document, which can reduce the amount of verification data and improve the efficiency of data consistency verification. This allows for timely alerts when document data inconsistency is detected, preventing users from operating on incorrect documents, avoiding loss of client operation data, and ultimately improving the accuracy of document data.

[0233] The above is an illustrative scheme of a document consistency verification device according to this embodiment. It should be noted that the technical solution of this document consistency verification device and the technical solution of the document consistency verification method described above belong to the same concept. For details not described in detail in the technical solution of the document consistency verification device, please refer to the description of the technical solution of the document consistency verification method described above.

[0234] Figure 6 This diagram illustrates a structural schematic of a document consistency verification device according to an embodiment of this application, applied to a server. Figure 6 As shown, the device includes:

[0235] The second receiving module 602 is configured to receive at least one operation data sent by the client for the target document, wherein the at least one operation data carries the target document identifier;

[0236] The second acquisition module 604 is configured to acquire the target data block identifier of the server, wherein the target data block identifier is the identifier of the last data block in the data block chain of the server;

[0237] Storage module 606 is configured to store at least one operation data block to obtain an updated data block, and to configure a corresponding updated data block identifier for the updated data block according to the current data block identifier of the server.

[0238] The generation module 608 is configured to generate corresponding document update information based on the target document identifier and the update data block identifier, and send the document update information to each client. The document update information is used to instruct each client to verify the current target document.

[0239] Optionally, the second acquisition module 604 is further configured as follows:

[0240] Based on the target document identifier, obtain the data block chain corresponding to the target document;

[0241] Determine the last data block in the data block chain as the target data block;

[0242] Based on the target data block, obtain the target data block identifier from the server.

[0243] Optionally, storage module 606 is further configured as follows:

[0244] Divide at least one piece of operational data into blocks to generate an initial data block;

[0245] The content of the initial data block is validated according to preset rules to obtain the validation result of the initial data block;

[0246] Based on the verification results of the initial data block, determine and store the updated data block.

[0247] Optionally, storage module 606 is further configured as follows:

[0248] If the verification result of the initial data block meets the preset rules, then the initial data block is determined to be an update data block and stored.

[0249] If the verification result of the initial data block does not conform to the preset rules, the content of the initial data block is adjusted according to the preset rules to generate corrected data. An updated data block is generated based on the initial data block and the corrected data and then stored.

[0250] Optionally, the generation module 608 is further configured as follows:

[0251] Obtain the second content encoding of the target data block corresponding to the target data block identifier;

[0252] Based on the second content encoding, generate the first content encoding of the updated data block;

[0253] Add the first content code, the second content code, the updated data block identifier, and the target document identifier to the document update information.

[0254] One embodiment of this application provides a document consistency verification method, which receives at least one operation data sent by a client for a target document, wherein the at least one operation data carries a target document identifier; obtains a target data block identifier from the server, wherein the target data block identifier is the identifier of the last data block in the server's data block chain; stores the at least one operation data in blocks to obtain an updated data block, and configures a corresponding updated data block identifier for the updated data block according to the server's current data block identifier; generates corresponding document update information according to the target document identifier and the updated data block identifier, and sends the document update information to each client, wherein the document update information is used to instruct each client to verify the current target document.

[0255] In this way, by receiving operation data for the target document from each client on the server side, generating update data blocks based on the operation data, storing the update data blocks in the data block chain corresponding to the target document, and sending the document update information corresponding to the update data blocks to each client, the server can complete the update and storage of the target document content and the distribution of update data. The server does not need to be aware of the local storage status of the target document on each client, does not need to verify and judge the data consistency of each client, and can reduce the amount of data distributed in each update, thereby greatly improving the server's data processing efficiency and performance.

[0256] The above is an illustrative scheme of a document consistency verification device according to this embodiment. It should be noted that the technical solution of this document consistency verification device and the technical solution of the document consistency verification method described above belong to the same concept. For details not described in detail in the technical solution of the document consistency verification device, please refer to the description of the technical solution of the document consistency verification method described above.

[0257] Figure 7 A structural block diagram of a computing device 700 according to an embodiment of this application is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and a database 750 is used to store data.

[0258] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include Public Switched Telephone Network (PSTN), Local Area Network (LAN), Wide Area Network (WAN), Personal Area Network (PAN), or combinations of communication networks such as the Internet. The access device 740 may include one or more of any type of wired or wireless network interface (e.g., a network interface card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) wireless interface, a Wi-MAX (Worldwide Interoperability for Microwave Access) interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0259] In one embodiment of this application, the aforementioned components of the computing device 700 and Figure 7 Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 7 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this application. Those skilled in the art can add or replace other components as needed.

[0260] The computing device 700 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or personal computers (PCs). The computing device 700 can also be a mobile or stationary server.

[0261] The processor 720 implements the document consistency verification method when executing the computer instructions.

[0262] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the document consistency verification method described above belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the document consistency verification method described above.

[0263] An embodiment of this application also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the document consistency verification method as described above.

[0264] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the document consistency verification method described above belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the document consistency verification method described above.

[0265] The foregoing has described specific embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired results. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0266] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0267] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0268] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0269] The preferred embodiments disclosed above are merely illustrative of this application. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this application. These embodiments are selected and specifically described in this application to better explain the principles and practical applications of this application, thereby enabling those skilled in the art to better understand and utilize this application. This application is limited only by the claims and their full scope and equivalents.

Claims

1. A method of checking document consistency, characterized by, Applied to a client, comprising: Receiving document update information of a target document sent by a server, wherein the document update information comprises a target document identifier, an update data block identifier of the server, a first content encoding of an update data block, and a second content encoding of a previous data block of the update data block, the update data block identifier being obtained by the server according to operation data of the client on the target document and being stored in time sequence; Obtaining document record information corresponding to the client locally according to the target document identifier, wherein the document record information comprises a locally recorded current data block identifier, the current data block identifier being an identifier corresponding to the last update data block stored by the client from the update data blocks issued by the server; Verifying the target document of the client currently according to the update data block identifier and the current data block identifier, and obtaining a verification result of the target document; The verification of the target document of the client currently according to the update data block identifier and the current data block identifier comprises: obtaining a verification identifier by adding 1 to the current data block identifier; comparing the update data block identifier with the verification identifier to obtain a comparison result; in the case that the comparison result is that the update data block identifier is greater than the verification identifier, determining that the verification result of the target document is verification failure; in the case that the comparison result is that the update data block identifier is not greater than the verification identifier, determining the verification result of the target document in combination with the first content encoding or the second content encoding.

2. The method of claim 1, wherein, The determination of the verification result of the target document in combination with the first content encoding or the second content encoding comprises: If the update data block identifier is equal to the verification identifier, obtaining a third content encoding of the current data block locally; comparing the second content encoding with the third content encoding to obtain the verification result of the target document; If the update data block identifier is less than the verification identifier, determining whether the current data block identifier and the update data block identifier are equal, and determining the verification result of the target document according to the determination result.

3. The method of claim 2, wherein, The determination of the verification result of the target document according to the determination result comprises: If they are equal, obtaining a third content encoding of the current data block locally, and comparing the first content encoding with the third content encoding to obtain the verification result of the target document; If they are not equal, determining that the verification result of the target document is to ignore this verification.

4. The method of claim 3, wherein, The comparison of the first content encoding with the third content encoding to obtain the verification result of the target document comprises: If the first content encoding and the third content encoding are the same, determining that the verification result of the target document is to ignore this verification; If the first content encoding and the third content encoding are not the same, determining that the verification result of the target document is verification failure.

5. The method of claim 1, wherein, The verification result comprises verification failure; after obtaining the verification result of the target document, the method further comprises: Issuing an alarm information, wherein the alarm information is used to prompt a user of the client to stop operating on the target document; Re-loading the target document.

6. The method of claim 1, wherein, The check result includes a check pass, and the document update information further includes an update data block of the server, After the check result of the target document is obtained, the method further includes: updating the current target document of the client using the update data block; updating the current data block identifier according to the update data block identifier.

7. A method of checking document consistency, characterized by, Applied to a server, the method includes: receiving at least one operation data sent by a client for a target document, wherein the at least one operation data carries a target document identifier; obtaining a target data block identifier of the server, wherein the target data block identifier is an identifier of a last data block in a data block chain of the server; storing the at least one operation data by block to obtain an update data block, and configuring a corresponding update data block identifier for the update data block according to a current data block identifier of the server; generating corresponding document update information according to the target document identifier and the update data block identifier, and distributing the document update information to each client, wherein the document update information is used to instruct the clients to check a current target document, and the document update information includes a first content encoding of the update data block and a second content encoding of a previous data block of the update data block; wherein the check process includes: adding 1 to a current data block identifier of the client to obtain a check identifier, wherein the current data block identifier of the client is an identifier corresponding to a last update data block in update data blocks stored by the client and distributed by the server; comparing the update data block identifier with the check identifier to obtain a comparison result; in a case where the comparison result is that the update data block identifier is greater than the check identifier, determining that the check result of the target document is a check fail; and in a case where the comparison result is that the update data block identifier is not greater than the check identifier, determining the check result of the target document in combination with the first content encoding or the second content encoding.

8. The method of claim 7, wherein, The target data block identifier of the server is obtained by: obtaining a data block chain corresponding to the target document according to the target document identifier; determining a last data block on the data block chain as a target data block; obtaining the target data block identifier of the server according to the target data block.

9. The method of claim 7, wherein, The update data block is obtained by storing the at least one operation data by block, including: blocking the at least one operation data to generate an initial data block; checking the content of the initial data block according to a preset rule to obtain a check result of the initial data block; determining and storing an update data block according to the check result of the initial data block.

10. The method of claim 9, wherein, The update data block is determined and stored according to the check result of the initial data block, including: if the check result of the initial data block is in line with the preset rule, determining the initial data block as the update data block and storing it; if the check result of the initial data block is not in line with the preset rule, adjusting the content of the initial data block to generate a correction data according to the preset rule, generating an update data block according to the initial data block and the correction data, and storing it.

11. The method of claim 7, wherein, The generating of the corresponding document update information according to the target document identifier and the update data block identifier comprises: obtaining a second content encoding of a target data block corresponding to the target data block identifier; generating a first content encoding of the update data block according to the second content encoding; adding the first content encoding, the second content encoding, the update data block identifier and the target document identifier to the document update information.

12. A document consistency checking system, characterized by The server and the client are included: The server is configured to receive at least one operation data sent by the client for a target document, wherein the at least one operation data carries a target document identifier; obtain a target data block identifier of the server, wherein the target data block identifier is an identifier of a last data block in a data block chain of the server; obtain an update data block by storing the at least one operation data by block, and configure a corresponding update data block identifier for the update data block according to a current data block identifier of the server; generate a corresponding document update information according to the target document identifier and the update data block identifier, and distribute the document update information to each client, wherein the document update information is used to instruct the each client to check a current target document; The client is configured to receive a document update information of a target document sent by the server, wherein the document update information comprises a target document identifier, an update data block identifier of the server, a first content encoding of an update data block and a second content encoding of a previous data block of the update data block, the update data block identifier is obtained by the server according to the operation data of the client for the target document by time sequence block storage; obtain a corresponding document record information of the client locally according to the target document identifier, wherein the document record information comprises a locally recorded current data block identifier, the current data block identifier is an identifier corresponding to a last update data block in the update data block stored by the server and distributed by the server at present; check the current target document of the client according to the update data block identifier and the current data block identifier, and obtain a check result of the target document; the checking of the current target document of the client according to the update data block identifier and the current data block identifier comprises: obtaining a check identifier by adding 1 to the current data block identifier; comparing the update data block identifier with the check identifier to obtain a comparison result; in a case that the comparison result is that the update data block identifier is greater than the check identifier, determining that the check result of the target document is check failure; in a case that the comparison result is that the update data block identifier is not greater than the check identifier, determining the check result of the target document in combination with the first content encoding or the second content encoding.

13. A document consistency checking apparatus characterized by comprising: The client is configured to include: The first receiving module is configured to receive document update information of a target document sent by a server, wherein the document update information comprises a target document identifier, an update data block identifier of the server, first content coding of an update data block, and second content coding of a previous data block of the update data block, and the update data block identifier is obtained according to chronological block storage of operation data of the client on the target document by the server; The first obtaining module is configured to obtain document record information corresponding to the client locally according to the target document identifier, wherein the document record information comprises a locally recorded current data block identifier, and the current data block identifier is an identifier corresponding to the last update data block stored by the client at present from the update data blocks issued by the server; The checking module is configured to check the target document of the client at present according to the update data block identifier and the current data block identifier, and obtain a checking result of the target document; The checking module is further configured to obtain a checking identifier by adding 1 to the current data block identifier, compare the update data block identifier with the checking identifier to obtain a comparison result, determine that the checking result of the target document is checking failure in the case that the comparison result is that the update data block identifier is greater than the checking identifier, and determine the checking result of the target document in combination with the first content coding or the second content coding in the case that the comparison result is that the update data block identifier is not greater than the checking identifier.

14. A document consistency checking apparatus characterized by comprising: The server comprises: The second receiving module is configured to receive at least one operation data sent by a client for a target document, wherein the at least one operation data carries a target document identifier; The second obtaining module is configured to obtain a target data block identifier of the server, wherein the target data block identifier is an identifier of the last data block in a data block chain of the server; The storage module is configured to obtain an update data block by block storage of the at least one operation data, and configure a corresponding update data block identifier for the update data block according to a current data block identifier of the server. The generating module is configured to generate corresponding document update information according to the target document identifier and the update data block identifier, and to issue the document update information to each client, wherein the document update information is used to instruct the each client to check a current target document, and the document update information comprises first content encoding of an update data block and second content encoding of a previous data block of the update data block, wherein the checking process comprises: adding 1 to a current data block identifier of the client to obtain a checking identifier, wherein the current data block identifier of the client is an identifier corresponding to a last update data block stored by the client from update data blocks issued by the server; comparing the update data block identifier with the checking identifier to obtain a comparison result; in a case where the comparison result is that the update data block identifier is greater than the checking identifier, determining that a checking result of the target document is checking failure; and in a case where the comparison result is that the update data block identifier is not greater than the checking identifier, determining the checking result of the target document in combination with the first content encoding or the second content encoding.

15. A computing device comprising a memory, a processor, and computer instructions stored on the memory and executable on the processor, wherein, The processor implements the steps of the method of any one of claims 1-11 when executing the computer instructions.

16. A computer-readable storage medium storing computer instructions, wherein, The computer instructions, when executed by the processor, implement the steps of the method of any one of claims 1-11.

17. A computer program product, characterised in that, The computer instructions, when executed by the processor, implement the steps of the method of any one of claims 1-11. The computer instructions, when executed by the processor, implement the steps of the method of any one of claims 1-11.

Citation Information

Patent Citations

  • Data consistency verification method and device, equipment and storage medium

    CN114610735A

  • Document synchronization method and device, equipment and medium

    CN114996230A