Information processing methods, apparatus, equipment, storage media and computer programs

By using a tree-structured information processing method, the atomic operation intent in collaborative documents is captured and reconstructed. The OT algorithm is used to handle conflicts between multiple editors, which solves the problem of inconsistent collaborative document states and achieves more accurate conflict handling and document state consistency.

CN116562236BActive Publication Date: 2026-06-30TENCENT TECHNOLOGY (SHENZHEN) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2022-01-26
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

When multiple people are collaboratively editing a document, existing technologies struggle to effectively handle editing conflicts between various types of data documents, leading to inconsistent collaborative document states.

Method used

A tree-based information processing method is adopted. By obtaining the tree structure of collaborative documents, the intent of atomic operations is captured and reconstructed. The OT algorithm is used to handle conflicts in collaborative documents, ensuring that the document status is consistent after multiple people have edited it.

Benefits of technology

It improves the accuracy of conflict handling in collaborative documents, ensures that all parties see the same new collaborative document, is compatible with multiple document formats such as mind maps, flowcharts, and charts, and reduces disruption of editing intentions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116562236B_ABST
    Figure CN116562236B_ABST
Patent Text Reader

Abstract

This application discloses an information processing method, apparatus, device, storage medium, and computer program. The method includes: when a collaborative document in a first state contains a first atomic operation and a second atomic operation, obtaining the tree structure corresponding to the collaborative document; updating the collaborative document from the first state to a second state based on the tree structure according to the operation intent expressed by the first atomic operation; wherein the first atomic operation includes a first type of operation among N predefined atomic operations in the tree structure, and the first type of operation is an operation that can be split into two or more atomic operations; performing intent restoration transformation on the operation intent expressed by the second atomic operation according to the operation intent expressed by the first atomic operation to obtain a transformed operation intent; and updating the collaborative document from the second state to a third state based on the tree structure according to the transformed operation intent. Using this application embodiment can improve the accuracy of conflict handling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to an information processing method, apparatus, device, storage medium, and computer program. Background Technology

[0002] With the continuous development of intelligent office systems, collaborative documents have brought numerous conveniences to office scenarios such as collecting data from multiple users, collaboratively editing data or documents, etc. Collaboration can be understood as cooperation and synchronization. Collaborative documents are documents that support multiple users to edit, and each person's edits are synchronized with everyone else, allowing everyone to share the editing results. As collaborative scenarios become more refined, the types of document data that need to support collaborative editing are increasing, such as text documents, spreadsheets, mind maps, flowcharts, and charts, etc.

[0003] When multiple people edit a collaborative document simultaneously, editing conflicts are inevitable. Therefore, to ensure that everyone sees a consistent collaborative document, conflict resolution mechanisms are needed to handle the editing operations performed by multiple people. Currently, in the field of collaborative document applications, how to handle collaborative conflicts for various types of data documents has become a hot research topic. Summary of the Invention

[0004] This application provides an information processing method, apparatus, device, storage medium, and computer program that improves the accuracy of conflict handling in collaborative documents.

[0005] On one hand, embodiments of this application provide an information processing method, including:

[0006] When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document;

[0007] The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0008] Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent;

[0009] According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

[0010] On the one hand, embodiments of this application also provide an information processing apparatus, including:

[0011] The acquisition unit is used to acquire the tree structure corresponding to the collaborative document when the collaborative document in the first state contains a first atomic operation and a second atomic operation;

[0012] The update unit is used to update the collaborative document from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation; the first atomic operation includes a first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0013] The conversion unit is used to perform intention restoration conversion on the operation intention expressed by the second atomic operation according to the operation intention expressed by the first atomic operation, so as to obtain the converted operation intention;

[0014] The update unit is further configured to update the collaborative document from the second state to the third state based on the tree structure according to the transformed operation intent.

[0015] On one hand, embodiments of this application provide an information processing device, including: a processor adapted to implement one or more computer programs; and a computer storage medium storing one or more computer programs, the one or more computer programs being adapted to be loaded and executed by the processor.

[0016] When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document;

[0017] The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0018] Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent;

[0019] According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

[0020] On one hand, embodiments of this application provide a computer storage medium storing a computer program, which, when executed by a processor of an information processing device, is used to perform:

[0021] When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document;

[0022] The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0023] Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent;

[0024] According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

[0025] On one hand, embodiments of this application provide a computer program product or a computer program, the computer program product including a computer program stored in a computer storage medium; the processor of an information processing device reads the computer program from the computer storage medium, and the processor executes the computer program, causing the information processing device to perform:

[0026] When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document;

[0027] The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0028] Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent;

[0029] According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

[0030] In this embodiment, when a collaborative document in a first state has a first atomic operation and a second atomic operation, since both the first and second atomic operations need to update the state of the collaborative document, they are considered to be in conflict. Therefore, conflict resolution is required to ensure that the first and second atomic operations update the collaborative document sequentially. This application primarily uses a tree structure to handle the conflict between the first and second atomic operations. Specifically, during conflict resolution, the collaborative document is first updated according to the intention of the first atomic operation. Then, the intention of the second atomic operation is captured. Based on the intention expressed by the first atomic operation, the intention expressed by the captured second atomic operation is restored to obtain the transformed intention. The collaborative document is then updated again according to the transformed intention. The first atomic operation can include a first type of operation, which includes any one of moving nodes, splitting nodes, and merging nodes. These operations share the common feature that they can all be replaced by one or more operations. In the prior art, the first type of operation is replaced by one or more operations, such as moving a node being split into deleting a node and creating a new node. This disrupts the original intention of these operations. In this embodiment of the application, a first type of operation is defined among N types of atomic operations. Thus, when conflict resolution is performed, the first type of operation can be executed as a single atomic operation, and its operation intent can be preserved, so that the tree structure or collaborative document can be updated according to the operation intent.

[0031] The execution of a first atomic operation may affect the execution of a second atomic operation. For example, if the first and second atomic operations are performed on the same node in the tree structure, the node may change after the first atomic operation is completed. This embodiment of the application avoids the problem of the second atomic operation failing due to the execution of the first atomic operation affecting it by capturing the intent of the second atomic operation and restoring the captured intent, thereby improving the accuracy of conflict handling. Attached Figure Description

[0032] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0033] Figure 1a This is a schematic diagram illustrating the implementation of an OT algorithm provided in an embodiment of this application;

[0034] Figure 1bThis is a schematic diagram illustrating another conflict resolution method provided in an embodiment of this application;

[0035] Figure 2 This is a schematic diagram of the structure of an information processing system provided in an embodiment of this application;

[0036] Figure 3 This is a flowchart illustrating an information processing method provided in an embodiment of this application;

[0037] Figure 4 This is a schematic diagram of a collaborative document provided in an embodiment of this application;

[0038] Figure 5a This is a schematic diagram illustrating the conversion of collaborative documents into a tree structure, as provided in an embodiment of this application.

[0039] Figure 5b This is a schematic diagram of a moving node provided in an embodiment of this application;

[0040] Figure 5c This is a schematic diagram of a split node provided in an embodiment of this application;

[0041] Figure 5d This application provides an embodiment of a merging node;

[0042] Figure 6 This application provides a schematic diagram of obtaining collaborative documents based on tree structure mapping.

[0043] Figure 7a This is a schematic diagram illustrating the transformation of atomic operations according to an embodiment of this application;

[0044] Figure 7b This is a schematic diagram illustrating another method of transforming atomic operations according to an embodiment of this application;

[0045] Figure 8 This is a schematic diagram illustrating the transformation of another atomic operation provided in an embodiment of this application;

[0046] Figure 9 This is a schematic diagram of the structure of an information processing device provided in an embodiment of this application;

[0047] Figure 10 This is a schematic diagram of the structure of an information processing device provided in an embodiment of this application. Detailed Implementation

[0048] The technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings.

[0049] This application provides an information processing scheme, which mainly implements a conflict resolution scheme based on a tree structure. When there are atomic operations of multiple objects in a collaborative document at a certain state, the proposed information processing scheme resolves the conflicts of the atomic operations of multiple objects and applies them to the collaborative document, ultimately ensuring that all objects can see the collaborative document in the same new state. Before introducing the information processing scheme of this application, two algorithms for conflict resolution are first introduced.

[0050] The first approach is conflict resolution based on Conflict-free Replicated Data Type (CRDT). In distributed systems, CRDT refers to a data structure that can be replicated in parallel across multiple hosts in a network without cooperation, and it always resolves potential inconsistencies. In a distributed system, assuming an object has many replicas distributed across multiple nodes, CRDT ensures that all operations querying this object on each replica node return the same result. In other words, in a distributed system, the goal is for multiple replicas of an object to eventually converge to the same state. This idea aligns with the goal of conflict resolution for collaborative documents; therefore, CRDT can be used when resolving conflicts in collaborative documents. Yjs is commonly used when applying CRDT. Yjs is a CRDT implementation that internally uses basic data types that support CRDT (such as maps or arrays) to achieve collaborative editing of JSON data of arbitrary formats through this combination.

[0051] The second type is the Operation Transform (OT) algorithm (hereinafter referred to as the OT algorithm for simplicity). The OT algorithm is an algorithm that handles conflicts during collaborative editing of a document by multiple objects, ensuring that all objects ultimately present a collaborative document in the same state. Its core idea is: if multiple editing operations are generated in a collaborative document in the same state, these operations need to be transformed before being applied sequentially to the collaborative document. Transformation can be understood as follows: when a collaborative document in the same state receives an editing operation from a first object and an editing operation from a second object, the first object responds first, meaning its editing operation is applied to the collaborative document displayed on the information processing device used by the first object to update the collaborative document. Then, based on the first object's editing operation, the second object's editing operation is transformed, and the transformed second object's editing operation is applied to the updated collaborative document. The object of the second object's editing operation may have changed due to the execution of the first object's editing operation; the purpose of the transformation is to ensure that the second object's editing operation is still executed on the original object.

