Document content changing method, electronic device, storage medium and program product

By splitting the content change operation submitted by the client into atomic data and processing conflicting data according to priority, the data integrity problem caused by inconsistency in versions in online collaborative editing of multiple users is solved, and higher data integrity and consistency are achieved.

CN120354839BActive Publication Date: 2025-08-26ZHEJIANG PLANER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510868788.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-26
Publication Date
2025-08-26
Estimated Expiration
2045-06-26

AI Technical Summary

Technical Problem

In the scenario where multiple users collaborate to edit documents online, when the document versions of the client and the server are inconsistent, the prior art cannot be compatible with retaining conflicting content, resulting in low data integrity of the conflicting part of the content in the server's document.

Method used

Split the content change operation submitted by the client into atomic data that cannot be re-divided, determine the conflicting data and selectively incorporate it into the server's target document according to the operation priority, lock the operation permissions of the conflicting data, and confirm the priority through manual decision-making to resolve the conflict.

Benefits of technology

Improve the data integrity of conflicting parts of the server document, avoid the impact of data consistency, and ensure the orderliness and accuracy of content changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120354839B_ABST
    Figure CN120354839B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for changing document content, an electronic device, a storage medium, and a program product. The method includes: obtaining a first content change operation with a first version number submitted by a client; when the first version number does not match the second version number of a target document locally on a server, splitting the first content changed by the first content change operation into multiple indivisible atomic data; determining the atomic data within the operation scope of a second content history change operation applied to the target document with the second version number as conflicting data; determining the operation priority between a first data operation acting on the conflicting data in the first content change operation and a second data operation acting on the conflicting data in the second content history change operation; and applying the first data operation to the target document locally on the server when the operation priority of the first data is greater than the operation priority of the second data operation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a method for changing document content, an electronic device, a storage medium, and a program product. Background Art

[0002] In scenarios where multiple users are collaborating online to edit a document, if a client submits changes to a document to a server and the client and server versions are inconsistent, the changes submitted by the client may conflict with the server's version. When conflicts arise, current technical solutions typically only retain either the client or server version of the content, failing to preserve the conflicting content. This results in lower data integrity for the conflicting content on the server. Summary of the Invention

[0003] The present disclosure provides a method for changing document content, an electronic device, a storage medium, and a program product.

[0004] According to one aspect of the present disclosure, a method for changing document content is provided, comprising: obtaining a first content change operation with a first version number submitted by a client; when the first version number does not match a second version number of a target document locally on a server, splitting the first content changed by the first content change operation into a plurality of indivisible atomic data; determining the atomic data within an operation scope of a second content history change operation applied to a target document with the second version number as conflicting data; determining the operation priority between a first data operation acting on the conflicting data in the first content change operation and a second data operation acting on the conflicting data in the second content history change operation; and applying the first data operation to the target document locally on the server when the operation priority of the first data is greater than the operation priority of the second data operation.

[0005] According to one aspect of the technical solution, by determining more fine-grained conflicting data from the first content to be changed, atomic data that is not conflicting data can be incorporated into the target document of the server, and the conflicting data can be selectively incorporated into the target document of the server according to its operation priority, thereby improving the data integrity of the first content in the target document of the server.

[0006] According to at least one embodiment of the document content change method disclosed herein, the first content changed by the first content change operation is split into multiple indivisible atomic data, including: determining the data type of the first content; when the data type is text, splitting the first content into multiple characters as multiple atomic data; or when the data type is a table, splitting the first content into multiple cells as multiple atomic data; or when the data type is an image, splitting the first content into multiple layers or multiple graphic objects as multiple atomic data.

[0007] According to the technical solution of this embodiment, first contents of different data types can be split into atomic data, and the scope of application is relatively wide.

[0008] According to at least one embodiment of the document content change method of the present disclosure, the method further includes: locking the operation permissions of each client on the conflicting data so that the conflicting data is only processed by the first content change operation; when the first data operation is applied to the target document locally on the server, unlocking the operation permissions of each client on the conflicting data.

[0009] According to the technical solution of this embodiment, it is possible to avoid that the data in conflict processing is operated in parallel by the client and affects the data consistency of the target document.

[0010] According to at least one embodiment of the document content change method of the present disclosure, the operation priority between the first data operation of the first version number and the second data operation of the second version number acting on the conflicting data is determined, including: generating conflict comparison content, the conflict comparison content including a first sub-content changed based on the first data operation and a second sub-content changed based on the second data operation; sending the conflict comparison content to a first client that submitted the first data operation and a second client that submitted the second data operation; obtaining a first confirmation message returned by the first client and a second confirmation message returned by the second client, the first confirmation message and the second confirmation message being used to confirm the first sub-content or the second sub-content applied to the target document; when the first confirmation message and the second confirmation message both confirm the application of the first sub-content, determining that the operation priority of the first data is greater than the operation priority of the second data operation.

[0011] According to the technical solution of this embodiment, the priority of data operations can be confirmed to the client, and a method for implementing manual decision-making to resolve conflicts can be provided.

[0012] According to the document content change method of at least one embodiment of the present disclosure, the operation priority between the first data operation of the first version number and the second data operation of the second version number acting on the conflicting data is determined, and also includes: when the first confirmation information and the second confirmation information both confirm that new collaborative content other than the first sub-content and the second sub-content is applied to the target document, the new collaborative content is applied to the target document locally on the server.

[0013] According to the technical solution of this embodiment, when a new collaborative content is provided as a new content change solution by manual decision-making, the new collaborative content can be used to replace the changed content of the conflicting data.

[0014] According to at least one embodiment of the document content change method disclosed herein, applying the first data operation to the target document locally on the server includes: querying the target version number, where the target version number is the version number of the target document of the latest version to which the second data operation is not applied; tracing the target document locally on the server with the second version number back to the target version number to obtain the target document with the target version number; and applying the first data operation to the target document locally on the server with the target version number.

[0015] According to the technical solution of this embodiment, it is possible to ensure that logic conflicts will not occur when the first data operation is applied to change the content, thereby avoiding operation crashes.

[0016] According to at least one embodiment of the document content change method disclosed herein, applying the first data operation to the target document locally on the server also includes: generating a conflict resolution record, the conflict resolution record including the historical version number before the first data operation is applied, the current version number when the first data operation is effective, the original content before the first data operation is applied, and the changed content after the first data operation is applied; the conflict resolution record is used for querying the target version number.

[0017] According to the technical solution of this embodiment, the target version number can be queried more quickly based on the conflict resolution record query.

