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

By splitting client content into atomic data and handling conflicts according to priority, the data integrity problem caused by inconsistency in versions in multi-user online collaborative editing is solved, and higher data integrity and consistency are achieved.

CN120354839AActive Publication Date: 2025-07-22ZHEJIANG PLANER TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When multiple users collaborate on document editing online, content conflicts caused by inconsistent document versions of the client and server, and the existing technology cannot be compatible with retaining conflicting content, resulting in low data integrity in server documents.

Method used

Split the content submitted by the client into atomic data that cannot be re-divided, determine the conflicting data and selectively incorporate it into the server document according to the operation priority, lock the conflicting data permissions, generate conflict comparison content, and manually decide the priority, and trace back the version number 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 CN120354839A_ABST
    Figure CN120354839A_ABST
Patent Text Reader

Abstract

The invention provides a document content changing method, electronic equipment, a storage medium and a program product. The change method comprises the following steps: acquiring a first content change operation of a first version number submitted by a client; when the first version number is not matched with a second version number of a local target document of the server, splitting the first content changed by the first content change operation into a plurality of atomic data which cannot be re-divided; determining atomic data in an operation range of a second content historical change operation applied to the target document of the second version number as conflict data; determining an operation priority between a first data operation acting on the conflict data in the first content change operation and a second data operation acting on the conflict data in the second content historical change operation; when the operation priority of the first data is larger than the operation priority of the second data operation, the first data operation is applied to a local target document of the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] In a scenario where multiple users collaboratively edit a document online, if the client submits the changed content in the document to the server and the document versions of the client and the server are inconsistent, the changed content submitted by the client may conflict with the document content on the server. When there is a conflict in the content, the current technical solutions usually can only select one to retain the content of the client or the version on the server, and cannot compatibly retain the conflicting content, resulting in a low data integrity of the conflicting part of the content in the server's document. 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, there is provided a method for changing document content, including: 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 on the server locally, splitting the first content changed by the first content change operation into multiple atomic data that cannot be further divided; determining the atomic data within the operation range of a second content historical change operation applied to the target document with the second version number as conflict data; determining the operation priority between a first data operation acting on the conflict data in the first content change operation and a second data operation acting on the conflict data in the second content historical change operation; when the operation priority of the first data is greater than the operation priority of the second data operation, applying the first data operation to the target document on the server locally.

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

[0006] A method for changing the content of a document according to at least one embodiment of the present disclosure, which splits the first content changed by the first content change operation into multiple atomic data that cannot be further divided, includes: 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, the first content of different data types can be split into atomic data, and the applicable range is relatively large.

[0008] A method for changing the content of a document according to at least one embodiment of the present disclosure further includes: locking the operation permissions of each client for the conflict data so that the conflict data only accepts the processing of the first content change operation; when applying the first data operation to the target document on the server local, unlocking the operation permissions of each client for the conflict data.

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

[0010] A method for changing the content of a document according to at least one embodiment of the present disclosure, which determines 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 conflict data, includes: generating conflict comparison content, which includes 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 the first client that submitted the first data operation and the 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, where the first confirmation message and the second confirmation message are used to confirm the application of the first sub-content or the second sub-content in the target document; when both the first confirmation message and the second confirmation message 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, it is possible to confirm the operation priority of the data operation to the client and provide an implementation method for resolving conflicts through manual decision-making.

[0012] A method for changing the content of a document according to at least one embodiment of the present disclosure, determining the operation priority between a first data operation on the first version number of the conflict data and a second data operation on the second version number, 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, applying the new collaborative content to the target document locally on the server.

[0013] According to the technical solution of this embodiment, when a human decision provides new collaborative content as a new content change plan, the new collaborative content can be used to replace the changed content of the conflict data.

[0014] A method for changing the content of a document according to at least one embodiment of the present disclosure, 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 the version number of the target document of the latest version to which the second data operation has not been applied; reverting the target document with the second version number locally on the server 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 with the target version number locally on the server.

[0015] According to the technical solution of this embodiment, it can be ensured that there will be no logical conflict when applying the first data operation for content change, avoiding running crashes.

[0016] A method for changing the content of a document according to at least one embodiment of the present disclosure, applying the first data operation to the target document locally on the server, further includes: generating a conflict resolution record, where the conflict resolution record includes the historical version number to which the first data operation has not been applied, the current version number when the first data operation takes effect, the original content before applying the first data operation, and the changed content after applying the first data operation; 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.

[0018] A method for changing the content of a document according to at least one embodiment of the present disclosure, querying a target version number, includes: determining a second sub-content changed based on the second data operation; querying a conflict resolution record including the second sub-content as a target conflict resolution record; and when the target conflict resolution record is queried, determining the historical version number to which the second data operation has not been applied in the target conflict resolution record 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.

[0020] The method for changing the document content according to at least one embodiment of the present disclosure further includes: saving each of the first data operations applied to the target document on the local server as a first content historical change operation.

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