[0052] The following example illustrates the above transformation process. See [link / reference] Figure 1a This is a schematic diagram illustrating the implementation of an OT algorithm provided in an embodiment of this application. Figure 1a In a collaborative document, each dot represents a state; for example, four dots represent states 1, 2, 3, and 4. An arrow represents an editing operation. Only two or more editing operations based on the same state require conflict resolution, i.e., mutual conversion. Suppose objects A and B perform editing operations A and B respectively on a collaborative document in the same state. Define A' = T(A, B) as meaning editing operation B is performed first, and editing operation A is converted; B' = T(B, A) as meaning editing operation A is performed first, and editing operation B is converted. The OT algorithm ultimately needs to ensure that AB' = BA', so that two conflicting editing operations can ultimately achieve the same document state after conversion.

[0053] Specifically, assuming a collaborative document is in state 1 as "test document", object A performs the following editing operation A on the collaborative document in state 1: insert "123" at position 4 of the collaborative document. Object B performs the following editing operation B on the collaborative document in the initial state: delete two characters at position 0 of the collaborative document.

[0054] Suppose that editing operation A and editing operation B are represented as follows:

[0055] A=insert: {index: 4, text: '123'}

[0056] B=delete: {index: 0, length: 2}

[0057] The information processing device used by object A needs to first perform an editing operation A in the collaborative document, that is, first execute editing operation A in the collaborative document, and then transform editing operation B. The transformation operation obtained by transforming editing operation B can be represented as B'. The specific transformation operation can be represented as follows:

[0058] B'=T(B,A)=delete:{index: 0, length: 2};

[0059] Then, based on this transformation operation, the updated collaborative document is updated again. From Figure 1a As can be seen, for object A, after updating the collaborative document based on the edit operation A, the collaborative document changes from state 1 to state 2; then, based on state 2, the collaborative document is updated based on the transformation operation B', changing the collaborative document from state 2 to state 3. Specifically, the edit operation A instructs to insert '123' at position 4 in the collaborative document. After performing this edit operation on the collaborative document "test document" in state 1, the collaborative document changes to state 2, namely "test document 123"; the transformation operation instructs to delete two characters at position 0 in the collaborative document. After performing this transformation operation on the collaborative document in state 2, the collaborative document is finally updated to state 3, namely "document 123".

[0060] Similarly, the information processing device used by object B needs to first perform an editing operation B in the collaborative document, that is, first update the collaborative document based on editing operation B, and then transform editing operation A. The transformation operation obtained by transforming editing operation A is denoted by A'. The specific expression of the transformation operation can be described as follows:

[0061] A'=T(A,B)=insert: {index: 2, text: '123'};

[0062] Furthermore, the information processing device used by object B updates the updated collaborative document again based on this transformation operation. From Figure 1aAs can be seen, for object B, after updating the collaborative document based on the edit operation B, the collaborative document changes from state 1 to state 4; then, based on state 4, the collaborative document is updated based on the transformation operation A', and the collaborative document changes from state 4 to state 3. Specifically, the edit operation B instructs to delete two characters at position 0 of the collaborative document. So, after performing the edit operation B on the collaborative document "Test Document" in state 1, the collaborative document changes to state 4, which is "Document"; the transformation operation instructs to add '123' at position 2 of the collaborative document. So, performing the transformation operation on the collaborative document in state 4, the collaborative document is finally updated to state 3, which is "Document 123".

[0063] The transformation operation derived from editing operation A shows that, originally, editing operation A intended to insert "123" at position 4 in the collaborative document, which was in state 1. However, because editing operation B was executed first, changing the state of the collaborative document, position 4 became position 2. Therefore, compared to editing operation A, the position where "123" was inserted has changed in this transformation operation. The transformation operation derived from editing operation B is the same as editing operation B itself. This is because, in collaborative documents, typically only editing operations occurring earlier in a document affect later editing operations.

[0064] In the example above, object A executes AB' in sequence, and object B executes BA' in sequence. This ensures that, for both object A and object B, the collaborative document is eventually updated from state 1 to state 3.

[0065] The above Figure 1a This example only illustrates how objects A and B each performed one edit operation on a collaborative document in state 1. Handling this type of conflict can be called single-conflict handling. In practical applications, objects A and B may perform more than one edit operation; handling this type of conflict can be called multiple-conflict handling. For example, see... Figure 1b This is a schematic diagram illustrating another conflict resolution method provided in an embodiment of this application. Figure 1b Assume object A performs edit operation A on a collaborative document in state 1, and object B subsequently performs edit operations B and C on the same collaborative document in state 1. Figure 1b In the process, for object A, firstly, the editing operation A is performed on the collaborative document, causing the collaborative document to change from state 1 to state 2. Then, the editing operation B is transformed into B'. Then, B' is performed on the collaborative document in state 2, causing the collaborative document to change from state 2 to state 3.

[0066] For object B, firstly, edit operation B is performed on the collaborative document in state 1, updating the collaborative document from state 1 to state 4. Edit operation A needs to be transformed at object B. That is, for object B, there are two edit operations to be performed in the collaborative document in state 4: A' and edit operation C. The conflict resolution process for A and edit operation C can be as follows: For object B, firstly, edit operation C is performed on the collaborative document in state 4, updating the collaborative document from state 3 to state 5; then A' is transformed to obtain A'', which can be represented as T(A', C). Further, A'' is performed in the collaborative document in state 5 to update the collaborative document to state 6.

[0067] For object A, in the collaborative document in state 3, there is an editing operation C performed by object B. Object A's information processing device needs to convert this editing operation C into C', and then apply C' to the collaborative document in state 3 to update the collaborative document to state 6. After the above process, the information processing device used by object A executes AB'C' in sequence, and the information processing device used by object B executes BC'A'' in sequence. In this way, both information processing devices will eventually display the collaborative document in state 6.

[0068] In its research on the two algorithms mentioned above, this application found that the first, CRDT-based conflict handling, is data structure-based, while the OT algorithm is operation-based. Comparatively, the latter is more suitable for collaborative document processing. Therefore, this application proposes an information processing scheme based on the OT algorithm. Specifically, when a collaborative document in a first state contains a first atomic operation and a second atomic operation, the tree structure corresponding to the collaborative document is obtained; the collaborative document is updated from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation; and the operation intent expressed by the second atomic operation is restored and transformed according to the operation intent expressed by the first atomic operation to obtain the transformed operation intent. The collaborative document is then updated from the second state to the third state based on the tree structure according to the transformed operation intent.

[0069] As can be seen, the above information processing solution uses a tree structure to handle conflicts in collaborative documents. This tree structure is naturally compatible with Office's OOXML data specification and the browser's DOM model, exhibiting good compatibility. It can implement complex data formats such as mind maps, flowcharts, and charts, as well as traditional rich text formats in Word or two-dimensional table structures in Excel. In short, the tree structure is compatible with many document formats. OOXML can be considered an international document format standard, while DOM, short for Document Object Model, is the data structure for HTML and XML documents. It provides a structured representation of documents and defines a way to access this structure from within a program, thereby changing the document's structure, style, and content.

[0070] The first atomic operation can include any one of moving a node, splitting a node, and merging a node. These operations share the common feature that they can all be replaced by one or more other operations. In existing technologies, these operations are performed by replacing them with one or more other operations; for example, moving a node is split into deleting a node and creating a new node. This disrupts the original intent of these operations. This application defines a first atomic operation to preserve the intent of these operations, allowing the tree structure or collaborative document to be updated according to the original intent.

[0071] The execution of a first atomic operation may affect the execution of a second atomic operation. For example, if the first and second atomic operations are performed on the same node in the tree structure, the node may change after the first atomic operation is completed. This embodiment of the application avoids the problem of the second atomic operation failing due to the execution of the first atomic operation affecting it by capturing the intent of the second atomic operation and restoring the captured intent, thereby improving the accuracy of conflict handling.

[0072] Based on the above information processing scheme, this application provides an information processing system, see [link to relevant documentation]. Figure 2 This is a schematic diagram of the structure of an information processing system provided for the implementation of this application. Figure 2 The information processing system may include a first information processing device 101, a second information processing device 102, and a document server 103. Both the first information processing device 101 and the second information processing device 102 can be connected to the document server 103 via wired or wireless means.

[0073] Both the first information processing device 101 and the second information processing device 102 can be terminal devices, such as smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, in-vehicle terminals, smart home appliances, smart voice interaction devices, etc.; the document server 103 can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0074] Both the first information processing device 101 and the second information processing device 102 can display collaborative documents in a first state. These collaborative documents can be displayed in a document application or in a browser. The document server 103 can provide operational support for collaborative documents for both the first information processing device 101 and the second information processing device 102. For example, a collaborative document in the first state can be created by a first object through the first information processing device 101. Specifically, the first object inputs a creation request for a collaborative document in the first information processing device 101, which forwards the request to the document server 103. The document server 103 then creates a collaborative document in the first state and notifies the first information processing device 101 to display it. When a first object triggers a sharing operation in the first information processing device 101 to share a collaborative document in the first state with a second object for collaborative editing, the first information processing device 101 sends the sharing operation back to the document server 103. The document server 103 then sends a notification message to the second information processing device 102. The notification message may include the collaborative document in the first state. When the notification message is triggered by the second object, the second information processing device 102 displays the collaborative document in the first state based on the notification message.

[0075] A first object can perform a first atomic operation on the collaborative document displayed in the first information processing device 101, and a second object can perform a second atomic operation on the collaborative document displayed in the second information processing device 102. The first atomic operation and the second atomic operation can be the same or different. An atomic operation can be understood as an operation that cannot be interrupted. An atomic operation is an editing operation on the collaborative document, such as inserting text, deleting text, modifying text, etc. For example, the first atomic operation can refer to inserting text content at a certain position in the collaborative document, and the second atomic operation can refer to moving the content at a certain position in the collaborative document to a new position; or the first atomic operation can refer to splitting a certain content in the collaborative document into two parts, and the second atomic operation can refer to selecting a region in the collaborative document, etc. The first information processing device 101 can transmit the first atomic operation to the document server 103, and the second information processing device 102 can transmit the second atomic operation to the document server 103.