[0018] According to at least one embodiment of the document content change method of the present disclosure, querying the target version number includes: determining the second sub-content changed based on the second data operation; querying the conflict resolution record containing the second sub-content as the target conflict resolution record; and when the target conflict resolution record is queried, determining the historical version number in the target conflict resolution record to which the second data operation is not applied as the target version number.

[0019] According to the technical solution of this embodiment, the target version number can be queried more quickly based on the conflict resolution record query.

[0020] According to at least one embodiment of the present disclosure, the document content changing method further includes: saving each of the first data operations applied to the target document locally on the server as a first content history change operation.

[0021] According to the technical solution of this embodiment, when the server obtains a content change operation with a mismatched version number next time, the conflicting data of this content change can be determined using the last saved first content history change operation.

[0022] According to at least one embodiment of the document content change method disclosed herein, obtaining a first content change operation with a first version number submitted by a client includes: adding a content change package submitted by the client to a content synchronization queue, sorting the content change packages in the content synchronization queue from old to new in submission order, the content change package including a version number and a content change operation; obtaining the version number and content change operation in the first content change package in the content synchronization queue to obtain the first version number and the first content change operation.

[0023] According to the technical solution of this embodiment, the server can perform serial processing on content change operations to ensure the orderliness of content changes.

[0024] The document content changing method according to at least one embodiment of the present disclosure further includes: when the first version number matches the second version number of the target document locally on the server, applying the first content changing operation to the target document locally on the server.

[0025] According to the technical solution of this embodiment, the changed content without conflict can be quickly incorporated into the local target document on the server.

[0026] According to the technical solution of this embodiment, it also includes: in response to a content synchronization request submitted by the client, obtaining the third version number of the target document to be synchronized by the client; comparing the local target document of the server with the target document with the third version number, and determining the content of the local target document of the server that has changed relative to the target document with the third version number as the content to be synchronized; and sending the content to be synchronized to the client.

[0027] According to the technical solution of this embodiment, when synchronizing the current content of the target document to the client, the server does not need to transmit the entire target document, but only needs to transmit the changed part of the data, thereby reducing the amount of data transmission.

[0028] According to another aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the document content changing method of any embodiment of the present disclosure.

[0029] According to another aspect of the present disclosure, a readable storage medium is provided, in which execution instructions are stored. When the execution instructions are executed by a processor, they are used to implement the method for changing document content in any embodiment of the present disclosure.

[0030] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, which implements the method for changing document content according to any embodiment of the present disclosure when the computer program is executed by a processor. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0032] Figure 1 It is a flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0033] Figure 2 It is a schematic diagram of an application scenario of a method for changing document content according to an embodiment of the present disclosure.

[0034] Figure 3 It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0035] Figure 4 It is a flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0036] Figure 5 It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0037] Figure 6 It is a schematic diagram of an application scenario of a method for changing document content according to an embodiment of the present disclosure.

[0038] Figure 7 It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0039] Figure 8 It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0040] Figure 9It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0041] Figure 10 It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0042] Figure 11 It is a flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0043] Figure 12 It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0044] Figure 13 It is a flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0045] Figure 14 It is a flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0046] Figure 15 It is a partial flowchart of a method for changing document content according to an embodiment of the present disclosure.

[0047] Figure 16 It is a schematic block diagram of the structure of a device for changing document content according to an embodiment of the present disclosure.

[0048] Figure 17 is a schematic block diagram of an electronic device according to one embodiment of the present disclosure. DETAILED DESCRIPTION

[0049] The present disclosure is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific examples described herein are intended only to illustrate the relevant content and are not intended to limit the present disclosure. It should also be noted that, for ease of description, only the portions relevant to the present disclosure are shown in the accompanying drawings.

[0050] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0051] In a scenario where multiple users are collaboratively editing a document online, if a client submits changes to the document (first content) to the server, and the server has already applied the content (second content) that the client did not modify, and there is a conflict between the first and second content, the server typically can only choose to retain one of the first and second content in the document. The server is unable to retain either the first or second content. The server is unable to retain both conflicting content, resulting in low data integrity for the conflicting parts of the document on the server.

[0052] To this end, the present disclosure proposes the following technical solution. This solution supports the identification of more granular conflicting data within the first content submitted by the client that conflicts with the second content, allowing the server document to retain portions of the first content that do not constitute conflicting data, rather than completely discarding the first content. Furthermore, conflicting data within the first content can be retained as appropriate based on its corresponding data operation priority. This improves the data integrity of the conflicting portions of the server document.

[0053] For the convenience of description and to make the technical solution of the present disclosure easier to understand, the terms of the present disclosure are first explained before describing the technical solution of the present disclosure.

[0054] Atomic data: refers to independent units in a document that cannot be divided, such as a single character, a single cell, a single graphic element, etc.

[0055] Figure 1 FIG. 1 shows a schematic diagram of the overall process of a method M10 for changing document content according to an embodiment of the present disclosure. Figure 1 The method shown includes steps S11 to S19.

[0056] In step S11 , the server obtains a modification operation of a first content with a first version number submitted by the client.

[0057] See also Figure 2 The application scenario of the document content change method can be a scenario where multiple clients collaborate online to edit a document. In this application scenario, the document edited by multiple clients (e.g., client A and client B) serves as the target document; the server receives the content change operation submitted by the client on the content of the target document, obtains the target document after the content change, and synchronizes the changed content to each client. Figure 2The first content change operation shown refers to a content change operation performed by client A on the target document. Content change operations can include content insertion, content overwriting, and content deletion. The content in the target document that is modified by the first content change operation is recorded as the first content. When client A submits the first content change operation to the server, the version number of the current version of the target document of client A is recorded as the first version number.

[0058] After client A performs a content change operation on the target document, it submits a change package corresponding to this change operation to the server. This change package is used to synchronize this content change operation with the server. The information in the change package includes the version number of client A's target document, denoted as the first version number, and the content change operation performed by client A on the target document, denoted as the first content change operation. A change package can contain multiple first content change operations. For example, suppose client A modifies the content of a cell and inserts a new image, then saves these changes and submits a change package to the server. This change package will contain two first content change operations: the cell modification operation and the image insertion operation. The change package also includes the version number of client A's target document, denoted as the first version number. After the server modifies the content of the local target document, it pushes a synchronization package to client B to synchronize the modified content. After receiving the synchronization package, client B performs the content change operation to be synchronized on a target document with a certain version number of client B, obtaining the target document with the modified content. It should be noted that there can be more than one client, not just two.