[0022] The method for changing the document content according to at least one embodiment of the present disclosure for obtaining the first content change operation with the first version number submitted by the client includes: adding the content change package submitted by the client to the content synchronization queue, and the content change packages in the content synchronization queue are sorted from old to new according to the submission order, and the content change package includes a version number and a content change operation; obtaining the version number and the 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 the content change operations to ensure the orderliness of the content change.

[0024] The method for changing the document content 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 on the local server, applying the first content change operation to the target document on the local server.

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

[0026] According to the technical solution of this embodiment, it further 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 target document on the local server with the target document with the third version number, and determining the content changed by the target document on the local server relative to the target document with the third version number as the content to be synchronized; sending the content to be synchronized to the client.

[0027] According to the technical solution of this embodiment, when the server synchronizes the current content of the target document to the client, it is not necessary to transmit the complete target document, and only the changed partial data needs to be transmitted, reducing the data transmission volume.

[0028] According to another aspect of the present disclosure, there is provided an electronic device, including: a memory that stores execution instructions; and a processor that executes the execution instructions stored in the memory, such that the processor executes the method for changing the document content of any one of the embodiments of the present disclosure.

[0029] According to still another aspect of the present disclosure, there is provided a readable storage medium storing execution instructions, which are used to implement the method for changing the document content of any one of the embodiments of the present disclosure when executed by a processor.

[0030] According to yet another aspect of the present disclosure, there is provided a computer program product including a computer program, which implements the method for changing the document content of any one of the embodiments of the present disclosure when executed by a processor. Description of the Drawings

[0031] The drawings illustrate exemplary embodiments of the present disclosure and, together with the description thereof, are used to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are included in this specification and form a part of this specification.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

[0048] Figure 17 It is a schematic block diagram of an electronic device according to an embodiment of the present disclosure. Detailed implementation manners

[0049] The present disclosure will be further described in detail below with reference to the accompanying drawings and examples. It can be understood that the specific examples described herein are only for explaining the relevant content and do not limit the present disclosure. Additionally, it should be noted that for the sake of description, only the parts related to the present disclosure are shown in the drawings.

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

[0051] In the scenario of multi-user online collaborative document editing, if the client submits the changed content (the first content) in the document to the server, and the server has applied the content (the second content) that the client has not changed, and there is a conflict between the first content and the second content, the server usually can only select one of the first content and the second content to be retained in the document. The server can either not retain the first content or not retain the second content. The server cannot compatibly retain the conflicting content, resulting in a low data integrity of the conflicting part of the content in the server's document.

[0052] For this reason, the present disclosure proposes the following technical solution. In this technical solution, it is supported to determine more fine-grained conflicting data that conflicts with the second content in the first content submitted by the client, so that the document on the server can retain the part of the first content that is not conflicting data, rather than completely abandoning the retention of the first content. Moreover, the conflicting data in the first content can be retained as appropriate based on its corresponding data operation priority. In this way, the data integrity of the conflicting part of the content in the server's document can be improved.

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

[0054] Atomic data: It refers to an indivisible independent unit in a document, such as a single character, a single cell, a single graphic element, etc. in the document.

[0055] Figure 1 FIG. shows an overall flowchart of a document content change method M10 according to an embodiment of the present disclosure. As Figure 1 shown, the method includes steps S11 to S19.

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

[0057] Refer to Figure 2 , the application scenario of the document content change method can be a scenario of multi-client online collaborative document editing. In this application scenario, the document collaboratively edited by multiple clients (such as client A, client B) is used as the target document; the server receives the content change operation submitted by the client for the content in the target document, obtains the target document with the content changed, and synchronizes the changed content to each client. As Figure 2The first content change operation shown refers to the content change operation performed by client A on the target document. Among them, the content change operation can include content insertion operation, content overwrite operation, content deletion operation, etc. The content in the target document that has changed due to 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 content in the target document, it submits a change package corresponding to this change operation to the server. This change package is used to enable the server to synchronize this content change operation. Among them, the information in the change package includes the version number of the target document of client A, recorded as the first version number, and the content change operation performed by client A on the content of the target document, recorded as the first content change operation. Among them, a change package can contain multiple first content change operations. For example, assume that client A modifies the content of a cell and inserts a new picture, then saves the above change operation and submits a change package to the server. Then this change package contains two first content change operations, namely the modification operation of the cell and the insertion operation of the picture, and the change package also contains the version number of the target document of client A, recorded as the first version number. After the content of the target document on the server is changed locally, it pushes a synchronization package to client B to synchronize the content of the changed part. After client B receives the synchronization package, it performs a content change operation on the target document of a certain version number of client B to obtain the target document after the content change. It should be noted that there can be more clients, not just two clients.

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

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

[0061] The mismatch between the first version number and the second version number indicates that the version of the target document edited by the client is different from the version of the target document on the server. In the scenario of multi-user online collaborative editing, the target document on the server often undergoes corresponding content changes based on the content change operations submitted by the client, resulting in a version change of the target document on the server and an update of the version number accordingly. Based on this, when the first version number and the second version number do not match, it is usually because before the current client submitted the content change operation with the first version number, the server applied the content change operations submitted by other clients, causing a version change of the target document on the server, and the target document after the version change on the server has not been pushed to the current client yet. 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 target document on the server locally, the server needs to consider whether there is a conflict between the content to be changed with the first version number and the content to be changed with the second version number. For content without conflicts, it can be directly merged, and for content with conflicts, further processing is required 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 different, 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, or include a major version number and a minor version number, etc., which are not limited here. In an example, when the characters (such as the major version number and the minor version number) representing the version of the target document in the first version number and the second version number are not exactly the same, it is determined that the first version number does not match the second version number.