[0076] As an optional implementation, the document server 103 transmits the first atomic operation to the second information processing device 102 and the second atomic operation to the first information processing device 101. Then, the first information processing device 101 and the second information processing device 102 each perform conflict resolution of the first atomic operation and the second atomic operation locally.

[0077] As another optional embodiment, the document server 103 performs conflict resolution on the first atomic operation and the second atomic operation for the first information processing device 101, and sends the collaborative document with the new state obtained after conflict resolution to the first information processing device 101 for display; and the document server 103 performs conflict resolution on the first atomic operation and the second atomic operation for the second information processing device 102, and sends the collaborative document with the new state obtained after conflict resolution to the second information processing device 102 for display.

[0078] In this embodiment, the first optional implementation described above is taken as an example. For the first information processing device, the first information processing device first responds to the first atomic operation, and then transforms the second atomic operation and applies it to the collaborative document. Specifically, when the first information processing device detects the first atomic operation and the second atomic operation, it can obtain the tree structure corresponding to the collaborative document; then, according to the operation intent expressed by the first atomic operation, it updates the collaborative document from a first state to a second state based on the tree structure; furthermore, according to the operation intent expressed by the first atomic operation table, it transforms the operation intent expressed by the second atomic operation to obtain a transformed operation intent, and according to the transformed operation intent, it updates the collaborative document from a second state to a third state based on the tree structure.

[0079] For the second information processing device, it first updates the collaborative document based on the tree structure according to the operation intent expressed by the second atomic operation. Then, it transforms the operation intent expressed by the first atomic operation based on the operation intent expressed by the second atomic operation to obtain the transformed operation intent, and updates the collaborative document based on the tree structure according to the transformed operation intent. After the above conflict handling, the first information processing device 101 and the second information processing device 102 can uniformly display a collaborative document in the third state.

[0080] Based on the information processing system described above, this application provides an information processing method. See also... Figure 3 This is a flowchart illustrating an information processing method provided in an embodiment of this application. Figure 3 The information processing method described above can be executed by the first information processing device in the aforementioned information processing system, specifically by the processor of the first information processing device. Figure 3The information processing method may include the following steps:

[0081] Step S301: When the collaborative document in the first state contains a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document.

[0082] Collaborative documents can refer to documents that support simultaneous collaborative editing by multiple people, such as... Figure 4 The image shown is a mind map that supports collaborative editing by multiple users. This mind map is a collaborative document. Figure 4 In the mind map shown, 401 indicates that region 402 is the selected area of ​​collaborating object W in the mind map, and 403 indicates that region 404 is the selected area of ​​collaborating object Q in the mind map. Each collaborating object edits the mind map in the corresponding selected area.

[0083] A collaborative document's tree structure can include multiple nodes, each corresponding to an operable element within the document. For example, if the collaborative document is a table document, a table item can be considered an operable element. Similarly, if the collaborative document is a presentation document, each page can be considered an operable element, as can the various shapes added to each page, such as triangles, circles, rectangles, and editable areas. See also... Figure 5a This is a schematic diagram illustrating how to convert collaborative documents into a tree structure, as provided in an embodiment of this application. Figure 5a A 401 error indicates a collaborative document, which can be any page of a presentation document, including a rectangle such as... Figure 5a 402 indicates a rectangle that may contain text content "xxxx", and any page may also include a composite shape such as Figure 5a The shape 503 formed by the dashed lines 3 is a composite shape, which is composed of two circular shapes; the tree structure obtained by converting the collaborative document described in 401 can be as follows: Figure 5aAs shown in page 404, Root is a root node that can represent any page of the presentation document. As a parent node, the root node includes two child nodes: a Shape node (as shown in page 41) and a ShapeGroup node (as shown in page 42), which are siblings. The Shape node (as shown in page 41) corresponds to rectangle 402 in the collaborative document, and the ShapeGroup node (as shown in page 42) corresponds to the combined shape 403 in the collaborative document 401. The Shape node (as shown in page 41) includes a Text node (as shown in page 45), which represents the text within rectangle 402. The ShapeGroup node also includes two child nodes: two Shape nodes (as shown in pages 43 and 44), which correspond to rectangle 404 and triangle 405, respectively, within the combined shape 403 in the collaborative document 401.

[0084] It should be noted that there are many ways to generate a tree structure from a collaborative document. Under different scenario requirements or in different products, appropriate methods can be used to convert a collaborative document into a tree structure. The above embodiments of this application only list one feasible implementation method.

[0085] This application defines N atomic operations based on a tree structure. See Table 1 for the N atomic operations provided in this application.

[0086] Table 1

[0087]

[0088]

[0089] The N atomic operations can be divided into several categories: Category I operations, Category II operations, text processing operations, and the set_selection operation. Category I operations include any one or more of the following: move_node, split_node, and merge_node. Category II operations include any one or more of the following: insert_node, delete_text, and set_node attributes. Text processing operations include adding text to nodes (insert_text), deleting text (delete_text), and modification operations. Modification operations refer to modifying existing text in a node, such as changing A to a or b to B; or deleting a specific text from an existing text.

[0090] In the N types of atomic operations, the first type of operation can actually be replaced by two operations: inserting a node and deleting a node. For example, moving a node can be replaced by deleting the node at the original path and then inserting the node at the new path; similarly, merging nodes can be replaced by deleting the two nodes to be merged and then inserting the node at the specified path; similarly, splitting nodes can be replaced by deleting the node to be split and then inserting the node at the specified path. In step S301, the first atomic operation can refer to the first type of operation, or it can also be other atomic operations of the N types of atomic operations, such as text processing operations, setting selection areas, and the second type of operation, etc.; similarly, the second atomic operation can also be any one of the N types of atomic operations. In the prior art, the first type of operation is not defined, so it is impossible to capture the operation intent of the first type of operation and modify the tree structure according to the operation intent of the first type of operation. Instead, the first type of operation is replaced by multiple other atomic operations. These multiple other atomic operations fail to retain the operation intent of the first type of operation, so the operation intent may be unclear when executing the first type of operation. Because the first type of operation is defined in this application, when executing the first type of operation, its operational intent can be captured and executed according to the captured operational intent. As an optional implementation, executing the first type of operation according to the captured operational intent means that the first type of operation can be executed as a whole without splitting it. As another optional implementation, executing the first type of operation according to the captured operational intent means that the first type of operation can be split into several other atomic operations, but these atomic operations all carry the operational intent of the first type of operation. Therefore, when executing these other atomic operations, it is clear that these atomic operations should be considered as a whole, and this whole is for the purpose of implementing the first type of operation, thus avoiding the need to split these atomic operations. This part will be described in detail later.

[0091] Furthermore, this application defines text processing operations, which are not defined in existing technologies. Therefore, it is impossible to modify the text within a node, such as adding or deleting text. Any modification to the text overwrites the current text, preventing incremental changes. Among the N atomic operations mentioned above, this application also defines setting a selection area. Setting a selection area corresponds to the operable element in a collaborative document being a selected location within the document. Selecting a location in a collaborative document may also lead to conflicts, requiring conflict resolution. However, existing technologies do not define such atomic operations, making conflict resolution impossible. Therefore, compared to existing technologies, this application defines richer atomic operations, enabling more comprehensive conflict resolution in collaborative documents and resolving more conflict scenarios, thus facilitating collaborative document updates.

[0092] This application also defines an atomic operation for node selection, which corresponds to the selection operation in collaborative documents. The selection area can be selected data or data of interest to the business code. For example, some businesses need to pay close attention to the latest position of certain data and require real-time monitoring to locate it at a specific time before proceeding to the next step. In this embodiment, the real-time monitoring can be preceded by obtaining user permission or authorization. Changes in data within the collaborative document also cause changes in the selection area. Since these changes are all caused by atomic operations, updating the selection area based on atomic operations is appropriate. Furthermore, the definition of atomic operations captures the user's intent, and the selection area, as an atomic operation, can also restore the intended intent during conflict resolution, meeting expectations. The biggest concern for business code during real-time monitoring is that collaborative editing can cause the position of the data of interest to shift. Using the `set_selection` atomic operation to monitor this is essentially using a collaborative approach to solve collaborative problems; this is the essence of the solution in this application.

[0093] In the N atomic operations, each atomic operation corresponds to an editing operation in the collaborative document. In the corresponding editing operations and atomic operations, the operable element to which the editing operation is performed also corresponds to the node to which the atomic operation is performed. For example, the atomic operation of inserting text into a node corresponds to the editing operation of adding text to the operable element corresponding to that node in the collaborative document; another example is the atomic operation of moving a node, which corresponds to the editing operation of moving the operable element corresponding to that node in the collaborative document.

[0094] Based on this, the first atomic operation can refer to the atomic operation corresponding to the first editing operation among N atomic operations, and the second atomic operation can refer to the atomic operation corresponding to the second editing operation among N atomic operations. The first editing operation is performed by a first object on a first operable element in the collaborative document through a first information processing device; the second editing operation is performed by a second object on a second operable element in the collaborative document through a second information processing device. The first editing operation and the second editing operation can be the same or different. Similarly, the first atomic operation and the second atomic operation can also be the same or different.

[0095] As discussed in the previous introduction to the OT algorithm, when collaborative documents in the same state receive editing operations from two different objects, the information processing device for each object first processes its own editing operation and then transforms the other editing operations. The same principle applies to atomic operations. When collaborative documents in the same state receive two atomic operations, one atomic operation is executed first, and the other atomic operation is transformed into a transformed atomic operation. Therefore, the first and second atomic operations in a collaborative document can also be transformed atomic operations obtained by converting other atomic operations.

[0096] Step S302: Update the collaborative document from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation.