[0059] In step S13 , when the first version number does not match the second version number of the local target document on the server, the first content changed by the first content change operation is split into multiple indivisible atomic data.

[0060] In the embodiments of the present disclosure, the first version number and the second version number represent the version number of the target document of the client and the version number of the target document of the server respectively, and do not represent the sequence order of the version numbers. The first version number and the second version number can be the same or different version numbers.

[0061] The first version number and the second version number do not match, indicating that the version of the target document edited by the client is different from the version of the target document on the server. In a scenario of multi-user online collaborative editing, the target document on the server often undergoes corresponding content changes based on the content change operation submitted by the client, resulting in a version change of the target document on the server and an update of the version number. Based on this, when the first version number and the second version number do not match, it is usually because before the current client submits the content change operation with the first version number, the server applies the content change operation submitted by other clients, resulting in a version change of the target document on the server, and the target document after the version change on the server has not yet been pushed to the current client. Therefore, the first version number of the current client does not match the second version number of the server. When the first version number of the target document of the current client does not match the second version number of the local target document on the server, the server needs to consider whether there is a conflict between the content of the change in the first version number and the content to be changed in the second version number. Content without conflict can be directly merged and processed, while content with conflict needs to be further processed in subsequent steps.

[0062] In one embodiment, the version number may include a major version number, a minor version number, and a revision number, such as "5.2.3". In this case, if the major version number and the minor version number of the first version number and the second version number are not exactly the same, that is, any one of the major version number and the minor version number is not the same, then it is determined that the first version number does not match the second version number. For example, the first version number "5.1.3" does not match the second version number "5.2.3". In other embodiments, the version number may also include a major version number and a revision number, a major version number and a minor version number, etc., which are not limited here. In one example, when the characters representing the version of the target document in the first version number and the second version number (such as the major version number and the minor version number) are not exactly the same, it is determined that the first version number and the second version number do not match.

[0063] Splitting the first content into indivisible atomic data means splitting the first content into indivisible independent units, such as splitting text into individual characters or splitting a table into individual cells.

[0064] When the first version number does not match the second version number of the target document locally on the server, the purpose of splitting the first content into multiple indivisible atomic data is to subdivide the first content to be changed into some non-conflicting content that can be merged with the content with the second version number change, and the content that conflicts with the content with the second version number change. In this way, more fine-grained conflict content processing can be supported, the scope of conflicting content can be narrowed, and it is beneficial to the local repair or update of the target document content. For example, conflict content processing can be performed only on a single character in the text of the first content that conflicts with the content with the second version number change, and other characters in the text that do not conflict can be directly merged into the target document with the second version number.

[0065] Among them, the content changed by the second version number is the content changed by the content change operation applied when the target document of the server is updated from the previous version number to the current second version number. The content change operation is recorded as the second content history change operation, and the content changed by the second content history change operation is recorded as the second content.

[0066] S15: Determine the atomic data within the operation scope of the second content history change operation applied to the target document of the second version number as conflicting data.

[0067] The second content history change operation is a content change operation that has been applied to the target document locally on the server, which updates the version of the target document locally on the server to the second version number. The operating scope of the second content history change operation refers to the location of the content that has been changed based on the second content history change operation, such as the text of a paragraph, an image at a certain location, a range of cells, etc. If the atomic data obtained based on the split of the first content is within the operating scope of the second content history change operation, the atomic data is determined to be conflicting data, indicating that there is a conflict between the atomic data in the first content with the first version number changed and the content with the second version number changed.

[0068] For example, if a certain atomic data is the 6th character of paragraph 1 and the operation range of the second content history change operation is the 1st to 100th characters of paragraph 1, then the atomic data is considered to be within the operation range of the second content history change operation and is determined as conflicting data.

[0069] When the atomic data is not conflicting data, the data operation acting on the atomic data in the first content change operation of the target document in the server local application will be used to modify the atomic data (for example, Figure 2 non-conflicting data in the target document) into the target document locally on the server.

[0070] In one embodiment, atomic data within the overlapping range between the operation scope of the first content change operation and the operation scope of the second content history change operation can be determined as conflicting data. For example, if the operation scope of the first content change operation is characters 6-12 of paragraph 1, and the operation scope of the second content history change operation is characters 1-100 of paragraph 1, and the overlapping operation scope between the two operation scopes is characters 6-12 of paragraph 1, then each character in characters 6-12 of paragraph 1 is determined as conflicting data.

[0071] Furthermore, in one embodiment, before splitting the first content changed by the first content change operation into multiple indivisible atomic data, whether the first content change operation is a conflicting operation can be determined based on whether the operation scope of the first content change operation overlaps with the operation scope of the second content history change operation. Specifically, when the operation scope of the first content change operation overlaps with the operation scope of the second content history change operation, the first content change operation is determined to be a conflicting operation; otherwise, when the operation scope of the first content change operation does not overlap with the operation scope of the second content history change operation, the first content change operation is determined not to be a conflicting operation.

[0072] When the first content change operation is non-conflicting, it indicates that the first content change operation performed by the client (e.g., client A) does not conflict with the second content change operation submitted by another client (e.g., client B) and applied by the server, but not yet synchronized to the client (e.g., client A). This means that the first content changed by the first content change operation and the second content changed by the second content change operation do not affect each other. Therefore, the splitting of the first content in step S13 can be skipped. The first content change operation is directly applied to the local target document on the server, and the first content changed by the first content change operation is merged into the local target document on the server.

[0073] When the first content change operation is a conflicting operation, it indicates that a conflict exists between the first content changed by the first content change operation and the second content changed by the second content history change operation, requiring resolution through subsequent conflict content processing steps. Therefore, when the first content change operation is a conflicting operation, the first content is split into multiple atomic data in step S13. Based on the multiple atomic data, conflict data with a finer granularity than that of the conflict operation is determined, thereby resolving content conflicts between different versions of the document in a more refined manner.

[0074] In step S17 , the operation priority between the first data operation acting on the conflicting data in the first content change operation and the second data operation acting on the conflicting data in the second content history change operation is determined.

[0075] The first data operation is a data change operation that acts solely on the conflicting data in the first content change operation, and the second data operation is a data change operation that acts solely on the conflicting data in the second content history change operation.

[0076] For example, if the conflicting data is the sixth character of paragraph 1 and the first content change operation is used to change characters 6-12 of paragraph 1, then the sub-operation (such as character insertion, overwriting, or deletion) used to change the sixth character of paragraph 1 in the first content change operation is the first data operation. Similarly, if the second content change operation is used to change characters 1-100 of paragraph 1, then the sub-operation (such as character insertion, overwriting, or deletion) used to change the sixth character of paragraph 1 in the second content change operation is the second data operation.