[0063] Splitting the first content into indivisible atomic data means splitting the first content into independent units that cannot be further divided. For example, splitting text into individual characters, splitting a table into individual cells, etc.

[0064] When the first version number does not match the second version number of the target document on the server local, the purpose of splitting the first content into multiple atomic data that cannot be further divided is as follows: to subdivide the conflict-free content that can be merged with the content changed by the second version number and the content that conflicts with the content changed by the second version number in the first content to be changed. In this way, it is possible to support more fine-grained conflict content processing, narrow the scope of conflict content, and facilitate local repair or update of the target document content. For example, it is possible to perform conflict content processing only on a single character in the text of the first content that conflicts with the content changed by the second version number, and directly merge the other characters in the text that do not conflict 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 on the server is updated from the previous version number to the current second version number. This content change operation is recorded as the second content historical change operation, and the content changed by the second content historical change operation is recorded as the second content.

[0066] S15. Determine the atomic data within the operation scope of the second content historical change operation applied to the target document with the second version number as conflict data.

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

[0068] For example, if an atomic data is the 6th character in paragraph 1 and the operation scope of the second content historical change operation is the 1st - 100th characters in paragraph 1, then it is considered that the atomic data is within the operation scope of the second content historical change operation and is determined as conflict data.

[0069] When the atomic data is not conflict data, the data operation in the first content change operation that acts on this atomic data can be applied to the target document on the server local, and the atomic data that is not conflict data (such as Figure 2 the conflict-free data in) is incorporated into the target document on the server local.

[0070] In one embodiment, conflict data can be determined for the atomic data within the overlapping range between the operation range of the first content change operation and the operation range of the second content historical change operation. For example, if the operation range of the first content change operation is the 6th to 12th characters of paragraph 1, and the operation range of the second content historical change operation is the 1st to 100th characters of paragraph 1, and the overlapping operation range between the two operation ranges is the 6th to 12th characters of paragraph 1, then each character within the 6th to 12th characters of paragraph 1 is determined as conflict data.

[0071] Further, in one embodiment, before splitting the first content changed by the first content change operation into multiple indivisible atomic data, it can be determined whether the first content change operation is a conflict operation based on whether the operation range of the first content change operation overlaps with the operation range of the second content historical change operation. Specifically, when there is an overlap between the operation range of the first content change operation and the operation range of the second content historical change operation, the first content change operation is determined as a conflict operation; otherwise, when there is no overlap between the operation range of the first content change operation and the operation range of the second content historical change operation, it is determined that the first content change operation is not a conflict operation.

[0072] When the first content change operation is not a conflict operation, it indicates that there is no operation conflict between the first content change operation performed by the client (such as client A) this time and the second content historical change operation submitted by other clients (such as client B) and not yet synchronized to this client (such as client A) by the server application. That is, the first content changed based on the first content change operation and the second content changed based on the second content historical change operation do not affect each other. Therefore, the splitting process of the first content in step S13 can be skipped. The first content change operation can be directly applied to the target document on the server local, and the first content changed by the first content change operation can be incorporated into the target document on the server local.

[0073] When the first content change operation is a conflict operation, it indicates that there is a conflict between the first content changed based on the first content change operation and the second content changed based on the second content historical change operation, and the conflict needs to be resolved through subsequent conflict content processing steps. Based on this, when the first content change operation is a conflict operation, the splitting process of the first content in step S13 is executed, the first content is split into multiple atomic data, and conflict data with a finer granularity than the conflict operation is determined based on the multiple atomic data to more precisely resolve the content conflict of different version documents.

[0074] In step S17, determine the magnitude of the operation priority between the first data operation acting on the conflict data in the first content change operation and the second data operation acting on the conflict data in the second content historical change operation.

[0075] Among them, the first data operation is a data change operation that acts on the conflicting data alone in the first content change operation. The second data operation is a data change operation that acts on the conflicting data alone in the second content historical change operation.

[0076] For example, the conflicting data is the 6th character of paragraph 1. Suppose the first content change operation is used to change the 6th to 12th characters of paragraph 1. Then the sub-operation (such as character insertion, overwrite, deletion, etc.) in the first content change operation for changing the 6th character of paragraph 1 is the first data operation. Similarly, suppose the second content historical change operation is used to change the 1st to 100th characters of paragraph 1. Then the sub-operation (such as character insertion, overwrite, deletion, etc.) in the second content historical change operation for changing the 6th character of paragraph 1 is the second data operation.

[0077] The operation priority magnitude of the data operation is an evaluation index for resolving content change conflicts. If the operation priority of the first data is greater than that of the second data operation, it indicates that the priority of applying the operation of the first data to change the conflicting data in the target document is higher. Conversely, if the operation priority of the first data is less than that of the second data operation, it indicates that the priority of applying the operation of the second data to change the conflicting data in the target document is higher.

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