[0097] As previously stated, the first atomic operation can be replaced by one or more atomic operations. However, if the first atomic operation is replaced by one or more atomic operations during actual execution, the intended operation expressed by the first atomic operation will be destroyed. For example, if the first atomic operation is to move a node, then the intended operation expressed by the first atomic operation is to move from one path to another.

[0098] Specifically, updating the collaborative document from a first state to a second state based on the tree structure according to the operational intent expressed by the first atomic operation can be: updating the tree structure according to the operational intent expressed by the first atomic operation; and mapping the collaborative document in the second state based on the updated tree structure. In one embodiment, the first atomic operation may include the operation object being the first node in the first path of the tree structure and the first operation data. The operational intent expressed by the first atomic operation is to modify the first node in the first path of the tree structure according to the first operation data. Therefore, updating the tree structure according to the operational intent expressed by the first atomic operation means modifying the first node in the first path of the tree structure according to the first operation data. For example, suppose in Figure 5a The node shown in 41 is the first node, and the path of the first node is [0]. Assume that in... Figure 5a The node mentioned in section 45 is the first node, and the path of the first node is [0, 0].

[0099] While defining N atomic operations in a tree structure, we can also define operation data items corresponding to each atomic operation. When each atomic operation is executed, the corresponding operation data is obtained according to the operation data items corresponding to each atomic operation. In other words, the operation data items corresponding to each atomic operation indicate which data needs to be obtained when executing this atomic operation. The operation data items only indicate which operation data needs to be obtained, but do not include the operation data itself. When each atomic operation is executed, the operation data specified in the operation data items of the corresponding atomic operation is obtained according to the editing operation and the tree structure. For example, in Table 1, the operation data item corresponding to the atomic operation insert_text can include the text insertion position within the node, which can be represented by offset, and the text to be inserted, which can be represented by text. As another example, the operation data item corresponding to the atomic operation insert_node can include the node to be inserted, which can be represented by node. Therefore, the first operation data included in the first atomic operation can be obtained according to the operation data items corresponding to the first atomic operation.

[0100] In one embodiment, if the first atomic operation is to move a node, then the first operation data corresponding to the first atomic operation may include the path of the first node in the tree structure after the move; then modifying the first node on the first path according to the first operation data to update the tree structure can mean: moving the first node in the tree structure from the original first path to the path indicated in the first operation data. Assuming the original path of the first node in the tree structure is [0], the path indicated in the first operation data is [2], and the first atomic operation is represented by A, then the first atomic operation can be represented as:

[0101] A=move_node: {path: [0], newPath: [2]};

[0102] Assuming in Figure 5a In the diagram, node 41 is the first node. After performing the first atomic operation on the first node, the tree structure changes as follows: Figure 5a The 404 error message in the middle is updated as shown below. Figure 5b As shown in Figure 405. It should be understood that if the first node being moved has child nodes, then those child nodes can also be moved along with the first node.

[0103] In another embodiment, if the first atomic operation is to split a node, the first operation data refers to the splitting position of the child nodes included in the first node. For example, if the first node is split into node A and node B, then the splitting position of the child nodes in the first operation data is taken as a dividing point. The child nodes before the splitting position are taken as the child nodes of node A, and the child nodes located at the splitting position and the child nodes after the splitting position are assigned to node B as the child nodes of node B.

[0104] Assume the first node refers to Figure 5a The node shown in 42 has two child nodes, namely the node shown in 43 and the node shown in 44. The path of the first node in the tree structure is [1]. Assuming that the first node is split into two nodes, the split position of the child node of the first node in the first operation data is 1, and the first atomic operation is represented by A, then the first atomic operation can be represented as:

[0105] A=split_node: {path: [1], position: 1}

[0106] Following this first atomic operation, the node shown in 42 is split into two nodes, respectively. Figure 5c Since the child node of the first node has a split position of 1, the child node before the split position, such as the node shown in 43, is assigned to the node shown in 411 as a child node of the node shown in 411. The child node at the split position, such as the node shown in 44, is assigned to the node shown in 412 as a child node of the node shown in 412.

[0107] In another embodiment, if the first atomic operation is to merge nodes, the first operation data is the path of the node to be merged in the tree structure. For example, if the first node and the second node are merged according to the first atomic operation, then the first operation data is the path of the second node in the tree structure. After merging the first node and the second node, a new node is obtained. The path of this new node in the tree structure can be determined based on the paths of the first node and the second node. For example, either the path of the first node or the path of the second node can be used as the path of the new node; or, the earlier path of the first node or the later path of the second node can be used as the path of the new node.

[0108] For example, assuming the path of the first node in the tree structure is [0], and the first atomic operation is denoted by A, if the first atomic operation is to merge nodes, then the first atomic operation can be represented as:

[0109] A = merge_node: {path: [0]}

[0110] For merging nodes, the first operation only needs to specify the path of the node to be merged, which will then be merged with its adjacent left or right sibling node. Which node to merge with is pre-defined. Let's assume the first node refers to... Figure 5a The nodes shown in 41 are merged, with the first node and the second node being... Figure 5a The tree structure obtained by merging the first and second nodes according to the first atomic operation shown in node 42 can be as follows: Figure 5d As shown. In Figure 5d In this diagram, 413 represents the node resulting from the merger of the first and second nodes. The path to this node can be the path to the first node. If both the first and second nodes have child nodes, after merging them, the child nodes of the first and second nodes become the child nodes of the merged node. For example, before the merger, the second node has two child nodes, namely the node shown in 43 and the node shown in 44; after the merger, these two child nodes become the child nodes of the new node 413.

[0111] Therefore, updating the tree structure according to the operational intent expressed by the first atomic operation means performing the corresponding operation on the tree structure according to the operational intent expressed by the first atomic operation. For example, if the operational intent expressed by the first atomic operation is to move the first node from the first path to a new path, then the move is performed. Optionally, performing the move means moving the first node from the first path to a new path. Alternatively, the move can also be divided into creating a node and deleting a node, and both creating and deleting nodes are associated with the operational intent of moving the node. In this way, whether creating or deleting a node, it can be known that these two operations are performed to restore the operational intent of moving the node, rather than simply creating or deleting.

[0112] Optionally, the first atomic operation may also include a second type of operation or a text processing operation. As mentioned above, the second type of operation may include any one of the following: inserting a node, deleting a node, and setting node attributes. If the first atomic operation is a text processing operation, then the first operation data is any one of the following: the newly added text, the text to be deleted, and the text corresponding to the modification operation. If the first atomic operation is inserting a node, then the first operation data refers to the node path and node content of the inserted node. If the first atomic operation is deleting, then the first operation data refers to the identifier of the node to be deleted. And if the first atomic operation is setting node attributes, then the first operation data is empty.

[0113] In one embodiment, after performing a first atomic operation on the tree structure, the tree structure changes. The updated tree structure can then be mapped to obtain a new state of the collaborative document, which can be considered the second state. For example, suppose the first atomic operation is splitting nodes. After modifying the tree structure according to the intention expressed by the first atomic operation, the tree structure is updated. The updated tree structure can be viewed as follows: Figure 5c As shown in Figure 406; the collaborative document obtained by mapping the updated tree structure can be as follows: Figure 6 As shown in Figure 501, in the collaborative document described in 501, 502 and 503 respectively represent the split nodes 411 and 412 in the tree structure shown in 406, and the child nodes under 411 and 412 correspond to the shapes included in 502 and 503 in the collaborative document described in 501. Comparing the collaborative document described in 401 with the collaborative document shown in 501, it can be seen that the two collaborative documents have different states. It is assumed that the collaborative document shown in 401 is in the first state, and the collaborative document shown in 501 is in the second state.

[0114] Step S303: Based on the operational intent expressed by the first atomic operation, perform intent reduction transformation on the operational intent expressed by the second atomic operation to obtain the transformed operational intent.

[0115] The second atomic operation can include the operation object being the second node located on the second path in the tree structure, and the second operation data. The operation intent expressed by the second atomic operation is to modify the second node located on the second path according to the second operation data. The reason for restoring the operation intent expressed by the second atomic operation based on the operation intent expressed by the first atomic operation is that after modifying the first node in the tree structure according to the operation intent expressed by the first atomic operation, it may cause certain changes to the second node itself or the path of the second node, such as changes in the path of the second node, changes in the number of second nodes, changes in the content or state of the second node, etc. In actual modification, if the second node is modified at the second path according to the operation intent expressed by the second atomic operation, it may result in the operation object not being found or the wrong node being modified.

[0116] Therefore, in order to ensure the accuracy of the execution of atomic operations, after modifying the tree structure according to the operation intention expressed by the first atomic operation, the operation intention expressed by the second atomic operation must be modified to ensure that the second node that the second atomic operation originally wanted to modify can be accurately modified according to the modified operation intention.

[0117] For example, suppose the first node and the second node are the same node. The intention of the first atomic operation is to move the first node on path 1 to path 2; the intention of the second atomic operation is to modify the attributes of the first node on path 1. That is, the object of the second atomic operation is the first node, regardless of where the first node is moved. If we don't restore the intention of the second atomic operation to its original intention, and instead modify the first node in the tree structure according to the intention of the second atomic operation, the first node might not be found on the original path 1 because it has been moved. However, if we restore the intention of the second atomic operation to its original intention, the resulting intention is to modify the first node on path 2 according to the second operation.

[0118] In one embodiment, performing intent restoration transformation on the intent expressed by the second atomic operation based on the intent expressed by the first atomic operation to obtain the transformed intent includes: determining the relevant change information of the second node at the second path after modifying the first node at the first path according to the first operation data; and performing intent restoration transformation on the intent expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed intent.