[0077] The operation priority of a data operation is an evaluation metric used to resolve content change conflicts. If the operation priority of a first data operation is greater than that of a second data operation, the first data operation has a higher priority for changing the conflicting data in the target document. Conversely, if the operation priority of a first data operation is less than that of a second data operation, the second data operation has a higher priority for changing the conflicting data in the target document.

[0078] In one embodiment, the operational priority of a data operation can be determined based on a priority rule. In one example, the operational priority of a data operation can be divided according to the operation type of the data operation, with the deletion operation having the highest priority, the insertion operation having the second priority, and the overwriting operation having the lowest priority. For example, assuming that the operation type of the first data operation is a deletion operation and the operation type of the second data operation is an overwriting operation, the operational priority of the first data operation is greater than the operational priority of the second data operation. When the operation types of the data operations are the same, the operational priority of the data operation submitted to the server later is higher than the operational priority of the data operation submitted to the server first. For example, assuming that the first data operation and the second data operation are both overwriting operations, and the first data operation is the data operation submitted to the server later than the second data operation, the operational priority of the first data operation is greater than the operational priority of the second data operation.

[0079] In another embodiment, the operational priority of the data operation can be determined by manual decision. For example, assuming that the first data operation is a data operation submitted by client A and the second data operation is a data operation submitted by client B, the server sends a priority confirmation request to client A and client B respectively to determine the operational priority between the first data operation and the second data operation. When the confirmation results returned by client A and client B are consistent, the operational priority confirmed in the confirmation result is applied. For example, when the confirmation results returned by client A and client B both indicate that the operational priority of the first data is greater than the operational priority of the second data operation, the server determines that the operational priority of the first data is greater than the operational priority of the second data operation.

[0080] In step S19, when the operation priority of the first data is greater than the operation priority of the second data operation, the first data operation is applied to the target document locally on the server.

[0081] When the priority of the first data operation is higher than the priority of the second data operation, applying the first data operation to modify the conflicting data in the target document takes precedence over applying the second data operation to modify the conflicting data in the target document. In other words, for a particular conflicting data, the conflict resolution solution is to modify the data content in the local target document on the server by applying the data operation with the higher priority.

[0082] When the operation priority of the first data operation acting on the conflicting data is greater than the operation priority of the second data operation, the solution to resolve the conflict is to apply the first data operation so that the conflicting data changed by the first data operation is incorporated into the target document of the server.

[0083] When the priority of the first data operation applied to the conflicting data is lower than the priority of the second data operation, the conflict resolution solution is to apply the second data operation, incorporating the data modified by the second data operation into the target document on the server. Since the target document with the second version number has already applied the second data operation to the conflicting data, when the priority of the first data operation applied to the conflicting data is lower than the priority of the second data operation, the server does not perform the modification operation on the conflicting data, and the content modified by the second data operation is maintained in the target document.

[0084] In summary, the document content modification method of the embodiment of the present disclosure provides a solution for performing content modification processing on a target document locally on a server when the first version number of a first content modification operation submitted by a client does not match the second version number of the target document locally on the server. To resolve conflicts caused by different modification operations on the same content in different versions of the target document, the embodiment of the present disclosure splits the first content to be modified into multiple indivisible atomic data, and then determines finer-grained conflict data from the multiple atomic data to process the conflicting content. In traditional content synchronization solutions, only the entire change to the first content can be applied to the target document. If a content change conflict exists between the first content change submitted by the client with the first version number and the second content change currently on the server with the second version number, the application of the first content change must be completely abandoned. Therefore, the document content modification method of the present disclosure supports the determination of finer-grained conflict data when a content change conflict exists between the first content change submitted by the client with the first version number and the second content change currently on the server with the second version number. This allows the target document on the server to directly apply the content change of the portion of the first content that does not constitute conflicting data, rather than completely abandoning the application of the first content change. Furthermore, for conflicting data, if the priority of the first data operation acting on the conflicting data is greater than the priority of the second data operation, the first data operation can be applied to the target document locally on the server to modify the conflicting data in the first content. This ensures that the first content in the target document on the server, after the modification, has higher data integrity.

[0085] Regarding step S13, in some embodiments of the present disclosure, it may include the following Figure 3 The step S131 and at least one of the steps S132 to S134 are not performed in sequence.

[0086] In step S131, the data type of the first content is determined. The first content is the content that is modified by the first content modification operation. The scope of the first content corresponds to the operation scope of the first content modification operation. The data type of the first content may typically include text data, table data, image data, etc. The purpose of determining the data type of the first content is to determine the type of indivisible atomic data corresponding to the first content, so as to split the first content into the corresponding atomic data types.

[0087] In step S132, when the data type is text, the first content is split into multiple characters as multiple atomic data. For the content change of text data, the smallest change unit is a character. Based on this, when the data type is text, the first content is split into multiple characters as multiple atomic data, and the attributes of each split character are saved. The attributes may include position, format, etc. For example, for the split character "是", its attribute is saved as "x font, x font size, the 6th character in paragraph 1 on page 1". The data change operations on characters include inserting characters, deleting characters, using new characters to overwrite the old characters at the same position, etc. For the modification operations of modifying the attributes such as color and font of characters, it is equivalent to using the characters after modification with color and font to overwrite the characters before modification at the same position, which belongs to the data overwrite type of operation.

[0088] In step S133, when the data type is a table, the first content is split into multiple cells as multiple atomic data. For the content change of table data, the smallest change unit is a single cell. Based on this, when the data type is a table, the first content is split into multiple cells as multiple atomic data, and the attributes of each split cell are saved. The attributes may include position, format, etc. For example, for a certain split cell, its attribute is saved as "x row x column, no border". The data change operations on the table include inserting cells, deleting cells, using new cells to overwrite the old cells at the same position, etc. For the modification operations of modifying the attributes such as color and style of cells, it is equivalent to using the cells after modification with color and style to overwrite the cells before modification at the same position, which belongs to the data overwrite type of operation.

[0089] In step S134, when the data type is an image, the first content is split into multiple layers or multiple graphic objects as multiple atomic data. In an example, if an image consists of multiple separately operable graphic objects, the image can be split into multiple graphic objects, and each graphic object is used as an atomic data. The data change operations on graphic objects include inserting graphic objects, deleting graphic objects, using new graphic objects to overwrite the old graphic objects at the same position, etc. For the modification operations of modifying the attributes such as color and style of graphic objects, it is equivalent to using the graphic objects after modification with color and style to overwrite the graphic objects before modification at the same position, which belongs to the data overwrite type of operation.