[0079] In yet another embodiment, the operation priority of data operations can be determined through manual decision-making. For example, assume 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. Then the server sends a priority confirmation request to client A and client B respectively to determine the operation 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 operation 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 operation priority of the first data is greater than that of the second data operation, the server determines that the operation priority of the first data is greater than that of the second data operation.

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

[0081] When the operation priority of the first data is greater than that of the second data operation, it indicates that the priority of changing the conflicting data by applying the operation of the first data to the target document is higher than that of changing the conflicting data by applying the operation of the second data to the target document. That is to say, for a certain piece of conflicting data, the solution to resolve the conflict is to apply the data operation with a higher operation priority to change the data content in the target document on the server locally.

[0082] When the operation priority of the first data operation acting on the conflicting data is greater than that 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 operation priority of the first data operation acting on the conflicting data is less than that of the second data operation, the solution to resolve the conflict is to apply the second data operation, so that the data changed by the second data operation is incorporated into the target document of the server. Since the target document with the second version number has already applied the second data operation to the conflicting data, when the operation priority of the first data operation acting on the conflicting data is less than that of the second data operation, the server does not perform a change operation on the conflicting data, and thus the content changed by the second data operation can be maintained in the target document.

[0084] In summary, the method for changing the content of the embodiments of the present disclosure provides a solution for processing content changes to the target document on the server side when the first version number of the first content change operation submitted by the client does not match the second version number of the target document on the server side. To solve the conflict caused by different change operations on the same content in the target documents of different versions that do not match, the embodiments of the present disclosure split the first content to be changed into multiple atomic data that cannot be further divided, so as to determine more fine-grained conflict data from the multiple atomic data for processing the conflicting content. In the traditional content synchronization solution, usually only all the changes to the first content can be applied to the target document. If there is a conflict in content changes between the changes to the first content with the first version number submitted by the client and the changes to the second content with the second version number on the server side currently, then the application of the changes to the first content has to be completely abandoned. Therefore, the method for changing the content of the present disclosure supports determining more fine-grained conflict data when there is a conflict in content changes between the changes to the first content with the first version number submitted by the client and the changes to the second content with the second version number on the server side currently, so that the target document on the server can directly apply partial content changes of the first content that are not conflict data, rather than completely abandoning the application of the changes to the first content. Moreover, for the conflict data, when the operation priority of the first data acting on the conflict data is higher than the operation priority of the second data operation, the content of the conflict data in the first content can be changed by applying the first data operation on the target document on the server side. In this way, the first content in the target document after the content change on the server can have higher data integrity.

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

[0086] In step S131, determine the data type of the first content. Herein, the first content is the content changed by the first content change operation. The scope of the first content corresponds to the operation scope of the first content change operation. The data type of the first content generally may include text data, table data, image data, etc. Determining the data type of the first content aims to determine the type of the atomic data that cannot be further divided corresponding to the first content, so as to split the first content into atomic data of the corresponding type.

[0087] In step S132, when the data type is text, the first content is split into multiple characters as multiple atomic data. For content changes 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 character after the split are saved, and the attributes may include position, format, etc. For example, for the split character "是", its attributes are 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, and using new characters to overwrite old characters in the same position. Modification operations on modifying the color, font and other attributes of characters are equivalent to using the modified characters with color and font to overwrite the characters before modification in the same position, which belongs to the data overwriting 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 content changes 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 properties of each cell after the split are saved, and the properties may include position, format, etc. For example, for a certain cell after the split, its properties are saved as "x rows and x columns, no border". The data change operations on the table include inserting cells, deleting cells, and using new cells to overwrite old cells in the same position. Modification operations such as modifying the color, style and other attributes of a cell are equivalent to using the modified cells with color and style to overwrite the cells before modification in the same position, which belongs to the data overwriting 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 one example, if an image is composed of multiple independently operable graphic objects, the image can be split into multiple graphic objects, each of which is an atomic data. The data change operation on the graphic object includes inserting a graphic object, deleting a graphic object, and using a new graphic object to overwrite the old graphic object in the same position. The modification operation of modifying the color, style and other attributes of the graphic object is equivalent to using the modified graphic object with color and style to overwrite the graphic object before modification in the same position, which belongs to the data overwriting type operation.

[0090] In yet another example, if an image is composed of multiple layers that can be individually manipulated, the image can be split into multiple layers, with each layer being an atomic piece of data. Data change operations on graphic objects include inserting layers, deleting layers, and using a new layer to overwrite an old layer at the same location. For operations that modify the attributes of a layer or the content within a layer, it is equivalent to using the modified layer object with the attributes and content to overwrite the layer before modification at the same location, which belongs to the data overwrite type of operation.

[0091] In some embodiments of the present disclosure, the method M10 for changing document content may further include steps S16 and S110 as Figure 4 shown. For other steps, reference may be made to Figure 1 the description.

[0092] In step S16, lock the operation permissions of each client for the conflicting data so that the conflicting data only undergoes processing of the first content change operation.