[0119] Specifically, if the relevant change information of the second node includes path changes, indicating that the second node changes from the second path to the third path in the tree structure, then the intention of the operation expressed by the second atomic operation is restored and transformed according to the relevant change information of the second node to obtain the transformed operation intention. This can include: modifying the second path included in the second atomic operation to the third path, and determining the operation intention expressed by the modified second atomic operation as the transformed operation intention. That is to say, after modifying the first node according to the operation intention expressed by the first atomic operation, the second node changes from being on the second path to the third path. The second atomic operation originally intended to operate on the second node. In order to restore the operation intention of the second atomic operation, intention restoration and transformation are required. In the case that the path of the second node has changed, the original operation intention of the second atomic operation is restored. This ensures that the transformed operation intention after intention restoration and transformation refers to modifying the second node in the third path according to the data of the second atomic operation.

[0120] It should be understood that after modifying the first node according to the operational intent expressed by the first atomic operation, the path of the second node may change in any of the following situations: the first node and the second node are the same; or, the first node and the second node have the same parent node, for example, the parent node of the first node and the second node are both the root node. Suppose the first node is the first child node under the root node and the second node is the second child node under the root node. Then the first path of the first node can be [0] and the second path of the second node can be [1]. If the first node is moved from the first path, then the second node becomes the first child node under the root node, and the path of the second node changes from [1] to [0].

[0121] In one embodiment, if the relevant change information of the second node includes node state change information, such as the second node being split or the second node being merged with other nodes, then the intention restoration transformation of the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intention may include: obtaining the fourth path of the new node generated by the node state change of the second node in the tree structure; modifying the second path in the second atomic operation to the fourth path, and determining the operation intention expressed by the modified second atomic operation as the transformed operation intention.

[0122] It should be understood that modifying the first node according to the operational intent expressed by the first atomic operation can cause a change in the node state of the second node, which can occur in any of the following situations: The first and second nodes are the same node, and the first atomic operation is to split the node; in this case, the second node is effectively split. The first and second nodes are different nodes, and the first atomic operation is to merge the first and second nodes; in this case, the second node is merged with other nodes, and that node is the first node. Alternatively, the first and second nodes are the same node, and the first atomic operation is to merge nodes, that is, to merge the first node with a third node; in this case, the second node is effectively merged with the third node. All of these situations will cause a change in the node state of the second node. Alternatively, the first atomic operation may insert or delete text in the second node.

[0123] In summary, if the state of the second node changes, regardless of whether the second node is eventually merged or split into several nodes, the second operation data in the second atomic operation will always be applied to the second node. If the second node is merged with other nodes, then the second operation data will be applied to the merged node; if the second node is split into multiple nodes, then the second operation data will be applied to each of the resulting nodes.

[0124] In one embodiment, the relevant change information of the second node may further include indication information that the second node has not changed. Then, the intention restoration and transformation of the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intention may include: determining the operation intention expressed by the second atomic operation as the transformed operation intention.

[0125] In one embodiment, if the relevant change information of the second node includes an indication that the second node has been deleted, then the intention restoration transformation of the operation intention expressed by the second atomic operation is performed based on the relevant change information of the second node to obtain the transformed operation intention. This includes: setting the operation intention expressed by the second atomic operation to empty, and using the modified operation intention expressed by the second atomic operation as the transformed operation intention. The situation that causes the second node to be deleted may be that the first node and the second node are the same node, and the first atomic operation belongs to the deletion node category of the second type of operation. In other words, if the second node no longer exists after the first atomic operation, then the second atomic operation has no operation object, so the intention restoration transformation of the second atomic operation will not yield an operation object; that is, the transformed operation intention is empty.

[0126] Step S304: Based on the tree structure, update the collaborative document from the second state to the third state according to the transformed operation intent.

[0127] After obtaining the transformed operational intent, the tree structure can be updated according to the transformed operational intent, and the updated tree structure can be mapped to obtain a collaborative document. At this time, the collaborative document is in the third state.

[0128] In one embodiment, updating the tree structure according to the transformed operation intent and updating the tree structure according to the operation intent expressed by the first atomic operation have similar feasible implementation methods. For details on how to update the tree structure according to the transformed operation intent, please refer to the foregoing, and it will not be repeated here. In summary, the transformed operation intent does exactly what it wants to do to the tree structure. For example, if the transformed operation intent is to split the second node in the tree structure that has moved to a new path, then the second node at the new path is split; similarly, if the transformed operation intent is to set attributes for the split second node in the tree structure, then attributes are set for each of the multiple nodes obtained from the split.

[0129] It should be understood that when the first atomic operation is a type 1 operation, if the tree structure is not updated according to the operational intent expressed by the first atomic operation, it will be replaced by two or more other atomic operations. In this case, if the operands of the first and second atomic operations are the same node, it's possible that after splitting the first atomic operation into two atomic operations, the operand of the second atomic operation no longer exists. For example, suppose the first atomic operation is moving a node, and the second atomic operation is setting a node attribute; the operands of the first and second atomic operations are the same.

[0130] For example, if the first atomic operation is to move a node, then it can be broken down into deleting a node and creating a node. If the object of the second atomic operation is the same node as the object of the first atomic operation, for instance, if the objects of both the first and second atomic operations are nodes on the path [1,0], and the first atomic operation is to move the node on path [1,0] to path [0], then it can be broken down into deleting a node. The atomic operations for deleting and inserting a node can be represented as follows:

[0131] delete=delete_node:{path:[1,0],node:shape}

[0132] insert=insert_node:{path:[0],node:shape}

[0133] The second atomic operation sets the attribute of the node at path [1,0]. The second atomic operation can be represented as:

[0134] set=set_node:{path:[1,0],property:xxx}

[0135] A diagram illustrating the conflict resolution between splitting and moving nodes and setting node attributes can be seen as follows: Figure 7a As shown, firstly, the node at path [1,0] is deleted from the tree structure corresponding to the collaborative document in state 1 to update the tree structure. Then, the node attribute setting is converted. However, since the node at path [1,0] has been deleted, the object for setting the node attribute no longer exists, so setting the node attribute is converted to a null operation, as shown. Figure 7a The "empty" operation refers to a no-operation operation. The updated tree structure corresponds to state 4 of the collaborative document. A node is inserted at path [0] in the tree structure corresponding to the collaborative document in state 4. The result of converting the empty operation and the inserted node is still an empty operation. In other words, splitting the moving node and handling the conflict may cause other operations to be lost.

[0136] When using the embodiments of this application to perform atomic operations of moving nodes and setting node attributes, the loss of operations can be avoided. In the embodiments of this application, since the first type of operation is defined, although the first type of operation can be broken down and replaced by one or more other atomic operations, the first type of operation can be executed as a whole during execution. Continuing with the above example, see... Figure 7b This is a schematic diagram illustrating conflict handling for moving nodes and setting node attributes, provided in an embodiment of this application. The atomic operation of moving a node can be represented as: move = move_node:{path:[1,0],newPath:[0]}. The first information processing device first performs the atomic operation of moving a node on the tree structure corresponding to the collaborative document in state 1, that is, moves the node at path [1,0] to path [0]. Then, it transforms the setting of node attributes, and the transformed atomic operation can be: set' = T(set,move) = set_node:{path:[0],property:xxx}. Executing this transformation operation means setting the attribute of the node at path [0].

[0137] The N atomic operations defined in this application also include node selection. The conversion logic between the atomic operation of setting node attributes and the atomic operation of node selection is very similar. If we change the example above from setting node attributes to node selection, that is, the second atomic operation refers to selecting the node at path [1,0]. If a node is then inserted at path [0], the tree structure changes, and the second atomic operation is transformed into selecting the node at path [2,0]. If there are multiple atomic operations for node selection, such as selecting multiple nodes in the tree structure and wanting to delete them all at once or set their styles all at once, multiple node selections can be combined to resolve conflicts.

[0138] In this embodiment, when a collaborative document in its first state contains both a first atomic operation and a second atomic operation, the tree structure corresponding to the collaborative document is obtained. Conflict resolution is then performed on the first and second atomic operations based on the tree structure, ensuring that the first object that performed the first atomic operation and the second object that performed the second atomic operation can see a collaborative document in the same state after they have each edited the document. It should be understood that tree structures have good compatibility and can express a wide variety of complex data; that is, many types of collaborative documents can be converted into tree structures. Therefore, conflict resolution based on tree structures for collaborative documents has a wide range of applications and strong compatibility.

[0139] This application, when handling conflicts between the first and second atomic operations based on a tree structure, first updates the collaborative document according to the operational intent of the first atomic operation. Then, it captures the operational intent of the second atomic operation, restores the captured operational intent of the second atomic operation based on the operational intent expressed by the first atomic operation, and obtains the transformed operational intent. The collaborative document is then updated again according to the transformed operational intent. The first atomic operation can include a first type of operation, which includes any one of moving nodes, splitting nodes, and merging nodes. These operations share the common feature that they can all be replaced by one or more operations. In the prior art, the first type of operation is replaced by one or more operations, such as moving a node being split into deleting a node and creating a new node, thus destroying the original operational intent of these operations. In the embodiments of this application, a first type of operation is defined among N types of atomic operations. Therefore, the operational intent of the first type of operation can be preserved during conflict handling, allowing the tree structure or collaborative document to be updated according to the operational intent.

[0140] The execution of a first atomic operation may affect the execution of a second atomic operation. For example, if the first and second atomic operations are performed on the same node in the tree structure, the node may change after the first atomic operation is completed. This embodiment of the application avoids the problem of the second atomic operation failing due to the execution of the first atomic operation affecting it by capturing the intent of the second atomic operation and restoring the captured intent, thereby improving the accuracy of conflict handling.

[0141] Based on the above-described information processing method embodiments, this application provides a process for conflict resolution based on a cooperative algorithm. This cooperative algorithm can run in the aforementioned first information processing device, which calls the cooperative algorithm to handle conflicts in atomic operations. It should be noted that the cooperative algorithm's input each time is two arrays of atomic operations; that is, each input consists of atomic operation groups for two objects. Each atomic operation array includes one or more atomic operations input for one object. If multiple atomic operations input for different objects exist in a collaborative document under the same state, then these atomic operations are processed pairwise for conflict resolution.

[0142] The conflict resolution process based on cooperative algorithms can be roughly summarized as follows:

[0143] s1: Receives two atomic operation arrays for two objects. An atomic operation array contains one or more atomic operations produced by an object in a collaborative document in a state.

[0144] s2: Perform multi-conflict handling according to the aforementioned multi-conflict handling method. If, during multi-conflict handling, an atomic operation is transformed into multiple atomic operations, for example, the atomic operation generated by object 1 in a collaborative document in a certain state is splitting nodes, such as in... Figure 8 In this context, A represents the atomic operation of splitting nodes. Therefore, the atomic operation array for object 1 is [A]. The atomic operation generated by object 2 in a collaborative document under a certain state is moving nodes, such as... Figure 8 The operations and settings of node attributes indicated by C are as follows: Figure 8 If the operation indicated by D is given, then the atomic operation array corresponding to object 2 is [C, D]. For the information processing device used by the object that generates atomic operation A, atomic operation A must be executed first, and then atomic operations C and D are transformed in sequence. When transforming atomic operation C, since atomic operation C needs to be transformed with atomic operation A, according to the aforementioned transformation principle, atomic operation C is transformed into two atomic operations C1' and C2', and atomic operation D is transformed into one atomic operation D'. Therefore, the atomic operation array corresponding to object 2 contains a nested atomic operation array, so the atomic operation array of object 2 changes from [C, D] to [[C1', C2'], D'].

[0145] s3: When a nested atomic operation array needs to be transformed with the next atomic operation, a recursive call is made. The parameters passed to the cooperative algorithm become the nested atomic array and the next atomic operation array. This atomic operation array can be a single element (i.e., excluding the nested atomic operation array) or it can include nested atomic operation arrays, for example, in... Figure 8 The nested atomic arrays [C1', C2'] and [B] are used as input parameters for the cooperative algorithm and are recursively called.

[0146] s4: After the recursive call is completed, the nested atomic data may be nested again. At this time, it is necessary to expand the nested atomic array inside to ensure that there is no more nesting inside. This ensures that the nested atomic array included in the atomic operation array does not exceed two levels in the process of this cooperative algorithm, thereby reducing the depth of recursion.

[0147] s5: After the transformation is complete, finally expand all remaining nested atomic arrays and output two one-dimensional arrays. Atomic operations, such as in... Figure 8The final outputs of the collaborative algorithm are two one-dimensional arrays: [A”, B1”', B2”'] and [C1”, C2”, D”']. Ultimately, the information processing device that generates atomic operation A executes the following atomic operations sequentially on the tree structure corresponding to the collaborative document in a certain state: A, B, C1”, C2”, D”'. Then, the information processing device that generates atomic operation B executes the following atomic operations sequentially on the tree structure corresponding to the collaborative document in the same state: C, D, A”, B1”', B2”'. Finally, both information processing devices can obtain collaborative documents in the same state.

[0148] It should be understood that tree structures have good compatibility and can express a wide variety of complex data. In other words, many types of collaborative documents can be converted into tree structures. Therefore, using tree structures for conflict resolution in collaborative documents has a wide range of applications and strong compatibility. Furthermore, this application's embodiments avoid the problem of one atomic operation being lost or malfunctioning due to the execution of another atomic operation affecting its transformation by capturing the intent of the atomic operation and restoring the captured intent. This provides accuracy in conflict resolution.

[0149] Furthermore, this application defines N types of atomic operations, which comprehensively encompass the most commonly used atomic operations in conflict resolution. Of particular note is the definition of a first type of operation within these N atomic operations. In existing conflict resolution methods, this type of operation is often replaced by one or more other operations, thus disrupting its original intent. This application provides a solution by defining this first type of operation within the N atomic operations. Therefore, during conflict resolution, this first type of operation is not replaced by one or more other operations but remains a separate atomic operation. This preserves the intent of the first type of operation and improves the accuracy of conflict resolution. Additionally, the N atomic operations also define node selection atomic operations. Node selection corresponds to editing selection areas in collaborative documents. As an atomic operation, selection can also restore intent during conflict resolution. In business monitoring scenarios, using the selection atomic operation for monitoring is equivalent to using a collaborative approach to solve collaborative problems.

[0150] Based on the embodiments of the information processing device method described above, this application also provides an information processing apparatus, see [link to relevant documentation]. Figure 9 This is a schematic diagram of the structure of an information processing device provided in an embodiment of this application. Figure 9 The information processing device can operate the following units:

[0151] The acquisition unit 901 is used to acquire the tree structure corresponding to the collaborative document when the collaborative document in the first state contains a first atomic operation and a second atomic operation;

[0152] Update unit 902 is used to update the collaborative document from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation; the first atomic operation includes a first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0153] The conversion unit 903 is used to perform intention restoration conversion on the operation intention expressed by the second atomic operation according to the operation intention expressed by the first atomic operation, so as to obtain the converted operation intention;

[0154] The update unit 902 is further configured to update the collaborative document from the second state to the third state based on the tree structure according to the transformed operation intention.

[0155] In one embodiment, the tree structure includes multiple nodes, each node representing an operable element in the collaborative document; the parent-child relationship between the multiple nodes is used to represent the inclusion relationship between operable elements; each of the N atomic operations corresponds to an editing operation; the first atomic operation refers to any one of the following: the atomic operation corresponding to the first editing operation in the set of N atomic operations, and the atomic operation transformed from the third atomic operation; the second atomic operation refers to any one of the following: the atomic operation corresponding to the second editing operation in the set of N atomic operations, and the atomic operation transformed from the fourth atomic operation;

[0156] Wherein, the first editing operation is performed by a first object on a first operable element in the collaborative document through a first information processing device; the second editing operation is performed by a second object on a second operable element in the collaborative document through a second information processing device; the node to which the first atomic operation is performed corresponds to the first operable element, and the node to which the second atomic operation is performed corresponds to the second operable element.

[0157] In one embodiment, the N atomic operations include a first type of operation, a second type of operation, a text processing operation, and a selection area setting operation. Atomic operations belonging to the second type of operation are irreplaceable. The first type of operation includes any one or more of moving nodes, splitting nodes, and merging nodes. The second type of operation includes any one or more of inserting nodes, deleting nodes, and setting node attributes. The text processing operation includes adding text, deleting text, or modifying text in a node. The second atomic operation is any one of the N atomic operations.

[0158] In one embodiment, the first atomic operation includes an operation object that is a first node in the first path of the tree structure and first operation data; the operation intent expressed by the first atomic operation is to modify the first node in the first path according to the first operation data; when the update unit 902 updates the collaborative document from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation, the update unit 902 performs the following steps:

[0159] The tree structure is updated by modifying the first node located on the first path according to the first operation data;

[0160] The collaborative document in its second state is obtained based on the updated tree structure mapping.

[0161] In one embodiment, if the first atomic operation is to move a node, then the first operation data is the path of the first node in the tree structure after the move is performed; if the first atomic operation is to split a node, then the first operation data refers to the split position of the child nodes included in the first node; if the first atomic operation is to merge a node, then the first operation data is the path of the first node in the tree structure.

[0162] In one embodiment, the first atomic operation further includes any one or more of the following: a second type of operation, a text processing operation, and a selection area setting operation; if the first atomic operation is a text processing operation, then the first operation data is any one of the following: text added to the first node, text to be deleted, or text corresponding to the modification operation; if the first atomic operation is an insertion node, then the first operation data refers to the path of the first node and the node content of the first node; if the first atomic operation is a deletion node, then the first operation data refers to the identifier of the first node; if the first atomic operation is a selection area setting operation, then the first operation data is empty; if the first atomic operation is a node attribute setting operation, then the first operation data is the node attribute to be set.

[0163] In one embodiment, the second atomic operation includes an operation object that is a second node in the second path of the tree structure and second operation data; the operation intent expressed by the second atomic operation is to modify the second node in the second path according to the second operation data; when the conversion unit 903 performs intent restoration conversion on the operation intent expressed by the second atomic operation according to the operation intent expressed by the first atomic operation to obtain the converted operation intent, it performs the following steps:

[0164] After modifying the first node at the first path according to the first operation data, determine the relevant change information of the second node at the second path;

[0165] Based on the relevant change information of the second node, the intention expressed by the second atomic operation is restored and transformed to obtain the transformed intention.

[0166] In one embodiment, if the relevant change information of the second node includes a path change, wherein the path change indicates that the second node changes from a second path to a third path in the tree structure, then when the conversion unit 903 performs intent restoration conversion on the operation intent expressed by the second atomic operation based on the relevant change information of the second node to obtain the converted operation intent, it performs the following steps:

[0167] The second path included in the second atomic operation is modified to the third path, and the operation intent expressed by the modified second atomic operation is determined as the transformed operation intent.

[0168] In one embodiment, if the relevant change information of the second node includes node state change information, wherein the node state change information includes the second node being split or the second node being merged with other nodes; then when the conversion unit 903 performs intention restoration conversion on the operation intention expressed by the second atomic operation according to the relevant change information of the second node to obtain the converted operation intention, it performs the following steps:

[0169] Obtain the fourth path in the tree structure for the new node generated by the node state change of the second node;

[0170] The second path in the second atomic operation is modified to the fourth path, and the operation intent expressed by the modified second atomic operation is determined as the transformed operation intent.

[0171] In one embodiment, the relevant change information of the second node includes indication information that the second node has not changed; then, when the conversion unit 903 performs intention restoration conversion on the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the converted operation intention, it performs the following steps:

[0172] The operational intent expressed by the second atomic operation is taken as the transformed operational intent.

[0173] In one embodiment, the relevant change information of the second node includes indication information that the second node has been deleted. When the conversion unit 903 performs intention restoration conversion on the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the converted operation intention, it performs the following steps:

[0174] Set the operation intent expressed by the second atomic operation to empty, and use the operation intent expressed by the modified second atomic operation as the transformed operation intent.