[0090] In another example, if an image is composed of multiple independently operable layers, the image can be split into multiple layers, with each layer acting as an atomic data element. Data modification operations on graphic objects include inserting layers, deleting layers, and overwriting existing layers with new layers. Modifying layer properties or content is equivalent to overwriting the original layer with the modified properties or content, and is considered a data overwrite operation.

[0091] In some embodiments of the present disclosure, the document content changing method M10 may further include: Figure 4 For other steps, please refer to the steps S16 and S110 shown in FIG. Figure 1 Description.

[0092] In step S16 , the operation authority of each client on the conflicting data is locked so that the conflicting data can only be processed by the first content change operation.

[0093] The purpose of step S16 is to avoid conflicting data in parallel modification processing by the client when the server processes conflicting content of the conflicting data, so as to ensure data consistency of the target document in the scenario of online collaborative editing of the target document.

[0094] In one example, when the server identifies conflicting data, it marks the conflicting data in the target document to indicate to the user that the marked conflicting data cannot be changed (e.g., edited). The conflicting data can be marked using color marking, box marking, or other methods, which are not limited herein.

[0095] In S110 , when a first data operation is applied to a target document locally on the server, the operation rights of each client on the conflicting data are unlocked.

[0096] When the first data operation is applied to the local target document on the server, it indicates that the version content conflict corresponding to the conflicting data has been resolved, and the operation rights of each client on the conflicting data can be unlocked to avoid affecting the client's modification operation on the conflicting data.

[0097] Regarding step S17, in some embodiments of the present disclosure, it may include the following Figure 5 Steps S171 to S174 are shown.

[0098] In step S171 , conflict comparison content is generated, where the conflict comparison content includes a first sub-content changed based on the first data operation and a second sub-content changed based on the second data operation.

[0099] For example, assuming that the first data operation is used to overwrite the sixth character "yes" in paragraph 1 of the target document with "no", the character "no" is the first sub-content. Similarly, assuming that the second data operation is used to overwrite the sixth character "yes" in paragraph 1 of the target document with "or", the character "or" is the second sub-content.

[0100] In one embodiment, the conflict comparison content also includes contextual data of the conflicting data to facilitate user identification of the location of the conflicting data. For example, when the conflicting data is a character, the contextual data of the conflicting data may be the text of the paragraph in which the character is located. When the conflicting data is a cell, the contextual data of the conflicting data may be the cell adjacent to the conflicting data. When the conflicting data is a graphic element, the contextual data of the conflicting data may be the graphic element adjacent to the conflicting data.

[0101] In step S172 , conflict comparison content is sent to the first client that submitted the first data operation and the second client that submitted the second data operation.

[0102] When the server receives a content change operation submitted by a client, it retains the client's submission record. This facilitates the server's identification of the client that submitted the content change operation. The first data operation is a sub-operation within the first content change operation, so the client that submitted the first content change operation is the first client. The second data operation is a sub-operation within the second content history change operation, so the client that submitted the second content history change operation is the second client.

[0103] Through step S172 , conflict comparison content may be provided to the first client and the second client that submitted the conflicting first data operation and second data operation, so that the first client and the second client can resolve the content change conflict through manual decision-making.

[0104] In step S173, first confirmation information returned by the first client and second confirmation information returned by the second client are obtained, where the first confirmation information and the second confirmation information are used to confirm the first sub-content or the second sub-content applied to the target document.

[0105] Figure 6 Schematic diagram of conflict comparison content of an embodiment of the present disclosure. The conflict comparison content includes a first sub-content and context data of the first sub-content, corresponding to Figure 6 The changes of user A (client A, first client), the second sub-content and the context data of the second sub-content correspond to Figure 6This illustrates the changes made by User B (Client B, the second client). The first and second sub-content are marked with different colors to help users distinguish them. The interface displaying the conflicting and compared content also displays a first confirmation button for confirming the application of the first sub-content, and a second confirmation button for confirming the application of the second sub-content. For example, when the user of the first client clicks the first confirmation button, the first client sends a first confirmation message to the server, confirming the application of the first sub-content.

[0106] In step S174 , when both the first confirmation information and the second confirmation information confirm the application of the first sub-content, it is determined that the operation priority of the first data is greater than the operation priority of the second data.

[0107] When the first confirmation message and the second confirmation message confirm the same sub-content, indicating that the users of the first client and the second client have reached an agreement on the conflict resolution strategy, the server can then determine the operational priority of the first data operation and the second data operation based on the agreed confirmation message. When both the first confirmation message and the second confirmation message confirm the application of the first sub-content, the first data operation is determined to have a higher operational priority, causing the server to apply the first data operation to modify the conflicting data and merge the first sub-content into the server's target document.

[0108] Furthermore, regarding step S17, in some embodiments of the present disclosure, the following may also be included: Figure 7 Step S175 shown.

[0109] In step S175 , when both the first confirmation information and the second confirmation information confirm that the new collaborative content other than the first sub-content and the second sub-content is applied to the target document, the new collaborative content is applied to the target document locally on the server.

[0110] In one embodiment, after manual decision-making, users of a first client and a second client determine that new collaborative content, other than the first and second sub-contents, should be applied to the target document. In this case, the first and second clients can each return first and second confirmation messages containing the new collaborative content to the server, informing the server of the new collaborative content changed by the manual decision-making process, allowing the server to apply the new collaborative content to resolve the content change conflict. This allows the new collaborative content to replace the conflicting data changes when the manual decision-making process provides the new collaborative content as a new content change solution.

[0111] For example, the first sub-content is used to replace the character "yes" with "no," the second sub-content is used to replace the character "yes" with "or," and the new collaborative content determined by manual decision-making is used to delete the character "yes." The first client and the second client then confirm the content obtained by deleting the character "yes" in the first confirmation message and the second confirmation message, respectively, as the new collaborative content. Based on the new collaborative content, the server deletes the character "yes" from the target document, applying the new collaborative content to the target document.

[0112] Regarding step S19, in some embodiments of the present disclosure, it may include the following Figure 8 Steps S191 to S193 are shown.

[0113] Steps S191 to S193 are used to handle situations where the first data operation cannot be applied directly to the local target document on the server. For example, the first data operation is used to overwrite the character "yes" with "no", while the second data operation is used to delete the character "yes" in the same position. In the case where the second data operation (the second content history change operation) has been applied to the target document with the current second version number on the server, the data overwriting operation cannot be performed on the deleted character "yes" due to the existence of a logical conflict. Through steps S191 to S193, the target document with the second version number can be traced back to the version where the second data operation has not been applied, that is, the version where the conflicting data character "yes" has not been deleted, and then the first data operation can be applied to perform content changes to ensure that there will be no logical conflicts when applying the first data operation to perform content changes, thereby avoiding operation crashes.