[0093] The purpose of step S16 is to avoid conflicting data in the parallel change processing of clients when the server processes the 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 determines the conflicting data, mark the conflicting data in the target document to prompt the user that the marked conflicting data is data that cannot be changed (such as edited). Among them, the way of marking the conflicting data can adopt ways such as color marking and annotation box marking, which are not limited here.

[0095] In S110, when applying the first data operation to the target document on the server locally, unlock the operation permissions of each client for the conflicting data.

[0096] When applying the first data operation to the target document on the server locally, it indicates that the version content conflict corresponding to the conflicting data has been resolved, and thus the operation permissions of each client for the conflicting data can be unlocked to avoid affecting the change operation of the conflicting data by the client.

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

[0098] In step S171, generate conflicting comparison content, which 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, assume that the first data operation is used to overwrite the 6th character "yes" in paragraph 1 of the target document with "no", then the character "no" is the first sub - content. Similarly, assume that the second data operation is used to overwrite the 6th character "yes" in paragraph 1 of the target document with "or", then the character "or" is the second sub - content.

[0100] In one embodiment, the conflict comparison content further includes the context data of the conflict data to facilitate the user to confirm the location where the conflict data is located. For example, when the conflict data is a character, the context data of the conflict data can be the text of the paragraph where the character is located. When the conflict data is a cell, the context data of the conflict data can be the cells adjacent to the conflict data. When the conflict data is a graphic element, the context data of the conflict data can be the graphic elements adjacent to the conflict data.

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

[0102] When the server obtains the content change operation submitted by the client, it retains the submission record of the client. In this way, it is convenient for the server to determine the client that submitted the content change operation. The first data operation is a sub - operation in 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 in the second content historical change operation, so the client that submitted the second content historical change operation is the second client.

[0103] Through step S172, the conflict comparison content can 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 conflict of content change through manual decision - making.

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

[0105] Figure 6 It is a schematic diagram of the conflict comparison content of an embodiment of the present disclosure. The conflict comparison content includes the first sub - content and the context data of the first sub - content, corresponding to Figure 6 the change of the user A (client A, the first client) shown, and the second sub - content and the context data of the second sub - content, corresponding to Figure 6Changes to the schematic User B (Client B, the second client). Among them, the first sub-content and the second sub-content are marked with different colors respectively to help users identify. The interface showing the conflict comparison 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. Taking the first client as an example, when the user of the first client clicks the first confirmation button, the first client sends a first confirmation message representing the confirmation of the application of the first sub-content to the server.

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

[0107] When the sub-content confirmed by the first confirmation message and the second confirmation message is the same, it indicates 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 operation priority sizes 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, it can be determined that the operation priority of the first data operation is higher, so that the server applies the first data operation to change the conflict data and incorporates the first sub-content into the target document of the server.

[0108] Furthermore, regarding step S17, in some embodiments of the present disclosure, it may further include step S175 as Figure 7 shown.

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

[0110] In one embodiment, after manual decision-making by the users of the first client and the second client, it is determined to apply new collaborative content other than the first sub-content and the second sub-content to the target document. In this case, the first client and the second client can respectively return a first confirmation message and a second confirmation message containing the new collaborative content to the server to inform the server of the new collaborative content changed by the manual decision, so that the server applies the new collaborative content to resolve the conflict of content change. In this way, when the manual decision provides new collaborative content as a new content change plan, the new collaborative content can be used to replace the changed content of the conflict data.

[0111] For example, the first sub - content is used to overwrite the character "yes" with "no", the second sub - content is used to overwrite the character "yes" with "or", and the newly determined collaborative content through manual decision is used to delete the character "yes". Then, the first client and the second client respectively confirm the content obtained by deleting the character "yes" in the first confirmation information and the second confirmation information as the new collaborative content. The server deletes the character "yes" in the target document based on the new collaborative content to apply the new collaborative content to the target document.

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

[0113] Steps S191 to S193 are used to handle the situation where the first data operation cannot be directly applied to the target document locally 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" at the same position. When the second data operation (the second content historical change operation) has been applied to the target document of the current second version number on the server, due to a logical conflict, it is impossible to perform a data overwrite operation on the already deleted character "yes". Through steps S191 to S193, the target document of the second version number can be traced back to the version before 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 is applied for content change to ensure that there will be no logical conflict when applying the first data operation for content change and avoid running crashes.

[0114] In step S191, the target version number is queried, and the target version number is the version number of the target document of the latest version that has not applied the second data operation.

[0115] In one embodiment, the server locally maintains a version tree, and the version tree includes the version numbers of the content that has been changed on the server and the corresponding content change operations or data operations. In this way, when version back - tracing processing is required, the version number of the first application of the second data operation can be queried from the version tree, and the previous version of the version number of the first application of the second data operation is the latest version that has not applied the second data operation.

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

[0117] Tracing back the target document to the latest possible version can retain more recently synchronized content and make the data integrity of the newly synchronized content of the target document better.

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

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

[0120] In one embodiment, the server can obtain the content changes of each version number between the second version number and the target version number from the version tree, and sequentially return the changed content in the target document to the previous version in the order from the new version number to the old version number, while the unchanged content remains unchanged until it is traced 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 with the target version number on the server local.