[0175] According to one embodiment of this application, Figure 3 The information processing method shown can involve various steps that can be derived from... Figure 9 This is performed by the various units within the information processing apparatus shown. For example, Figure 3 The aforementioned step S301 can be performed by Figure 9 The acquisition unit 901 in the information processing device executes the steps S302 and S3304, which can be performed by... Figure 9 The update unit 902 in the information processing device is responsible for executing step S303; step S303 can be performed by... Figure 9 The conversion unit 903 in the information processing device performs the operation.

[0176] According to another embodiment of this application, Figure 9 The various units in the information processing apparatus shown can be individually or entirely merged into one or more other units, or some of the units can be further divided into multiple functionally smaller units. This achieves the same operation without affecting the technical effects of the embodiments of this application. The above-mentioned units are divided based on logical functions. In practical applications, the function of one unit can also be implemented by multiple units, or the function of multiple units can be implemented by one unit. In other embodiments of this application, the information processing apparatus may also include other units. In practical applications, these functions can also be implemented with the assistance of other units, and can be implemented collaboratively by multiple units.

[0177] According to another embodiment of this application, the following can be achieved by running on a general-purpose computing device, such as a computer, which includes processing elements and storage elements such as a central processing unit (CPU), random access memory (RAM), and read-only memory (ROM), a device capable of performing operations such as... Figure 3 The computer program (including program code) for each step involved in the corresponding method shown, to construct such... Figure 9 The information processing apparatus shown herein, and the information processing method for implementing the embodiments of this application, are described. The computer program may be recorded on, for example, a computer-readable storage medium, loaded onto the information processing device via the computer-readable storage medium, and run therein.

[0178] This application, when handling conflicts between the first and second atomic operations based on a tree structure, first updates the collaborative document according to the operational intent of the first atomic operation. Then, it captures the operational intent of the second atomic operation, restores the captured operational intent of the second atomic operation based on the operational intent expressed by the first atomic operation, and obtains the transformed operational intent. The collaborative document is then updated again according to the transformed operational intent. The first atomic operation can include a first type of operation, which includes any one of moving nodes, splitting nodes, and merging nodes. These operations share the common feature that they can all be replaced by one or more operations. In the prior art, the first type of operation is replaced by one or more operations, such as moving a node being split into deleting a node and creating a new node, thus destroying the original operational intent of these operations. In the embodiments of this application, a first type of operation is defined among N types of atomic operations. Therefore, the operational intent of the first type of operation can be preserved during conflict handling, allowing the tree structure or collaborative document to be updated according to the operational intent.

[0179] The execution of a first atomic operation may affect the execution of a second atomic operation. For example, if the first and second atomic operations are performed on the same node in the tree structure, the node may change after the first atomic operation is completed. This embodiment of the application avoids the problem of the second atomic operation failing due to the execution of the first atomic operation affecting it by capturing the intent of the second atomic operation and restoring the captured intent, thereby improving the accuracy of conflict handling.

[0180] Based on the above-described information processing method and apparatus embodiments, this application also provides an information processing device, see [link to relevant documentation]. Figure 10 This is a schematic diagram of the structure of an information processing device provided in an embodiment of this application. Figure 10 The information processing device may include a processor 1001, an input interface 1002, an output interface 1003, and a computer storage medium 1004. The processor 1001, input interface 1002, output interface 1003, and computer storage medium 1004 may be connected via a bus or other means.

[0181] The computer storage medium 1004 can be stored in the memory of the information processing device. The computer storage medium 1004 is used to store computer programs, and the processor 1001 is used to execute the computer programs stored in the computer storage medium 1004. The processor 1001 (or CPU (Central Processing Unit)) is the computing and control core of the information processing device, and is suitable for implementing one or more computer programs, specifically for loading and executing them.

[0182] When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document;

[0183] The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0184] Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent;

[0185] According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

[0186] This application, when handling conflicts between the first and second atomic operations based on a tree structure, first updates the collaborative document according to the operational intent of the first atomic operation. Then, it captures the operational intent of the second atomic operation, restores the captured operational intent of the second atomic operation based on the operational intent expressed by the first atomic operation, and obtains the transformed operational intent. The collaborative document is then updated again according to the transformed operational intent. The first atomic operation can include a first type of operation, which includes any one of moving nodes, splitting nodes, and merging nodes. These operations share the common feature that they can all be replaced by one or more operations. In the prior art, the first type of operation is replaced by one or more operations, such as moving a node being split into deleting a node and creating a new node, thus destroying the original operational intent of these operations. In the embodiments of this application, a first type of operation is defined among N types of atomic operations. Therefore, during conflict handling, the first type of operation can be executed as a single atomic operation, and its operational intent can be preserved, allowing the tree structure or collaborative document to be updated according to the operational intent.

[0187] The execution of a first atomic operation may affect the execution of a second atomic operation. For example, if the first and second atomic operations are performed on the same node in the tree structure, the node may change after the first atomic operation is completed. This embodiment of the application avoids the problem of the second atomic operation failing due to the execution of the first atomic operation affecting it by capturing the intent of the second atomic operation and restoring the captured intent, thereby improving the accuracy of conflict handling.

[0188] This application embodiment also provides a computer storage medium (memory), which is a memory device of an information processing device used to store programs and data. It is understood that the computer storage medium here may include the built-in storage medium of the information processing device, or it may include an extended storage medium supported by the information processing device. The computer storage medium provides storage space, which stores the operating system of the information processing device. Furthermore, one or more computer programs suitable for loading and execution by the processor 1001 are also stored in this storage space. It should be noted that the computer storage medium here may be a high-speed RAM memory, or a non-volatile memory, such as at least one disk storage device; optionally, it may also be at least one computer storage medium located remotely from the aforementioned processor.

[0189] In one embodiment, one or more computer programs stored in the computer storage medium may be loaded and executed by the processor 1001:

[0190] When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document;

[0191] The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0192] Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent;

[0193] According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

[0194] In one embodiment, the tree structure includes multiple nodes, each node representing an operable element in the collaborative document; the parent-child relationship between the multiple nodes is used to represent the inclusion relationship between operable elements; each of the N atomic operations corresponds to an editing operation; the first atomic operation refers to any one of the following: the atomic operation corresponding to the first editing operation in the set of N atomic operations, and the atomic operation transformed from the third atomic operation; the second atomic operation refers to any one of the following: the atomic operation corresponding to the second editing operation in the set of N atomic operations, and the atomic operation transformed from the fourth atomic operation;

[0195] Wherein, the first editing operation is performed by a first object on a first operable element in the collaborative document through a first information processing device; the second editing operation is performed by a second object on a second operable element in the collaborative document through a second information processing device; the node to which the first atomic operation is performed corresponds to the first operable element, and the node to which the second atomic operation is performed corresponds to the second operable element.

[0196] In one embodiment, the N atomic operations include a first type of operation, a second type of operation, a text processing operation, and a selection area setting operation. Atomic operations belonging to the second type of operation are irreplaceable. The first type of operation includes any one or more of moving nodes, splitting nodes, and merging nodes. The second type of operation includes any one or more of inserting nodes, deleting nodes, and setting node attributes. The text processing operation includes adding text, deleting text, or modifying text in a node. The second atomic operation is any one of the N atomic operations.

[0197] In one embodiment, the first atomic operation includes an operation object that is a first node in the first path of the tree structure and first operation data; the operation intent expressed by the first atomic operation is to modify the first node in the first path according to the first operation data; when the processor 1001 updates the collaborative document from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation, the processor 1001 performs the following steps:

[0198] The tree structure is updated by modifying the first node located on the first path according to the first operation data;

[0199] The collaborative document in its second state is obtained based on the updated tree structure mapping.

[0200] In one embodiment, if the first atomic operation is to move a node, then the first operation data is the path of the first node in the tree structure after the move is performed; if the first atomic operation is to split a node, then the first operation data refers to the split position of the child nodes included in the first node; if the first atomic operation is to merge a node, then the first operation data is the path of the first node in the tree structure.

[0201] In one embodiment, the first atomic operation further includes any one or more of the following: a second type of operation, a text processing operation, and a selection area setting operation; if the first atomic operation is a text processing operation, then the first operation data is any one of the following: text added to the first node, text to be deleted, or text corresponding to the modification operation; if the first atomic operation is an insertion node, then the first operation data refers to the path of the first node and the node content of the first node; if the first atomic operation is a deletion node, then the first operation data refers to the identifier of the first node; if the first atomic operation is a selection area setting operation, then the first operation data is empty; if the first atomic operation is a node attribute setting operation, then the first operation data is the node attribute to be set.

[0202] In one embodiment, the second atomic operation includes an operation object that is a second node in the second path of the tree structure and second operation data; the operation intent expressed by the second atomic operation is to modify the second node in the second path according to the second operation data; when the processor 1001 performs intent restoration transformation on the operation intent expressed by the second atomic operation according to the operation intent expressed by the first atomic operation to obtain the transformed operation intent, it performs the following steps:

[0203] After modifying the first node at the first path according to the first operation data, determine the relevant change information of the second node at the second path;

[0204] Based on the relevant change information of the second node, the intention expressed by the second atomic operation is restored and transformed to obtain the transformed intention.

[0205] In one embodiment, if the relevant change information of the second node includes a path change, wherein the path change indicates that the second node changes from a second path to a third path in the tree structure, then when the processor 1001 performs intent restoration and transformation on the operation intent expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intent, it executes the following steps:

[0206] The second path included in the second atomic operation is modified to the third path, and the operation intent expressed by the modified second atomic operation is determined as the transformed operation intent.

[0207] In one embodiment, if the relevant change information of the second node includes node state change information, wherein the node state change information includes the second node being split or the second node being merged with other nodes; then when the processor 1001 performs intent restoration and transformation on the operation intent expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intent, it executes the following steps:

[0208] Obtain the fourth path in the tree structure for the new node generated by the node state change of the second node;

[0209] The second path in the second atomic operation is modified to the fourth path, and the operation intent expressed by the modified second atomic operation is determined as the transformed operation intent.