[0114] In step S191 , a target version number is queried, where the target version number is the version number of the latest version of the target document to which the second data operation is not applied.

[0115] In one embodiment, the server maintains a local version tree that includes the version numbers of the server's modified content and the content modification operations or data operations corresponding to the modified content. Therefore, when version rollback is required, the version tree can be queried to obtain the version number of the first application of the second data operation. The version immediately preceding the version number of the first application of the second data operation is the latest version without the second data operation applied.

[0116] For example, if the version "V5.2" is the version number to which the second data operation is first applied, and the version "V5.1" is the previous version of the version "V5.2", then "V5.1" is determined as the target version number.

[0117] By tracing the target document back to the latest possible version, more of the latest synchronized content can be retained, thereby improving the data integrity of the newly synchronized content of the target document.

[0118] In step S192, the target document of the second version number locally on the server is traced back to the target version number to obtain the target document of the target version number.

[0119] In one embodiment, the server stores complete data of the target document with the target version number, and can use the target document with the target version number to overwrite the target document with the second version number, so that the target document with the second version number can be traced back to the target version number.

[0120] In one embodiment, the server can obtain the content of each version number change between the second version number and the target version number from the version tree, and roll back the changed content in the target document to the previous version in order from new to old version numbers, while the unchanged content remains unchanged until it rolls back to the target version, so as to trace the target document back to the target version number.

[0121] In step S193, a first data operation is applied to the target document of the target version number locally on the server.

[0122] Since the second data operation has not been applied to the target document of the target version number, no logical conflict of data operations will occur when the first data operation is applied to the target document of the target version number, so that the first data operation can be applied to the target document even when there is a logical conflict between the first data operation and the second data operation.

[0123] Regarding step S19, in some embodiments of the present disclosure, it may also include the following Figure 9 Step S194 is shown.

[0124] In step S194, a conflict resolution record is generated, which is used to query the target version number. The conflict resolution record includes the historical version number before the first data operation is applied, the current version number when the first data operation is effective, the original content before the first data operation is applied, and the changed content after the first data operation is applied.

[0125] If the first data operation is successfully applied to the target document locally on the server, the content change conflict is considered resolved, and the server records the relevant information for resolving the conflict, generating a conflict resolution record. The conflict resolution record includes the version numbers before and after the first data operation was applied, as well as the content before and after the change based on the first data operation. This way, if a data operation that conflicts with the first data operation is encountered in subsequent versions, the historical version number that did not apply the first data operation can be retrieved based on the conflict resolution record and used as the target version number for version backtracking to resolve the content change conflict.

[0126] Furthermore, in one embodiment, when performing version backtracking based on the conflict resolution record, it is not necessary to backtrack all the data of the target version. Instead, only the changed content after the first data operation is applied is backtracked to the original content before the first data operation is applied, so as to minimize the operation scope of the data backtracking and reduce the amount of data backtracked to ensure the integrity of the newly changed content in the target document as much as possible.

[0127] Regarding step S191, in some embodiments of the present disclosure, it may include the following Figure 10 Steps S1911 to S1913 are shown. Steps S1911 to S1913 are used to query the target version number based on the conflict resolution record if the server stores the conflict resolution record. The conflict resolution record may include multiple conflict resolution records, and different conflict resolution records correspond to different data operations, version numbers, and content before and after the change.

[0128] In step S1911, the second sub-content changed based on the second data operation is determined. In step S191, the purpose of querying the target version number is to find the version number to which the second data operation is not applied, that is, the previous version of the version number to which the second data operation is first applied. If the server stores a conflict resolution record for applying the second operation data to resolve the conflict, the conflict resolution record corresponding to the second operation data contains the historical version number to which the second data operation is not applied, the current version number in which the second data operation takes effect, the original content before the second data operation is applied, and the changed content after the second data operation is applied. The historical version number to which the second data operation is not applied can be obtained as the target version number. In this case, the changed content after the second data operation is applied in the conflict resolution record corresponding to the second operation data is the second sub-content changed based on the second data operation. Therefore, as long as the second sub-content is determined, the conflict resolution record corresponding to the second data operation can be found based on the second sub-content.

[0129] In step S1912, a conflict resolution record containing the second sub-content is searched for as the target conflict resolution record. The conflict resolution record containing the second sub-content is the conflict resolution record corresponding to the second data operation, and includes the historical version number in which the second data operation was not applied. Therefore, this is used as the target conflict resolution record.

[0130] In step S1913, when the target conflict resolution record is found, the historical version number in the target conflict resolution record to which the second data operation is not applied is determined as the target version number.

[0131] When the target conflict resolution record is found, the version numbers before and after the second data operation is applied can be retrieved from the target conflict resolution record, and the historical version number before the second data operation is applied can be used to determine the target version number. This allows for convenient and quick querying of the target version number using the target conflict resolution record. Since the historical version number in the target conflict resolution record is always the latest version without the second data operation applied, the process of determining the latest version without the second data operation is eliminated.

[0132] In one embodiment, when no target conflict resolution record is found, the version tree is queried to obtain the target version number. Alternatively, in another embodiment, when no target conflict resolution record is found, the first version number is determined as the target version number. Since the conflict between the first and second data operations arises from the client's target document not being synchronized to the second version number, the target document with the first version number must be the version to which the second data operation has not been applied. This allows the target version number to be obtained quickly, saving computing power.

[0133] In some embodiments of the present disclosure, the document content changing method M10 may further include: Figure 11 Step S111 is shown. Figure 11 The specific contents of other steps shown in can refer to the above description.

[0134] In step S111 , each first data operation applied to the local target document on the server is saved as a first content history change operation.

[0135] The first content history change operation is the content change operation actually applied to the target document locally on the server. Compared to the first content change operation submitted by the client, some first data operations in the first content change operation may not be applied due to their lower priority than the second data operations. Therefore, the amount of content actually changed by the first content history change operation may be less than or equal to the amount of content changed by the first content change operation.

[0136] When the server processes the content change operation in the next change package, the content change operation in the next change package becomes the new first content change operation. At this point, the first content change operation actually applied in the first content change operation of the previous change package becomes the second content change operation with the second version number for the next change package, which is used to determine the new conflicting data for the next change package. This way, the next time the server receives a content change operation with a mismatched version number, it can use the previously saved first content change operation as the second content change operation for the current content change to determine the conflicting data for that content change.

