An interconnection and intercommunication document editing system and method
By registering document editing data on the blockchain and capturing user editing behavior, an atomic operation chain with semantic context is constructed. Combined with smart contracts and improved algorithms to detect document editing conflicts, the problems of misjudgment of intent between operations and ambiguity of conflict scope in existing technologies are solved, and high-precision collaborative document editing is achieved.
Patent Information
- Application Number
- CN202511455604.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2045-10-13
AI Technical Summary
Existing document collaborative editing technologies suffer from low accuracy in detecting operation position conflicts and an inability to identify the relationship between terms and the true intent in cross-team collaboration.
By collecting document editing data for blockchain registration, capturing user editing behavior and encapsulating it into atomic operations with semantic context, a local operation chain with hash chain association is constructed. The chain is verified and uploaded to the chain using smart contracts. Conflict detection is performed by combining an improved OT algorithm and the BERT model, and traceable resolution operations are generated.
It significantly improves the accuracy of conflict detection, enables full-chain traceability of operations and cross-platform document collaboration consistency, ensures data security and reliability, and meets the collaborative scenario requirements of high logical integrity and operational traceability.
Smart Images

Figure CN120930606B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of blockchain document editing, and more particularly, to an interconnection document editing system and method. BACKGROUND
[0002] With the popularization of remote office and cross-team collaboration scenarios, the demand for multi-end interconnection, data consistency and operation credibility in document collaborative editing is increasingly urgent. However, the existing document collaborative editing technology still has limitations: traditional algorithms based on OT or CRDT rely on the operation time sequence recorded by the local client, which is easy to cause operation position conflict misjudgment due to network delay and data synchronization deviation. Moreover, only the surface information such as operation position and type is compared, and the operation semantic context is not analyzed, so the term association and real intention between operations cannot be identified, which leads to low conflict detection accuracy.
[0003] The patent application with publication number CN118657120A discloses a document real-time collaborative editing method and device based on blockchain, which includes: constructing a collaborative editing communication network of blockchain; the network is established on the P2P blockchain network framework, and users dispersed in different places perform local editing operations on the same document through terminals. Through the blockchain network, the user simultaneously accepts the update operation sequence of other users on the local terminal, and combines the remote operation and the local operation, so that each terminal maintains the same data structure. Defining the data structure: the data structure includes a bidirectional hash linked list, the position of the new node in the bidirectional hash linked list is queried, and the information of the new node is converted into a new remote operation. Each operation in the operation sequence is traversed to generate a new operation sequence, which is synchronized to other users through the blockchain network.
[0004] Although the above method can meet most scenarios, research and actual application of the above method and existing technology have found that the above method and existing technology at least have the following defects:
[0005] The above method defines an operation model and a conflict processing algorithm, but its conflict detection is only based on the simple comparison of operation position and time sequence, which cannot identify the term association and real intention between operations, is easy to cause intention misjudgment, and cannot accurately evaluate the influence range of the conflict on the document logic, thereby reducing the conflict detection accuracy.
[0006] In view of this, the present application provides an interconnection document editing system and method to solve the above problems. SUMMARY
[0007] In order to overcome the above defects of the prior art and achieve the above purpose, the present application provides the following technical scheme: an interconnection document editing system and method.
[0008] An interoperable document editing method, comprising:
[0009] Collect document editing data to perform document initialization and blockchain registration operations. The blockchain captures user editing behavior and encapsulates it into atomic operations with semantic context. Based on the atomic operations, a local operation chain with hash chain association is constructed.
[0010] Based on the local operation chain, user batch operations are packaged into transactions and put on the chain, verified by smart contracts, and the operation data and verification results are stored to form on-chain records.
[0011] Based on collaborative operation data and on-chain records, intent conflict detection is performed to obtain conflict detection results, and a suggestion list is generated based on a preset rule base.
[0012] Based on the suggestions selected by the user from the suggestion list, a traceable solution is generated. After updating the local operation chain, all operations are replayed to generate the final document, which is then synchronized to the server and associated with the records on the chain.
[0013] Furthermore, methods for collecting document editing data to perform document initialization and blockchain registration operations include:
[0014] A document identifier is generated based on the document editing data. The document editing data includes the initial document content, user certificate, and initialization timestamp. The initial document content is a UTF-8 encoded byte stream converted from the original document content. The user certificate is a public key and identity information encoded according to DER. The initialization timestamp is a UTF-8 encoded byte stream converted from the initialization time. The document identifier is a hash value calculated based on the initial document content, user certificate, and initialization timestamp.
[0015] Submit the document identifier, user certificate, and initialization timestamp to the consortium blockchain. After successful verification, the initial block pointer is obtained.
[0016] Furthermore, methods for capturing user editing behavior and encapsulating it into atomic operations with semantic context include:
[0017] Monitor the client, record the user certificate of the operation initiator, and capture the operation type, operation location, operation content and corresponding operation time of the client;
[0018] Operation types include insert operations, delete operations, and formatting operations;
[0019] The operation location is represented by three-dimensional data: document offset, paragraph index, and inline coordinates;
[0020] If the operation type is an insert operation, then record the complete content of the insert;
[0021] Based on NLP, semantic parsing is performed on atomic operation objects and original document content to obtain operation type, operation location context text and operation content. The operation location context text includes the first L bytes and the last L bytes of the operation location. The operation type, operation location context text and operation content are used as input to the analysis model pre-deployed on the client to obtain semantic context.
[0022] By concatenating the document identifier, user certificate, operation type, operation location, operation content, corresponding operation timestamp, and semantic context, an atomic operation with semantic context is obtained.
[0023] Furthermore, methods for constructing local operation chains with hash-chain associations include:
[0024] Obtain all atomic operation objects and their corresponding semantic contexts, and perform format validation on each atomic operation object;
[0025] Operations that fail format validation are marked as exceptions, temporarily stored in the error queue for manual confirmation, and are not included in the operation chain; for atomic operations that pass format validation, a unique hash value for each operation is calculated in chronological order.
[0026] The operation objects are paired with their corresponding hash values in chronological order to form an operation chain. The operation chain is stored, and the integrity of the operation chain is automatically checked each time it is stored or retrieved.
[0027] When a user generates a new operation, the system returns to validate the new operation's format, calculates the hash value corresponding to the new operation, and updates the operation chain to obtain the local operation chain.
[0028] Furthermore, the format verification includes: verifying whether the timestamps of all atomic operations are sequentially incremented; and whether the document identifiers of all atomic operations are consistent.
[0029] Methods for calculating the unique hash value for each operation include:
[0030] when At that time, calculate the hash value of the first atomic operation and its corresponding semantic context;
[0031] when When the hash value of the current operation is obtained, it is calculated by combining the hash value of the previous operation.
[0032] The integrity verification method includes:
[0033] Starting with the first hash value, hash values are recalculated sequentially. If the recalculated hash value corresponds one-to-one with the hash value in the operation chain, the verification passes; otherwise, the verification fails. The non-corresponding hash value is marked as the breakpoint position, and a message is sent indicating that the operation chain has been tampered with or damaged.
[0034] Furthermore, methods for packaging user batch operations into transactions and uploading them to the blockchain based on the local operation chain include:
[0035] Filter out operations that are not on the chain from the local operation chain, and start the batch packaging process when any of the preset configuration conditions are met;
[0036] The system marks the starting index 'a' and the ending index 'b' of the operations that are not currently on the chain, where b = 1 + k - 1, and k is the number of operations in this package;
[0037] Extract the operations from index a to b from the local operation chain to form an operation chain fragment to be added to the chain. Convert all fields in the operation chain fragment into a preset uniform format to obtain the standard operation chain.
[0038] Generate a transaction data packet containing document identifier, standard operation chain, user signature, preceding transaction hash and transaction timestamp based on the standard operation chain;
[0039] The client sends transaction data packets to the consortium blockchain network via the blockchain;
[0040] If the transmission is successful, the client updates the on-chain status of the local operation chain, including adding on-chain markers for operations with indices a to b in the operation table of the local database; adding a new transaction information table to store transaction hashes, complete transaction data packets, transaction timestamps, and associating them with document identifiers;
[0041] If the transmission fails, the client will temporarily store the transaction data packet in the local retry queue and automatically retry when the trigger condition is met, with the number of retries not exceeding F.
[0042] Furthermore, the preset configuration conditions include: K unlisted operations; the user actively clicks the save button on the client, which immediately triggers the packaging of all currently unlisted operations; and packaging is automatically triggered when the network latency is lower than R and the upload bandwidth is higher than E.
[0043] Methods for obtaining user signatures include:
[0044] The document identifier, standard operation chain, and preceding transaction hash are concatenated to obtain the data to be signed. The preceding transaction hash is the hash value of the last transaction added to the chain, and the transaction hash of the first time the document is added to the chain is the block hash corresponding to the initial block pointer.
[0045] The user's signature is obtained by signing the data to be signed using the user's private key pre-stored on the client.
[0046] Furthermore, methods for verifying and storing operational data and verification results through smart contracts to form on-chain records include:
[0047] The blockchain receives transaction data packets. Nodes call the verification function of smart contracts pre-deployed to the blockchain network. The smart contract performs format verification on the transaction data packets. If the format verification fails, it directly returns verification failure.
[0048] The smart contract performs user identity verification, operation fragment integrity verification, and historical correlation verification on the transaction data packets that have passed the format verification. If any one of them fails, the contract terminates and returns the reason for the failure.
[0049] The legitimacy verification includes: the smart contract obtains the user certificate associated with the document identifier from the underlying blockchain and parses out the user's public key; the verification function is used to verify the validity of the signature; the verification function is a built-in verification function of the smart contract that matches the client; if the document has edit permissions set, the smart contract queries the pre-stored edit permission list and verifies whether the user's public key is in the edit permission list. If it is, the verification passes; otherwise, it fails.
[0050] Historical correlation verification includes: the smart contract queries the identifier mapping table stored in its own state to obtain the transaction hash of the last successfully uploaded document; and verifies whether the hash of the last transaction in the transaction data packet is consistent with the hash of the previously successfully uploaded transaction. If they are consistent, the verification passes; otherwise, it fails.
[0051] After successful verification, the smart contract's built-in functions calculate the Merkle root of the hash sequence of the operation chain fragments through a binary tree-based hashing process.
[0052] The smart contract calls the storage function to write the transaction data packet into the blockchain ledger. The smart contract broadcasts a public event, and the client listens for the event to know the result on the chain.
[0053] If any verification fails, the smart contract returns a structured error message, and the blockchain node marks the corresponding transaction data packet as invalid and does not write it into the ledger.
[0054] Furthermore, methods for obtaining collision detection results include:
[0055] Obtain the operation chain fragment of the collaborating user and the corresponding blockchain notarized transaction hash. Query the corresponding on-chain Merkle root through the blockchain notarized transaction hash to verify the integrity of the operation chain fragment. If the verification is successful, proceed to the next step; otherwise, it is determined to be untrusted operation data and synchronization is refused.
[0056] By comparing the timestamps of local operations that are not recorded on the blockchain with the timestamps of blockchain transactions, the true time sequence of collaborative operations and local operations can be obtained.
[0057] Based on real time series, an improved OT algorithm is used to resolve position conflicts;
[0058] A pre-trained BERT model is used to extract terms from the semantic context of cooperation, the semantic context of local operations, and the context text of document conflict locations, to obtain the term set involved in cooperation and the term set involved in local operations.
[0059] The terminology relevance of the term intersection is calculated using the Jaccard coefficient to determine whether the operations target the same object. If so, proceed to the next step of intent analysis; otherwise, it is determined to be an unrelated operation with no intent conflict.
[0060] The intention label is obtained by taking the cooperation semantic context and the local operation semantic context as input to the intention classification model.
[0061] Based on a predefined conflict rule base, conflict matching is performed on intent tags to determine whether a conflict exists and the corresponding conflict type.
[0062] The analysis yields a conflict score. If the conflict score is greater than the conflict threshold, it is determined that there is a conflict; otherwise, it is determined that there is no conflict.
[0063] For operations identified as conflicting, the probability that the affected content is concentrated in a single paragraph is obtained. Combining the citation dependency and terminology function weight, the scope of impact index is calculated. The scope of conflict impact is divided according to the scope of impact index to obtain the conflict level.
[0064] Structured conflict information is generated by combining historical blockchain data. The structured conflict information includes conflict document identifiers, conflict origination information, and conflict descriptions.
[0065] Furthermore, methods for generating traceable resolution actions based on suggestions selected by the user from the suggestion list include:
[0066] If the user selects a suggestion from the suggestion list, the system extracts the suggestion content and suggestion document identifier of the corresponding suggestion as decision information;
[0067] If the user does not select a suggestion from the suggestion list, decision information that retains the decision content of both parties' actions will be generated.
[0068] Transform decision information into structured data that includes decision type, decision text, decision basis, and decision timestamp;
[0069] Encapsulate structured data into conflict resolution operations that are consistent with the format of atomic operation objects;
[0070] Calculate the hash value of the conflict resolution operation, pair the conflict resolution operation with the corresponding hash value, append it to the end of the latest local operation chain, generate a new latest local operation chain, write the new latest local operation chain into the operation chain list of the local database, and set the on-chain flag of the newly added record to False.
[0071] Perform an integrity check on the new, locally updated operation chain. If the check is complete, it passes and a traceable solution is obtained; otherwise, the operation chain is marked as corrupted, and the user is prompted to regenerate the solution.
[0072] Furthermore, the methods for updating the local operation chain, replaying all operations to generate the final document, synchronizing it to the server, and associating it with the records on the chain include:
[0073] Recalculate all operation hashes of the new local latest operation chain to confirm that the hash chain is continuous;
[0074] Extract the blockchain transaction hashes corresponding to the operation fragments already on-chain in the latest local operation chain. For each blockchain transaction hash, call the blockchain node interface to query the corresponding on-chain Merkle root, denoted as MRj.
[0075] The Merkle root of the operation fragment that has been uploaded to the chain in the new local latest operation chain is reconstructed locally, denoted as MRj′. MRj′ is compared with MRj: if they are all consistent, the new local latest operation chain is trustworthy; otherwise, it is determined that the operation chain is inconsistent with the on-chain record, the document generation is terminated and the on-chain data is prompted to be synchronized.
[0076] Based on the operation sequence of the new local latest operation chain, all operations are replayed in chronological order by operation type to generate the final document from the initial document:
[0077] Load the initial document as an editable text buffer and sort all operations in the new local latest operation chain by operation timestamp;
[0078] For each sorted operation, execute the corresponding logic based on the operation type:
[0079] When the operation type is insert, parse the total document offset of the operation position; insert the string of decision text at the total document offset position in the buffer;
[0080] When the operation type is deletion, parse the total document offset and the deletion length Len at the operation position; delete Len characters starting from the total document offset, and update the buffer length;
[0081] When the operation type is formatting, parse the paragraph index of the operation position, add the format specified by the decision text string to the paragraph index, and mark the format attribute;
[0082] When the operation type is conflict resolution, parse the conflict paragraph at the operation location, adjust the content of the conflict paragraph according to the decision text in the string of decision text, and record the decision mark;
[0083] After all operations are replayed, the document buffer is converted to a standard document format, and the final hash of the document is generated.
[0084] The final document's binary data is encapsulated with associated trusted data into a synchronization data packet;
[0085] The client sends synchronization data packets to the office server via a preset protocol. The office server performs signature verification, document hash verification, and on-chain association verification. After successful verification, the office server performs the following operations:
[0086] Replace the initial document corresponding to the document identifier in the server, and save the binary data of the final document;
[0087] The core information of the synchronization data packet is stored in the data record table of the server database, including the document identifier, the hash value of the final document, the transaction hash of the last on-chain operation, and the synchronization timestamp.
[0088] The server binds the document identifier stored on the server with the transaction hash of the last on-chain operation. The server generates a synchronization confirmation, which includes a synchronization success identifier and the binary data hash value of the final document stored on the server, and returns it to the client through a preset protocol.
[0089] An interoperable document editing system, used to implement the aforementioned interoperable document editing method, includes:
[0090] Acquisition and encapsulation module: Acquires document editing data to perform document initialization and blockchain registration operations. The blockchain captures user editing behavior and encapsulates it into atomic operations with semantic context. Based on the atomic operations, a local operation chain with hash chain association is constructed.
[0091] Data on-chain module: Based on the local operation chain, it packages user batch operations into transactions and uploads them to the chain. It verifies the transactions through smart contracts and stores the operation data and verification results to form on-chain records.
[0092] Conflict detection module: Based on collaborative operation data and on-chain records, it performs intent conflict detection, obtains conflict detection results, and generates a suggestion list based on a preset rule base;
[0093] Document generation module: Generates traceable solutions based on suggestions selected by the user from the suggestion list, updates the local operation chain, replays all operations to generate the final document, synchronizes it to the server, and associates it with the records on the chain.
[0094] The technical effects and advantages of the interconnected document editing system and method of the present invention are as follows:
[0095] This invention completes blockchain registration by converting initial document content and user certificates into unified encoding and generating a unique document identifier, laying a trustworthy foundation for subsequent operation associations. When capturing user editing behavior, it not only records the operation type, three-dimensional location, and complete content, but also generates semantic context through NLP parsing and encapsulates it into atomic operations, addressing the lack of semantic dimension in existing technologies. It constructs a local operation chain with hash chain associations and ensures continuous operation sequence and data integrity through integrity verification. Combined with a batch operation packaging and on-chain mechanism and triple verification of smart contract identity legitimacy, operation integrity, and historical correlation, along with Merkle root storage, it guarantees the authenticity and reliability of on-chain operation data and its sequential continuity, preventing data tampering or chain breaks from affecting conflict detection. The conflict detection process first verifies the integrity of the collaborative operation chain, and then determines the authenticity based on the blockchain timestamp. An improved OT algorithm, which optimizes temporal weights through natural heuristics, resolves positional conflicts and identifies the core objects of the operation. It then combines an intent classification model with multi-dimensional parameters to classify conflict levels, accurately identifying the terminological associations and true intents between operations, and assessing the impact of conflicts on document logic. This addresses the issues of misjudgment of intent and ambiguity of impact caused by existing technologies relying solely on position and temporal comparisons. Subsequently, a suggestion list tailored to the conflict scenario is generated based on a pre-defined rule base. User decisions are encapsulated as traceable conflict resolution operations and added to the operation chain. Finally, the final document is generated by replaying the trusted operation chain and synchronized to the server, forming a closed-loop process. This not only significantly improves the accuracy of conflict detection but also achieves full-chain traceability of operations, cross-platform document collaboration consistency, and data security and trustworthiness, effectively meeting the needs of collaborative scenarios with high requirements for document logical integrity and operation traceability. Attached Figure Description
[0096] Figure 1 This is a schematic diagram of an interconnected document editing method according to the present invention;
[0097] Figure 2 This is a schematic diagram of the data flow in this invention;
[0098] Figure 3 This is a flowchart illustrating the method for obtaining collision detection results according to the present invention;
[0099] Figure 4 This is a schematic diagram of the structure of an interconnected document editing system according to the present invention. Detailed Implementation
[0100] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0101] Example 1
[0102] Please see Figure 1 , Figure 2 As shown in the figure, this embodiment discloses an interoperable document editing method, including the following steps:
[0103] Collect document editing data to perform document initialization and blockchain registration operations. The blockchain captures user editing behavior and encapsulates it into atomic operations with semantic context. Based on the atomic operations, a local operation chain with hash chain association is constructed.
[0104] Methods for collecting document editing data to perform document initialization and blockchain registration operations include:
[0105] A document identifier is generated based on the document editing data. The document editing data includes the initial document content, user certificate, and initialization timestamp. The initial document content is a UTF-8 encoded byte stream converted from the original document content. The user certificate is a byte stream converted from a public key and identity information, such as user ID and issuing authority, using DER encoding. The initialization timestamp is a UTF-8 encoded byte stream converted from the initialization time. The document identifier is a hash value calculated based on the initial document content, user certificate, and initialization timestamp.
[0106] Submit the document identifier, user certificate, and initialization timestamp to the consortium blockchain. After successful verification, the initial block pointer is obtained.
[0107] Methods for capturing user editing behavior and encapsulating it into atomic operations with semantic context include:
[0108] Monitor the client, record the user certificate of the operation initiator, and capture the operation type, operation location, operation content and corresponding operation time of the client;
[0109] Operation types include insert operations, delete operations, and formatting operations;
[0110] The operation location is represented by three-dimensional data: document offset, paragraph index, and inline coordinates;
[0111] If the operation type is an insert operation, the complete inserted content is recorded. If the content is text, the corresponding string is stored directly. If the content is an image, the unique access link or Base64 encoded abbreviation information of the image is stored. If the operation type is a delete operation, the complete content fragment before deletion is recorded, such as the deleted sentence and table data, to avoid the inability to recover the deleted content during subsequent tracing. If the operation type is a formatting operation, the specific formatting parameters are recorded, such as font settings recorded as font name: Times New Roman, font size: 12pt, and paragraph alignment recorded as alignment method: center, to ensure that the formatting behavior can be reproduced.
[0112] Based on NLP, semantic parsing is performed on atomic operation objects and original document content to obtain operation type, operation location context text and operation content. The operation location context text includes the first L bytes and the last L bytes of the operation location. The operation type, operation location context text and operation content are used as input to the analysis model pre-deployed on the client to obtain semantic context.
[0113] By concatenating the document identifier, user certificate, operation type, operation location, operation content, corresponding operation timestamp, and semantic context, an atomic operation with semantic context is obtained.
[0114] The aforementioned method for collecting document editing data, initializing and registering it on the blockchain, capturing user editing behavior, and encapsulating it into atomic operations with semantic context provides a precise document association benchmark for subsequent conflict detection by converting key data such as initial document content and user certificates into a unified encoded byte stream and calculating a unique document identifier. Simultaneously, it not only captures detailed operation types, three-dimensional positioning of operation locations, and complete operation content, ensuring data integrity and reproducibility during operation tracing, but also uses NLP technology to analyze atomic operation objects and original document content, extracting L bytes of contextual text before and after the operation location. This, combined with the operation type and content, generates semantic context, enabling conflict detection to move beyond simple comparisons of operation location and time sequence. Instead, it identifies terminological relationships and true intentions between operations based on semantic context, effectively avoiding misjudgments of intent due to a lack of semantic dimension analysis. Furthermore, by using the operation-related content, terminology, and associated document fragments contained in the semantic context, it can more accurately determine the scope and logical relationships of documents involved in the conflict. This solves the problems of existing technologies failing to identify terminological relationships and true intentions between operations, easily leading to misjudgments of intent, and failing to accurately assess the scope of the conflict's impact on document logic, significantly improving the accuracy of conflict detection.
[0115] Methods for constructing a local operation chain with hash-chain associations include:
[0116] Obtain all atomic operation objects and their corresponding semantic contexts, and perform format validation on each atomic operation object. The format validation includes: verifying whether the timestamps of all atomic operations are sequentially incremented; and verifying whether the document identifiers of all atomic operations are consistent.
[0117] Operations that fail format validation are marked as exceptions, temporarily stored in the error queue for manual confirmation, and are not included in the operation chain; for atomic operations that pass format validation, a unique hash value for each operation is calculated in chronological order.
[0118] Methods for calculating the unique hash value of each operation in chronological order include:
[0119] when At that time, calculate the hash value of the first atomic operation and its corresponding semantic context; for example, the hash value of the first atomic operation. , This is the first atomization operation; The semantic context corresponding to the first atomication operation. For XOR operation, It is an abbreviation for Secure Hash Algorithm, which means that the XORed data stream is converted into a fixed-length, 256-bit hash value using this algorithm;
[0120] when When the hash value of the current operation is obtained, it is calculated by combining the hash value of the previous operation; for example... The first time Hash value of atomic operations , For the first One atomization operation; For the first The semantic context corresponding to each atomication operation; For the first The hash value of an atomic operation;
[0121] The operation objects are paired with their corresponding hash values in chronological order to form an operation chain. The operation chain is stored, and the integrity of the operation chain is automatically checked each time it is stored or retrieved.
[0122] Integrity verification methods include:
[0123] Starting with the first hash value, hash values are recalculated sequentially. If the recalculated hash value corresponds one-to-one with the hash value in the operation chain, the verification passes; otherwise, the verification fails. The non-corresponding hash value is marked as the breakpoint position, and a message is sent indicating that the operation chain has been tampered with or damaged.
[0124] When a user generates a new operation, the system returns to validate the new operation's format, calculates the hash value corresponding to the new operation, and updates the operation chain to obtain the local operation chain.
[0125] The method for constructing a local operation chain with hash-based associations first performs format validation on all atomic operation objects and their corresponding semantic contexts, filtering out valid operations that meet the requirements of temporal logic and document association, and excluding abnormal operations. This provides a reliable operation sequence foundation with accurate temporal order and document matching for subsequent conflict detection, avoiding false judgments of conflicts caused by disordered operation timing or mismatched document identifiers. Then, it calculates the unique hash value of each valid operation in chronological order, forming a chain structure carrying semantic association information. This allows each operation to be associated with its predecessor operations and the underlying semantics, enabling the identification of terminological associations and true / false conflicts during conflict detection. The real intent provides crucial data support, overcoming the limitations of existing technologies that rely solely on simple comparisons of operation location and timing. Simultaneously, it automatically performs integrity checks each time the operation chain is stored or retrieved, ensuring the operation chain has not been tampered with and guaranteeing the authenticity and reliability of the operation data used for conflict detection, further reducing misjudgments of intent caused by data distortion. Furthermore, it dynamically updates the operation chain when a user generates a new operation, maintaining the chain's continuity and timeliness. This allows conflict detection to accurately trace the preceding and following relationships of conflicting operations based on the latest and complete operation sequence, thereby more accurately assessing the scope of the conflict's impact on document logic and ultimately effectively solving the problem of insufficient accuracy in existing conflict detection technologies.
[0126] Based on the local operation chain, user batch operations are packaged into transactions and put on the chain, verified by smart contracts, and the operation data and verification results are stored to form on-chain records.
[0127] Methods for packaging user batch operations into transactions and uploading them to the blockchain based on the local operation chain include:
[0128] Filter out operations that are not on the chain from the local operation chain, and start the batch packaging process when any of the preset configuration conditions are met;
[0129] The preset configuration conditions include: K non-on-chain operations; the default value of K is 5, which can be adjusted to 1-10 through client configuration to avoid excessive data volume in a single on-chain operation;
[0130] When a user actively clicks the save button on the client, it immediately triggers the packaging of all currently un-on-chain operations;
[0131] Packaging is automatically triggered when network latency is below R and upload bandwidth is above E. Network latency and upload bandwidth can be obtained by monitoring network status via the web or desktop client. The specific values of R and E are set by those skilled in the art based on actual conditions.
[0132] The system marks the starting index 'a' and the ending index 'b' of the operations that are not currently on the chain, where b = 1 + k - 1, and k is the number of operations in this package;
[0133] The operations from index a to b are extracted from the local operation chain to form an operation chain fragment to be uploaded to the chain. All fields in the operation chain fragment are converted into a preset unified format to obtain a standard operation chain. For example, the structured data of the operation object, such as location coordinates and timestamps, are converted into JSON strings, and the hash value is preserved in hexadecimal string format.
[0134] Generate a transaction data packet containing a document identifier, standard operation chain, user signature, preceding transaction hash, and transaction timestamp based on the standard operation chain; methods for obtaining the user signature include:
[0135] The document identifier, standard operation chain, and preceding transaction hash are concatenated to obtain the data to be signed. The preceding transaction hash is the hash value of the last transaction added to the chain, and the transaction hash of the first time the document is added to the chain is the block hash corresponding to the initial block pointer.
[0136] The user's signature is obtained by signing the data to be signed using the user's private key pre-stored on the client.
[0137] The client sends transaction data packets to the consortium blockchain network via the blockchain;
[0138] If the transmission is successful, the client updates the on-chain status of the local operation chain, such as adding on-chain markers for operations with indices a to b in the operation table of the local database; adding a new transaction information table to store transaction hashes, complete transaction data packets, transaction timestamps, and associating them with document identifiers;
[0139] If the transmission fails, the client will temporarily store the transaction data packet in the local retry queue and automatically retry when the trigger condition is met, with the number of retries not exceeding F.
[0140] This method, based on a local operation chain, packages user batch operations into on-chain transactions. By filtering out un-on-chain operations according to preset conditions and initiating batch packaging, it ensures orderly collection of operation data while avoiding semantic information loss due to data overload in a single on-chain process. During packaging, the extracted operation chain fragments are converted into a preset unified format to ensure consistent operation data structure and complete and extractable semantic information. This provides a standardized data foundation for accurately identifying terminological relationships between operations during subsequent conflict detection, overcoming the limitations of existing technologies that rely solely on position and time sequence comparisons. Simultaneously, by concatenating document identifiers, standard operation chains, and preceding transaction hashes to generate data to be signed, and based on user private... Key signing, combined with the hash of preceding transactions and historical on-chain records, ensures both the authenticity and immutability of the on-chain data and the continuity of the operation sequence, avoiding misjudgments of conflict intent due to data tampering or time sequence breaks. In addition, after successful on-chain processing, the local operation chain status is updated and a new transaction information table is added to store key transaction data. In case of failure, the data packet is temporarily stored and automatically retried, ensuring that the operation data used for conflict detection is complete, without loss, and historically traceable. This allows subsequent conflict detection to more accurately assess the impact of conflicts on document logic based on the complete operation sequence and semantic context, thereby effectively solving the problem of insufficient accuracy in conflict detection of existing technologies.
[0141] Methods for verifying data and storing operational data and verification results to form on-chain records through smart contracts include:
[0142] The blockchain receives transaction data packets. Nodes call the verification function of smart contracts pre-deployed to the blockchain network. The smart contract performs format verification on the transaction data packets. If the format verification fails, it directly returns verification failure.
[0143] The smart contract performs user identity verification, operation fragment integrity verification, and historical correlation verification on the transaction data packets that have passed the format verification. If any one of them fails, the contract terminates and returns the reason for the failure.
[0144] The legitimacy verification includes: the smart contract obtaining the user certificate associated with the document identifier from the underlying blockchain and parsing out the user's public key; verifying the validity of the signature using a verification function; wherein, the verification function is a built-in verification function of the smart contract that matches the client; if the document has edit permissions set, the smart contract queries the pre-stored edit permission list and verifies whether the user's public key is in the edit permission list. If it is, the verification passes; otherwise, it fails.
[0145] Integrity verification includes: the smart contract parses the operation chain fragments from the transaction data packet, recalculates the hash value of each operation, obtains the reconstructed hash sequence, and compares the reconstructed hash sequence with the hash sequence carried in the operation chain fragment bit by bit. If they all match, the integrity verification passes; otherwise, the operation fragment is determined to have been tampered with.
[0146] Historical correlation verification includes: the smart contract queries its own state storage identifier mapping table to obtain the transaction hash of the last successfully uploaded document; it verifies whether the hash of the last transaction in the transaction data packet is consistent with the hash of the previous successfully uploaded transaction. If they are consistent, the verification passes, indicating that the current transaction forms a continuous chain with the historical transactions, thus avoiding forked uploads. Otherwise, it fails.
[0147] After successful verification, the smart contract's built-in functions calculate the Merkle root of the hash sequence of the operation chain fragments using a binary tree, layer by layer; for example, for 4 hash values... First, calculate the hash value of concatenating H1 and H2, and the hash value of concatenating H3 and H4, and then calculate the hash of both as the MRelkle root.
[0148] The smart contract calls the storage function to write the transaction data packet to the blockchain ledger. The smart contract broadcasts a public event, and the client learns the result of the on-chain event by listening to the event.
[0149] If any verification fails, the smart contract returns a structured error message. The blockchain node marks the corresponding transaction data packet as invalid and does not write it into the ledger. The client can then retry based on the error message.
[0150] The method of verifying and storing operation data and verification results through smart contracts to form on-chain records firstly filters valid transaction data packets submitted by legitimate users through format validation and user identity verification, eliminating interference from invalid or malicious operation data and providing reliable basic data for subsequent conflict analysis. Secondly, integrity verification ensures that the operation chain fragments on the chain have not been tampered with by recalculating the hash sequence and comparing it with the original sequence. Semantic context is the key basis for identifying the terminology association between operations and judging the true intent, which avoids the problem of semantic information distortion caused by data tampering, thus preventing misjudgment of intent. Thirdly, historical correlation verification confirms the relationship between the current transaction and previous on-chain transactions by querying the identifier mapping table. The continuity of transactions prevents forks in the operation chain and ensures the accuracy of operation timing and relationships, providing continuous timing and data support for tracing the logical connections between operations during conflict detection. Simultaneously, the smart contract calculates the Merkle root of the operation chain segment and stores valid transaction data packets, facilitating rapid verification of operation data integrity and ensuring the completeness and traceability of on-chain recorded operation data. Based on these reliable, continuous, and semantically informative on-chain operation records, clients can no longer rely solely on simple comparisons of operation position and timing during conflict detection. Instead, they can accurately identify terminological connections between operations, determine the true intent, and thus accurately assess the impact of conflicts on document logic, ultimately effectively solving the problem of insufficient accuracy in existing conflict detection technologies.
[0151] Based on collaborative operation data and on-chain records, intent conflict detection is performed to obtain conflict detection results, and a suggestion list is generated based on a preset rule base.
[0152] Reference Figure 3 Methods for obtaining collision detection results include:
[0153] The client obtains the operation chain fragment of the collaborating user and the corresponding blockchain notarized transaction hash. The client calls the blockchain node interface to query the corresponding on-chain Merkle root through the blockchain notarized transaction hash and performs operation chain fragment integrity verification: locally reconstruct the hash sequence of the operation chain fragment and calculate the local Merkle root; compare the local Merkle root with the on-chain Merkle root. If they match, the operation chain fragment has not been tampered with and proceeds to the next step; otherwise, it is determined to be untrusted operation data, synchronization is refused and a prompt is made to obtain the collaborative operation again.
[0154] By comparing the timestamps of local operations that are not recorded on the blockchain with the timestamps of blockchain transactions, the true time sequence of collaborative operations and local operations can be obtained. The timestamps of blockchain transactions are extracted from the hashes of blockchain-stored transactions.
[0155] Based on real time series, an improved OT algorithm is used to resolve position conflicts;
[0156] Methods for resolving location conflicts using improved OT algorithms include:
[0157] If the actual timing sequence is that the cooperative operation occurs first, and the cooperative operation is an insertion operation, the local operation position is... If greater than the collaborative operation position Combining time-series weights, for Increase the length of content inserted by the cooperation operation The temporal weights are obtained based on a natural heuristic optimization algorithm, such as the position of the local operation after transformation. ,in, For collaborative operation Temporal weights; For indicator functions, At that time Otherwise ;
[0158] When the cooperative operation is a delete operation, the position of the local operation L is... If greater than Combining time-series weights, for Reduce the length of content deleted in collaborative operations For example, the location of the local operation after the current conversion. ,in For indicator functions, At that time Otherwise ;
[0159] If the actual timing sequence is that the local operation occurs first, and the local operation is an insertion operation, the position of the cooperation is... If larger than the local operation location Combining time-series weights, for Increase the length of content inserted in local operations Such as the location of the cooperation after conversion ,in, For indicator functions, At that time Otherwise , For local operation Temporal weights;
[0160] When the local operation is a delete operation, the location of the collaborative operation. If larger than the local operation location Combining time-series weights, for Reduce the length of content inserted in local operations Such as the current position of the cooperation after the transformation. ,in, For indicator functions, At that time Otherwise ;
[0161] If the actual timing sequence involves both cooperative and local operations occurring simultaneously, then the timing weights are equal, and comparisons are made. and Prioritize operations with smaller positions, and increase the content length of operations with larger positions by increasing the position of smaller operations. For example, after conversion, the larger operation will have a smaller position. ,in, For larger operating positions; For smaller operation content lengths;
[0162] like For insertion operations, L represents deletion operations, or For deletion operation, L represents insertion operation: if the position of the insertion operation is... Within the scope of the deletion operation Inside, If the starting position for a deletion operation is specified, the deletion operation will be executed first, and the position for an insertion operation will be reduced accordingly. Otherwise, execute according to the original position without conversion. The length of the deletion operation.
[0163] A pre-trained BERT model is used to extract terms from the semantic context of cooperation, the semantic context of local operations, and the context text of document conflict locations, to obtain the term set involved in cooperation and the term set involved in local operations.
[0164] The term relevance of a term intersection is calculated using the Jaccard coefficient to determine whether the operations target the same object, such as the term relevance of the term intersection. ,in, Terminology related to collaborative operations; These are the terms involved in the local operation. If TermSim is greater than or equal to the relevance threshold, such as 0.5, it can be calibrated using the domain corpus. If the operation is determined to target the same core object, proceed to the next step of intent analysis; otherwise, it is determined to be an unrelated operation with no intent conflict.
[0165] The semantic context of cooperation and the semantic context of local operation are used as input to the intent classification model to obtain intent labels; intent labels include addition, deletion, modification, retention, reference, and irrelevant.
[0166] Based on a predefined conflict rule base, conflict matching is performed on intent tags to determine whether a conflict exists and the corresponding conflict type.
[0167] The process involves: obtaining the context text and corresponding terms at the conflict locations in the conflicting documents; calculating the ratio of the number of times the conflicting terms appear in the core chapters to the total number of times they appear in the document; calculating the number of times the core chapters appear, which includes the abstract and conclusion; calculating the ratio of the number of sentences citing the conflicting terms to the total number of sentences in the document; calculating the chapter ratio of the first occurrence chapter number of the conflicting terms to the total number of chapters; calculating the logical chain position based on the chapter ratio; calculating the TF-IDF value of the conflicting terms in the document; and weighting the core chapter occurrence count, citation dependency, logical chain position, and TF-IDF value to obtain the terminology function weight.
[0168] The semantic context of each operation is input into the intent embedding model to obtain the intent vector. The cosine similarity of the intent vector is calculated and then mapped to the interval [-1,1] to obtain the intent vector. Figure 1 Consistency score;
[0169] The blockchain timestamps of collaborative and local operations are used to determine the order of occurrence. If the local operation is executed first and the collaborative operation is executed later, it may resolve some conflicts, and the time-series impact value is assigned to 1. If the collaborative operation is executed first and the local operation is executed later, the conflict is amplified, and the time-series impact value is assigned to -1. If the error value between the local operation and the collaborative operation is within the allowable range, the time-series impact value is assigned to the difference between the timestamp of the collaborative operation and the timestamp of the local operation.
[0170] According to the functional weight of terms, meaning Figure 1 A conflict score is calculated by combining the consistency score and the temporal impact value. If the conflict score is greater than a conflict threshold, a conflict is considered to exist; otherwise, no conflict is considered. ,in, For terminology function weights; For the purpose Figure 1 Consistency score; This refers to the timing effect value;
[0171] For operations identified as conflicting, the probability that the affected content is concentrated in a single paragraph is obtained. Combining citation dependency and terminology function weight, an impact scope index is calculated. Based on this index, the conflict's impact scope is divided into three levels: Level 1 conflict (affecting only a single paragraph), Level 2 conflict (affecting within a chapter), and Level 3 conflict (affecting the entire document). (Imagine the impact scope index...) ,in, For reference dependency; The probability that the affected content is concentrated in a single paragraph is calculated by the paragraph distribution in which the term appears.
[0172] Structured conflict information is generated by combining historical blockchain data. This structured conflict information includes conflict document identifiers, conflict origination information, and conflict descriptions. Conflict document identifiers are hash values calculated based on associated documents, conflict detection timestamps, on-chain transaction hashes of collaborative operations, and the hash of the last local operation. Conflict origination information is the historical record of conflicting operations retrieved from the blockchain. Conflict descriptions are natural language descriptions based on the conflict type, severity, and origination path.
[0173] The method for obtaining conflict detection results firstly involves querying the Merkle root on the blockchain through the blockchain's notarized transaction hash and comparing it with the locally reconstructed Merkle root to verify the integrity of the collaborative operation chain segment. This ensures that the operation data used for conflict detection is authentic and unaltered, laying a reliable data foundation for subsequent accurate analysis. Next, the blockchain timestamp is used to determine the true time sequence of collaborative and local operations. An improved OT algorithm based on natural heuristic optimization is employed to optimize time sequence weights and resolve positional conflicts. This overcomes the limitations of existing technologies that simply compare positions and time sequences, avoiding misjudgments of positional conflicts due to coarse time sequence judgments. Subsequently, a pre-trained BERT model is used to extract terms from the semantic context. The Jaccard coefficient is used to calculate term association, accurately determining whether operations target the same core object, solving the problem that existing technologies cannot identify term associations between operations. Then, an intent classification model is used to obtain operation intent labels, which are combined with a conflict rule base to match conflict types, achieving the identification of the true intent of the operation and effectively avoiding intent misjudgments. Simultaneously, the functional weight of the term is obtained by calculating parameters such as the frequency of occurrence of core chapters and citation dependency of conflicting terms, combined with the meaning... Figure 1The system calculates conflict scores based on consistency scores and time-series impact values. It also calculates an impact range index based on the probability of affected content concentration and citation dependency to classify conflict levels, accurately assessing the impact range of conflicts on document logic and overcoming the shortcomings of existing technologies in assessing the scope of impact. Finally, it combines historical blockchain data to generate structured conflict information containing conflict tracing information, further ensuring the traceability and credibility of conflict detection results. Overall, it achieves full-dimensional accurate conflict detection from data credibility, time-series accuracy, terminology association recognition, intent judgment to impact range assessment, completely solving the problem of insufficient accuracy in conflict detection by existing technologies.
[0174] Methods for generating suggestion lists based on a preset rule base include:
[0175] The pre-defined rule base is structured and includes Rk independent rules. Each rule contains a rule identifier, trigger condition, suggested template, and priority. The rule identifier is a unique string identifier for each rule, which is easy to trace and manage. The trigger condition is a logical expression obtained by combining conflict features. The suggested template is natural language text containing variable placeholders. The priority is the basic weight of the rule, with a value range of [0,1] (the higher the value, the higher the priority of the rule), which can be preset based on the experience of domain experts.
[0176] Extract features that match the rule base fields from the conflict information and perform standardization processing, such as converting discrete features into enumerated values to obtain a standardized feature vector consistent with the trigger condition field.
[0177] The logical expression of the triggering condition is converted into a logical judgment. The feature vector is then subjected to a logical judgment to obtain all rules that meet the condition, thus obtaining a candidate set.
[0178] Extract the specific attributes of conflicting operations and replace the placeholders in the suggestion template; unify the format of the suggestion text to ensure consistency of expression; calculate the similarity of the instantiated suggestion text based on cosine similarity, remove suggestions with repetition higher than the preset repetition threshold, and obtain deduplicated suggestions. The preset repetition threshold can be set manually.
[0179] Calculate the overall priority based on the priority of the deduplication suggestions and the conflict score. Sort the suggestions in descending order of overall priority and obtain the top T deduplication suggestions. List the unique identifier, suggestion text, rule identifier, and overall priority for each suggestion to obtain a suggestion list. The unique identifier is a hash value generated based on the rule identifier and the corresponding timestamp. (See example...) Overall priority of deduplication suggestions ,in, For the first Prioritize the deduplication suggestions; For the first The conflict score of each deduplication suggestion.
[0180] The method for generating a suggestion list based on a pre-defined rule base breaks through the limitations of existing technologies that rely solely on simple comparisons of operation location and timing by defining the pre-defined rule base in a structured way. Its triggering conditions are no longer based on single location or timing information, but rather on conflict features obtained from previous accurate conflict detection, ensuring the targeting and accuracy of rule triggering. Subsequently, standardized feature vectors matching the rule base fields are extracted from the conflict information, further transforming key information such as term association, intent judgment, and scope of influence obtained in the conflict detection stage into the basis for rule matching, avoiding false rule triggering due to missing feature dimensions. When generating suggestions, conflict operations are extracted... The specific attribute replacement suggestion template placeholders ensure that the suggestion text accurately corresponds to the actual situation of the conflict, rather than a generalized suggestion, effectively avoiding suggestion bias caused by the inability to identify terminological associations and true intentions. At the same time, duplicate suggestions are eliminated based on cosine similarity, and a comprehensive priority ranking is calculated by combining rule priority and conflict score. This ensures that the output suggestion list not only matches the true intention and scope of the conflict, but is also presented in an orderly manner according to importance. From the decision support level of conflict resolution, this further makes up for the shortcomings of existing technologies in misjudging intent and lacking assessment of the scope of impact. Finally, it forms a closed loop with the accurate conflict detection in the early stage, and together improves the overall accuracy of conflict handling.
[0181] Based on the suggestions selected by the user from the suggestion list, a traceable solution is generated. After updating the local operation chain, all operations are replayed to generate the final document, which is then synchronized to the server and associated with the records on the chain.
[0182] Methods for generating traceable resolution actions based on suggestions selected by users from the suggestion list include:
[0183] If the user selects a suggestion from the suggestion list, the system extracts the suggestion content and suggestion document identifier of the corresponding suggestion as decision information;
[0184] If the user does not select a suggestion from the suggestion list, decision information that retains the decision content of both parties' actions will be generated.
[0185] Transform user decisions into structured data that includes decision type, decision text, decision basis, and decision timestamp;
[0186] Encapsulate structured data into conflict resolution operations that are consistent with the format of atomic operation objects;
[0187] Calculate the hash value of the conflict resolution operation, pair the conflict resolution operation with the corresponding hash value, append it to the end of the latest local operation chain, generate a new latest local operation chain, write the new latest local operation chain into the operation chain list of the local database, and set the "on-chain flag" of the newly added record to False.
[0188] Perform an integrity check on the new, locally updated operation chain. If the check is complete, the operation chain passes; otherwise, mark the operation chain as corrupt and prompt the user to regenerate the solution operation.
[0189] The method for generating traceable resolution actions based on user-selected suggestions from a suggestion list is fundamentally about deeply binding user decisions with accurate prior conflict detection results. Whether the user chooses a suggestion from the suggestion list or customizes a decision that retains both parties' actions, the system converts the decision into structured data containing decision type, text, basis, and timestamps. This data directly relates to the core semantic information of the conflict, avoiding the disconnect between decisions and real-world conflict scenarios caused by a lack of semantic association in existing technologies. Subsequently, the structured data is encapsulated into conflict resolution actions consistent with the atomic operation format, ensuring that the resolution actions can be integrated into the local operation chain, and that the actions themselves carry traceable semantic decision information, rather than merely recording location or... The method first calculates the hash value of the conflict resolution operation and appends it to the local operation chain. Combined with integrity verification, it ensures that the operation chain has not been tampered with, thus forming a continuous semantic association chain between the conflict resolution operation and the previous conflict detection and on-chain operation. This further strengthens the ability to trace the terminological association and true intent between operations. Finally, by transforming accurate conflict detection results into implementable and traceable conflict resolution operations, this method avoids the decision-making errors caused by existing technologies that rely solely on location and time sequence comparison. At the same time, it matches the scope of the conflict resolution operation with the impact of the conflict on the document logic. This further compensates for the shortcomings of existing technologies from the conflict resolution implementation stage, forming a closed loop with the previous conflict detection and suggestion generation, and jointly improving the overall accuracy of conflict handling.
[0190] The methods for updating the local operation chain, replaying all operations to generate the final document, synchronizing it to the server, and associating it with the records on the chain include:
[0191] Recalculate all operation hashes of the new local latest operation chain to confirm that the hash chain is continuous;
[0192] Extract the blockchain transaction hash corresponding to the operation fragment that has been uploaded to the chain in the latest local operation chain;
[0193] For each blockchain transaction hash, call the blockchain node interface to query the corresponding on-chain Merkle root, denoted as MRj;
[0194] The Merkle root of the operation fragment that has been uploaded to the chain in the new local latest operation chain is reconstructed locally, denoted as MRj′. MRj′ is compared with MRj: if they are all consistent, the new local latest operation chain is trustworthy; otherwise, it is determined that the operation chain is inconsistent with the on-chain record, the document generation is terminated and a prompt is made to synchronize the on-chain data.
[0195] Based on the operation sequence of the new local latest operation chain, all operations are replayed in chronological order by operation type to generate the final document from the initial document:
[0196] Load the initial document as an editable text buffer and sort all operations in the new local latest operation chain by operation timestamp;
[0197] For each sorted operation, execute the corresponding logic based on the operation type:
[0198] When the operation type is insert, parse the total document offset of the operation position; insert the string of decision text at the total document offset position in the buffer;
[0199] When the operation type is deletion, parse the total document offset and the deletion length Len at the operation position; delete Len characters starting from the total document offset, and update the buffer length;
[0200] When the operation type is formatting, parse the paragraph index of the operation position, add the format specified by the decision text string to the paragraph index, and mark the format attribute;
[0201] When the operation type is conflict resolution, parse the conflict paragraph at the operation location, adjust the content of the conflict paragraph according to the decision text in the string of decision text, and record the decision mark.
[0202] After all operations are replayed, the document buffer is converted to a standard document format, and the final hash of the document is generated.
[0203] The final document's binary data is encapsulated with associated trusted data into a synchronization data packet;
[0204] The client sends synchronization data packets to the office server via a preset protocol, such as HTTPS. The office server performs signature verification, document hash verification, and on-chain association verification. After successful verification, the office server performs the following operations:
[0205] Replace the initial document corresponding to the document identifier in the server, and save the binary data of the final document;
[0206] The core information of the synchronization data packet is stored in the data record table of the server database, including the document identifier, the hash value of the final document, the transaction hash of the last on-chain operation, and the synchronization timestamp.
[0207] The document identifier stored on the server is bound to the transaction hash of the last on-chain operation to facilitate subsequent traceability; the server generates a "synchronization confirmation", which includes a synchronization success identifier and the binary data hash value of the final document stored on the server, and returns it to the client via HTTPS.
[0208] The method of updating the local operation chain, replaying all operations to generate the final document, and synchronizing it to the server-side associated chain records first ensures the integrity and reliability of the operation chain by recalculating all hashes of the new operation chain and comparing the local Merkle root of the operation fragments already on the chain with the on-chain Merkle root. This operation chain not only contains operation position and timing information but also integrates previously identified inter-operation terminology associations, true intentions, and conflict impact scope data, laying a reliable and semantically meaningful foundation for subsequent accurate document generation and avoiding the conflict handling deviations caused by unreliable data or lack of semantic information in existing technologies. Subsequently, operations are replayed chronologically based on the operation chain, no longer simply relying on operation position and timing, but transforming terminology associations and intent judgments into precise adjustments to the document content through the replay process. For example, for "core terminology reference conflicts,"... The decision will accurately correct the corresponding quoted paragraphs during replay, effectively avoiding misjudgment of intent. At the same time, the replay covers the entire operation chain, which can fully present the impact of the conflict on the document logic and solve the problem that existing technologies cannot accurately assess the scope of impact. Finally, the client sends a synchronization data packet containing trusted data. After the server performs triple verification of signature, hash, and on-chain association, it updates the document and binds the document identifier with the last on-chain transaction hash, forming a closed loop of "operation chain verification - accurate replay - synchronous traceability". This ensures that the final document is completely consistent with the semantic information and conflict decision on the chain, completely getting rid of the limitations of existing technologies that rely solely on position and time sequence comparison. It further consolidates the accuracy of conflict detection from the document generation and synchronous landing stage, forming a complete and accurate processing chain with the previous conflict detection, suggestion generation, and resolution operation generation, effectively solving the problem of insufficient accuracy of conflict detection in existing technologies.
[0209] Example 2
[0210] Please see Figure 4 As shown, this embodiment discloses an interoperable document editing system, including:
[0211] Acquisition and encapsulation module: Acquires document editing data to perform document initialization and blockchain registration operations. The blockchain captures user editing behavior and encapsulates it into atomic operations with semantic context. Based on the atomic operations, a local operation chain with hash chain association is constructed.
[0212] Data on-chain module: Based on the local operation chain, it packages user batch operations into transactions and uploads them to the chain. It verifies the transactions through smart contracts and stores the operation data and verification results to form on-chain records.
[0213] Conflict detection module: Based on collaborative operation data and on-chain records, it performs intent conflict detection, obtains conflict detection results, and generates a suggestion list based on a preset rule base;
[0214] Document generation module: Generates traceable solutions based on suggestions selected by the user from the suggestion list, updates the local operation chain, replays all operations to generate the final document, synchronizes it to the server, and associates it with the records on the chain.
[0215] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
[0216] In conclusion, the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for editing interconnected documents, characterized in that, include: Collect document editing data to perform document initialization and blockchain registration operations. The blockchain captures user editing behavior and encapsulates it into atomic operations with semantic context. Based on the atomic operations, a local operation chain with hash chain association is constructed. Based on the local operation chain, user batch operations are packaged into transactions and put on the chain, verified by smart contracts, and the operation data and verification results are stored to form on-chain records. Based on collaborative operation data and on-chain records, intent conflict detection is performed to obtain conflict detection results, and a suggestion list is generated based on a preset rule base. Based on the suggestions selected by the user from the suggestion list, a traceable solution is generated, the local operation chain is updated, all operations are replayed to generate the final document, and the document is synchronized to the server and associated with the records on the chain. Methods for obtaining collision detection results include: Obtain the operation chain fragment of the collaborating user and the corresponding blockchain notarized transaction hash. Query the corresponding on-chain Merkle root through the blockchain notarized transaction hash to verify the integrity of the operation chain fragment. If the verification is successful, proceed to the next step; otherwise, it is determined to be untrusted operation data and synchronization is refused. By comparing the timestamps of local operations that are not recorded on the blockchain with the timestamps of blockchain transactions, the true time sequence of collaborative operations and local operations can be obtained. Based on real time series, an improved OT algorithm is used to resolve position conflicts; A pre-trained BERT model is used to extract terms from the semantic context of cooperation, the semantic context of local operations, and the context text of document conflict locations, to obtain the term set involved in cooperation and the term set involved in local operations. The terminology relevance of the term intersection is calculated using the Jaccard coefficient to determine whether the operations target the same object. If so, proceed to the next step of intent analysis; otherwise, it is determined to be an unrelated operation with no intent conflict. The intention label is obtained by taking the cooperation semantic context and the local operation semantic context as input to the intention classification model. Based on a predefined conflict rule base, conflict matching is performed on intent tags to determine whether a conflict exists and the corresponding conflict type. The analysis yields a conflict score. If the conflict score is greater than the conflict threshold, it is determined that there is a conflict; otherwise, it is determined that there is no conflict. For operations identified as conflicting, the probability that the affected content is concentrated in a single paragraph is obtained. Combining the citation dependency and terminology function weight, the scope of impact index is calculated. The scope of conflict impact is divided according to the scope of impact index to obtain the conflict level. Structured conflict information is generated by combining historical blockchain data. The structured conflict information includes conflict document identifiers, conflict origination information, and conflict descriptions.
2. The interoperable document editing method according to claim 1, characterized in that, Methods for collecting document editing data to perform document initialization and blockchain registration operations include: A document identifier is generated based on the document editing data. The document editing data includes the initial document content, user certificate, and initialization timestamp. The initial document content is a UTF-8 encoded byte stream converted from the original document content. The user certificate is a public key and identity information encoded according to DER. The initialization timestamp is a UTF-8 encoded byte stream converted from the initialization time. The document identifier is a hash value calculated based on the initial document content, user certificate, and initialization timestamp. Submit the document identifier, user certificate, and initialization timestamp to the consortium blockchain. After successful verification, the initial block pointer is obtained.
3. The interoperable document editing method according to claim 1, characterized in that, Methods for capturing user editing behavior and encapsulating it into atomic operations with semantic context include: Monitor the client, record the user certificate of the operation initiator, and capture the operation type, operation location, operation content and corresponding operation time of the client; Operation types include insert operations, delete operations, and formatting operations; The operation location is represented by three-dimensional data: document offset, paragraph index, and inline coordinates; If the operation type is an insert operation, then record the complete content of the insert; Based on NLP, semantic parsing is performed on atomic operation objects and original document content to obtain operation type, operation location context text and operation content. The operation location context text includes the first L bytes and the last L bytes of the operation location. The operation type, operation location context text and operation content are used as input to the analysis model pre-deployed on the client to obtain semantic context. By concatenating the document identifier, user certificate, operation type, operation location, operation content, corresponding operation timestamp, and semantic context, an atomic operation with semantic context is obtained.
4. The interoperable document editing method according to claim 1, characterized in that, Methods for constructing a local operation chain with hash-chain associations include: Obtain all atomic operation objects and their corresponding semantic contexts, and perform format validation on each atomic operation object; Operations that fail format validation are marked as exceptions, temporarily stored in the error queue for manual confirmation, and are not included in the operation chain; for atomic operations that pass format validation, a unique hash value for each operation is calculated in chronological order. The operation objects are paired with their corresponding hash values in chronological order to form an operation chain. The operation chain is stored, and the integrity of the operation chain is automatically checked each time it is stored or retrieved. When a user generates a new operation, the system returns to validate the new operation's format, calculates the hash value corresponding to the new operation, and updates the operation chain to obtain the local operation chain.
5. The interoperable document editing method according to claim 4, characterized in that: The format verification includes: verifying whether the timestamps of all atomic operations are sequentially incremented; and whether the document identifiers of all atomic operations are consistent. Methods for calculating the unique hash value for each operation include: when At that time, calculate the hash value of the first atomic operation and its corresponding semantic context; Indicates the first One atomization operation; when When the hash value of the current operation is obtained, it is calculated by combining the hash value of the previous operation. The integrity verification method includes: Starting with the first hash value, hash values are recalculated sequentially. If the recalculated hash value corresponds one-to-one with the hash value in the operation chain, the verification passes; otherwise, the verification fails. The non-corresponding hash value is marked as the breakpoint position, and a message is sent indicating that the operation chain has been tampered with or damaged.
6. The interoperable document editing method according to claim 1, characterized in that, Methods for packaging user batch operations into transactions and uploading them to the blockchain based on the local operation chain include: Filter out operations that are not on the chain from the local operation chain, and start the batch packaging process when any of the preset configuration conditions are met; The system marks the starting index 'a' and the ending index 'b' of the operations that are not currently on the chain, where b = 1 + k - 1, and k is the number of operations in this package; Extract the operations from index a to b from the local operation chain to form an operation chain fragment to be added to the chain. Convert all fields in the operation chain fragment into a preset uniform format to obtain the standard operation chain. Generate a transaction data packet containing document identifier, standard operation chain, user signature, preceding transaction hash and transaction timestamp based on the standard operation chain; The client sends transaction data packets to the consortium blockchain network via the blockchain; If the transmission is successful, the client updates the on-chain status of the local operation chain, including adding on-chain markers for operations with indices a to b in the operation table of the local database; adding a new transaction information table to store transaction hashes, complete transaction data packets, transaction timestamps, and associating them with document identifiers; If the transmission fails, the client will temporarily store the transaction data packet in the local retry queue and automatically retry when the trigger condition is met, with the number of retries not exceeding F.
7. The interoperable document editing method according to claim 6, characterized in that, The preset configuration conditions include: K operations not yet on the blockchain; the user actively clicks the save button on the client, which immediately triggers the packaging of all currently un-on-the-chain operations; and packaging is automatically triggered when the network latency is lower than R and the upload bandwidth is higher than E. Methods for obtaining user signatures include: The document identifier, standard operation chain, and preceding transaction hash are concatenated to obtain the data to be signed. The preceding transaction hash is the hash value of the last transaction added to the chain, and the transaction hash of the first time the document is added to the chain is the block hash corresponding to the initial block pointer. The user's signature is obtained by signing the data to be signed using the user's private key pre-stored on the client.
8. The interoperable document editing method according to claim 1, characterized in that, Methods for verifying data and storing operational data and verification results to form on-chain records through smart contracts include: The blockchain receives transaction data packets. Nodes call the verification function of smart contracts pre-deployed to the blockchain network. The smart contract performs format verification on the transaction data packets. If the format verification fails, it directly returns verification failure. The smart contract performs user identity verification, operation fragment integrity verification, and historical correlation verification on the transaction data packets that have passed the format verification. If any one of them fails, the contract terminates and returns the reason for the failure. The legitimacy verification includes: the smart contract obtains the user certificate associated with the document identifier from the underlying blockchain and parses out the user's public key; the verification function is used to verify the validity of the signature; the verification function is a built-in verification function of the smart contract that matches the client; if the document has edit permissions set, the smart contract queries the pre-stored edit permission list and verifies whether the user's public key is in the edit permission list. If it is, the verification passes; otherwise, it fails. Historical correlation verification includes: the smart contract queries the identifier mapping table stored in its own state to obtain the transaction hash of the last successfully uploaded document; and verifies whether the hash of the last transaction in the transaction data packet is consistent with the hash of the previously successfully uploaded transaction. If they are consistent, the verification passes; otherwise, it fails. After successful verification, the smart contract's built-in functions calculate the Merkle root of the hash sequence of the operation chain fragments through a binary tree-based hashing process. The smart contract calls the storage function to write the transaction data packet into the blockchain ledger. The smart contract broadcasts a public event, and the client listens for the event to know the result on the chain. If any verification fails, the smart contract returns a structured error message, and the blockchain node marks the corresponding transaction data packet as invalid and does not write it into the ledger.
9. The interoperable document editing method according to claim 1, characterized in that, Methods for generating traceable resolution actions based on suggestions selected by users from the suggestion list include: If the user selects a suggestion from the suggestion list, the system extracts the suggestion content and suggestion document identifier of the corresponding suggestion as decision information; If the user does not select a suggestion from the suggestion list, decision information that retains the decision content of both parties' actions will be generated. Transform decision information into structured data that includes decision type, decision text, decision basis, and decision timestamp; Encapsulate structured data into conflict resolution operations that are consistent with the format of atomic operation objects; Calculate the hash value of the conflict resolution operation, pair the conflict resolution operation with the corresponding hash value, append it to the end of the latest local operation chain, generate a new latest local operation chain, write the new latest local operation chain into the operation chain list of the local database, and set the on-chain flag of the newly added record to False. Perform an integrity check on the new, locally updated operation chain. If the check is complete, it passes and a traceable solution is obtained; otherwise, the operation chain is marked as corrupted, and the user is prompted to regenerate the solution.
10. The interoperable document editing method according to claim 1, characterized in that, The methods for updating the local operation chain, replaying all operations to generate the final document, synchronizing it to the server, and associating it with the records on the chain include: Recalculate all operation hashes of the new local latest operation chain to confirm that the hash chain is continuous; Extract the blockchain transaction hash corresponding to the operation fragment that has been put on the chain in the latest local operation chain. For each blockchain transaction hash, call the blockchain node interface to query the corresponding on-chain Merkle root, denoted as MRj. The Merkle root of the operation fragment that has been uploaded to the chain in the new local latest operation chain is reconstructed locally, denoted as MRj′. MRj′ is compared with MRj: if they are all consistent, the new local latest operation chain is trustworthy; otherwise, it is determined that the operation chain is inconsistent with the on-chain record, the document generation is terminated and the on-chain data is prompted to be synchronized. Based on the operation sequence of the new local latest operation chain, all operations are replayed in chronological order by operation type to generate the final document from the initial document: Load the initial document as an editable text buffer and sort all operations in the new local latest operation chain by operation timestamp; For each sorted operation, execute the corresponding logic based on the operation type: When the operation type is insert, parse the total document offset of the operation position; insert the string of decision text at the total document offset position in the buffer; When the operation type is deletion, parse the total document offset and the deletion length Len at the operation position; delete Len characters starting from the total document offset, and update the buffer length; When the operation type is formatting, parse the paragraph index of the operation position, add the format specified by the decision text string to the paragraph index, and mark the format attribute; When the operation type is conflict resolution, parse the conflict paragraph at the operation location, adjust the content of the conflict paragraph according to the decision text in the string of decision text, and record the decision mark; After all operations are replayed, the document buffer is converted to a standard document format, and the final hash of the document is generated. The final document's binary data is encapsulated with associated trusted data into a synchronization data packet; The client sends synchronization data packets to the office server via a preset protocol. The office server performs signature verification, document hash verification, and on-chain association verification. After successful verification, the office server performs the following operations: Replace the initial document corresponding to the document identifier in the server, and save the binary data of the final document; The core information of the synchronization data packet is stored in the data record table of the server database, including the document identifier, the hash value of the final document, the transaction hash of the last on-chain operation, and the synchronization timestamp. The server binds the document identifier stored on the server with the transaction hash of the last on-chain operation. The server generates a synchronization confirmation, which includes a synchronization success identifier and the binary data hash value of the final document stored on the server, and returns it to the client through a preset protocol.
11. An interoperable document editing system, used to implement the interoperable document editing method according to any one of claims 1-10, characterized in that, include: Acquisition and encapsulation module: Acquires document editing data to perform document initialization and blockchain registration operations. The blockchain captures user editing behavior and encapsulates it into atomic operations with semantic context. Based on the atomic operations, a local operation chain with hash chain association is constructed. Data on-chain module: Based on the local operation chain, it packages user batch operations into transactions and uploads them to the chain. It verifies the transactions through smart contracts and stores the operation data and verification results to form on-chain records. Conflict detection module: Based on collaborative operation data and on-chain records, it performs intent conflict detection, obtains conflict detection results, and generates a suggestion list based on a preset rule base; Document generation module: Generates traceable solutions based on suggestions selected by the user from the suggestion list, updates the local operation chain, replays all operations to generate the final document, synchronizes it to the server, and associates it with the records on the chain.
Citation Information
Patent Citations
Block chain-based document management method, device and system and storage medium
CN111353152A
Document real-time collaborative editing method and device based on block chain
CN118657120A