[0210] In one embodiment, the relevant change information of the second node includes indication information that the second node has not changed; when the processor 1001 performs intention restoration and transformation on the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intention, it performs the following steps:

[0211] The operational intent expressed by the second atomic operation is taken as the transformed operational intent.

[0212] In one embodiment, the relevant change information of the second node includes indication information that the second node has been deleted; when the processor 1001 performs intent restoration transformation on the operation intent expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intent, it performs the following steps:

[0213] Set the operation intent expressed by the second atomic operation to empty, and use the operation intent expressed by the modified second atomic operation as the transformed operation intent.

[0214] This application, when handling conflicts between the first and second atomic operations based on a tree structure, first updates the collaborative document according to the operational intent of the first atomic operation. Then, it captures the operational intent of the second atomic operation, restores the captured operational intent of the second atomic operation based on the operational intent expressed by the first atomic operation, and obtains the transformed operational intent. The collaborative document is then updated again according to the transformed operational intent. The first atomic operation can include a first type of operation, which includes any one of moving nodes, splitting nodes, and merging nodes. These operations share the common feature that they can all be replaced by one or more operations. In the prior art, the first type of operation is replaced by one or more operations, such as moving a node being split into deleting a node and creating a new node, thus destroying the original operational intent of these operations. In the embodiments of this application, a first type of operation is defined among N types of atomic operations. Therefore, the operational intent of the first type of operation can be preserved during conflict handling, allowing the tree structure or collaborative document to be updated according to the operational intent.

[0215] The execution of a first atomic operation may affect the execution of a second atomic operation. For example, if the first and second atomic operations are performed on the same node in the tree structure, the node may change after the first atomic operation is completed. This embodiment of the application avoids the problem of the second atomic operation failing due to the execution of the first atomic operation affecting it by capturing the intent of the second atomic operation and restoring the captured intent, thereby improving the accuracy of conflict handling.

[0216] This application also provides a computer program product or a computer program, wherein the computer program product includes a computer program, the computer program is stored in a computer storage medium, and the computer program is loaded and executed by a processor 1001.

[0217] When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document;

[0218] The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations;

[0219] Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent;

[0220] According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

[0221] This application, when handling conflicts between the first and second atomic operations based on a tree structure, first updates the collaborative document according to the operational intent of the first atomic operation. Then, it captures the operational intent of the second atomic operation, restores the captured operational intent of the second atomic operation based on the operational intent expressed by the first atomic operation, and obtains the transformed operational intent. The collaborative document is then updated again according to the transformed operational intent. The first atomic operation can include a first type of operation, which includes any one of moving nodes, splitting nodes, and merging nodes. These operations share the common feature that they can all be replaced by one or more operations. In the prior art, the first type of operation is replaced by one or more operations, such as moving a node being split into deleting a node and creating a new node, thus destroying the original operational intent of these operations. In the embodiments of this application, a first type of operation is defined among N types of atomic operations. Therefore, the operational intent of the first type of operation can be preserved during conflict handling, allowing the tree structure or collaborative document to be updated according to the operational intent.

[0222] The execution of a first atomic operation may affect the execution of a second atomic operation. For example, if the first and second atomic operations are performed on the same node in the tree structure, the node may change after the first atomic operation is completed. This embodiment of the application avoids the problem of the second atomic operation failing due to the execution of the first atomic operation affecting it by capturing the intent of the second atomic operation and restoring the captured intent, thereby improving the accuracy of conflict handling.

Claims

1. An information processing method, characterized in that, include: When a collaborative document in the first state contains both a first atomic operation and a second atomic operation, obtain the tree structure corresponding to the collaborative document; The collaborative document is updated from the first state to the second state based on the tree structure according to the operational intent expressed by the first atomic operation; the first atomic operation includes the first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations, where N is a positive integer greater than 1; Based on the operational intent expressed by the first atomic operation, the operational intent expressed by the second atomic operation is restored and transformed to obtain the transformed operational intent; According to the transformed operational intent, the collaborative document is updated from the second state to the third state based on the tree structure.

2. The method as described in claim 1, characterized in that, The tree structure includes multiple nodes, each node representing an operable element in the collaborative document; the parent-child relationship between the multiple nodes is used to represent the inclusion relationship between operable elements; each of the N atomic operations corresponds to an editing operation; the first atomic operation refers to any one of the following: the atomic operation corresponding to the first editing operation in the set of N atomic operations, and the atomic operation transformed from the third atomic operation; the second atomic operation refers to any one of the following: the atomic operation corresponding to the second editing operation in the set of N atomic operations, and the atomic operation transformed from the fourth atomic operation; Wherein, the first editing operation is performed by a first object on a first operable element in the collaborative document through a first information processing device; the second editing operation is performed by a second object on a second operable element in the collaborative document through a second information processing device; the node to which the first atomic operation is performed corresponds to the first operable element, and the node to which the second atomic operation is performed corresponds to the second operable element.

3. The method as described in claim 1, characterized in that, The N atomic operations include a first type of operation, a second type of operation, a text processing operation, and a selection area setting operation. Atomic operations belonging to the second type of operation cannot be substituted. The first type of operation includes any one or more of moving nodes, splitting nodes, and merging nodes. The second type of operation includes any one or more of inserting nodes, deleting nodes, and setting node attributes. The text processing operation includes adding text, deleting text, or modifying text in a node. The second atomic operation is any one of the N types of atomic operations.

4. The method as described in claim 3, characterized in that, The first atomic operation includes an operation object that is a first node in the first path of the tree structure and first operation data; the operation intent expressed by the first atomic operation is to modify the first node in the first path according to the first operation data; the step of updating the collaborative document from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation includes: The tree structure is updated by modifying the first node located on the first path according to the first operation data; The collaborative document in its second state is obtained based on the updated tree structure mapping.

5. The method as described in claim 4, characterized in that, If the first atomic operation is to move a node, then the first operation data is the path of the first node in the tree structure after the move is performed; if the first atomic operation is to split a node, then the first operation data refers to the split position of the child nodes included in the first node; if the first atomic operation is to merge a node, then the first operation data is the path of the first node in the tree structure.

6. The method as described in claim 5, characterized in that, The first atomic operation further includes any one or more of the following: a second type of operation, a text processing operation, and a selection area setting operation; if the first atomic operation is a text processing operation, then the first operation data is any one of the following: text added to the first node, text to be deleted, or text corresponding to the modification operation; if the first atomic operation is a node insertion operation, then the first operation data refers to the path of the first node and the node content of the first node; if the first atomic operation is a node deletion operation, then the first operation data refers to the identifier of the first node; if the first atomic operation is a selection area setting operation, then the first operation data is empty; if the first atomic operation is a node attribute setting operation, then the first operation data is the node attribute to be set.

7. The method as described in claim 6, characterized in that, The second atomic operation includes the operation object being the second node in the second path of the tree structure and the second operation data; the operation intention expressed by the second atomic operation is to modify the second node in the second path according to the second operation data; The step of performing intent restoration transformation on the operation intent expressed by the second atomic operation based on the operation intent expressed by the first atomic operation to obtain the transformed operation intent includes: After modifying the first node at the first path according to the first operation data, determine the relevant change information of the second node at the second path; Based on the relevant change information of the second node, the intention expressed by the second atomic operation is restored and transformed to obtain the transformed intention.

8. The method as described in claim 7, characterized in that, If the relevant change information of the second node includes a path change, and the path change indicates that the second node changes from a second path to a third path in the tree structure, then the step of performing intention restoration transformation on the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intention includes: The second path included in the second atomic operation is modified to the third path, and the operation intent expressed by the modified second atomic operation is determined as the transformed operation intent.

9. The method as described in claim 7, characterized in that, If the relevant change information of the second node includes node state change information, and the node state change information includes the second node being split or the second node being merged with other nodes; then the step of performing intention restoration transformation on the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intention includes: Obtain the fourth path in the tree structure for the new node generated by the node state change of the second node; The second path in the second atomic operation is modified to the fourth path, and the operation intent expressed by the modified second atomic operation is determined as the transformed operation intent.

10. The method as described in claim 7, characterized in that, The relevant change information of the second node includes indication information that the second node has not changed; the step of performing intention restoration and transformation on the operation intention expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intention includes: The operational intent expressed by the second atomic operation is taken as the transformed operational intent.

11. The method as described in claim 7, characterized in that, The relevant change information of the second node includes indication information that the second node has been deleted. The step of restoring and transforming the operation intent expressed by the second atomic operation based on the relevant change information of the second node to obtain the transformed operation intent includes: Set the operation intent expressed by the second atomic operation to empty, and use the operation intent expressed by the modified second atomic operation as the transformed operation intent.

12. An information processing device, characterized in that, include: The acquisition unit is used to acquire the tree structure corresponding to the collaborative document when the collaborative document in the first state contains a first atomic operation and a second atomic operation; The update unit is used to update the collaborative document from the first state to the second state based on the tree structure according to the operation intent expressed by the first atomic operation; the first atomic operation includes a first type of operation among the N atomic operations predefined in the tree structure, and the first type of operation refers to an operation that can be replaced by two or more atomic operations; The conversion unit is used to perform intention restoration conversion on the operation intention expressed by the second atomic operation according to the operation intention expressed by the first atomic operation, so as to obtain the converted operation intention; The update unit is further configured to update the collaborative document from the second state to the third state based on the tree structure according to the transformed operation intent.

13. An information processing device, characterized in that, include: A processor, suitable for implementing one or more computer programs; and, A computer storage medium storing one or more computer programs, said one or more computer programs being adapted to be loaded by said processor and executed as described in any one of claims 1-11.

14. A computer storage medium, characterized in that, The computer storage medium stores a computer program, which, when executed by a processor, is used to perform the information processing method as described in any one of claims 1-11.

15. A computer program product, characterized in that, The computer program product includes a computer program stored in a computer storage medium. When the computer program in the computer storage medium is executed by a processor, it is used to load and execute the information processing method as described in any one of claims 1-11.