[0137] Regarding step S11, in some embodiments of the present disclosure, it may include the following Figure 12 Steps S1101 to S1102 are shown.

[0138] In step S1101, the content change package submitted by the client is added to the content synchronization queue. Content change packages in the content synchronization queue are sorted from oldest to newest in the order they were submitted. Each content change package includes a version number and the content change operation. The content synchronization queue maintains the order of content change packages, allowing the server to serially process content change operations and ensure orderly content changes.

[0139] In step S1102, the version number and content change operation of the first content change package in the content synchronization queue are retrieved, resulting in the first version number and first content change operation. The first content change package in the content synchronization queue is the earliest content change package submitted to the server. Therefore, each time the server processes a content change operation, it retrieves the first content change package in the content synchronization queue for processing, thereby maintaining the orderliness of content changes. The version number and content change operation in the first content change package serve as the first version number and first content change operation in this content change operation processing task.

[0140] In some embodiments of the present disclosure, the document content changing method M10 may further include: Figure 13 The description of other steps can refer to the above content.

[0141] In step S12, when the first version number matches the second version number of the local target document on the server, the first content change operation is applied to the local target document on the server.

[0142] The first version number matches the second version number of the target document locally on the server, and the portion of the first and second version numbers that indicates the consistency of the version content is identical. For example, a version number includes a major version number, a minor version number, and a revision number, where the major and minor version numbers are used to indicate the consistency of the version content. In this case, if the major and minor version numbers of the first and second version numbers are the same, the first and second version numbers are considered to match.

[0143] When the first version number matches the second version number of the local target document on the server, it indicates that the client submits the first content change operation based on the target document with the synchronized server version, and therefore the first content changed by the first content change operation can be directly merged into the local target document on the server.

[0144] In some embodiments of the present disclosure, the document content changing method M10 may further include: Figure 14 Step S113 shown.

[0145] In step S113 , in response to the content synchronization request submitted by the client, the to-be-synchronized content of the target document of the server version that has changed relative to the target document of the client is sent to the client.

[0146] Specifically, step S113 includes the following steps: Figure 15 Steps S1131 to S1133 are shown.

[0147] In step S1131, in response to the content synchronization request submitted by the client, the third version number of the target document to be synchronized by the client is obtained. The third version number is the version number of the target document of the client that submitted the content synchronization request, and the third version number does not represent the sequence order of the versions.

[0148] In one embodiment, before a client performs a new content modification operation, it can proactively submit a content synchronization request to synchronize the client's version of the target document to the same version as the server's target document. This ensures that content edited by other clients can be seamlessly transferred to the current client, ensuring data consistency of the target document across all clients.

[0149] The server can query the versions iterated between the third version number and the current version number of the server's target document based on the third version number and the version tree, so that the server can determine the content changes of the server's current version of the target document relative to the target document with the third version number.

[0150] In step S1132, the local target document on the server is compared with the target document with the third version number, and the content of the local target document on the server that has been changed relative to the target document with the third version number is determined as the content to be synchronized.

[0151] In other words, the server can determine the content to be synchronized based on the version difference between the target document on the server and the client, and push the content to be synchronized in a personalized manner for the client version synchronization. In this way, the amount of data required for synchronization can be reduced and network bandwidth consumption can be reduced.

[0152] In one embodiment, the server queries the version tree to obtain each version iterated between the third version number and the current version number of the server's target document, and obtains the content change operations of each version between the third version number and the current version number of the server's target document, which are recorded as content change operations to be synchronized. The content changed by the content change operations to be synchronized is the content to be synchronized.

[0153] Furthermore, the server merges the content corresponding to different content change operations in the content to be synchronized based on the operation priorities corresponding to the content changes, and merges the content changes in the overlapping operation ranges to obtain the merged content to be synchronized.

[0154] For example, the content change operation of version V5.1 includes an overwriting operation on the character "yes", and the content change operation of version V5.2 includes a deletion operation on the character "yes" and its priority is greater than the overwriting operation on the character "yes", then the content changes of the character "yes" are merged, and the content of the deleted character "yes" is used as the content to be synchronized.

[0155] In step S1133, the content to be synchronized is sent to the client. The content to be synchronized is used to synchronize the version of the target document on the client to match the version on the server. Figure 2 In one example, the content to be synchronized is pushed to the client in the form of a change package.

[0156] Through steps S1131 to S1133, when synchronizing the current content of the target document to the client, the server does not need to transmit the entire target document, but only needs to transmit the changed part of the data, which can reduce the amount of data transmission.

[0157] Based on any of the above embodiments, the present disclosure further provides a device for changing document content. Figure 16 It is a schematic block diagram of the structure of a device for changing document content according to an embodiment of the present disclosure.

[0158] like Figure 16 As shown, the document content changing device includes a changed content acquisition module 110 , a content splitting module 120 , a conflict determination module 130 , a priority determination module 140 and a content changing module 150 .

[0159] The changed content acquisition module 110 is used to obtain the first content change operation of the first version number submitted by the client. The content splitting module 120 is used to split the first content changed by the first content change operation into multiple indivisible atomic data when the first version number does not match the second version number of the target document locally on the server. The conflict determination module 130 is used to determine the atomic data within the operation scope of the second content history change operation applied to the target document with the second version number as conflict data. The priority determination module 140 is used to determine the operation priority between the first data operation acting on the conflicting data in the first content change operation and the second data operation acting on the conflicting data in the second content history change operation. The content change module 150 is used to apply the first data operation to the target document locally on the server when the operation priority of the first data is greater than the operation priority of the second data operation.

[0160] The above-mentioned document content changing device can be computer software, and its various modules can be computer software modules. The implementation process of the functions and effects of each module in the above-mentioned document content changing device can be specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0161] Based on any of the above embodiments, the present disclosure further provides an electronic device, which can execute the method for changing document content of any of the above embodiments described in the present disclosure.

[0162] Figure 17 1 is a schematic block diagram of the structure of an electronic device 1000 according to an embodiment of the present disclosure.

[0163] The hardware structure of the electronic device 1000 can be implemented using a bus architecture. The bus architecture can include any number of interconnecting buses and bridges, depending on the specific application and overall design constraints of the hardware. The bus 1100 connects various circuits including one or more processors 1200, memory 1300, and / or hardware modules. The bus 1100 can also connect various other circuits 1400 such as peripheral devices, voltage regulators, power management circuits, external antennas, etc.

