Document processing method, device, computer equipment, readable storage medium and product
By generating a query cursor on the client and initiating a data retransmission request, the data inconsistency problem caused by version number differences in documents edited by multiple people is solved, and the consistency and operation synchronization of client and server version identification are achieved.
Patent Information
- Application Number
- CN202210564751.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-23
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-05-23
AI Technical Summary
In existing multi-person collaborative document editing systems, the version number gap between the client and the server is too large, resulting in asynchronous editing operations and inconsistent data. The existing OT algorithm cannot effectively solve the problem of disordered data packet reception.
By obtaining the client's version identifier, a query cursor is generated, the operation data is queried and a data retransmission request is initiated. The operation data returned by the server is obtained and applied to the document edited by the client, ensuring that the version identifier is accurately incremented and consistent with the server.
Improves the synchronization effect of multiple people collaborating on different clients to edit documents, ensures that the version identifier on the client is consistent with the version identifier on the server, and avoids data inconsistency issues.
Smart Images

Figure CN114896960B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and specifically to a document processing method, apparatus, computer equipment, readable storage medium and product, wherein the readable storage medium is a computer-readable storage medium and the product is a computer program product. Background Art
[0002] Multi-person collaborative document editing can support multiple users editing through the client, and synchronize the editing operations performed by the users to other clients through the server. The Operation Transformation (OT) algorithm can usually be used to resolve the problem of editing operation conflicts between multiple clients to synchronize editing operations between different clients. The version number of the multi-person collaborative document on the client is related to the number of data packets received from the server for editing operations. The existing OT algorithm has the problem of out-of-order data packet reception. The OT algorithm processes editing operations for the same version of the multi-person collaborative document. The out-of-order data packet reception will cause the version number of the multi-person collaborative document on the client to be incorrect. When the client packet loss is serious, the version number difference between the client and the server is large, which will cause the OT algorithm to fail, resulting in the editing operations performed in the multi-person collaborative document on different clients being out of sync, and the data in the multi-person collaborative document on the same client being inconsistent. Summary of the Invention
[0003] The embodiments of the present application provide a document processing method, apparatus, computer equipment, readable storage medium and product, which can improve the synchronization effect of editing operations of different clients for collaborative editing of documents by multiple people.
[0004] An embodiment of the present application provides a document processing method, including:
[0005] Get the version ID of the multi-person collaborative editing document currently being edited by the client;
[0006] Generate a query cursor according to the version identifier, wherein the query cursor is used to query operation data generated by editing the document collaboratively edited by multiple people;
[0007] If the operation data is not found locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identifier;
[0008] The operation data returned by the server in response to the data retransmission request is obtained, and the operation data is applied to the multi-person collaborative editing document currently being edited by the client.
[0009] Accordingly, an embodiment of the present application further provides a document processing device, comprising:
[0010] An identification acquisition unit, used to acquire the version identification of the multi-person collaborative editing document currently being edited by the client;
[0011] A cursor generating unit, configured to generate a query cursor according to the version identifier, wherein the query cursor is used to query operation data generated by editing the document collaboratively edited by multiple people;
[0012] a query unit, configured to initiate a data retransmission request to a server based on the version identifier if the operation data is not found locally on the client through the query cursor;
[0013] An application unit is configured to obtain the operation data returned by the server in response to the data retransmission request, and apply the operation data to the multi-person collaborative editing document currently being edited by the client.
[0014] In one embodiment, the operation data carries an operation type, and the application unit includes:
[0015] a decomposition subunit, configured to, if the operation type of the operation data is a target type, perform operation decomposition on the operation data to obtain at least one sub-operation data;
[0016] The first data application subunit is configured to apply the at least one sub-operation data in sequence to the multi-person collaboratively edited document currently being edited by the client.
[0017] In one embodiment, the operation data is stored in a message queue, and the application unit includes:
[0018] A first data acquisition subunit is configured to acquire current operation data for a multi-person collaboratively edited document currently being edited by the client, wherein the current operation data carries an operation type;
[0019] a second data acquisition subunit, configured to acquire the operation data from the message queue if the operation type of the current operation data meets a preset condition;
[0020] The second data application subunit is configured to apply the operation data to the multi-person collaboratively edited document currently being edited by the client.
[0021] In one embodiment, the current operation data includes a plurality of items, and the document processing device further includes:
[0022] an acquiring unit, configured to acquire an operation object and an operation type of the current operation data;
[0023] an operation merging unit, configured to merge the multiple current operation data that match the operation object and the operation type to obtain merged operation data;
[0024] A sending unit is used to send the merged operation data to the server so that the collaborative client obtains the merged operation data from the server to synchronize the current operation data of the client. The collaborative client is a client that collaborates with the client to edit the multi-person collaboratively edited document.
[0025] In one embodiment, the sending unit includes:
[0026] a data segmentation subunit, configured to segment the merged data to obtain first segmented data and second segmented data if the amount of the merged operation data meets a preset threshold;
[0027] A first data sending subunit, configured to send the first segmented data to the server;
[0028] The second data sending subunit is configured to send the second segmented data to the server upon receiving confirmation information returned by the server based on the first segmented data.
[0029] In one embodiment, the query unit includes:
[0030] an updating subunit, configured to update the version identifier if the operation data is not found through the query cursor and the operation data is generated by the client, and use the updated version identifier as the version identifier, and return to execute the query cursor generated according to the version identifier;
[0031] The data retransmission subunit is configured to initiate a data retransmission request to the server based on the version identifier if the operation data is not found and the operation data is not generated by the client.
[0032] In one embodiment, the document processing device further includes:
[0033] A copy obtaining unit, configured to obtain from the server a copy of the document collaboratively edited by multiple persons corresponding to the version identifier;
[0034] a difference comparison unit, configured to compare the copy of the multi-person collaboratively edited document with the multi-person collaboratively edited document currently being edited by the client to obtain difference information;
[0035] an operation conversion unit, configured to perform operation conversion according to the difference information to obtain difference operation data;
[0036] A correction unit is configured to correct the multi-person collaboratively edited document currently being edited by the client based on the operation difference data.
[0037] Correspondingly, an embodiment of the present application also provides a computer device, including a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute any document processing method provided in the embodiment of the present application.
[0038] Accordingly, an embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program, and the computer program is loaded by a processor to execute any document processing method provided in the embodiment of the present application.
[0039] Accordingly, an embodiment of the present application further provides a computer program product, including a computer program, which implements any document processing method provided in the embodiment of the present application when executed by a processor.
[0040] An embodiment of the present application obtains the version identifier of a multi-person collaboratively edited document currently being edited by a client; generates a query cursor based on the version identifier, and the query cursor is used to query the operation data generated by editing the multi-person collaboratively edited document; if the operation data is not found locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identifier; obtains the operation data returned by the server in response to the data retransmission request, and applies the operation data to the multi-person collaboratively edited document currently being edited by the client.
[0041] This solution generates a query cursor based on the version identifier of the multi-person collaboratively edited document currently being edited by the client, and obtains the corresponding operation data through the query cursor, ensuring that the client can obtain the correct version of the operation data, so that the version identifier of the multi-person collaboratively edited document on the client can be accurately incremented and remain consistent with the version identifier of the multi-person collaboratively edited document on the server, thereby improving the synchronization effect of multi-person collaboratively edited document operations on different clients. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0043] Figure 1 It is a scene diagram of the document processing method provided in the embodiment of the present application;
[0044] Figure 2 This is a flowchart of a document processing method provided by an embodiment of the present application;
[0045] Figure 3 This is a communication diagram of the document processing method provided in an embodiment of the present application;
[0046] Figure 4 is another flow chart of the document processing method provided by an embodiment of the present application;
[0047] Figure 5 Schematic diagram of the server thread of the document processing method provided in the embodiment of the present application;
[0048] Figure 6 This is an overall architecture diagram of the document processing method provided by the embodiment of the present application;
[0049] Figure 7 is a schematic diagram of a document processing device provided in an embodiment of the present application;
[0050] Figure 8 It is a structural diagram of the computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0051] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without making creative efforts are within the scope of protection of this application.
[0052] The embodiments of the present application provide a document processing method, apparatus, computer device, and computer-readable storage medium. The document processing apparatus can be integrated into a computer device, which can be a server, a terminal, or other device.
[0053] The terminal may include a mobile phone, a wearable smart device, a tablet computer, a laptop computer, a personal computer (PC), and a vehicle-mounted computer.
[0054] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms.
[0055] For example, Figure 1As shown, the computer device obtains the version identifier of the multi-person collaboratively edited document currently being edited by the client; generates a query cursor based on the version identifier; queries the operation data generated by editing the multi-person collaboratively edited document locally on the client through the query cursor; if the operation data is not found, initiates a data retransmission request to the server based on the version identifier; obtains the operation data returned by the server in response to the data retransmission request, and applies the operation data to the multi-person collaboratively edited document currently being edited by the client.
[0056] This solution generates a query cursor based on the version identifier of the multi-person collaboratively edited document currently being edited by the client, and obtains the corresponding operation data through the query cursor, ensuring that the client can obtain the correct version of the operation data, so that the version identifier of the multi-person collaboratively edited document on the client can be accurately incremented and remain consistent with the version identifier of the multi-person collaboratively edited document on the server, thereby improving the synchronization effect of multi-person collaboratively edited document operations on different clients.
[0057] It should be noted that the order of description of the following embodiments is not intended to limit the preferred order of the embodiments.
[0058] This embodiment will be described from the perspective of a document processing apparatus. The document processing apparatus may be integrated into a computer device, which may be a server or a terminal.
[0059] The embodiment of the present application provides a document processing method, such as Figure 2 As shown, the specific process of the document processing method can be as follows:
[0060] 101. Obtain the version identifier of the multi-person collaborative editing document currently being edited by the client.
[0061] The client may be a client that supports different users to perform online editing of a multi-person collaborative document at the same time, and the user may start the client through a link of the multi-person collaborative document to perform editing.
[0062] Among them, a document edited by multiple people can include one or more types of content, for example, it can include text, images, videos, audio and other content. A document edited by multiple people can be a document in doc, docx, xls or txt formats. A document edited by multiple people can also be a mind map.
[0063] Among them, the version identifier can represent the version of the multi-person collaboratively edited document (hereinafter referred to as the multi-person document) currently edited by the client. For example, the version identifier can be the version number. When different users edit the same version of the multi-person collaboratively edited document, there will be operation conflicts. The edits need to be conflict resolved to make the content of the multi-person collaboratively edited versions on the clients of different users consistent.
[0064] Conflict resolution involves defining conversion rules to transform edits into conflict-free edits when conflicts arise. Suppose A and B are edits made by multiple people collaborating on the same version of document S, each from different clients. A' and B' are the outputs of A and B after processing them through the Operational Transformation (OT) process. The key to OT is ensuring that apply(apply(S,A),B') = apply(apply(S,B),A'). Otherwise, data consistency across clients cannot be guaranteed.
[0065] When multiple people collaborate on a mind map, the supported editing operations include adding, deleting, updating, and moving nodes. Node relationships can include parent nodes, child nodes, sibling nodes, and identical nodes. The OT algorithm provides 4 x 4 x 4 = 64 possible combinations of operations for conversion. For example, operation data a specifies one of four editing operations for node a, while operation data b specifies one of four editing operations for one of node a's four related nodes.
[0066] For example, a document edited by multiple people can carry a version identifier, and the version identifier of the document edited by the client can be obtained. Optionally, when the document edited by multiple people is just started, the version identifier can be obtained based on the document data returned by the server, or based on the document data of the document edited by multiple people stored locally. The version identifier can then be obtained through a query cursor. The query cursor can include a cursor for querying operation data. A cursor is a method of processing data. A cursor provides the ability to browse data forward or backward in a result set one or more rows at a time.
[0067] In an embodiment of the present application, the result set viewed by the query cursor may include operation data generated by editing different versions of a collaboratively edited document. The operation data that the query cursor needs to extract is the operation data generated by editing the version of the collaboratively edited document currently being edited by the client, so that the client can obtain this operation data to update the collaboratively edited document. Before the query cursor points to the operation data of the collaboratively edited document currently being edited by the client, the operation data pointed to by the query cursor is the version previous to the currently edited version. Therefore, the version identifier of the currently edited document can be determined based on the query cursor.
[0068] For example, if the multi-person collaborative document currently being edited by the client is version 1.0, the operation data that the query cursor needs to extract is the data generated by editing the multi-person collaborative document of version 1.0. After the client applies the operation data to the multi-person collaborative document and updates it to version 2.0, the query cursor needs to extract the operation data generated by editing the multi-person collaborative document of version 2.0. Therefore, the version identifier of the multi-person collaborative document currently being edited by the client can be determined based on the cursor. Before the query cursor points to the multi-person document of version 2.0, the query cursor points to the multi-person document of version 1.0.
[0069] The server may store copies of different versions of a document that is collaboratively edited by multiple people. During the process of the server sending operation data to the client, some data may be missing or changed due to network instability or other reasons, resulting in differences between the document that is collaboratively edited by multiple people on the client and the copy of the same version of the document that is collaboratively edited by multiple people on the server, thereby causing inconsistency in the data of the document that is collaboratively edited by multiple people on different clients. In one embodiment, the document that is collaboratively edited by multiple people on the client may be corrected based on the differences between the copy of the document that is collaboratively edited by multiple people on the server (hereinafter referred to as the copy) and the document that is collaboratively edited by multiple people on the client, so that the documents that are collaboratively edited by multiple people on different clients contain the same version. That is, the document processing method provided in the embodiment of the present application may further specifically include:
[0070] Obtain a copy of the multi-person collaboratively edited document corresponding to the version identifier from the server;
[0071] Compare the copy of the multi-person collaboratively edited document with the multi-person collaboratively edited document currently being edited by the client to obtain difference information;
[0072] Perform operation conversion according to the difference information to obtain difference operation data;
[0073] Based on the operation difference data, the multi-person collaborative editing document currently being edited by the client is corrected.
[0074] The copy of the document edited by multiple people in collaboration is the document edited by multiple people in collaboration with the version corresponding to the version identifier saved by the server.
[0075] For example, the terminal may periodically or irregularly obtain a copy corresponding to a version identifier from the server, perform a difference comparison between the multi-person document and the copy, and obtain difference information, which includes the difference between the multi-person document and the copy. The difference information is converted into difference operation data indicating an editing operation, and then the difference operation data is applied to the multi-person document currently being edited by the client to correct the multi-person document and keep it consistent with the client.
[0076] Alternatively, you can use Web Workers to compare multiple documents with a copy. The client can run a script operation in a background thread independent of the main thread. The advantage of this is that time-consuming processing tasks can be performed in a separate thread, allowing the main thread (for example, the UI thread) to not be blocked / slowed down.
[0077] Optionally, this process can be completed by the server, which obtains difference operation data based on similar steps as above and sends the difference operation data to the client. The client applies the received operation data to the multi-person document to keep it consistent with the server's copy.
[0078] 102. Generate a query cursor based on the version identifier, where the query cursor is used to query operation data generated by editing a document collaboratively edited by multiple people.
[0079] For example, the client may receive operation data generated by at least one client (for example, a client and a collaborative client) editing different versions of a multi-person document sent by the server, use the version identifier as the query object of the cursor, and generate a query cursor. The query cursor may query the operation data generated by editing the version identifier in the local storage space of the terminal (for example, a cache).
[0080] The collaborative client is a client that edits a multi-person document together with the client.
[0081] In one embodiment, the operation data generated by editing multi-person documents of different versions is mapped according to the version identifier, the storage location of the operation data is determined, and the operation data corresponding to the version identifier is stored. The storage location of the operation data of the multi-person document corresponding to the version identifier can be obtained by mapping the version identifier, and the storage location is used as the query object of the query cursor to generate a query cursor. The query cursor queries the storage location and obtains the data at the storage location.
[0082] 103. If the operation data is not found locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identifier.
[0083] The local location of the client may include a corresponding storage space of the client on the terminal where the client is installed.
[0084] For example, if the operation data is not found locally on the client, for example, the operation data does not exist in the storage location corresponding to the version identifier, a data retransmission request is sent to the server according to the version identifier to obtain the operation data from the server.
[0085] If no response is received from the server within a preset time after a data retransmission request is sent to the server, the data retransmission request is resent.
[0086] To reduce the number of data retransmission requests initiated by the client, when the operation data to be retransmitted is data generated on the client, the client may not initiate a data retransmission request to the server because the operation data already exists. That is, in one embodiment, the step of "if the operation data is not found locally on the client through the query cursor, initiating a data retransmission request to the server based on the version identifier" includes:
[0087] If the operation data is not found through the query cursor and the operation data is generated by the client, the version identifier is updated and the updated version identifier is used as the version identifier. The query cursor generated based on the version identifier is returned.
[0088] If the operation data is not found and the operation data is not generated by the client, a data retransmission request is initiated to the server based on the version identifier.
[0089] For example, the server can send the number of people currently collaborating on the document to the terminal. If only the client is currently performing editing operations on the multi-person document, it means that the operation data all comes from the client itself. If no operation data is found, no data retransmission request is initiated, and the query cursor is updated, that is, the query object of the query cursor is updated. For example, the query object of the query cursor is operation data with version number 1.0, and it is updated to operation data with version number 2.0, so that it obtains the operation data corresponding to the next version. If there are other collaborative clients currently operating on the multi-person document and no operation data is found, a data retransmission request is initiated to the server based on the version identifier.
[0090] 104. Obtain the operation data returned by the server in response to the data retransmission request, and apply the operation data to the multi-person collaborative editing document currently being edited by the client.
[0091] For example, it may be that after sending a data retransmission request to the server, the operation data returned by the server in response to the data retransmission request is received, and after obtaining the operation data corresponding to the version identifier, the operation data is applied to the multi-person document currently being edited by the client. For example, the operation data represents adding node a at position A of the multi-person document. Then, after the terminal obtains the operation data, it applies the operation data to the multi-person document, thereby adding node a at position A of the multi-person document.
[0092] For multiple people collaborating on a document, you can perform various types of editing operations. For example, if the document is a mind map, operations such as deleting first-level nodes, copying root nodes, undoing first-level nodes and adding nodes, deleting child nodes, and modifying nodes can be included. If the document is a table document, operations such as deleting rows and copying columns can be included. Some editing operations affect not only the object being operated on, but also the corresponding related objects. For example, deleting a first-level node not only deletes the first-level node, but also all child nodes of the first-level node. Copying a root node not only copies the root node, but also the child nodes of the root node. If these operation data are directly applied to the document, the page will not be able to respond to too many editing operations in a timely manner, resulting in freezing or even crashing.
[0093] In one embodiment, such editing operations can be decomposed into multiple sub-operations to reduce the load on the terminal and avoid page freezes or even crashes. That is, the operation data carries the operation type. The step of "applying the operation data to the multi-person collaboratively edited document currently being edited by the client" includes:
[0094] If the operation type of the operation data is the target type, the operation data is decomposed to obtain at least one sub-operation data;
[0095] At least one sub-operation data is sequentially applied to the multi-person collaborative editing document currently being edited by the client.
[0096] The target type may represent an operation type that may involve operation data of many other objects.
[0097] For example, the operation data may carry an operation type. If the operation type of the operation data is a target type, the operation data may be decomposed to obtain at least one sub-operation data. The sub-operation data obtained from the operation decomposition may be applied to multi-person documents in sequence to implement the editing operation corresponding to the operation data. For example, if the operation data is data corresponding to copying the root node A, the operation data may be decomposed into sub-operation data corresponding to editing operations such as copying only the root node A, copying the child node a of the root node, and copying the child node b of the root node. The sub-operation data may be applied to the multi-person documents of the client in sequence to complete the editing operation of copying the root node A.
[0098] Optionally, the sub-operation data obtained by decomposing the operation can be stored in a message queue, and the message queue can be used to control the speed at which the terminal consumes the sub-operation data. The time interval (for example, 300s) and quantity (for example, 300 items) for pulling data from the message queue can also be set. The terminal obtains a certain amount of sub-operation data at the set time interval to prevent the operation data from taking too long and causing the page to become unresponsive.
[0099] In addition to the sub-operation data obtained by operation decomposition being stored in the message queue, non-target type operation data can also be stored in the message queue to control whether to consume the operation data through the message queue.
[0100] When a user is currently editing a multi-person document on the client and performing an operation on edit object A, and another user is also performing the same operation on edit object A on their collaborative client, the user's operation on the client may be interrupted. For example, if user A is moving node A to position a while user B is moving node A to position b, user A's editing operation will be interrupted and node A will be moved to position b. This may cause the user to believe that the node movement was incorrectly caused by an error in the client response, affecting the user experience.
[0101] The message queue can be used to control the consumption of user B's editing operation first, and the consumption of user B's editing operation after user A's editing operation is completed. That is, in one embodiment, the operation data is stored in the message queue, and the step of "applying the operation data to the multi-person collaborative editing document currently being edited by the client" includes:
[0102] Get the current operation data of the multi-person collaborative editing document currently being edited by the client. The current operation data carries the operation type.
[0103] If the operation type of the current operation data meets the preset conditions, the operation data is obtained from the message queue;
[0104] Apply the operation data to the multi-person collaborative editing document currently being edited by the client.
[0105] For example, specifically, it can be to obtain the user's operation data on the multi-person document currently being edited by the client. If the operation type of the operation data meets the preset conditions, that is, it is not the preset operation type, indicating that the user's editing operation does not belong to an operation that will be interrupted by other editing operations, then the operation data is obtained from the message queue, or the sub-operation data obtained by decomposing the operation data, and the operation data is applied to the multi-person document currently being edited by the client.
[0106] If the operation type of the current operation data does not meet the preset conditions, that is, the operation type is the preset operation type, then wait for the current operation data to be applied to the multi-person document, obtain the operation data from the message queue, and then apply the operation data to the multi-person collaborative editing document currently being edited by the client.
[0107] The corresponding multiple current operation data generated by the multiple editing operations of the multi-person document currently being edited by the client may include operation data of editing operations that can be merged. These operation data can be merged to reduce the amount of current operation data and the occupation of network resources by sending the current operation data to the server. The current operation data received by the collaborative client is also reduced, reducing the amount of operation data that needs to be responded to by the collaborative client. That is, in one embodiment, the current operation data includes multiple data. After the step of "obtaining the current operation data for the multi-person collaboratively edited document currently being edited by the client", the document processing method provided in the embodiment of the present application may further specifically include:
[0108] Get the operation object and operation type of the current operation data;
[0109] Merge multiple current operation data that match both the operation object and the operation type to obtain merged operation data;
[0110] The merged operation data is sent to the server so that the collaborative client can obtain the merged operation data from the server to synchronize the current operation data of the client. The collaborative client is a client that collaborates with the client to edit a document jointly edited by multiple people.
[0111] For example, specifically, the operation object and operation type of the current operation data can be obtained, and multiple current operation data that match the operation object and operation type can be merged to obtain the merged operation data. The matching operation object can be that the position of the operation object of operation data b is the target position of the operation object of operation data a. For example, the current operation data a indicates that node a is moved to position b (target position), and the current operation data b indicates that node b from position b is moved to position c. The position of node b is the target position of node a, so node a and node b match.
[0112] Whether the operation types between the operation data match can be flexibly set according to the types of the multi-person documents and the editing operations that can be supported by the multi-person document index. For example, the same operation type is considered a match.
[0113] The operation data that match both the operation type and the operation object are merged. For example, multiple current operation data include the current operation data a corresponding to moving node a to position b, and the current operation data b for moving from position b to position c. The current operation data a and the current operation data b can be merged to obtain merged operation data, and the merged operation data indicates that the node a is moved to position c. For another example, multiple current operation data include the current operation data a corresponding to moving node a to position b, and the current operation data b for deleting c from position b. The current operation data a and the current operation data b can be merged to obtain merged operation data, and the merged operation data indicates that the node is deleted.
[0114] When a user performs many editing operations on a multi-person document currently being edited by a client, the client generates a large amount of operation data. When the client sends the operation data to the server, it is easy for the network to be disconnected due to excessive network load. To avoid the network connection between the server and the client being disconnected due to excessive network load, data segmentation can be performed to divide the current operation data into multiple parts and send them to the server separately. That is, in one embodiment, the step of "sending the merged operation data to the server" may specifically include:
[0115] If the amount of the merged operation data meets the preset threshold, the merged data is split to obtain first split data and second split data;
[0116] Sending the first split data to the server;
[0117] When confirmation information returned by the server based on the first segmented data is received, the second segmented data is sent to the server.
[0118] The amount of data included in the first segmented data is less than or equal to a preset threshold.
[0119] For example, specifically, if the number of merged operation data meets a preset threshold, the merged operation data is split to obtain first split data containing operation data whose number is less than or equal to the preset threshold, and second split data containing operation data other than the first split data. The first split data is sent to the server, but when a confirmation message is received from the server based on the first split data, the second split data is sent to the server, and the confirmation message indicates that the server has received the first split data.
[0120] Optionally, if the number of operation data contained in the second split data meets a preset threshold, the second split data is split to obtain two parts of data, one part of which contains operation data less than or equal to the preset threshold. If the number of operation data contained in the other part meets the preset threshold, data splitting needs to be continued to ensure that the amount of operation data sent to the server each time does not exceed the preset threshold.
[0121] Optionally, the ot algorithm is set up with different state machines, such as Figure 3 As shown, the state machine includes a synchronized state (synchronized), a waiting confirmation state (AwaitingConfirm), and an operation waiting state (AwaitingWithBuffer). When the client does not send a data retransmission request, the client is in the Synchronized state. When the client sends a data retransmission request and is not responded to by the server, it is in the AwaitingConfirm state. When the client is in the AwaitingConfirm state and the client continuously generates new actions, it is converted to the AwaitingWithBuffer state. The client performs different operations in different states.
[0122] When the current operation data is split, it is necessary to split the current operation data into the first split data and the second split data for sending. This is equivalent to the client generating a new action (i.e., the second split data) while the first split data is being sent. Therefore, the client is converted from the AwaitingConfirm state to the AwaitingWithBuffer state.
[0123] As can be seen from the above, the embodiment of the present application obtains the version identifier of the multi-person collaboratively edited document currently being edited by the client; generates a query cursor based on the version identifier, and the query cursor is used to query the operation data generated by editing the multi-person collaboratively edited document; if the operation data is not found locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identifier; obtains the operation data returned by the server in response to the data retransmission request, and applies the operation data to the multi-person collaboratively edited document currently being edited by the client.
[0124] This solution generates a query cursor based on the version identifier of the multi-person collaboratively edited document currently being edited by the client, and obtains the corresponding operation data through the query cursor, ensuring that the client can obtain the correct version of the operation data, so that the version identifier of the multi-person collaboratively edited document on the client can be accurately incremented and remain consistent with the version identifier of the multi-person collaboratively edited document on the server, thereby improving the synchronization effect of editing operations of different clients on multi-person collaboratively edited documents.
[0125] Based on the above embodiments, further detailed description will be given below with examples.
[0126] This embodiment will be described from the perspective of a document processing system. The document processing system may include a terminal and a server. The terminal is equipped with a client that supports different users to simultaneously perform online editing of a document collaboratively edited by multiple people. A communication connection is established between the server and the client, and the server can provide services to the client based on the communication connection.
[0127] The embodiment of the present application provides a document processing method, such as Figure 4 As shown, the specific process of the document processing method can be as follows:
[0128] 201. The server receives operation data sent by multiple clients for editing a document currently being edited by multiple people in a collaborative editing process, and sends the operation data to the multiple clients.
[0129] For a multi-person document, the server should process the operation data in the order in which it arrives. The server will receive operation data generated by editing different multi-person documents. The server can hash the document identifier of the multi-person document to save the operation data generated by editing the multi-person document to the corresponding message queue, and consume the message queue through threads to ensure sequential processing of operation data for different multi-person documents.
[0130] For example, Figure 5 As shown, the main thread of the server is mainly responsible for network communication, receiving operation data sent by the client, and sending the operation data to the client through broadcast / unicast.
[0131] Create a worker thread pool to handle the operation conversion and operation application of operation data. The number of threads in the worker thread pool is limited. The server can hash the operation data to the corresponding message queue based on the document identifier of multiple documents. Each queue is consumed by a thread in the worker thread pool.
[0132] Optionally, the server may send multiple operation data to the client in the form of data packets.
[0133] 202. The terminal receives the operation data sent by the server through the client, and saves the operation data to a storage location corresponding to the version identifier carried in the operation data.
[0134] For example, for operation data generated by editing documents of different versions by multiple people, the terminal maps the operation data according to the version identifier, determines the storage location of the operation data, and stores the operation data corresponding to the version identifier.
[0135] 203. The terminal obtains a version identifier of the multi-person collaboratively edited document currently being edited by the client.
[0136] For example, a document collaboratively edited by multiple people may carry a version identifier, and the terminal obtains the version identifier of the document collaboratively edited by the client. Optionally, when the document collaboratively edited by multiple people is just started, the terminal can obtain the version identifier based on the document data returned by the server, or obtain the version identifier based on the document data of the document collaboratively edited by multiple people stored locally. The terminal can then obtain the version identifier by querying the cursor.
[0137] 204. The terminal queries the operation data in the storage location corresponding to the version identifier by using a query cursor.
[0138] For example, the terminal uses the version identifier as a query object of the cursor to generate a query cursor. The query cursor can query the operation data generated by editing the version identifier in the local storage space of the terminal (such as cache).
[0139] In one embodiment, the terminal can obtain the storage location of the operation data of the multi-person document corresponding to the version identifier by mapping the version identifier, use the storage location as the query object of the query cursor, generate a query cursor, query the storage location with the query cursor, and obtain the data at the storage location.
[0140] By mapping the version identifier, the storage location of the operation data of the multi-person document corresponding to the version identifier can be obtained. The storage location is used as the query object of the cursor to generate a query cursor. The query cursor queries the storage location and obtains the data at the storage location.
[0141] 205. If the operation data is not found, the terminal initiates a data retransmission request to the server based on the version identifier.
[0142] For example, if the terminal does not find the operation data through the query cursor, for example, the operation data does not exist in the storage location corresponding to the version identifier, a data retransmission request is sent to the server according to the version identifier to obtain the operation data from the server.
[0143] Optionally, a timeout mechanism can be set. When the server responds to the data retransmission request with a timeout, the data retransmission request is re-initiated. In addition, when the network is disconnected, the client will reconnect to the server to avoid data loss.
[0144] 206. The terminal obtains the operation data returned by the server in response to the data retransmission request, and applies the operation data to the multi-person collaborative editing document currently being edited by the client.
[0145] For example, specifically, after the terminal sends a data retransmission request to the server, it receives the operation data returned by the server in response to the data retransmission request. After obtaining the operation data corresponding to the version identifier, the terminal applies the operation data to the multi-person document currently being edited by the client. For example, the operation data represents adding node a at position A of the multi-person document. Then, after the terminal obtains the operation data, it applies the operation data to the multi-person document, thereby adding node a at position A of the multi-person document.
[0146] 207. The terminal updates the version identifier of the currently edited multi-person collaborative document through the client, and updates the query cursor.
[0147] For example, after the terminal applies the operation data to the multi-person document, it updates the version identifier of the multi-person document and updates the query cursor. For example, the version identifier of the multi-person document is updated from 1.0 to 2.0. After updating the query cursor, the query cursor can obtain the operation data generated by editing the multi-person document with a version identifier of 2.0.
[0148] like Figure 6 As shown, the client may include a network transmission module, an operation conversion algorithm module, an action delay module, a data generation module, and an exception generation module.
[0149] Among them, the network transmission module is used for packet receiving and caching: obtaining operation data and caching it; packet loss retransmission: initiating a data retransmission request to the server when operation data is lost; timeout retransmission: when the server responds with a timeout, initiating a data retransmission request again; network disconnection reconnection: when the network is disconnected, the client will reconnect to the server to avoid data loss.
[0150] The operation conversion algorithm module is used for state flow; conflict handling: when editing conflicts, the editing action is converted into a conflict-free editing action; action merging: multiple current operation data that match the operation object and operation type are merged to obtain the merged operation data; action splitting: if the number of operation data meets the preset threshold, the data is split. The specific process refers to the description of the relevant content in the above embodiment and will not be repeated here.
[0151] The action delay module is used to control the consumption of operation data through the message queue, including controlling the consumption of operation data from the server and operation data generated by the client, and delaying consumption.
[0152] The data generation module is used for converting the editing operation into operation data in response to an instruction triggered by a user's editing operation on a multi-person document.
[0153] The exception recovery module is used for data reconciliation: comparing the differences between multi-person documents and copies; data recovery: applying the difference operation data corresponding to the difference information to the multi-person document currently edited by the client to restore the data of the multi-person document.
[0154] like Figure 6 As shown, the server may include a network module, a business module, a service management module and a data module.
[0155] Among them, the network module is used for heartbeat detection: used to detect whether the client is connected; maintenance connection: maintain the network connection between the client and the client; message broadcast: send operation data, etc. to the client.
[0156] The business module is used for version control: controlling the versions of documents edited by multiple people; data reconciliation: comparing the differences between multi-person documents on the client and the copies on the server; conversion control, performing operational conversions on operational data; data statistics: collecting statistics on operational data.
[0157] The service management module is used for configuration management, detection alarm and service management.
[0158] The data module supports database (MySQL), storage system (Redis), and file functions.
[0159] From the above, it can be seen that the embodiment of the present application receives the operation data sent by multiple clients for the editing of the multi-person collaboratively edited document currently being edited through the server, and sends the operation data to multiple clients; the terminal receives the operation data sent by the server through the client, and saves the operation data to the storage location corresponding to the version identifier carried by the operation data; the terminal obtains the version identifier of the multi-person collaboratively edited document currently being edited by the client; the terminal queries the operation data in the storage location corresponding to the version identifier through the query cursor; if the operation data is not queried, the terminal initiates a data retransmission request to the server based on the version identifier; the terminal updates the version identifier of the multi-person collaboratively edited document currently being edited through the client, and updates the query cursor.
[0160] This solution generates a query cursor based on the version identifier of the multi-person collaboratively edited document currently being edited by the client, and obtains the corresponding operation data through the query cursor, ensuring that the client can obtain the correct version of the operation data, so that the version identifier of the multi-person collaboratively edited document on the client can be accurately incremented and remain consistent with the version identifier of the multi-person collaboratively edited document on the server, thereby improving the synchronization effect of editing operations of different clients on multi-person collaboratively edited documents.
[0161] In order to facilitate better implementation of the document processing method provided in the embodiment of the present application, a document processing device is also provided in one embodiment. The meanings of the terms are the same as those in the above-mentioned document processing method, and the specific implementation details can be referred to the description in the method embodiment.
[0162] The document processing device can be integrated into a computer device, such as Figure 7 As shown, the document processing device may include: an identification acquisition unit 301, a cursor generation unit 302, a query unit 303 and an application unit 304, specifically as follows:
[0163] (1) Identification acquisition unit 301: used to obtain the version identification of the multi-person collaborative editing document currently being edited by the client.
[0164] (2) Cursor generation unit 302: used to generate a query cursor according to the version identifier, and the query cursor is used to query the operation data generated by editing a document collaboratively edited by multiple people.
[0165] (3) Query unit 303: used to initiate a data retransmission request to the server based on the version identifier if the operation data is not found locally on the client through the query cursor.
[0166] In one embodiment, the query unit 303 may include an update subunit and a data retransmission subunit, specifically:
[0167] Update subunit: used to update the version identifier if the operation data is not found through the query cursor and the operation data is generated by the client, and use the updated version identifier as the version identifier, and return to execute the query cursor generated according to the version identifier;
[0168] Data retransmission subunit: used to initiate a data retransmission request to the server based on the version identifier if no operation data is found and the operation data is not generated by the client.
[0169] (4) Application unit 304: used to obtain the operation data returned by the server in response to the data retransmission request, and apply the operation data to the multi-person collaborative editing document currently being edited by the client.
[0170] In one embodiment, the operation data carries the operation type, and the application unit 304 may include a decomposition subunit and a first data application subunit, specifically:
[0171] Decomposition sub-unit: used for decomposing the operation data into at least one sub-operation data if the operation type of the operation data is the target type;
[0172] The first data application subunit is used to sequentially apply at least one sub-operation data to the multi-person collaborative editing document currently being edited by the client.
[0173] In one embodiment, the operation data is stored in a message queue, and the application unit 304 may include a first data acquisition subunit, a second data acquisition subunit, and a second data application subunit. Specifically:
[0174] A first data acquisition subunit is used to acquire current operation data of a multi-person collaboratively edited document currently being edited by a client, where the current operation data carries an operation type;
[0175] The second data acquisition subunit is used to acquire the operation data from the message queue if the operation type of the current operation data meets the preset conditions;
[0176] The second data application subunit is used to apply the operation data to the multi-person collaborative editing document currently being edited by the client.
[0177] In one embodiment, the current operation data includes multiple items, and the document processing device may further include an acquisition unit, an operation merging unit, and a sending unit. Specifically:
[0178] Acquisition unit: used to obtain the operation object and operation type of the current operation data;
[0179] Operation merging unit: used to merge multiple current operation data that match the operation object and operation type to obtain merged operation data;
[0180] Sending unit: used to send the merged operation data to the server so that the collaborative client can obtain the merged operation data from the server to synchronize the client's current operation data. The collaborative client is a client that collaborates with the client to edit a document with multiple people.
[0181] In one embodiment, the sending unit may include a data slicing subunit, a first data sending subunit, and a second data sending subunit. Specifically:
[0182] Data segmentation subunit: used for segmenting the merged data to obtain first segmentation data and second segmentation data if the amount of the merged operation data meets a preset threshold;
[0183] A first data sending subunit is used to send the first segmented data to the server;
[0184] The second data sending subunit is configured to send the second segmented data to the server upon receiving confirmation information returned by the server based on the first segmented data.
[0185] In one embodiment, the document processing apparatus may further include a copy obtaining unit, a difference comparing unit, an operation converting unit, and a correction unit. Specifically:
[0186] A copy acquisition unit is used to acquire a copy of a document collaboratively edited by multiple people corresponding to a version identifier from a server;
[0187] Difference comparison unit: used to compare the copy of the multi-person collaboratively edited document with the multi-person collaboratively edited document currently being edited by the client to obtain difference information;
[0188] Operation conversion unit: used to perform operation conversion according to the difference information to obtain difference operation data;
[0189] Correction unit: used to correct the multi-person collaborative editing document currently being edited by the client based on the operation difference data.
[0190] As can be seen from the above, the document processing device of the embodiment of the present application obtains the version identification of the multi-person collaboratively edited document currently being edited by the client through the identification acquisition unit 301; the cursor generation unit 302 generates a query cursor based on the version identification, and the query cursor is used to query the operation data generated by editing the multi-person collaboratively edited document; if the operation data is not found locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identification through the query unit 303; finally, the operation data returned by the server in response to the data retransmission request is obtained through the application unit 304, and the operation data is applied to the multi-person collaboratively edited document currently being edited by the client.
[0191] This solution generates a query cursor based on the version identifier of the multi-person collaboratively edited document currently being edited by the client, and obtains the corresponding operation data through the query cursor, ensuring that the client can obtain the correct version of the operation data, so that the version identifier of the multi-person collaboratively edited document on the client can be accurately incremented and remain consistent with the version identifier of the multi-person collaboratively edited document on the server, thereby improving the synchronization effect of editing operations of different clients on multi-person collaboratively edited documents.
[0192] The embodiment of the present application also provides a computer device, which can be a terminal or a server. Figure 8 , which shows a schematic diagram of the structure of the computer device involved in the embodiment of the present application, specifically:
[0193] The computer device may include one or more processing core processors 1001, one or more computer readable storage media memories 1002, a power supply 1003, an input unit 1004 and other components. Those skilled in the art will understand that Figure 8 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange components differently.
[0194] Processor 1001 is the control center of the computer device. It connects the various components of the entire computer device using various interfaces and lines. By running or executing software programs and / or modules stored in memory 1002 and accessing data stored in memory 1002, it performs various functions of the computer device and processes data, thereby performing overall testing of the computer device. Optionally, processor 1001 may include one or more processing cores; preferably, processor 1001 may integrate an application processor and a modem processor, wherein the application processor primarily processes the operating system, user interface, and computer programs, while the modem processor primarily handles wireless communications. It is understood that the modem processor may not be integrated into processor 1001.
[0195] The memory 1002 can be used to store software programs and modules. The processor 1001 executes various functional applications and data processing by running the software programs and modules stored in the memory 1002. The memory 1002 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, a computer program required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage device. Accordingly, the memory 1002 may also include a memory controller to provide the processor 1001 with access to the memory 1002.
[0196] The computer device also includes a power supply 1003 for supplying power to various components. Preferably, the power supply 1003 can be logically connected to the processor 1001 via a power management system, thereby enabling the power management system to manage charging, discharging, and power consumption. The power supply 1003 can also include one or more DC or AC power supplies, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components.
[0197] The computer device may further include an input unit 1004, which may be configured to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.
[0198] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail here. Specifically, in this embodiment, the processor 1001 in the computer device will load the executable files corresponding to one or more computer program processes into the memory 1002 according to the following instructions, and the processor 1001 will run the computer programs stored in the memory 1002 to implement various functions as follows:
[0199] Get the version ID of the multi-person collaborative editing document currently being edited by the client;
[0200] Generate a query cursor based on the version identifier, and use the query cursor to query the operation data generated by editing a document jointly edited by multiple people;
[0201] If the operation data is not found locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identifier;
[0202] The operation data returned by the server in response to the data retransmission request is obtained, and the operation data is applied to the multi-person collaborative editing document currently being edited by the client.
[0203] The specific implementation of the above operations can be found in the previous embodiments and will not be described in detail here.
[0204] From the above, it can be seen that the computer device of the embodiment of the present application can obtain the version identification of the multi-person collaborative editing document currently being edited by the client; generate a query cursor based on the version identification, and the query cursor is used to query the operation data generated by editing the multi-person collaborative editing document; if the operation data is not queried locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identification; obtain the operation data returned by the server in response to the data retransmission request, and apply the operation data to the multi-person collaborative editing document currently being edited by the client.
[0205] This solution generates a query cursor based on the version identifier of the multi-person collaboratively edited document currently being edited by the client, and obtains the corresponding operation data through the query cursor, ensuring that the client can obtain the correct version of the operation data, so that the version identifier of the multi-person collaboratively edited document on the client can be accurately incremented and remain consistent with the version identifier of the multi-person collaboratively edited document on the server, thereby improving the synchronization effect of editing operations of different clients on multi-person collaboratively edited documents.
[0206] According to one aspect of the present application, a computer program product is provided, comprising a computer program, the computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in various optional implementations of the above embodiments.
[0207] Those skilled in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be accomplished by a computer program, or by controlling related hardware through a computer program. The computer program may be stored in a computer-readable storage medium and loaded and executed by a processor.
[0208] To this end, an embodiment of the present application provides a computer-readable storage medium, which stores a computer program. The computer program can be loaded by a processor to execute any document processing method provided in the embodiment of the present application.
[0209] The specific implementation of the above operations can be found in the previous embodiments and will not be repeated here.
[0210] The computer-readable storage medium may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0211] Since the computer program stored in the computer-readable storage medium can execute any document processing method provided in the embodiments of the present application, the beneficial effects that can be achieved by any document processing method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.
[0212] The above is a detailed introduction to a document processing method, device, computer equipment and computer-readable storage medium provided in the embodiments of the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core ideas. At the same time, for those skilled in the art, based on the ideas of the present application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A document processing method, characterized in that: include: Get the version ID of the multi-person collaborative editing document currently being edited by the client; Receiving, by the client, first operation data generated by editing a document collaboratively edited by multiple people in different versions, and using the version identifier as a query object of the cursor to generate a query cursor, wherein the query cursor is used to search a local storage space of the client for operation data generated by editing the document collaboratively edited by multiple people corresponding to the version identifier; If the operation data is not found locally on the client through the query cursor, a data retransmission request is initiated to the server based on the version identifier; Acquire the operation data returned by the server in response to the data retransmission request, and apply the operation data to the multi-person collaboratively edited document currently being edited by the client; If the operation data is not found locally on the client through the query cursor, initiating a data retransmission request to the server based on the version identifier includes: If the operation data is not found through the query cursor, and the operation data is generated by the client, the version identifier is updated, and the updated version identifier is used as the version identifier, and the query object with the version identifier as the cursor is returned to generate a query cursor; If the operation data is not found and the operation data is not generated by the client, a data retransmission request is initiated to the server based on the version identifier; The operation data is stored in a message queue, and the operation data is applied to a multi-person collaboratively edited document currently being edited by the client, including: Acquire current operation data for a multi-person collaboratively edited document currently being edited by the client, the current operation data carrying an operation type; If the operation type of the current operation data satisfies a preset condition, the operation data is obtained from the message pair sequence, and the operation data is applied to the multi-person collaboratively edited document currently being edited by the client, wherein the operation type of the current operation data satisfies the preset condition, indicating that the editing operation of the client user on the multi-person collaboratively edited document currently being edited by the client is not an operation that will be interrupted by the editing operation of other client users on the multi-person collaboratively edited document currently being edited by the client; If the operation type of the current operation data does not meet the preset conditions, wait until the current operation data is applied to the multi-person collaboratively edited document currently being edited by the client, obtain the operation data from the message queue, and then apply the operation data to the multi-person collaboratively edited document currently being edited by the client.
2. The method according to claim 1, characterized in that The operation data carries an operation type, and applying the operation data to the multi-person collaboratively edited document currently being edited by the client includes: If the operation type of the operation data is a target type, performing operation decomposition on the operation data to obtain at least one sub-operation data; The at least one sub-operation data is sequentially applied to the multi-person collaborative editing document currently being edited by the client.
3. The method according to claim 1, characterized in that The current operation data includes a plurality of items. After obtaining the current operation data for the multi-person collaboratively edited document currently being edited by the client, the method further includes: Obtaining the operation object and operation type of the current operation data; Merging multiple current operation data that match the operation object and the operation type to obtain merged operation data; The merged operation data is sent to the server so that the collaborative client obtains the merged operation data from the server to synchronize the current operation data of the client, and the collaborative client is a client that collaborates with the client to edit the multi-person collaboratively edited document.
4. The method according to claim 3, characterized in that The sending the merged operation data to the server includes: If the amount of the merged operation data meets a preset threshold, performing data segmentation on the merged operation data to obtain first segmented data and second segmented data; Sending the first segmented data to the server; When confirmation information returned by the server based on the first segmented data is received, the second segmented data is sent to the server.
5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Obtaining from the server a copy of the document collaboratively edited by multiple people corresponding to the version identifier; Comparing the copy of the multi-person collaboratively edited document with the multi-person collaboratively edited document currently being edited by the client to obtain difference information; Performing operation conversion according to the difference information to obtain difference operation data; The multi-person collaborative editing document currently being edited by the client is revised based on the operation difference data.
6. A document processing device, characterized in that: include: An identification acquisition unit, used to acquire the version identification of the multi-person collaborative editing document currently being edited by the client; a cursor generating unit configured to receive, via the client, first operation data generated by editing a document collaboratively edited by multiple people in different versions, and to generate a query cursor using the version identifier as a cursor query object, the query cursor being configured to query a local storage space of the client for operation data generated by editing the document collaboratively edited by multiple people corresponding to the version identifier; a query unit, configured to initiate a data retransmission request to a server based on the version identifier if the operation data is not found locally on the client through the query cursor; an application unit, configured to obtain the operation data returned by the server in response to the data retransmission request, and apply the operation data to the multi-person collaboratively edited document currently being edited by the client; If the operation data is not found locally on the client through the query cursor, initiating a data retransmission request to the server based on the version identifier includes: If the operation data is not found through the query cursor, and the operation data is generated by the client, the version identifier is updated, and the updated version identifier is used as the version identifier, and the query object with the version identifier as the cursor is returned to generate a query cursor; If the operation data is not found and the operation data is not generated by the client, a data retransmission request is initiated to the server based on the version identifier; The operation data is stored in a message queue, and the operation data is applied to a multi-person collaboratively edited document currently being edited by the client, including: Acquire current operation data for a multi-person collaboratively edited document currently being edited by the client, the current operation data carrying an operation type; If the operation type of the current operation data satisfies a preset condition, the operation data is obtained from the message pair sequence, and the operation data is applied to the multi-person collaboratively edited document currently being edited by the client, wherein the operation type of the current operation data satisfies the preset condition, indicating that the editing operation of the client user on the multi-person collaboratively edited document currently being edited by the client is not an operation that will be interrupted by the editing operation of other client users on the multi-person collaboratively edited document currently being edited by the client; If the operation type of the current operation data does not meet the preset conditions, wait until the current operation data is applied to the multi-person collaboratively edited document currently being edited by the client, obtain the operation data from the message queue, and then apply the operation data to the multi-person collaboratively edited document currently being edited by the client.
7. A computer device, characterized in that: It comprises a memory and a processor; the memory stores a computer program, and the processor is used to run the computer program in the memory to execute the document processing method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that The computer-readable storage medium is used to store a computer program, and the computer program is loaded by a processor to execute the document processing method according to any one of claims 1 to 5.
9. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the document processing method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
File synchronization method, server and terminal
CN104488248A
Document collaboration discovery
CN109074351A