[0122] Since the second data operation has not been applied to the target document with the target version number, applying the first data operation to the target document with the target version number will not cause a logical conflict in the data operation, so as to apply the first data operation to the target document in the case of 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 further include step S194 as Figure 9 shown.

[0124] In step S194, a conflict resolution record is generated, and the conflict resolution record is used for querying the target version number. Among them, the conflict resolution record includes the historical version number to which the first data operation has not been applied, the current version number when the first data operation takes effect, the original content before the change after applying the first data operation, and the changed content after the change after applying the first data operation.

[0125] When the first data operation is successfully applied to the target document on the server local, it is regarded as resolving a conflict in content change, and the relevant information for resolving this conflict is recorded on the server to generate a conflict resolution record. Among them, the conflict resolution record contains the version numbers before and after applying the first data operation, and the content before and after the change based on the first data operation. In this way, when encountering a data operation conflicting with the first data operation in a subsequent version, the historical version number to which the first data operation has not been applied can be queried based on the conflict resolution record as the target version number for version backtracking to resolve the conflict in content change.

[0126] Further, in one embodiment, when performing version rollback based on the conflict resolution record, it is not necessary to roll back all the data of the target version. Instead, only the changed content after applying the first data operation is rolled back to the original content before applying the first data operation, minimizing the scope of the data rollback operation and reducing the amount of data to be rolled back, so as 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 steps S1911 to S1913 as Figure 10 shown. Steps S1911 to S1913 are used to query the target version number based on the conflict resolution record when the server stores the conflict resolution record. Among them, there may be multiple conflict resolution records, and different conflict resolution records correspond to different data operations, version numbers, and content before and after changes.

[0128] In step S1911, determine the second sub-content changed based on the second data operation. In step S191, the purpose of querying the target version number is to find the version number before the second data operation is applied, that is, the previous version of the version number when the second data operation is first applied. If the server stores the conflict resolution record for resolving conflicts by applying the second operation data, the conflict resolution record corresponding to the second operation data contains the historical version number before the second data operation is applied, the current version number when the second data operation takes effect, the original content before applying the second data operation, and the changed content after applying the second data operation. Then, the historical version number before the second data operation is applied can be obtained as the target version number. In this case, the changed content after applying the second data operation 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, query the conflict resolution record containing the second sub-content 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, which contains the historical version number before the second data operation is applied. Therefore, it is used as the target conflict resolution record.

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

[0131] When the target conflict resolution record is queried, the version numbers before and after the application of the second data operation can be obtained from the target conflict resolution record, and the historical version number before the application of the second data operation therein can be determined as the target version number. In this way, the target version number can be conveniently and quickly queried using the target conflict resolution record. Since the historical version number in the target conflict resolution record must be the latest version without the application of the second data operation, the process of determining the latest version without the application of the second data operation can be omitted.

[0132] In one embodiment, when the target conflict resolution record is not queried, the version tree needs to be queried to obtain the target version number. Alternatively, in another embodiment, when the target conflict resolution record is not queried, the first version number is determined as the target version number. Since the conflict between the first data operation and the second data operation stems from the fact that the target document on the client is not synchronized to the second version number, the target document of the first version number must be the version without the application of the second data operation. In this way, the target version number can be quickly obtained, saving computing power.

[0133] In some embodiments of the present disclosure, the document content change method M10 may further include step S111 as Figure 11 shown. Figure 11 The specific content of the other steps shown in can be referred to the above description.

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

[0135] Among them, the first content historical change operation is the content change operation actually applied to the target document on the server local. Compared with the first content change operation submitted by the client, since some of the first data operations in the first content change operation may not be applied due to their operation priorities being lower than those of the second data operation, the amount of content actually changed by the first content historical 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 serves as the new first content change operation. At this time, the first content historical change operation actually applied in the first content change operation of the previous change package is the second content historical change operation of the second version number relative to the next change package, which is used to determine the new conflict data corresponding to the next change package. In this way, when the server next obtains a content change operation with a mismatched version number, the first content historical change operation saved last time can be used as the second content historical change operation for this content change process to determine the conflict data for this content change.

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

[0138] In step S1101, the content change package submitted by the client is added to the content synchronization queue. Among them, the content change packages in the content synchronization queue are sorted from old to new according to the submission order. The content change package includes a version number and a content change operation. The content synchronization queue is used to maintain the order of the content change packages, so that the server can process the content change operations serially, ensuring the orderliness of the content changes.

[0139] In step S1102, the version number and the content change operation in the first content change package in the content synchronization queue are obtained to obtain a first version number and a first content change operation. The first content change package in the content synchronization queue is the content change package that is earliest submitted to the server in the content synchronization queue. Therefore, each time the server processes a content change operation, it takes out the first content change package in the content synchronization queue for processing, so as to maintain the orderliness of the content changes. The version number and the content change operation in the first content change package are used as the first version number and the first content change operation in the processing task of this content change operation.

[0140] In some embodiments of the present disclosure, the document content change method M10 may further include step S12 as Figure 13 shown. The descriptions 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 target document on the server local, the first content change operation is applied to the target document on the server local.