[0164] Bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component Architecture (EISA) bus. Buses can be classified as address buses, data buses, control buses, and the like. For ease of illustration, this figure shows only one connecting line, but this does not imply that there is only one bus or only one type of bus.

[0165] The present disclosure also provides a readable storage medium having a computer program stored therein, which is used to implement the above-mentioned method when the computer program is executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.

[0166] The present disclosure also provides a computer program product. The methods of the present disclosure can be implemented in whole or in part using software, hardware, firmware, or any combination thereof. When implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer programs or instructions are loaded and executed, the processes or functions of the present disclosure are performed in whole or in part.

[0167] A computer program or instruction can be stored in a readable storage medium or transferred from one readable storage medium to another. For example, a computer program or instruction can be transferred from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. A readable storage medium can be any accessible medium or a data storage device such as a server or data center that integrates one or more accessible media. The accessible medium can be a magnetic medium such as a floppy disk, hard disk, or magnetic tape; an optical medium such as a digital video disk; or a semiconductor medium such as a solid-state drive. The computer-readable storage medium can be a volatile or non-volatile storage medium, or can include both volatile and non-volatile types of storage media.

[0168] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0169] The present disclosure is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0170] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.

[0172] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in a suitable manner in any one or more embodiments / methods or examples. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and the features of different embodiments / methods or examples, unless they are contradictory.

[0173] Those skilled in the art will appreciate that the above embodiments are merely intended to clearly illustrate the present disclosure and are not intended to limit the scope of the present disclosure. Other changes or modifications may be made based on the above disclosure, and such changes or modifications are still within the scope of the present disclosure.

Claims

1. A method for changing document content, characterized in that: include: Obtain the first content change operation with the first version number submitted by the client; When the first version number matches the second version number of the local target document on the server, applying the first content change operation to the local target document on the server; When the first version number does not match the second version number of the local target document on the server, splitting the first content changed by the first content change operation into multiple indivisible atomic data; determining atomic data within an operation scope of the second content history change operation applied to the target document of the second version number as conflicting data; and if the atomic data is not conflicting data, applying the data operation in the first content change operation on the atomic data that is not conflicting data to the target document locally on the server, and merging the atomic data that is not conflicting data into the target document locally on the server; Determining an operation priority between a first data operation acting on the conflicting data in the first content change operation and a second data operation acting on the conflicting data in the second content history change operation; as well as When the operation priority of the first data is greater than the operation priority of the second data, the first data operation is applied to the local target document on the server.

2. The method for changing the content of a document according to claim 1, wherein: Splitting the first content changed by the first content change operation into multiple indivisible atomic data includes: determining a data type of the first content; When the data type is text, splitting the first content into multiple characters as multiple atomic data; or When the data type is a table, splitting the first content into a plurality of cells as the plurality of atomic data; or When the data type is an image, the first content is split into multiple layers or multiple graphic objects as the multiple atomic data.

3. The method for changing the content of a document according to claim 1, wherein: Also includes: Locking the operation authority of each client on the conflicting data so that the conflicting data is only processed by the first content change operation; as well as When the first data operation is applied to the local target document on the server, the operation rights of each client on the conflicting data are unlocked.

4. The method for changing the content of a document according to claim 1, wherein: Determining the operation priority between a first data operation with the first version number and a second data operation with the second version number acting on the conflicting data includes: generating conflict comparison content, the conflict comparison content including a first sub-content changed based on the first data operation and a second sub-content changed based on the second data operation; Sending the conflict comparison content to a first client that submitted the first data operation and a second client that submitted the second data operation; Obtaining first confirmation information returned by the first client and second confirmation information returned by the second client, wherein the first confirmation information and the second confirmation information are used to confirm the first sub-content or the second sub-content applied to the target document; and When both the first confirmation information and the second confirmation information confirm the application of the first sub-content, it is determined that the operation priority of the first data is greater than the operation priority of the second data.

5. The method for changing the content of a document according to claim 4, wherein: Determining the operation priority between a first data operation with the first version number and a second data operation with the second version number acting on the conflicting data further includes: When both the first confirmation information and the second confirmation information confirm that new collaborative content other than the first sub-content and the second sub-content is applied to the target document, the new collaborative content is applied to the target document locally on the server.

6. The method for changing the content of a document according to claim 1, wherein: Applying the first data operation to the target document locally on the server includes: querying a target version number, where the target version number is a version number of a latest version of a target document to which the second data operation is not applied; Tracing the local target document of the second version number on the server back to the target version number to obtain the target document of the target version number; and The first data operation is applied to the target document with the target version number locally on the server.

7. The method for changing the content of a document according to claim 6, wherein: Applying the first data operation to the target document locally on the server further includes: Generate a conflict resolution record, which includes the historical version number before the first data operation is applied, the current version number when the first data operation is effective, the original content before the first data operation is applied, and the changed content after the first data operation is applied; the conflict resolution record is used to query the target version number.

8. The method for changing the content of a document according to claim 6, wherein: Query the target version number, including: determining a second sub-content changed based on the second data operation; Searching for a conflict resolution record containing the second sub-content as a target conflict resolution record; and When the target conflict resolution record is found, the historical version number in the target conflict resolution record to which the second data operation is not applied is determined as the target version number.

9. The method for changing document content according to claim 1, wherein: Also includes: Each of the first data operations applied to the local target document on the server is saved as a first content history change operation.

10. The method for changing document content according to claim 1, wherein: Obtain the first content change operation of the first version number submitted by the client, including: Adding the content change package submitted by the client to a content synchronization queue, wherein the content change packages in the content synchronization queue are sorted from old to new in the order of submission, and the content change package includes a version number and a content change operation; and The version number and content change operation in the first content change package in the content synchronization queue are obtained to obtain the first version number and the first content change operation.

11. The method for changing document content according to claim 1, wherein: Also includes: In response to a content synchronization request submitted by a client, obtaining a third version number of a target document to be synchronized by the client; Comparing the local target document on the server with the target document with the third version number, and determining the content of the local target document on the server that has been changed relative to the target document with the third version number as content to be synchronized; as well as Send the content to be synchronized to the client.

12. An electronic device, characterized in that: include: a memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory, so that the processor executes the method for changing document content according to any one of claims 1 to 7.

13. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which, when executed by a processor, are used to implement the method for changing document content according to any one of claims 1 to 7.

14. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method for changing the document content according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Collaborative programming method, device and system, server and medium

    CN113626010A

  • Collaborative development method, device and equipment based on low-code platform and storage medium

    CN119045873A