[0142] Among them, the matching of the first version number and the second version number of the target document on the server local means that the parts of the first version number and the second version number representing the version content consistency are the same. For example, the version number includes a major version number, a minor version number, and a revision number, where the major version number and the minor version number are used to represent the consistency of the version content. In this case, when the major version number and the minor version number of the first version number and the second version number are the same, it is considered that the first version number and the second version number match.

[0143] When the first version number matches the second version number of the target document on the server local, it means that the client submits the first content change operation on the basis of the target document whose server version has been synchronized. Therefore, the first content changed by the first content change operation can be directly incorporated into the target document on the server local.

[0144] In some embodiments of the present disclosure, the document content change method M10 may further include step S113 as Figure 14 shown.

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

[0146] Specifically, step S113 includes steps S1131 to S1133 as Figure 15 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. Among them, the third version number is the version number of the target document of the client that submits the content synchronization request, and the third version number does not represent the sequence order of the versions.

[0148] In one embodiment, before the client performs a new content change operation, a content synchronization request can be actively submitted to synchronize the version of the target document of the client to the same version as the target document of the server. To ensure that the content edited by other clients can be seamlessly connected to the current client and ensure data consistency of the target document on each client.

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

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

[0151] That is to say, the server can determine the content to be synchronized based on the version difference between the target documents of the server and the client, so as to push the content to be synchronized personalized for the version synchronization of the client. In this way, the amount of data to be transmitted for synchronization can be reduced, and the consumption of network bandwidth 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 target document of the server, and obtains the content change operations of each version between the third version number and the current version number of the target document of the server, which are recorded as the 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 performs a merging process on the content corresponding to different content change operations in the content to be synchronized based on the operation priority corresponding to the content change, and merges the content changes with overlapping operation ranges to obtain the merged content to be synchronized.

[0154] For example, the content change operation in version V5.1 includes an overwrite operation on the character "yes", and the content change operation in version V5.2 includes a deletion operation on the character "yes" and its priority is higher than the overwrite operation on the character "yes". Then, the content changes to the character "yes" are merged, and the content of deleting the character "yes" is taken 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 side to match the server. See 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 the server synchronizes the current content of the target document to the client, it is not necessary to transmit the entire target document, and only the changed part of the data needs to be transmitted, which can reduce the amount of data transmission.

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

[0158] As Figure 16 shown, the device for changing the content of the document 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 change module 150.

[0159] The changed content acquisition module 110 is used to acquire 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 atomic data that cannot be further divided when the first version number does not match the second version number of the target document on the server side. The conflict determination module 130 is used to determine the atomic data within the operation range of the second content historical change operation applied to the target document of the second version number as conflict data. The priority determination module 140 is used to determine the magnitude of the operation priority between the first data operation acting on the conflict data in the first content change operation and the second data operation acting on the conflict data in the second content historical change operation. The content change module 150 is used to apply the first data operation to the target document on the server side when the operation priority of the first data is greater than the operation priority of the second data operation.

[0160] The apparatus for changing the above-mentioned document content may be computer software, and each module thereof may be a computer software module. The implementation processes of the functions and roles of each module in the apparatus for changing the above-mentioned document content are specifically described in the implementation processes of the corresponding steps in the above method, and will not be elaborated here.

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

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

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

[0164] The bus 1100 can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Component (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of simplicity of representation, only one connecting line is used in this figure, but it does not mean that there is only one bus or one type of bus.

[0165] The present disclosure also provides a readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, it is used to implement the above method. The "readable storage medium" can be any device that can contain, store, communicate, propagate, or transmit a program for use in an instruction execution system, apparatus, or device, or in combination with these instruction execution systems, apparatus, or devices. More specific examples of the readable storage medium include the following: an electrical connection part (electronic device) having one or more wirings, a portable computer disk cartridge (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable programmable 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 by software, hardware, firmware, or any combination thereof. When implemented using software, it 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 program or instructions are loaded and executed, the processes or functions of the present disclosure are executed in whole or in part.

[0167] The computer program or instructions can be stored in a readable storage medium, or transmitted from one readable storage medium to another. For example, the computer program or instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center in a wired or wireless manner. The readable storage medium can be any available medium that can be accessed, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium, such as a floppy disk, hard disk, or magnetic tape; it can also be an optical medium, such as a digital video disc; or it can be 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 should understand that the embodiments of the present disclosure can be provided as a method, system, or computer program product. Therefore, the present disclosure can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0169] The present disclosure is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (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, and 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 the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate a means for implementing the specified functions in Figure 1 one process or multiple processes and / or blocks Figure 1 one block or multiple blocks.

[0170] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to work in a particular manner, such that the instructions stored in the computer-readable memory produce a manufacture including an instruction device that implements the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks.

[0171] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus, such that a series of operational steps are performed on the computer or other programmable apparatus to produce a computer-implemented process, so that the instructions executed on the computer or other programmable apparatus provide steps for implementing the functions specified in one process Figure 1 or more processes and / or blocks Figure 1 or more blocks.

[0172] In the description of this specification, the descriptions with reference to the terms "one embodiment / way", "some embodiments / ways", "example", "specific example", or "some examples", etc., mean that the specific features, structures, or characteristics described in connection with the embodiment / way or example are included in at least one embodiment / way or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / way or example. Moreover, the specific features, structures, or characteristics described can be combined in any one or more embodiments / ways or examples in a suitable manner. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments / ways or examples described in this specification and the features of different embodiments / ways or examples.

[0173] Those skilled in the art should understand that the above embodiments are only for clearly explaining the present disclosure, rather than limiting the scope of the present disclosure. For those skilled in the art, other changes or variations can be made on the basis of the above disclosure, and these changes or variations are still within the scope of the present disclosure.

Claims

1. A method for changing document content, characterized in that, Including: A first content change operation for obtaining a first version number submitted by a client; When the first version number does not match a second version number of a target document on the server local, splitting first content changed by the first content change operation into multiple atomic data that cannot be further divided; Determining atomic data within an operation scope of a second content historical change operation applied to the target document with the second version number as conflict data; Determining a magnitude of operation priority between a first data operation acting on the conflict data in the first content change operation and a second data operation acting on the conflict data in the second content historical change operation; And When the operation priority of the first data is greater than that of the second data operation, applying the first data operation to the target document on the server local.

2. The method for changing the document content according to claim 1, characterized in that Splitting the first content changed by the first content change operation into multiple atomic data that cannot be further divided 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 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.

3. The method for changing the document content according to claim 1, wherein It further includes: Locking operation permissions of each client for the conflict data, such that the conflict data only accepts processing of the first content change operation; And When applying the first data operation to the target document on the server local, unlocking operation permissions of each client for the conflict data.

4. The method for changing the document content according to claim 1, characterized in that Determining a magnitude of operation priority between the first data operation of the first version number acting on the conflict data and the second data operation of the second version number includes: Generating conflict comparison content, 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; 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, where the first confirmation message and the second confirmation message are used to confirm the first sub-content or the second sub-content applied in the target document; and When both the first confirmation message and the second confirmation message confirm applying the first sub-content, determining that the operation priority of the first data is greater than that of the second data operation.

5. The method for changing the document content according to claim 4, wherein Determining a magnitude of operation priority between the first data operation of the first version number acting on the conflict data and the second data operation of the second version number further includes: When both the first confirmation message and the second confirmation message confirm applying new collaborative content other than the first sub-content and the second sub-content in the target document, applying the new collaborative content to the target document on the server local.

6. The method for changing the content of a document according to claim 1, wherein Applying the first data operation to the target document on the server local includes: Query the target version number, where the target version number is the version number of the target document of the latest version that has not applied the second data operation; Backtrack the target document with the second version number on the server local to the target version number to obtain the target document with the target version number; and Apply the first data operation to the target document with the target version number on the server local.

7. The method for changing document content according to claim 6, characterized in that, Applying the first data operation to the target document on the server local further includes: Generate a conflict resolution record, where the conflict resolution record includes the historical version number that has not applied the first data operation, the current version number when the first data operation takes effect, the original content before applying the first data operation, and the changed content after applying the first data operation; the conflict resolution record is used for querying the target version number.

8. The method for changing the document content according to claim 6, wherein, Querying the target version number includes: Determine the second sub-content changed based on the second data operation; Query the conflict resolution record containing the second sub-content as the target conflict resolution record; and When the target conflict resolution record is queried, determine the historical version number that has not applied the second data operation in the target conflict resolution record as the target version number.

9. The method for changing the content of a document according to claim 1, characterized in that, Further includes: Save each of the first data operations applied to the target document on the server local as a first content historical change operation.

10. The method for changing the document content according to claim 1, characterized in that, Obtaining the first content change operation with the first version number submitted by the client includes: Add the content change package submitted by the client to the content synchronization queue, and the content change packages in the content synchronization queue are sorted from old to new according to the submission order, and the content change package includes a version number and a content change operation; and Obtain the version number and the 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.

11. The method for changing the content of a document according to claim 1, characterized in that Further includes: When the first version number matches the second version number of the target document on the server local, apply the first content change operation to the target document on the server local.

12. The method for changing the document content according to claim 1, wherein Further includes: In response to the content synchronization request submitted by the client, obtain the third version number of the target document to be synchronized by the client; Compare the target document on the server local with the target document with the third version number, and determine the content changed by the target document on the server local relative to the target document with the third version number as the content to be synchronized; And Send the content to be synchronized to the client.

13. An electronic device, characterized in that, Includes: A memory that stores execution instructions; And A processor that executes the execution instructions stored in the memory, so that the processor executes the document content change method according to any one of claims 1 to 7.

14. A readable storage medium, characterized in that, The executable instructions are stored in the readable storage medium, and when executed by the processor, are used to implement the document content change method according to any one of claims 1 to 7.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the document content change method according to any one of claims 1 to 7.

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

  • Embedded content suitability scoring

    US20160275051A1

  • Atom-based sensible synchronization for information indexing

    US20180107635A1

  • Calling a plugin and using a merging policy for mitigating version conflicts

    US20250173504A1