Data processing method, device and related equipment for sharing a document, and program product

By recording and updating the location of incomplete edit data in shared documents, the problems of editing misalignment and data loss in multi-person collaborative editing are solved, enabling accurate collaborative processing of shared documents.

CN116341495BActive Publication Date: 2026-07-21TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TENCENT TECHNOLOGY (SHENZHEN) CO LTD
Filing Date
2021-12-22
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

When multiple people collaboratively edit and share documents, incomplete editing data may lead to problems such as editing misalignment and data loss. Existing technologies cannot guarantee the accuracy and efficiency of collaborative editing.

Method used

By acquiring the instruction information of the pre-editing operation, the insertion position of the content data to be collaborated on is recorded, and when the shared editing instruction information is received, the operation conversion process is performed to update the position of the content data to be collaborated on, and the collaboration instruction information is generated to ensure the accurate collaboration of data in the shared document.

Benefits of technology

Effectively maintain the location of content data to be collaborated on, ensure the accuracy and consistency of editing in shared documents, reduce resource waste, and improve the efficiency of collaborative editing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116341495B_ABST
    Figure CN116341495B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data processing method and device for a shared document, related equipment and program product. The method comprises: obtaining pre-editing operation corresponding pre-editing instruction information comprising to-be-coordinated content data and an insertion position; before obtaining first coordination data corresponding to the to-be-coordinated content data, if shared editing instruction information for the shared document is received, then performing operation conversion processing on the pre-editing instruction information and the shared editing instruction information according to a position processing rule to obtain an updated position of the to-be-coordinated content data, and correctly submitting or applying the converted shared editing instruction information; and if it is determined that the first coordination data corresponding to the to-be-coordinated content data is obtained, then generating coordination instruction information, so as to facilitate submitting to-be-coordinated content data corresponding to the to-be-coordinated content data to a server for coordination processing. Through the embodiments of the present application, the to-be-coordinated content data can be better maintained, and the coordination processing of the shared document can be better implemented.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer application technology, and in particular to a data processing method, apparatus, and related equipment and program products for shared documents. Background Technology

[0002] Collaborative editing refers to multiple people editing the same document online simultaneously. When one participant makes a change at a certain point in the document, that change is synchronized to the computer devices of other participants. In other words, everyone's edits can be shared with everyone else, thus achieving the sharing of editing results.

[0003] However, during collaborative content editing, some incomplete data doesn't need to be shared with other users in real time. It can be shared after editing is complete; this type of data can be called "content data awaiting collaboration." Currently, maintaining this data in scenarios with a large number of users editing simultaneously can lead to problems such as editing errors, misalignment, and data loss, failing to guarantee a good collaborative editing effect and ensure accurate editing of collaborative data. Summary of the Invention

[0004] This application provides a data processing method, apparatus, and related equipment and program products for shared documents, which can better maintain the data of content to be collaborated on and better realize the collaborative processing of shared documents.

[0005] On the one hand, embodiments of this application provide a data processing method for shared documents, including:

[0006] In response to a pre-editing operation on a shared document, the system obtains the pre-editing instruction information corresponding to the pre-editing operation. The pre-editing instruction information records the content data to be collaborated on generated by the pre-editing operation, as well as the insertion position of the content data to be collaborated on in the shared document.

[0007] Before obtaining the first collaborative data corresponding to the content to be collaborated on, if a shared editing instruction for a shared document is received, the pre-editing instruction and the shared editing instruction are processed according to the location processing rules to obtain the updated position of the content to be collaborated on, and the converted shared editing instruction is correctly submitted or applied. If the shared editing instruction is generated based on the operation of this end, the converted shared editing instruction is correctly submitted to the server to realize the collaborative processing of the second collaborative data to the shared document. If the shared editing instruction is generated by other user ends, the second collaborative data can be correctly applied to the shared document displayed on this end according to the converted shared editing instruction.

[0008] If it is determined that the first collaborative data corresponding to the content data to be collaboratively obtained is obtained, collaborative indication information is generated. The collaborative indication information includes: the first collaborative data and the collaborative position of the first collaborative data obtained according to the update position.

[0009] The shared editing instruction information includes the editing location of the second collaborative data and the second collaborative data in the shared document.

[0010] On the other hand, embodiments of this application provide a data processing apparatus for shared documents, including:

[0011] The acquisition module is used to respond to the pre-editing operation on the shared document, acquire the pre-editing instruction information corresponding to the pre-editing operation, and the pre-editing instruction information records the content data to be collaborated generated by the pre-editing operation, as well as the insertion position of the content data to be collaborated in the shared document;

[0012] The processing module is used to, before obtaining the first collaborative data corresponding to the content data to be collaborated on, if it receives shared editing instruction information for the shared document, perform operation conversion processing on the pre-editing instruction information and the shared editing instruction information according to the position processing rules to obtain the update position of the content data to be collaborated on, and correctly submit or apply the converted shared editing instruction information; if it is determined that the first collaborative data corresponding to the content data to be collaborated on has been obtained, then collaborative instruction information is generated, which includes: the first collaborative data and the collaborative position of the first collaborative data obtained according to the update position; wherein, the shared editing instruction information includes the second collaborative data and the editing position of the second collaborative data in the shared document.

[0013] In one embodiment, the processing module is specifically configured to: determine the update location of the content data to be coordinated as the coordination location of the first coordination data; delete the content data to be coordinated, and generate coordination indication information including the first coordination data corresponding to the content data to be coordinated and the coordination location of the first coordination data.

[0014] In one embodiment, the processing module is specifically configured to: obtain editing location information corresponding to the collaboration identifier based on the collaboration identifier generated for the collaboration content data generated for the pre-editing operation, wherein the editing location information is used to indicate the location of the collaboration content data in the shared document; and delete the collaboration content data based on the location indicated by the editing location information in the shared document.

[0015] In one embodiment, the processing module is further configured to: generate a collaborative identifier for the collaborative content data generated by the pre-editing operation; construct a mapping relationship between the editing position information of the collaborative content data and the collaborative identifier; wherein the editing position information includes any one of the following: insertion position, update position.

[0016] In one embodiment, the processing module is further configured to: detect whether there is an insertion confirmation event for inserting collaborative content data into a shared document; if so, use the collaborative data generated based on the collaborative content data as the first collaborative data, and use the current update position of the collaborative content data record as the collaborative position of the first collaborative data; wherein, the insertion confirmation event includes any one or more of the following: text input confirmation event, multimedia data upload confirmation event, speech conversion completion event, and image editing completion event.

[0017] In one embodiment, the processing module is further configured to: update the pre-editing instruction information to obtain updated pre-editing instruction information; wherein the updated pre-editing instruction information includes at least one of the following: pre-editing instruction information obtained by replacing the insertion position with the updated position; pre-editing instruction information obtained by editing and updating the content data to be coordinated in the pre-editing instruction information in response to the detected editing operation.

[0018] In one embodiment, if the shared editing instruction information is server-side shared instruction information, the processing module is specifically used to: perform operation conversion processing on the shared editing instruction information based on the pre-editing instruction information to obtain converted shared editing instruction information; and perform operation conversion processing on the pre-editing instruction information based on the shared editing instruction information to obtain converted pre-editing instruction information, wherein the converted pre-editing instruction information includes the update position of the content data to be coordinated. The operation conversion processing involved belongs to the processing logic of the position processing rules.

[0019] In one embodiment, if the shared editing instruction information is local shared instruction information, the processing module is specifically used to: generate a pending cancellation instruction information corresponding to a pending cancellation operation on the pending content data in the pre-edited instruction information; perform operation conversion processing on the pending cancellation instruction information and the local shared instruction information to obtain the converted local shared instruction information; determine the addition instruction information corresponding to the addition operation of adding the pending content data again after the pending cancellation operation; perform operation conversion processing on the addition instruction information and the converted local shared instruction information to obtain the update position of the pending content data, and correctly submit or apply the converted shared editing instruction information. The operation conversion processing involved belongs to the processing logic of the position processing rules.

[0020] In one embodiment, the processing module is further configured to: output converted local sharing indication information; wherein the local sharing indication information includes: local shared content data generated by the local shared editing operation, and the initial position of the local shared content data in the shared document, and the converted local sharing indication information includes: local shared content data generated by the local shared editing operation, and the shared position of the converted local shared content data in the shared document.

[0021] In one embodiment, before outputting the converted local shared indication information, the processing module is further configured to: if a local shared cancellation operation is detected on the local shared content data included in the local shared indication information, generate local shared cancellation indication information; perform operation conversion processing on the cancellation indication information to be coordinated and the local shared indication information to obtain the converted cancellation indication information to be coordinated; perform operation conversion processing on the local shared cancellation indication information and the converted cancellation indication information to be coordinated to obtain the converted local shared cancellation indication information; and store the converted local shared cancellation indication information into the cancellation stack so as to revoke the local shared content data generated by the local shared editing operation through the converted local shared cancellation indication information. The operation conversion processing involved belongs to the processing logic of the position processing rules.

[0022] Accordingly, this application provides a computer device, including: a processor, a memory, and a network interface; the processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the data processing method for shared documents in this application.

[0023] Accordingly, embodiments of this application provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, perform the data processing method for shared documents as described in this application.

[0024] Accordingly, this application provides a computer program product, which includes a computer program or computer instructions. When the computer program or computer instructions are executed by a processor, they implement the steps of the data processing method for shared documents according to the embodiments of this application.

[0025] In this embodiment, for pre-editing operations on a shared document, the pre-editing instruction information records the collaborative content data generated by the pre-editing operation and its insertion position in the shared document. Upon receiving shared editing instruction information, the pre-editing instruction information and the shared editing instruction information are converted to update the latest insertion position of the collaborative content data in the shared document. Therefore, when the first collaborative data corresponding to the collaborative content data is determined to be obtained, the collaborative position included in the collaborative instruction information is accurately generated. This scheme maintains the collaborative content data through pre-editing instruction information, which can be converted to the received shared editing instruction information. This ensures that the position of the collaborative content data is effectively maintained when other collaborative data exists in the shared document, and guarantees accurate editing of the collaborative data. Attached Figure Description

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

[0027] Figure 1 This is a schematic diagram illustrating the application of an operational conversion algorithm provided in an exemplary embodiment of this application;

[0028] Figure 2 This is an architectural diagram of a data processing system provided in an exemplary embodiment of this application;

[0029] Figure 3 This is a flowchart illustrating a data processing method for shared documents provided in an exemplary embodiment of this application;

[0030] Figure 4 This is a schematic diagram of a common input editing process provided in an embodiment of this application;

[0031] Figure 5 This is a flowchart illustrating another data processing method for shared documents provided in an exemplary embodiment of this application;

[0032] Figure 6 This is a schematic diagram of the editing process of an input method candidate state provided in an embodiment of this application;

[0033] Figure 7 This is an exemplary diagram illustrating the editing effect of a collaborative editing intermediate state problem provided in an embodiment of this application;

[0034] Figure 8 This is a schematic diagram of a process according to position processing rules provided in an exemplary embodiment of this application;

[0035] Figure 9a This application provides a schematic diagram illustrating the operation conversion between pre-editing and local shared editing operations.

[0036] Figure 9b This is an exemplary schematic diagram illustrating the conversion between pre-editing and collaborative editing operations provided in an embodiment of this application;

[0037] Figure 10 This is a schematic diagram illustrating the principle of maintaining data to be coordinated using a maintenance interval, as provided in an embodiment of this application.

[0038] Figure 11 This is a schematic diagram of the structure of a data processing apparatus for shared documents provided in an exemplary embodiment of this application;

[0039] Figure 12 This is a schematic diagram of the structure of a computer device provided in an exemplary embodiment of this application. Detailed Implementation

[0040] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, not all embodiments. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present application.

[0041] To better understand the solutions of the embodiments of this application, the relevant terms and concepts involved in the embodiments of this application will be introduced below.

[0042] 1) Collaborative editing

[0043] Collaboration, encompassing cooperation and synchronization, typically refers to real-time collaborative editing. In simpler terms, it means multiple people simultaneously editing a document online, with each participant's edits immediately syncing to the computers of all other participants. Documents edited online by multiple people can be called shared documents (also known as collaborative documents or online documents). Each person's edits within this shared document are synchronized with all other editors, allowing everyone's edits to be shared. This collaborative editing enables more efficient communication and reduces communication costs.

[0044] 2) OT algorithm

[0045] The full name is Operation Transform (OT), an algorithm used in collaborative document editing to handle conflicts and ensure consistency in the final editing results across all devices. OT algorithms are primarily used for conflict resolution in collaborative editing, where multiple editing operations are generated under the same document state; these operations need to be transformed before being applied sequentially. As a positional processing rule, the OT algorithm can handle positional conflicts in shared documents. Specifically, it can include one-sided OT or two-sided OT. OT algorithms can run on a server or on a front-end device. If it only runs on the front-end, it's one-sided OT; if both the front-end and server run, it's two-sided OT. A typical two-sided OT scenario is where the server executes... Figure 1 The edge corresponding to point AB' at point (1) in the middle, the front-end device executes Figure 1 The edge corresponding to BA' at point (1) in the middle is used to achieve a consistent result.

[0046] Please see Figure 1 , Figure 1 This is a schematic diagram illustrating the application of an operation conversion algorithm provided in an embodiment of this application. Figure 1 Each dot represents a state of a shared document, and the arrow represents an editing operation. Conflict resolution, or conversion, can only occur when documents share the same state. Figure 1 In this context, (1) and (2) represent single-conflict handling and multi-conflict handling, respectively. For example... Figure 1 As shown in (1), A and B are two operations based on the same document state. Here, T(A,B) is defined as the result of the transformation of operation A when operation B is applied first, i.e., A' = T(A,B). Similarly, B' = T(B,A). The OT algorithm ultimately needs to ensure that AB' = BA', so that the two conflicting operations can eventually obtain the same document state after transformation. Suppose that operation A inserts the character 'a' at position 0, and operation B deletes a character at position 2. Then, operation B is transformed into deleting a character at position 3. Operation A remains unchanged after transformation because it is not affected by operation B. Figure 1 As shown in (2), assuming that under the same document state, one user performs operation A and another user performs two operations B and C, then the conversion of A' and B' is the same as that of a single conflict. At this time, A' and C are based on the same document state, so C' = T(C,A'), A” = T(A',C), and finally AB'C' = BCA”. After multiple conflicting operations are converted, the same document state can also be achieved.

[0047] 3) Model

[0048] The data model runs on each terminal. In collaborative editing scenarios, the OT (Operational Technology) algorithm ensures consistency of the final model across all terminals. This model is an abstract representation of the document. The actual document displayed on the page in the terminal is the View layer, rendered from the Model. Any user modifications must first be converted into modifications to the Model before being rendered to the page.

[0049] 4) Placeholder

[0050] Placeholders are used to reserve a fixed position, waiting for the user to replace it with other content. They are widely used in the editing of various documents on computers.

[0051] 5) Cloud computing

[0052] Cloud computing is a computing model that distributes computing tasks across a large pool of computers, enabling various application systems to access computing power, storage space, and information services as needed. The network providing these resources is called the "cloud." From the user's perspective, resources in the "cloud" appear infinitely scalable, readily available, on-demand, and expandable, with payment based on usage. As a provider of fundamental cloud computing capabilities, a cloud resource pool (referred to as a cloud platform, generally called an IaaS (Infrastructure as a Service) platform) is established. Various types of virtual resources are deployed within this pool for external customers to choose from. The cloud resource pool mainly includes: computing devices (virtualized machines containing operating systems), storage devices, and network devices. Logically, a PaaS (Platform as a Service) layer can be deployed on top of the IaaS layer, and a SaaS (Software as a Service) layer can be deployed on top of the PaaS layer. Alternatively, SaaS can be directly deployed on top of IaaS. PaaS is a platform for running software, such as databases and web containers. SaaS refers to various types of business software, such as web portals and bulk SMS senders. Generally, SaaS and PaaS are upper layers compared to IaaS.

[0053] Cloud storage is a new concept that extends and develops from cloud computing. A distributed cloud storage system (hereinafter referred to as a storage system) refers to a storage system that uses cluster applications, grid technology, and distributed storage file systems to aggregate a large number of storage devices (also called storage nodes) of various types in a network through application software or application interfaces to work together and provide data storage and business access functions. For example, the shared documents in this application embodiment can be stored in a cloud server that provides cloud storage services. Furthermore, cloud computing can be used to manage data edited by various end users in shared documents, or to perform collaborative computing on distributed data, etc.

[0054] The architecture of the data processing system provided in the embodiments of this application will be described below with reference to the accompanying drawings.

[0055] Please see Figure 2 , Figure 2 This is an architectural diagram of a data processing system provided in an exemplary embodiment of this application, which can be applied to the collaborative processing of shared documents. Figure 2As shown in the diagram, this architecture may include a cluster of terminal devices (including a first terminal device 200a, a second terminal device 200b, a third terminal device 200c, etc.) and a server 201. The terminal devices and the server 201 can communicate with each other via wired or wireless means. The terminal devices can be smartphones, tablets, smart wearable devices, smart voice interaction devices, smart home appliances, personal computers, in-vehicle terminals, and other computer devices that support online collaborative editing functions; there are no restrictions on this. The server 201 can be an independent physical server, a server cluster composed of multiple physical servers, or a distributed system. It can also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; there are no restrictions on this as well. Figure 2 The number of terminal devices and servers shown is merely an example, and this application does not limit the number of terminal devices and servers.

[0056] The terminal device cluster includes various terminal devices that can run a web platform or a third-party application with online collaborative editing capabilities. Through this application or web platform, users can open and edit shared documents on the terminal devices. The various terminal devices can share data through the server 201. For example, the collaborative data edited by a user on the shared document through a terminal device (e.g., the first terminal device 200a) can be synchronized to the shared document on the terminal devices of other users (e.g., the second terminal device 200b and the third terminal device 200c). In one embodiment, a user edits a shared document using a local terminal device (e.g., the first terminal device 200a). Some editing operations (e.g., pre-editing operations) may generate collaborative content data. This collaborative content data is only displayed on the local terminal device and is not synchronized to other users' terminal devices; it is recorded in the pre-editing instruction information. The operation conversion function provided by the terminal device can convert the pre-editing instruction information and other shared editing instruction information (including collaborative data) corresponding to the editing operations, so as to correctly update the collaborative content data and correctly submit or collaboratively update the shared editing instruction information. This shared editing instruction information can be generated by local editing operations on the shared document on the local terminal device, or it can be generated by collaborative editing operations on the shared document by other terminal devices and synchronized to the local terminal device via the server 201.

[0057] It's important to note that during the conversion process, the pre-edited content data to be collaborated on, along with other collaborative data (such as second collaborative data), has already been applied to the shared document. The pre-editing process for the shared document is not significantly different from regular editing; the only difference is that the content data to be collaborated on is marked as non-collaborative and will not be directly collaborated on before confirmation. If other collaborative data is determined through local editing, the purpose of the conversion is to correctly update the positions of the content data to be collaborated on and other collaborative data within the document, and to correctly submit the corresponding first collaborative data. The other local collaborative data is also submitted to the server based on its latest update position. The server then performs collaborative processing of the shared document according to the submitted collaborative data and its latest update position. Subsequent further editing of the content data to be collaborated on continues based on the update position obtained after the previous OT conversion, and position updates are performed upon receiving new collaborative data.

[0058] If the other collaborative data was generated through collaborative editing by other users, then the purpose of the conversion process is to correctly update the data to be collaborated on (including updating the content and insertion position), and to correctly insert and display other collaborative data from other users (which may also correspond to second collaborative data) to the user. Throughout the conversion process, the shared document's model remains unchanged, the view presented to the user remains unchanged, and the content presented in the UI (User Interface) remains unchanged.

[0059] For example, when a user places the cursor in a desired editing location and inputs the first letter of the Pinyin input method through a pre-editing operation, the collaborative content data is inserted into the shared document, enters the Model, and is rendered in the View layer, which the user can then see. If a local editing operation occurs afterward—that is, if other editing operations (i.e., shared editing operations) exist in addition to the collaborative content data, such as inserting a number at the user-defined cursor position—this is also rendered in the View layer. In this case, the Model has already applied both operations and remains in this state. There will be a pre-editing operation for the collaborative content data and a shared editing operation in memory. The latter wants to be submitted first, while the former wants to update its insertion position in the shared document after being affected by the latter. Therefore, an operation transformation is required. This transformation involves changes to both the pre-editing and shared editing operations (because OT is simply operation transformation), but does not involve changes to the Model or View. The number inserted by other editing operations and the latest updated position of the number obtained after the OT transformation based on these two operations are submitted to the server for collaborative processing. During the pre-editing process of inputting subsequent letters using the Pinyin input method, the system will also start updating according to the latest updated position of the first letter obtained after OT conversion based on these two operations, until the first collaborative data finally obtained from this pre-editing operation is determined.

[0060] It should be noted that the content data to be collaborated on will not be collaborated on before its insertion is confirmed. In this embodiment, on the one hand, the content data to be collaborated on will be edited and updated before its insertion is confirmed. For example, in the process of converting speech to text in a shared document, the first character in the intermediate text can be considered as the content data to be collaborated on. Subsequent speech conversion processes will continuously edit and update the content data to be collaborated on, resulting in new content data to be collaborated on. On the other hand, the insertion position of the content data to be collaborated on in the shared document may also be updated. In this embodiment, the content data to be collaborated on can also be considered as data waiting to be deleted, because once there is an edit or update, the content data to be collaborated on before the edit or update will be found and deleted according to the aforementioned insertion position (or the update position obtained after the operation and conversion process), and replaced by the new content data to be collaborated on after the edit. Therefore, the content data to be collaborated on can actually be considered as serving as a placeholder in the shared document for the collaborative data that will eventually be collaborated on.

[0061] The interaction flow of the data processing system is described below based on the above content. It is assumed that the shared document is collaboratively edited by three users (user A, user B, and user C) through terminal devices (corresponding to the first terminal device 200a, the second terminal device 200b, and the third terminal device 200c, respectively). User A edits the shared document and generates the content data to be collaboratively edited on the first terminal device 200a. The specific interaction flow is as follows:

[0062] 1) The first terminal device 200a responds to the pre-editing operation initiated by user A on the shared document. The pre-editing operation can generate the content data to be collaborated on and the insertion position of the content data to be collaborated on in the shared document. All of these data are recorded in the pre-editing instruction information.

[0063] The data to be collaboratively stored is stored and displayed on the local terminal device (i.e., the first terminal device 200a) and is not synchronized to other terminal devices (such as the second terminal device 200b and the third terminal device 200c). The data to be collaboratively stored can include input method candidate states, images being uploaded, speech being parsed into text, graphics being drawn, images being edited, etc. For example, before inserting the pinyin after "abc", the pinyin annotation character "pinyin" in the input method is the data to be collaboratively stored. Once the user confirms the pinyin using methods such as pressing Enter, the pinyin can be used as the first collaborative data, becoming the actual data to be collaboratively stored. It should be noted that before obtaining the first collaborative data, user A can continuously trigger pre-editing operations in the shared document through the local terminal device, thereby continuously updating the data to be collaboratively stored.

[0064] 2) Before the first terminal device 200a obtains the first collaborative data corresponding to the content data to be collaborated, if the first terminal device 200a receives shared editing instruction information for the shared document, it can perform operation conversion processing on the pre-editing instruction information and the shared editing instruction information according to the position processing rules set by the local kernel, update the insertion position (or the position that has been updated once) included in the pre-editing instruction information and the editing position included in the shared editing instruction information to obtain the updated position of the content data to be collaborated, and correctly submit or apply the converted shared editing instruction information, wherein the converted shared editing instruction information includes the editing position updated by this conversion.

[0065] In this application, the position processing rules are mainly used to adjust the position of editing operations on shared documents generated by the same user terminal or different user terminals. The rules are adjusted according to the operation order of the editing operations on the shared document and the position of the content corresponding to the editing operations (such as inserted or deleted content, content involving style conversion, etc.) in the shared document, thereby improving the accuracy of the editing position of each editing operation in the shared document.

[0066] When the shared editing instruction information is local shared instruction information, the result of the conversion process also includes the update position of the shared editing instruction information. Because the existence of the content data to be collaborated on will also affect the position of the second collaborative data in the shared editing instruction information, the latest update position of each can be determined in real time by performing OT conversion on the new pre-editing instruction information and the new shared editing instruction information. The second collaborative data and the latest update position of the second collaborative data, the finally determined first collaborative data, and the latest update position of the first collaborative data are submitted sequentially. For a detailed description of the OT conversion process in this case, please refer to the following embodiment. Figure 9a According to the description of the corresponding embodiment, this maintains the data of content to be collaborated on, and prioritizes the submission of collaborative data generated by the local shared editing operation, thereby ensuring that the content edited in the shared document meets the user's expectations.

[0067] In one embodiment, the shared editing instruction information received by the first terminal device 200a may originate from the user's own terminal device. This shared editing instruction information includes second collaborative data and its editing position within the shared document. The second collaborative data primarily consists of other data that has been determined to be collaboratively included in the shared document; this can be data to be inserted into or deleted from the shared document. Correspondingly, the editing position can be either the insertion or deletion position of the second collaborative data within the shared document. The second collaborative data includes data collaboratively received from other terminals capable of editing the shared document, or data generated during the processing of collaborative content data by the local terminal and intended for collaboration with other users.

[0068] For example, if a user inserts an image into a shared document displayed on their local device, and the image is still uploading and not yet confirmed for insertion, this image can be considered as collaborative content data. Before the upload is complete, the user on their local device can continue to edit the shared document and obtain data that can be collaboratively shared with other users as secondary collaborative data.

[0069] When the shared editing instruction information received by the first terminal device 200a originates from a local user (i.e., user A), this typically occurs when user A pre-edits a shared document using the first terminal device 200a (e.g., uploading an image), and subsequently performs a local shared editing operation (e.g., inserting the characters 123) within the shared document using the first terminal device 200a. The shared editing instruction information corresponding to this local shared editing operation is the shared editing instruction information received by the first terminal device 200a. After receiving this shared editing instruction information, the first terminal device 200a can perform subsequent processing as described above. In this case, the conversion process prioritizes submitting the locally generated shared editing instruction information.

[0070] In one embodiment, the shared editing instruction information received by the first terminal device 200a comes from other users. That is, before obtaining the first collaborative data corresponding to the content to be collaborated on, other users (e.g., user B) perform collaborative editing operations in the shared document through a terminal device (e.g., the second terminal device 200b), generating corresponding shared editing instruction information. This shared editing instruction information is then submitted to the server 201, which sends it to the third terminal device 200c where user C is located and the first terminal device 200a where user A is located. After receiving the shared editing instruction information sent by the server 201, the first terminal device 200a can perform subsequent processing as described above. In this case, the conversion process is to adjust the positional relationship between the collaborative data of the shared editing instruction information from other users and the content to be collaborated on at the local end within the shared document, better maintaining the content to be collaborated on, and ensuring that the second collaborative data from other users can be correctly applied to the shared document and displayed to the user along with the content to be collaborated on, thus meeting the user's editing and collaboration expectations.

[0071] When shared editing instructions from other users via server collaboration are received, the current pre-editing instructions include the acquired collaborative content data and its latest position (insertion position or latest update position) in the shared document. An OT (On-The-Air) conversion is performed directly on the pre-editing instructions and the shared editing instructions to obtain the latest update position of the collaborative content data in the pre-editing instructions and the latest update position of the second collaborative data in the shared editing instructions. The terminal will then render and display the second collaborative data at the latest update position corresponding to the second collaborative data in the shared document presented on its local device. For a detailed description of the OT conversion process in this case, please refer to the following embodiment. Figure 9b Description of the corresponding embodiments.

[0072] 3) When the first terminal device 200a detects an insertion confirmation event for inserting collaborative content data into a shared document (e.g., an input method confirmation event where user A selects a candidate word in the pinyin input method candidate state), it can confirm that the first terminal device 200a has obtained the first collaborative data corresponding to the collaborative content data. The updated position can be determined as the collaborative position of the first collaborative data, thereby generating collaborative indication information including the first collaborative data and its collaborative position. It should be noted that the collaborative position refers to the updated position recorded when the first collaborative data is determined. During the editing process, the collaborative content data may continuously change due to user editing. For example, the collaborative content data may undergo editing operations (e.g., deleting one or more pinyin letters during pinyin input, causing a change in the length of the collaborative content data), or other shared collaborative data may be continuously received before the first collaborative data is finally determined. Based on the changes in pinyin letters or other collaborative data, a new updated position will be calculated (e.g., calculating the offset of the collaborative content data in the shared document), and the corresponding new updated position will be recorded. Finally, after the first collaborative data is determined, the latest recorded updated position will be used as the collaborative position of the first collaborative data.

[0073] 4) The first terminal device 200a can automatically submit the collaboration instruction information to the server 201, which will then synchronize this collaboration instruction information to other terminal devices (including the second terminal device 200b and the third terminal device 200c). In one embodiment, when other terminal devices (e.g., terminal device 200c) perform collaborative editing operations, the server 201 performs operation conversion processing on the collaboration instruction information and the shared editing instruction information corresponding to the collaborative editing operation according to the location processing rules, so as to achieve consistency in the final editing results of each terminal device.

[0074] In one embodiment, the method described in this application can be applied on a server or on a front-end device, such as a personal computer, and the location processing rules described above can adopt the OT algorithm.

[0075] In one embodiment, server 201 provides a database, which may be a cloud database accessible to terminal device 200. The database stores versions of shared documents, collaborative instruction information submitted by each terminal device, and shared editing instruction information corresponding to shared editing operations, including collaborative data (e.g., first collaborative data, second collaborative data), etc. Server 201 can provide OT services to handle conflicts in shared documents.

[0076] This application provides a data processing system applied to shared documents. By converting pre-editing instructions received from pre-editing operations on the shared document in a terminal device with received shared editing instructions, the system updates the insertion position of the content data to be collaborated on within the shared document, as included in the pre-editing instructions. Upon determining that the first collaborative data corresponding to the content data to be collaborated on has been obtained, collaborative instructions are generated so that the first collaborative data included in the collaborative instructions can be submitted subsequently. It can be observed that using the content data to be collaborated on not only saves collaboration resources but also allows for continued reception of collaborative data included in other shared editing instructions in this state. Furthermore, it maintains the latest insertion position of the content data to be collaborated on within the shared document, thereby ensuring the accuracy of the collaborative data in the shared document. This application not only correctly updates the content data to be collaborated on but also ensures the correct submission or collaborative updating of shared editing instructions (including local editing and collaborative editing).

[0077] The specific implementation of the data processing method proposed in the embodiments of this application will be described in detail below with reference to the accompanying drawings.

[0078] Please see Figure 3 , Figure 3 This is a flowchart illustrating a data processing method for shared documents provided in an exemplary embodiment of this application. Specifically, it can be executed by a computer device (e.g., a terminal device, which can be such as...). Figure 2 The first terminal device 200a in the data processing system shown includes, but is not limited to, the following steps.

[0079] S301, in response to a pre-editing operation on a shared document, obtain the pre-editing instruction information corresponding to the pre-editing operation.

[0080] Users can edit shared documents through their terminal devices. Pre-editing operations refer to the editing operations performed on the shared document to generate collaborative content data. For example, pre-editing operations can include typing in Pinyin, uploading multimedia data (such as pictures, videos, voice, etc.), etc. The triggering methods for pre-editing operations can be button triggering, gesture triggering, voice triggering, etc. Through pre-editing operations, collaborative content data can be inserted into the shared document, or parts of the collaborative content data can be deleted from the existing collaborative content data. For example, during Pinyin input, one or more Pinyin letters may be deleted.

[0081] The pre-editing operation generates collaborative content data, which refers to non-final data generated during the collaborative editing of a shared document. Since this collaborative content data is temporarily incomplete, it can be applied to the shared document's Model for the UI (User Interface) to display, allowing local users to track the editing progress. Furthermore, to ensure the independence of the editing process, the "semi-finished product" (i.e., collaborative content data) will not be shared with other users, preventing them from further editing the data and interfering with the current user's work. Collaborative content data is data displayed on the interface but not yet fully edited. This data is stored and displayed on the local terminal device (or simply local device) but not synchronized to other terminal devices, effectively saving collaborative resources. Collaborative content data includes, but is not limited to, input method candidate states, multimedia data being uploaded (e.g., images, videos), voice input being parsed into text, and graphics being drawn. Input method candidate states refer to the characters preceding the target character, such as the following... Figure 7 The text in ① shows multiple candidate words (target characters) corresponding to the pinyin letters "pinyinshurufa" (the labeled character), such as "pinyin input method" and "pinyin input". Input method candidate states include, but are not limited to, pinyin input method candidate states and Wubi input method candidate states.

[0082] The pre-editing instruction information obtained by the terminal device records the collaborative content data generated by the pre-editing operation, as well as the insertion position of the collaborative content data in the shared document. The insertion position here includes the starting position of the collaborative content data in the shared document. For example, the shared document includes the text content "test text". The pre-editing operation first locates the starting position of the edit, and then, after the second character, the annotation character "pinyin" is typed using a Pinyin input method. Here, the pre-editing operation is denoted as ex, and the specific operation expression can be written as ex = insert:{index:2,text:'pinyin'}, indicating that "pinyin" is inserted at position 2. As can be seen from the operation expression, the pre-editing instruction information includes the insertion position 2 and the collaborative content data "pinyin".

[0083] It should be noted that the pre-editing operations on the collaborative content may be continuous before the first collaborative data is acquired. The terminal device can respond to the continuous pre-editing operations and continuously update the collaborative content data.

[0084] S302, before obtaining the first collaborative data corresponding to the content data to be collaborated on, if a shared editing instruction information for a shared document is received, the pre-editing instruction information and the shared editing instruction information are processed according to the position processing rules to obtain the updated position of the content data to be collaborated on. Furthermore, the converted shared editing instruction information can be correctly submitted or applied. The first collaborative data refers to converting the currently most recently recorded content data to be collaborated on into the actual data that needs to be collaborated on. The shared editing instruction information for a shared document can be generated by a local editing operation or by a collaborative editing operation generated by other devices. Both local editing operations and collaborative editing operations will cause the content data to be collaborated on to shift in the position of the shared document; the updated position is the latest position after the shift.

[0085] Shared editing instructions are information that instructs collaborative editing of data generated by shared editing operations within a shared document. Shared editing operations include at least one of the following: local editing operations and collaborative editing operations. Specifically, the collaborative editing operation is an editing operation on the shared document generated by another user's client, and this collaborative editing operation corresponds to the server-side shared editing instructions. The shared editing instructions may include second collaborative data and the editing location of the second collaborative data. For example, if another user is collaboratively editing a shared document and inserts the number 123 at editing position 2, the collaborative editing operation can be expressed as: share1 = insert:{index:2,text:'123'}. This means the corresponding shared editing instruction information includes the number 123 (i.e., the second collaborative data) and the insertion position 2 (i.e., the editing position of the second collaborative data). As another example, if a local user is collaborating on a shared document and deletes the text "pinyin" at editing positions 2 to 3, the local editing operation can be expressed as: share2 = delete:{index:2,end:3}. This also means the corresponding shared editing instruction information includes the text "pinyin" (i.e., the second collaborative data) and the editing positions 2 to 3 (i.e., the editing positions of the second collaborative data).

[0086] The second collaborative data is collaborative data generated in a shared document through collaborative editing or local editing operations. In some embodiments, when the data to be collaborated with corresponding to the first collaborative data exists in the shared document, the editing positions of the generated second collaborative data and the first collaborative data affect each other. For example, the text content of the shared document is "test text", and the data to be collaborated with, "pinyin", is inserted at editing position 3 in the shared document. The subsequently obtained first collaborative data is the corresponding text "pinyin", which is also inserted at editing position 3. Using the shared editing instruction information generated by the collaborative editing operations of other users in the above example, including the numbers 123 and their editing position 2, if the editing position of the data to be collaborated with remains unchanged, the position of the second collaborative data also remains unchanged. Since the editing positions of other users are before the pre-edited positions of the local users, their respective editing positions are affected, and the final edited content may be "test1pinyin23text", which does not meet the user's editing expectations. This problem can be solved by subsequently performing operation conversion processing on the pre-editing instruction information where the first collaborative data is located and the shared editing instruction information where the second collaborative data is located.

[0087] In one embodiment, if the shared editing instruction information is local shared instruction information, the above-mentioned conversion process, in addition to obtaining the update position of the content data to be collaborated on, can also obtain the converted shared editing instruction information. The converted shared editing instruction information includes the update position of the second collaborative data (i.e., the latest editing position of the updated second collaborative data on the shared document). This update position may or may not be consistent with the editing position of the second collaborative data included in the shared editing instruction information before conversion. OT conversion can be performed in real time on the new pre-editing instruction information and the new shared editing instruction information to determine the two latest update positions. After the first collaborative data is finally determined, the latest update positions of the first collaborative data and the latest update positions of the second collaborative data are submitted respectively, facilitating collaborative processing of the shared document by all sharing users on the server. For the relevant conversion operations regarding the shared editing instruction information being local shared instruction information, please refer to the description in subsequent embodiments.

[0088] Since the collaborative content data is not submitted to the server and shared with other users, the operations performed by other users in the collaborative document will not affect the local user's editing of the collaborative content data. However, for collaborative data from other users or locally generated collaborative data, the coexistence of collaborative content data and collaborative data in the shared document on the local terminal device is mutually influential. This is particularly evident in the impact of data insertion into or deletion from the shared document, which will cause positional offsets of the collaborative data and collaborative data within the local shared document. In this case, operation transformation processing can be performed according to position processing rules (i.e., executing S302) to ensure that the position of each data item in the shared document is the position expected by the user. In one embodiment, the position processing rules can correspond to the aforementioned OT transformation.

[0089] Before acquiring the first collaborative data corresponding to the content to be collaborated on, the received shared editing instruction information can be generated by the shared editing operation. This shared editing instruction information includes the second collaborative data and its editing position within the shared document. This editing position of the second collaborative data within the shared document is the starting position for editing the second collaborative data. The second collaborative data is collaborative data without any content to be collaborated on beforehand, and this second collaborative data can be directly synchronized to other terminal devices via the server. For an example of a typical input process, please refer to [link to example]. Figure 4 This is a schematic diagram of a common input editing process provided in an embodiment of this application. The process consists of obtaining content, inputting content, and clearing the input box. Specifically, the terminal device responds to the keyboard key event (oninput), obtains the character content corresponding to the key (such as abc), and then inserts it into the Model. This process does not involve transitioning from the content data to the collaborative data.

[0090] A shared editing operation refers to an editing operation that directly generates collaborative data within a shared document. This operation can involve directly inputting corresponding character content, such as directly inputting "123." Through this shared editing operation, collaborative data can be obtained directly without the need for transitioning to collaborative content data. In one embodiment, a shared editing operation may include one or both of local shared editing operations (i.e., local editing operations) and collaborative editing operations. Local shared editing operations refer to those generated on a local terminal device, which is on the same device as the pre-editing operation; collaborative editing operations refer to those generated on other terminal devices. If the shared editing instruction information is generated by a collaborative editing operation, the received information is the shared editing instruction information sent by the server (e.g., server 202); if the shared editing instruction information is generated by a local shared editing operation, it can be directly obtained from the local device.

[0091] When shared editing instructions are generated by collaborative editing operations, since the received shared editing instructions and pre-editing instructions are edited in the same document state (i.e., the same version of the shared document), a positional offset will occur on the local end. For example, if the data to be collaboratively edited is inserted after the second character in the shared document, and the second collaborative data was originally inserted after the zeroth character, after the second collaborative data is collaboratively edited on the local end, inserting the data to be collaboratively edited in its original position will not match the user's expected editing position. When shared editing instructions are generated by local shared editing operations, since the pre-editing operations that generate the pre-editing instructions are adjacent operations and sequential, there is no conflict. The operation conversion process here is to reverse the order of the operations, so that the shared editing instructions can be submitted to the server first.

[0092] In both cases described above, the pre-editing instruction information and the shared editing instruction information can be converted according to the location processing rules. This involves adjusting the insertion position of the content data to be collaborated on within the shared document, as included in the pre-editing instruction information, to obtain the updated position of the content data to be collaborated on. However, the specific conversion process differs for shared editing instruction information from different terminal devices; please refer to [link to relevant documentation] for details. Figure 5 The corresponding embodiments describe the conversion process when a shared editing operation generates shared editing instruction information on the local end, and the conversion process when a collaborative operation generates shared editing instruction information.

[0093] The updated position is the latest insertion position in the shared document. It may be the same as the original insertion position or different because other collaborative data may have been inserted into the shared document, or the content data to be collaborated on may have changed, resulting in a change in length. When other collaborative data is inserted into the shared document, the insertion position of the content data to be collaborated on may shift, and the corresponding updated position will be the insertion position after the shift in the content data to be collaborated on. It should be noted that, for the case where the shared editing instruction information is the local shared instruction information, the operation conversion process can obtain not only the updated position of the content data to be collaborated on but also the converted shared editing instruction information. The converted shared editing instruction information includes the updated position of the second collaborative data (i.e., the updated editing position). This updated position may or may not be consistent with the editing position of the second collaborative data in the shared editing instruction information before conversion.

[0094] The above method maintains the latest position of the content to be collaborated on within the shared document, ensuring that the content is accurately presented to the user. For specific implementation details, please refer to the following... Figure 8The corresponding embodiments will not be detailed here. In one embodiment, the location processing rule can adopt the OT algorithm. It should be noted that, for this end, whether it is pre-editing instruction information or shared editing instruction information, it is first applied to the shared document. After operation conversion, it can be ensured that the editing of the shared document meets the user's expectations.

[0095] In one embodiment, the terminal device may further: generate a collaborative identifier for the collaborative content data generated by the pre-editing operation; construct a mapping relationship between the editing position information of the collaborative content data and the collaborative identifier; wherein, the editing position information includes any one of the following: insertion position and update position. Whether it is the insertion position before the OT conversion as described in this application or the update position after the OT conversion, it can be considered as the maintained insertion position of the current collaborative content data. For example, if a video segment (collaborative content data) is inserted after the 5th character in the text content of a shared document, then the editing position information indicates the position after the 5th character. If the insertion position needs to be updated due to the existence of shared editing instruction information, the editing position information will also be updated to the update position, and the insertion position will be replaced.

[0096] The identifier for collaboration can uniquely mark the collaborative content data generated by the pre-editing operation. This identifier is held by business logic, such as Pinyin input method logic or image upload logic. Through this identifier, the collaborative content data that the business party is interested in can be quickly found. Specifically, by marking the collaborative content data with a collaborative tag and constructing a mapping relationship between the editing position information of the collaborative content data and the collaborative identifier, the latest position recorded in the maintained editing position information of the collaborative content data can be quickly found based on the collaborative identifier, making the collaborative content data easy to capture and maintain. In one embodiment, a mapping table can be constructed to record the mapping relationship between the pre-editing instruction information corresponding to multiple pre-editing operations and the collaborative identifier. When a shared editing instruction information is received, the insertion position included in the pre-editing instruction information in the mapping table can be updated to obtain the updated position, thereby accurately and efficiently maintaining the latest state of multiple collaborative content data.

[0097] S303, if it is determined that the first collaborative data corresponding to the content data to be collaboratively obtained has been obtained, then collaborative instruction information is generated.

[0098] The collaborative indication information includes: first collaborative data and the collaborative position of the first collaborative data obtained based on the update position. The first collaborative data is the data generated after the collaborative content data is completed for editing, that is, the collaborative data generated through the transition of the collaborative content data. For example, the Chinese character "pinyin" corresponding to the collaborative content data "pinyin" is the first collaborative data. The collaborative position refers to the update position recorded when the first collaborative data is determined, that is, the insertion position of the first collaborative data in the shared document. When it is determined that the first collaborative data corresponding to the collaborative content data is obtained, it indicates that the pre-editing operation in the shared document is completed, that is, the editing of the collaborative content data is completed. After that, the collaborative content data at the corresponding position can be replaced with the first collaborative data, the first collaborative data is displayed on the local side, and the generated collaborative indication information is submitted to the server for collaboration with other terminal devices to ensure the consistency of the shared document in each terminal device.

[0099] The solution provided in this application records the collaborative content data and its insertion position in the shared document through the pre-editing indication information. When receiving the shared editing indication information for the shared document, an operation conversion process is performed on the pre-editing indication information and the shared editing indication information to obtain the update position, so as to maintain the latest insertion position of the collaborative content data recorded in the pre-editing indication information in the shared document, and further ensure the accuracy of the collaborative position of the first collaborative data included in the generated collaborative indication information. In addition, the collaborative content data concerned by the business party can be quickly found through the collaborative identifier, and according to the mapping relationship between the collaborative identifier and the editing position information, the editing position information of the collaborative content data in the shared document is further maintained to ensure the accurate editing of the collaborative data. The collaborative identifier can be held by the business logic (business party). For example, for the pinyin input method logic, when there is an editing requirement to delete some or all of the data in the collaborative content data, the collaborative content data can be found according to the collaborative identifier, and the corresponding part or all of the collaborative content data can be deleted.

[0100] Please refer to Figure 5 , Figure 5 is a schematic flowchart of another method for processing data of a shared document provided by an exemplary embodiment of this application. Specifically, it can be executed by a computer device (such as a terminal device, which can be the first terminal device 200a in the data processing system shown in Figure 2 ), and this method includes but is not limited to the following steps.

[0101] S501, in response to a pre-editing operation on a shared document, obtain pre-editing indication information corresponding to the pre-editing operation.

[0102] S502: After obtaining the pre-editing instruction information, and before obtaining the first collaborative data corresponding to the content data to be collaborated on, it checks whether a shared editing instruction information for the shared document has been received. If so, the pre-editing instruction information and the shared editing instruction information are processed according to the position processing rules to obtain the update position of the content data to be collaborated on (i.e., execute S503 and / or S504 below). If not, the latest content data to be collaborated on continues to be obtained, and the starting position remains the original insertion position. The steps for determining the update position are described in S503 and S504 below.

[0103] S503, if the shared editing instruction information is the local shared instruction information, then the operation is converted according to the pre-editing instruction information, the shared editing instruction information, the pending collaboration cancellation instruction information, and the addition instruction information to obtain the update position of the content data to be collaborated on.

[0104] This method corresponds to editing the shared document on the local end. Specifically, the local shared editing operation generates shared editing instruction information. By coordinating the processing of various different instruction information, the position of the content to be collaborated on within the shared document is updated, and the collaborative data generated by the local shared editing operation is submitted with priority. For a more detailed processing flow, please refer to [link to relevant documentation]. Figure 8 The description of the corresponding embodiments will not be detailed here.

[0105] S504, if the shared editing instruction information is server-side shared instruction information, then the shared editing instruction information is processed by operation conversion based on the pre-editing instruction information to obtain the converted shared editing instruction information, and the pre-editing instruction information is processed by operation conversion based on the shared editing instruction information to obtain the converted pre-editing instruction information, wherein the converted pre-editing instruction information includes the update position of the content data to be coordinated.

[0106] The server-side shared instruction information here refers to the shared editing instruction information generated by collaborative editing operations. Collaborative editing operations are editing operations performed by other terminals in a shared document, and the resulting shared editing instruction information is synchronized to this terminal via the server. Similar to local shared editing operations, the shared editing instruction information generated by collaborative editing operations can also be converted to and from pre-editing instruction information to obtain the update position of the content data to be collaborated on, and thus obtain the converted shared editing instruction information. The converted shared editing instruction information includes the position of the collaborative data (corresponding to the second collaborative data) from other user terminals in the shared document displayed on this terminal. In this way, the data collaboratively transferred from other user terminals can be correctly displayed to the user in the shared document displayed on this terminal. The specific processing method can be referred to in the following combination. Figure 9b The details of its introduction will not be elaborated here.

[0107] It should be noted that, regardless of whether the method of S503 or S504 updates the location of the collaborative content data in the shared document, it is necessary to determine whether the first collaborative data corresponding to the collaborative content data has been obtained. After confirming that the first collaborative data has been obtained, the following steps S505 and S506 are executed.

[0108] S505, if it is determined that the first collaborative data corresponding to the content data to be collaboratively obtained is obtained, then the update position of the content data to be collaboratively obtained is determined as the collaborative position of the first collaborative data.

[0109] The update position here is the latest update position. Before determining the update position of the content data to be collaborated on, the terminal device may continue to receive new shared editing instruction information, and then repeat steps S503 or S504 until an insertion confirmation event is detected, confirming that the first collaborative data has been obtained and using the latest update position as the collaborative position of the first collaborative data.

[0110] In one embodiment, the specific implementation steps for the terminal device to determine the first collaborative data corresponding to the content data to be collaboratively acquired are as follows (1) to (3):

[0111] (1) The terminal device detects whether there is an insertion confirmation event for inserting collaborative content data into the shared document; among which, the insertion confirmation event includes any one or more of the following: text input confirmation event, multimedia data upload confirmation event, voice conversion completion event, and image editing completion event. Text input confirmation event includes input method input confirmation event, for example, when using a Pinyin input method to input Pinyin, if the user completes text input by pressing the "space key," the detected "space key" being pressed is considered a text input confirmation event; multimedia data upload confirmation event, for example, if all data such as images, videos, and audio are uploaded, then a multimedia data upload confirmation event is confirmed; voice conversion completion event specifically refers to the voice-to-text conversion completion event, for example, if a 10-second audio clip is completely converted into text; image editing completion event refers to the event when image editing in the shared document is completed, for example, if a "space key" is detected when adding Chinese characters to an image.

[0112] Detecting whether the editing of the collaborative content data has ended is a necessary step for the terminal device to proceed to the next operation, marked by the occurrence of an insertion confirmation event. The collaborative content data here refers to the data included in the latest pre-editing instruction information. For example, the latest pre-editing instruction information could mean that the included position is the latest updated position, and the included collaborative content data is the latest edited data.

[0113] In one feasible implementation, the terminal device may: update the pre-editing instruction information to obtain updated pre-editing instruction information; wherein, the updated pre-editing instruction information includes: pre-editing instruction information obtained by replacing the insertion position with the updated position in response to a detected editing operation, wherein the editing operation is other local editing operation or other collaborative editing operation detected before obtaining the first collaborative data corresponding to the content data to be collaborated on, wherein the local editing operation or other collaborative editing operation causes the content data to be collaborated on in the pre-editing instruction information to have a positional offset on the shared document, and the local editing operation or other collaborative editing operation can generate shared editing instruction information for the shared document; and / or, pre-editing instruction information obtained after editing and updating the content data to be collaborated on in response to a detected editing operation. In other words, updating the pre-editing instruction information includes updating the insertion position of the collaborative content data in the shared document and updating the editing of the collaborative content data. The updated pre-editing instruction information can be obtained by offsetting the collaborative content data in the pre-editing instruction information in response to other detected local or collaborative editing operations. For updating the insertion position, an operation conversion process can be performed based on the existence of the shared editing instruction information to update the insertion position of the pre-editing instruction information. Specifically, this can be done by replacing the insertion position in the pre-editing instruction information with the updated position, or by continuing to update the currently recorded updated position to obtain a new updated position. Regardless of the method, the obtained updated position is the latest updated position, and the new updated position can be obtained by offsetting the latest editing position of the collaborative content data in the shared document. Because the terminal device may continue to receive new shared editing instructions before determining the update location of the content data to be collaborated on, it will repeatedly execute steps S503 or S504 until an insertion confirmation event is detected. For the update of the content data to be collaborated on, the terminal device can continuously receive the content input by the user. For example, the input of the Chinese character "pinyin" in the Pinyin input method is continuously updated in response to the continuous input of a single character on the keyboard.

[0114] The above-listed insertion confirmation events are matched with different types of collaborative content data. For example, if the collaborative content data is input pinyin annotation characters, then when the user selects a candidate word, it corresponds to "editing complete," meaning the terminal device can detect a text input confirmation event. A multimedia data upload confirmation event indicates that multimedia data such as images, videos, and audio has been uploaded, meaning the multimedia data loading is finished, and the collaborative content data corresponds to the image being loaded. A speech conversion completion event indicates that speech has been completely converted to text, and the collaborative content data corresponds to the intermediate text being converted. During the conversion process, the user can see changes in the text, such as characters gradually increasing or deleting a character to correct the parsed text. An image editing completion event indicates that image editing in a shared document is complete, and the collaborative content data can be shapes or characters being overlaid on the image, such as drawing or inputting text on the image. When the terminal device detects the presence of any one or more of the above events, it can execute step (2) below; otherwise, it executes step (3) below.

[0115] (2) If so, the collaborative data generated based on the content data to be collaborated on will be used as the first collaborative data, and the update position recorded in the content data to be collaborated on at the current moment will be used as the collaborative position of the first collaborative data. That is, if the terminal device detects an insertion confirmation event for the content data to be collaborated on into the shared document, it can obtain the collaborative data generated from the content data to be collaborated on. This collaborative data can be the content data to be collaborated on itself, such as an uploaded image, or data obtained after editing operations, such as candidate words corresponding to pinyin annotations in a pinyin input method. Then, the collaborative data can be used as the first collaborative data, and the update position recorded in the content data to be collaborated on at the current moment will be used as the collaborative position of the first collaborative data. The update position recorded at the current moment can be the latest update position determined based on the identifier to be collaborated on, and the latest update position is used to obtain the collaborative position of the first collaborative data.

[0116] (3) If not, continue with step (1). The terminal device can detect the insertion confirmation event for inserting collaborative content data into the shared document in real time or at regular intervals. Therefore, the absence of detection within a certain period or at a fixed time does not mean that the insertion confirmation event will not occur in the future. Thus, step (1) can continue until the insertion confirmation event is detected.

[0117] S506, delete the content data to be coordinated, and generate coordination indication information including the first coordination data corresponding to the content data to be coordinated and the coordination position of the first coordination data.

[0118] In one embodiment, the content data to be collaborated on is data awaiting deletion. All content data to be collaborated on has placeholders in the Model. For example, letters from a Pinyin input method or a special character from an uploaded image can be used as placeholders. After the corresponding first collaborative data is finally determined, these placeholders are deleted according to the collaboration criteria. After the terminal device deletes the content data to be collaborated on, related information, including the editing position information (insertion or update position) of the content data to be collaborated on in the shared document recorded in the pre-editing instruction information, and the collaboration identifier, can be deleted as needed. That is, once the first collaboration data obtained from the content data to be collaborated on can be collaboratively distributed, all related information about the content data to be collaborated on before the first collaborative data is generated can be deleted. After deleting the content data to be collaborated on at the corresponding update position in the shared document, the first collaborative data can be inserted into the corresponding collaboration position (i.e., the update position of the content data to be collaborated on) in the shared document according to the generated collaboration instruction information. In other words, the content data to be collaborated on is replaced with the first collaborative data, so that the terminal device can collaborate with other users.

[0119] In one implementation, the specific implementation of deleting the content data to be collaborated on may be: a) obtaining the editing position information corresponding to the collaboration identifier based on the collaboration identifier generated for the content data to be collaborated on during the pre-editing operation; b) deleting the content data to be collaborated on based on the position in the shared document indicated by the editing position information.

[0120] The edit position information indicates the location of the content data to be collaborated on within the shared document. This information can include either an insertion position or an update position. The insertion or update position is the maintained insertion position of the data to be collaborated on within the shared document, while the update position can be the latest insertion position, which can be found later based on the collaboration identifier. In one embodiment, the edit position information corresponding to the collaboration identifier can be obtained based on the mapping relationship between the collaboration identifier and the edit position information, or the pre-editing instruction information corresponding to the collaboration identifier can be found based on the mapping relationship between the collaboration identifier and the pre-editing instruction information, thus obtaining the included edit position information. This edit position information represents the insertion or update position of the content data to be collaborated on within the shared document. Then, starting from the insertion or update position, the deletion range of the content data to be collaborated on is determined based on the character length occupied by the content data in the shared document. The content data to be collaborated on within this deletion range is then deleted from the shared document, and the generated collaborative data is inserted into the corresponding collaborative position. In other words, based on the mapping relationship between the identifier to be collaborated and the pre-editing instruction information, after determining the pre-editing instruction information corresponding to the identifier to be collaborated, the position interval is calculated starting from the pre-editing instruction information to obtain the deletion interval and complete the deletion of the current content data to be collaborated on in the shared document.

[0121] The solution provided in this application can quickly locate the editing position information of the content data to be collaborated on by generating a collaboration identifier for the content data to be collaborated on, thereby accurately and quickly deleting the content data to be collaborated on and inserting the first collaborative data into the corresponding editing position. After detecting the insertion confirmation event of the content data to be collaborated on, the first collaborative data and the corresponding collaboration position can be accurately determined, thereby generating collaboration instruction information, ensuring the accuracy of collaborative editing, that new edited content can be correctly submitted or applied, and that the insertion position of the content data to be collaborated on within the Model can be updated in a timely manner.

[0122] based on Figure 3 and Figure 5 The following description, taking the input method candidate state as an example, is adapted to illustrate the content described in the corresponding embodiments. Please refer to [link / reference]. Figure 6 This is a schematic diagram of the editing process of an input method candidate state provided in an embodiment of this application.

[0123] S60, Assign a Collaboration Identifier. This involves assigning an ID to the content data to be collaborated with. This step is executed when the terminal device detects a Pinyin input start event (onCompositionStart). The collaboration identifier is used to mark the content data to be collaborated with. Simultaneously with generating the collaboration identifier, the insertion position of the currently edited content data to be collaborated with can be recorded. This insertion position and the content data to be collaborated with are recorded through pre-editing instructions, allowing for subsequent maintenance of changes in the insertion position.

[0124] S61, Update Intermediate State. The intermediate state is the content data to be coordinated. The intermediate state can also be called non-coordinated data or temporary non-coordinated data. The "temporary" in temporary non-coordinated data means that it is temporarily displayed on the interface relative to the coordinated data and will eventually be replaced by the corresponding coordinated data. For example, the pinyin letters displayed in the pinyin input method will eventually be replaced by Chinese characters.

[0125] If the terminal device detects a Pinyin input update event (onCompositionUpdate), it can insert the content data to be coordinated (here, the input non-coordinated character, such as "pinyin") into the Model and reflect it on the UI, officially entering the input method candidate state. Subsequently, the Pinyin input update event can be triggered multiple times continuously with the input method input, thereby continuously updating the specific content of the content data to be coordinated. In this state, if new edited content (corresponding to the second coordinated data mentioned above) is generated in the shared document, it must be operated and transformed with the content data to be coordinated to ensure the correct submission or application of the new edited content, as well as the update of the insertion position of the content data to be coordinated in the Model, which corresponds to the content of steps S503 or S504 mentioned above.

[0126] S62, sequentially clear the pending collaboration identifier, clear intermediate states, and input candidate words. When the terminal device detects the Pinyin input end event (onCompositionEnd), the user has selected a candidate word and completed editing. The latest update position of the pending collaboration content data can be found through the pending collaboration identifier generated in the Pinyin input start event. At the same time, all data related to the pending collaboration content data, including the pending collaboration identifier, the pending collaboration content data itself, the record insertion position, and the update position, are cleared. Then, the selected candidate word (collaboration data) is inserted into the latest update position and collaboratively submitted to the server, which then synchronizes it with other terminal devices. From the user interface perspective, this means that the pending collaboration content data is directly replaced with the candidate word.

[0127] It should be noted that the above steps also apply to other types of content data to be collaborated on, such as multimedia data that is being uploaded and has been partially uploaded, intermediate text corresponding to speech that needs to be parsed into text (intermediate text includes characters that have been successfully parsed), the edited part of an image that needs to be edited, the drawn part of a graphic that needs to be drawn, and so on.

[0128] To better illustrate the effects of this solution, the following section discusses the intermediate state issue in collaborative editing. Please refer to [link / reference]. Figure 7 This is an exemplary diagram illustrating the editing effect of an intermediate state problem in collaborative editing, provided by an embodiment of this application. Taking the input method candidate state as an example, since collaborative editing does not distinguish between collaborative data and data to be collaboratively edited (a type of temporarily non-collaborative data) as in this solution, all data, once generated, is collaboratively distributed, including all input from the input method. This can cause other users to interfere with the local user's input process. For example... Figure 7 As shown, taking the candidate states of the Pinyin input method as an example, Figure 7 In the example ①, user A inputs "pin yin shu ru fa" using the Pinyin input method and shares it with other users. These other users can directly see the incomplete Pinyin on their computer devices (e.g., terminal devices). For example, user B, after seeing it, inserts the characters "TC" in the middle of the Pinyin (e.g., ...). Figure 7 In step ②), user A's input is interfered with. When user A inserts the selected candidate word, such as "pinyin input method," the result is as follows: Figure 7 The output shown in ③ indicates that when user A's computer device (e.g., a terminal device) inserted the selected candidate word, it first deleted the pinyin letters but mistakenly deleted "TC," while the two pinyin letters "pi" were incorrectly retained. Furthermore, if an uploaded image is shared, other users will only see an invalid image; if the intermediate text corresponding to the speech that needs to be parsed into text, including the successfully parsed characters, is shared, it will also encounter input method problems. Moreover, the process of parsing speech into text involves a significant number of character additions and deletions; sharing all of this adds a lot of meaningless network transmission.

[0129] To address this, the shared document includes collaborative data and content data to be collaborated on. Since the content data to be collaborated on is not actually collaborated on, but rather its corresponding first collaborative data is, meaningless collaboration and user editing interference are avoided, ensuring a smooth editing experience. This application proposes a novel solution that can receive collaborative data edited by other users while the content data to be collaborated on exists, and can also quickly adjust the insertion position of the content data to be collaborated on, thereby obtaining the accurate collaborative position of the first collaborative data. This effectively solves the intermediate state problem in collaborative editing, further ensuring error-free execution and meeting user editing expectations.

[0130] Please see Figure 8 This is a schematic diagram illustrating a process according to location processing rules, provided in an exemplary embodiment of this application. Specifically, it can be executed by a computer device (e.g., a terminal device, which can be such as...). Figure 2 The first terminal device 200a) in the data processing system shown is a further description of the specific implementation of step S302 in the above embodiment. It should be noted that the prerequisite for performing the following steps is that the shared editing instruction information is local shared instruction information. Local shared instruction information is generated by local shared editing operations. Here, local shared editing operation refers to a local editing operation that occurs after the user has initiated a pre-editing operation and generated corresponding collaborative content data on their local end. Since the data information generated by the local shared editing operation is based on the state of the shared document after the pre-editing instruction information corresponding to the pre-editing operation is applied, it cannot be submitted before the pre-editing operation. Instead, it is converted to allow for priority submission. Simultaneously, the updated position of the collaborative content data in the shared document must be maintained. Specifically, the following steps can be used to achieve this.

[0131] S801, Generate the collaborative cancellation instruction information corresponding to the collaborative cancellation operation on the collaborative content data in the pre-edited instruction information.

[0132] The "Cancel Collaboration" operation allows for one-click cancellation of the latest collaborative content data. This collaborative content data refers to the most recent data, such as the latest data generated after additions or deletions. For example, if the collaborative content data at time t1 is "pin yin" and at time t2 it is "pinyi" or possibly "pinyinshuru", then when a shared editing instruction is received at time t2, the corresponding collaborative content data is the latest. The cancellation instruction information includes the editing position information of the collaborative content data within the shared document. In one embodiment, the editing position information indicates the number of characters occupied by the collaborative content data in the shared document. The operation expression for the cancellation collaboration operation can be: un(ex) = delete:{index: x, end: y}, which means deleting all characters within the position range x to y. The editing position information included in the corresponding cancellation instruction information is also reflected through this operation expression.

[0133] For example, suppose the initial text of a local shared document is "test text", the pre-edit operation is the `ex` operation, and `ex = insert:{index:2,text:'pi'}`. After executing the `ex` operation, the local text becomes "test pi text". This means the pre-edit instruction information records the collaborative content data as "pi" with an insertion position of 2, indicating that "pi" will be inserted after the second character of the initial text. Therefore, the undo operation corresponding to `ex`, i.e., the collaborative undo operation `un(ex) = delete:{index:2,end:4}`, records the editing position information of the collaborative content data as the second to fourth characters. It is evident that the undo operation `un(ex)` of `ex` can cancel out the data generated by the two operations.

[0134] S802, perform operation conversion processing on the collaborative cancellation instruction information and the local shared instruction information to obtain the converted local shared instruction information.

[0135] Here, the local shared editing operation corresponding to the local shared instruction information is denoted as cs, the pre-editing operation is denoted as ex, and the pending collaborative undo operation is denoted as un(ex). The pending collaborative undo operation un(ex) and the local shared editing operation cs are operations generated based on the same document state. The position processing rule is assumed to be the processing logic of the OT algorithm. Therefore, un(ex) can be used to perform operation transformation on cs. The operation transformation is actually the transformation of the local shared instruction information using the pending collaborative undo instruction information. Finally, the transformed local shared instruction information can be obtained. The expression for operation transformation is as follows: cs'=T(cs,un(ex)).

[0136] The local sharing instruction information includes: local shared content data generated by local sharing editing operations, and the initial position of the local shared content data in the shared document. The converted local sharing instruction information includes: local shared content data generated by local sharing editing operations, and the converted local shared content data's shared position in the shared document. The local shared content data included in both the local sharing instruction information and the converted local sharing instruction information are the same; the difference may be the position in the shared document, i.e., the shared position obtained after the conversion of the local shared content in the shared document. This position may be the same as or different from the initial position, but even if it doesn't change, such a conversion is necessary. In this embodiment, by using a virtual cancellation operation and a re-addition operation of the content data to be collaborated with, the content data to be collaborated with is adjusted to be after the local shared editing operation corresponding to the local shared instruction information. This ensures that the local shared content data corresponding to the local shared editing operation is collaborated with the server before the first collaborative data corresponding to the content data to be collaborated with. Since the initial position of the local shared content data in the shared document is obtained when the content data to be collaborated with needs to be inserted during the local editing process, the initial position cannot actually be used as the final update position. This is because if the user decides not to input the content data to be collaborated with, and the local shared content data is collaborated with based on the initial position, the collaborative shared document will have errors, and the local shared content data will not be edited in the position the user wants, such as insertion or deletion. Therefore, the above conversion is required to obtain the shared position of the local shared content data in the shared document. Here, the local shared content data is also the aforementioned second collaborative data, and the initial position or shared position is the editing position of the second collaborative data.

[0137] In one embodiment, after obtaining the converted local sharing instruction information, the converted local sharing instruction information can also be output. Since the pending undo operation and the pre-edit operation can cancel each other out—specifically, the data they generate can cancel each other out—after performing undo processing on the pending content data in the shared document according to the pending undo operation, the document state of the shared document returns to its initial state without pending content data. Thus, the converted local sharing instruction information corresponding to the local sharing edit operation can be directly submitted to the server, i.e., submitted to the server before the pending content data generates collaborative data.

[0138] It should be noted that the "undo collaborative" operation does not actually undo the collaborative content data in the Model. Instead, it transforms the shared edit operation into the "undo collaborative" operation. During this process, the Model and View remain unchanged.

[0139] Following the example in step S801, assuming cs = insert:{index:6,text:'123'}, cs is executed after ex, and the local text becomes: "test pi text 123". un(ex) and cs undergo conflict resolution OT transformation, resulting in cs' = insert:{index:4,text:'123'}. cs' is the result that cs should be transformed into if un(ex) is executed first. At this point, cs' is the operation that can bypass ex and submit first, because the text on the server side is still the four characters "test document", and the three characters "123" should indeed be inserted at position 4.

[0140] S803, determine the addition instruction information corresponding to the addition operation of adding content data to be collaborated again after the collaboration cancellation operation is performed.

[0141] Since the shared document is in its initial state after the collaborative cancellation operation, the addition instruction information corresponding to the addition operation of adding content data to be collaborative is the same as the pre-editing instruction information. Here, the addition operation is denoted as ex, which is the same as the pre-editing operation that generates the content data to be collaborative, for example, ex = insert:{index:2,text:'pi'}. At this time, the local shared instruction information and the addition instruction information after conversion are both generated based on the same document state, so the next conversion can be carried out, that is, step S804 can be executed.

[0142] S804 performs operation and conversion processing on the added instruction information and the converted local shared instruction information to obtain the update position of the content data to be coordinated.

[0143] The processing logic is the same as in step S802. The expression for the operation conversion between adding instruction information and the converted local shared instruction information can be: ex' = T(ex, cs'), where ex' becomes the subsequent operation of cs', representing the latest change in the current shared document, that is, the latest state of the content data to be collaborated on, specifically the latest insertion position of the content data to be collaborated on, i.e., the update position. In this state, the converted add instruction information can continue to be converted with the instruction information corresponding to subsequent editing operations.

[0144] Following the example above, the transformed addition instruction information can be represented as: ex' = insert:{index:2,text:'pi'}. It can be observed that although ex and cs' have undergone transformation, ex' itself remains unchanged because cs' is inserted later and doesn't offset the previous insertion positions. However, if cs''s insertion position is 0, the transformed cs' will also remain unchanged, while ex' will change (i.e., its insertion position will shift). Therefore, even though it doesn't change, this transformation process is necessary. In this case, it's equivalent to ex' being executed after cs', first inserting "123" at position 4, then inserting "pi" at position 2. The resulting local text is still "test pi text 123". The transformed ex' represents the latest state of the content data to be collaborated on, i.e., the latest insertion position is position 2. It can be seen that the converted addition instruction information can be the pre-edit instruction information obtained after offsetting the collaborative content data in the pre-edit instruction information in response to the detected local shared editing operation, and whether the insertion position of the collaborative content data in the shared document is offset depends on whether the insertion position of other collaborative data is before or after the editing position of the collaborative content data.

[0145] In one possible embodiment, before outputting the converted local sharing indication information, the following processing steps may also be included:

[0146] ①If a local sharing cancellation operation is detected on local shared content data included in the local sharing indication information, local sharing cancellation indication information is generated.

[0147] Local sharing editing operations can be undone, specifically the undone local sharing content data in the local sharing instruction information generated by the local sharing editing operation. If the terminal device detects the corresponding local sharing undone operation (denoted as un(cs)), it can generate local sharing undone instruction information. This local sharing undone instruction information can include the editing position information of the local sharing content data in the shared document. The editing position information can be used to indicate the position of the local sharing content in the shared document that needs to be processed. Then, steps ② and ③ are executed sequentially to obtain the corresponding instruction information through operation conversion.

[0148] ② Perform operation conversion processing on the collaborative cancellation instruction information and the local shared instruction information to obtain the converted collaborative cancellation instruction information.

[0149] The system performs an operation transformation on the collaborative cancellation instruction information shared locally to obtain the transformed collaborative cancellation instruction information. The specific expression for the operation transformation can be: un(ex)'=T(un(ex),cs). Continuing with the example above, un(ex)'=delete:{index:2,end:4}. As above, un(ex)' remains unchanged because cs is inserted later, but this operation transformation process must be performed.

[0150] It should be noted that the information to be revoked and the local shared information can be converted to each other to obtain different content. For example, the local shared information obtained in step S802 is converted in the same way. Therefore, this step is also another result obtained by performing step S802, namely, the converted information to be revoked. The above process is also the result of swapping the parameters in the function T(). For example, the information to be revoked is converted based on the local shared information to obtain the converted information to be revoked: un(ex)'=T(un(ex),cs), and the local shared information is converted based on the information to be revoked to obtain the converted local shared information: cs'=T(cs,un(ex)).

[0151] ③ Perform operation conversion processing on the local shared cancellation instruction information and the converted cancellation instruction information to be coordinated to obtain the converted local shared cancellation instruction information.

[0152] Here, the transformed collaborative cancellation instruction information (un(ex)') is used to perform operation transformation processing on the local shared cancellation instruction information corresponding to the local shared cancellation operation (un(cs)), resulting in the transformed local shared cancellation instruction information, i.e., un(cs)' = T(un(cs), un(ex)'). This transformed local shared cancellation instruction information can be considered as the instruction information generated by the cancellation operation on the transformed local shared instruction information. The resulting transformed local shared instruction information can realize the cancellation of local shared content data, i.e., the content corresponding to step ④.

[0153] ④ Store the converted local shared undo instruction information into the undo stack so that the local shared content data generated by the local shared editing operation can be undoed using the converted local shared undo instruction information.

[0154] The undo stack can store the converted local shared undo instruction information, which can then be used to undo the local shared content data generated by the local shared editing operation from the shared document when the corresponding undo operation is executed.

[0155] Based on the description of steps S801 to S804, the pre-editing operation, the local shared editing operation, and the collaborative undo editing operation can be converted into different operations. For a detailed representation of the corresponding operation conversion, please refer to [link to relevant documentation]. Figure 9a This diagram illustrates the operation transition between pre-editing and local editing operations provided in this embodiment. The editing operations performed under different document states correspond to the steps described in this embodiment.

[0156] It should be noted that the operation conversion processing between different indication information involved in the above steps S802, S804 and the more detailed description is implemented using the operation conversion logic of the position processing rules. For example, if the position processing rules adopt the OT algorithm, the corresponding operation is converted into an OT conversion.

[0157] This solution maintains the data to be collaborated on by converting it into insert operations. If there are multiple pieces of data to be collaborated on, they are converted into multiple insert operations. Then, based on positional processing rules (such as the OT algorithm), conflict handling and transformation are performed to ensure the status of the data to be collaborated on is updated, while collaborative editing can continue. Specifically, the data to be collaborated on in the shared document is maintained as operations in the OT algorithm. These operations can be transformed into OT operations with other locally generated edits and collaborative edits. This ensures that in this state, it is possible to continue receiving collaborative edits from other users, and also to generate new edits locally and submit them collaboratively first. At the same time, the latest status of non-collaborative operations is maintained for subsequent processing, continuing to maintain a lossless editing experience.

[0158] Figure 8 The corresponding embodiment describes a collaborative editing scenario where a user initiates a pre-editing operation locally and then initiates a shared editing operation on the local device. Alternatively, it could be a collaborative editing scenario where other users collaboratively edit a shared document; that is, there is no shared editing operation on the local device, and the local device only performs a pre-editing operation, which is not collaborative. For this scenario, please refer to... Figure 9b This is an exemplary schematic diagram illustrating the conversion between pre-editing and collaborative editing operations provided in this application embodiment.

[0159] In one embodiment, server-side shared instruction information refers to shared editing instruction information generated by collaborative editing operations. Collaborative editing operations are editing operations performed by other terminals in a shared document, and the generated shared editing instruction information is synchronized to the local terminal via the server. If the shared editing instruction information is server-side shared instruction information, then the corresponding instruction information is transformed according to location processing rules. Specifically, this may include the following: performing operation transformation processing on the shared editing instruction information based on the pre-editing instruction information to obtain transformed shared editing instruction information; performing operation transformation processing on the pre-editing instruction information based on the shared editing instruction information to obtain transformed pre-editing instruction information, wherein the transformed pre-editing instruction information includes the update position of the content data to be collaborated on.

[0160] When the pre-editing instruction information corresponding to the pre-editing operation (denoted as ex) exists, the terminal device receives the shared editing instruction information corresponding to the collaborative editing operation (denoted as collab) sent by the server. It needs to convert the shared editing instruction information and the pre-editing instruction information, which involves two conversion steps: collab' = T(collab, ex); ex' = T(ex, collab). The execution order of these two conversion steps is not restricted here; they can be executed simultaneously or sequentially. It can be observed that collab' becomes a subsequent operation of ex, which can be applied to the document after ex; ex' becomes a subsequent operation of collab, which can represent the latest state of the content data to be collaborated on, i.e., the updated position of the content data to be collaborated on in the shared document, thus allowing for further conversion with subsequent editing operations.

[0161] To facilitate understanding of the above operation conversion principle, the following example will be used for illustration:

[0162] Suppose another collaborating user (e.g., user S1) is editing a shared document. The initial text in user S1's shared document is also "test text". User S1 inserts "test" at position 0, resulting in the operation: `collab = insert:{index:0,text:'test'}`. Since the current user (e.g., user S2) has already executed the operation `ex` in the shared document, specifically: `ex = insert:{index:2,text:'pi'}`, `collab` needs to be converted to handle the conflict with `ex` before it can be executed in the current user's (e.g., user S2's) shared document: `collab' = insert:{index:0,text:'test'}`. It can be observed that the shared editing instruction information corresponding to the converted collaborative editing operation is not... There is a change because the insertion position of `collab` comes first, but the position of `ex` comes later. The converted pre-edit operation changes: `ex' = insert:{index:6,text:'pi'}`. The corresponding pre-edit instruction information also changes, with the insertion position shifted four characters backward. The current text becomes: "test test pi text". It's clear that the collaborative content data (non-collaborative text) "pi" is indeed inserted from position 6. Therefore, `ex'` represents the latest state of the collaborative content data. The latest pre-edit instruction information can be obtained by shifting the collaborative content data in the pre-edit instruction information in response to the detection of a collaborative editing operation. This includes the update position being the latest insertion position in the shared document after the shift of the collaborative content data.

[0163] It should be noted that in this scenario, the data to be collaborated on can also be converted into insert operations for maintenance. If there are multiple data to be collaborated on, they can be converted into multiple insert operations. Then, based on position processing rules (such as the OT algorithm), conflict handling and transformation can be performed to ensure the status update of the data to be collaborated on, while continuing collaborative editing.

[0164] By converting between shared editing instructions generated by collaborative editing operations and pre-editing instructions generated by pre-editing operations, the correct application of collaborative editing can be achieved, ensuring the user's editing experience.

[0165] Converting the shared editing instruction information corresponding to collaborative editing operations and the pre-editing instruction information corresponding to pre-editing operations is a common operation conversion idea. It can fundamentally solve the collaboration problem when there is collaborative content data. It is implemented using existing OT algorithms and has the advantages of low cost, high accuracy, comprehensive scenario coverage, non-intrusive modification, and easy maintenance. Any multi-person collaborative product that has its own designed OT algorithm for maintaining collaborative content data can adopt the solution provided in this application.

[0166] In summary, the solution provided in this application processes collaborative content data as an insertion operation within position processing rules. This insertion operation includes inserting characters and their positions, which are recorded and maintained using pre-editing instructions. Based on the concept of operation transformation, insertion operations are mutually converted to other editing operations. Stable position processing rules (such as the OT algorithm) serve as the most fundamental support for collaborative documents, and this solution can also directly utilize existing OT algorithms for operation transformation, offering advantages such as high accuracy, low cost, and greater reliability. This is because:

[0167] 1. For boundary value problems (including various scenarios, such as the editing position of collaborative data and the insertion position of the content data to be collaborated are equal), the OT algorithm has the advantages of high accuracy and full coverage of scenarios, and can cover all boundary value cases.

[0168] 2. To address the specific issues of different operations, a complete OT algorithm has the logic to convert between any two operations, which can effectively handle all specific scenarios.

[0169] 3. For situations involving multiple pieces of content to be collaborated on, these multiple pieces of content are converted into multiple insert operations, and then transformed with other editing operations. Maintaining multiple pieces of content to be collaborated on is transformed into multi-conflict handling, a common feature in OT algorithms, where multi-conflict handling is a fundamental capability of every collaborative document.

[0170] 4. Ensure transparency to the outside world and avoid injecting too much intrusive code into the processing modules. There should be standardized logic for each business of content data to be collaborated on. The processing of content data to be collaborated on can exist as an independent logic layer in the collaborative module of shared documents. When content data to be collaborated on is generated, as long as it is marked with a "non-collaboration" tag (e.g., a collaboration identifier), it will be captured and maintained by this layer. Other local or collaborative editing during the maintenance period will go through this layer and execute standard transformation logic according to the OT algorithm to finally obtain the correct processing result.

[0171] Based on the above, this application provides a data processing method for shared documents. By maintaining temporary non-collaborative editing data as an operation in the operation transformation algorithm, and transforming it with other editing operations or collaborative operations, this method not only ensures the receipt of editing content from other users' collaborative operations, but also allows newly generated editing content to be submitted collaboratively first, and maintains the latest state of non-collaborative operations, thus achieving a lossless editing experience.

[0172] In addition to maintaining the content data to be collaborated on as described in the above embodiments, the content data to be collaborated on can also be maintained as an interval in the Model, called the Exception Range (hereinafter referred to as Exception, or maintenance interval or collaboration interval, which represents the pre-editing operation that generates the content data to be collaborated on). Assuming that the value of an Exception is [2, 3), it indicates that one non-collaborative character was inserted at position 2. Its relationship with editing and collaboration satisfies the following... Figure 10 Conditions shown:

[0173] Please see Figure 10 This is a schematic diagram illustrating how to maintain data on content to be coordinated using a maintenance interval. Combined with... Figure 10 The content shown may include the following processing scenarios. It should be noted that the following editing includes shared editing in a shared document containing content data to be collaborated on, including local editing and collaborative editing.

[0174] 1. When editing locally, if the editing position is 5, after the Exception, then before submitting, you need to subtract the length of the Exception from the editing position, making it 4. This will ensure it corresponds to the correct operation position in the backend. Figure 10 As shown on the left. This is because the local editing position is 5 when the content data to be collaborated on exists (i.e., the value of the Exception above [2,3]). Since the content data to be collaborated on has not been submitted to the server, the shared document recorded by the server does not contain the content data to be collaborated on. Therefore, from the server's perspective, the editing is actually performed at the editing position 4 of the shared document. For this reason, it is necessary to subtract the character length of the content data to be collaborated on (i.e., the length of the collaborative interval) to obtain the correct editing position.

[0175] 2. During local editing, if the editing position is 1, which is before the Exception, then the editing position does not need to be modified. However, the Exception needs to be offset (backward or forward) by the corresponding number of characters due to the local editing (insertion or deletion) to dynamically determine the latest state of the Exception for subsequent processing. For example, if the local editing inserts 1 character at editing position 1, the value of the Exception [2, 3) can be adjusted to [3, 4).

[0176] 3. When receiving a collaboration, if the collaboration editing position is 5, after the Exception, then before applying the collaboration editing to the front end, the editing position needs to be increased by the length of the Exception (i.e., the length of the area to be collaborated on), making it 6. This ensures it corresponds to the correct operation position on the front end. Figure 10 As shown on the right. This is because the latest document state of the shared document recorded on the server is edited at collaborative position 5, but the local shared document has a non-collaborative character at position 2. Therefore, for the local machine, the actual collaborative editing position is position 6.

[0177] 4. When a collaboration is received, if the collaboration editing position is 1 and it is before the Exception, then the collaboration editing position does not need to be modified. However, the Exception needs to be offset by the corresponding number of characters due to the influence of the collaboration editing, just like in scenario 2.

[0178] Meeting the above four conditions also allows for the maintenance of temporary, non-collaborative data while still enabling continued editing and collaborative document sharing. However, this approach simplifies the maintenance of collaborative content data to range conversions, which may not fully cover boundary value handling scenarios and may overlook the specificity of different operations. Furthermore, external systems need to be aware of the existence of exceptions to perform mutual conversions, and developers need to write generation logic for each business logic that generates an exception; failure to meet specifications can easily lead to errors. In the case of multiple exceptions, how to convert editing operations to and from multiple exceptions is also a complex processing logic, and when editing errors occur, it may consume a significant amount of developer time for troubleshooting, analysis, and resolution.

[0179] Please see Figure 11 , Figure 11 This is a schematic diagram of the structure of a data processing apparatus for shared documents provided in an exemplary embodiment of this application. The aforementioned data processing apparatus for shared documents can be a computer program (including program code) running on a computer device; for example, the data processing apparatus for shared documents can be an application software. The data processing apparatus for shared documents can be used to execute corresponding steps in the methods provided in the embodiments of this application. Figure 11 As shown, the data processing device 1100 for shared documents may include: an acquisition module 1101 and a processing module 1102.

[0180] The acquisition module 1101 is used to acquire the pre-editing instruction information corresponding to the pre-editing operation in response to the pre-editing operation of the shared document. The pre-editing instruction information records the content data to be collaborated generated by the pre-editing operation and the insertion position of the content data to be collaborated in the shared document.

[0181] The processing module 1102 is used to, before obtaining the first collaborative data corresponding to the content data to be collaborated on, if it receives shared editing instruction information for the shared document, perform operation conversion processing on the pre-editing instruction information and the shared editing instruction information according to the position processing rules to obtain the update position of the content data to be collaborated on; if it is determined that the first collaborative data corresponding to the content data to be collaborated on has been obtained, it generates collaborative instruction information, which includes: the first collaborative data and the collaborative position of the first collaborative data obtained according to the update position; wherein, the shared editing instruction information includes the editing position of the second collaborative data and the second collaborative data in the shared document.

[0182] In one embodiment, the processing module 1102 is specifically used to: determine the update position of the content data to be coordinated as the coordination position of the first coordination data; delete the content data to be coordinated, and generate coordination indication information including the first coordination data corresponding to the content data to be coordinated and the coordination position of the first coordination data.

[0183] In one embodiment, the processing module 1102 is specifically configured to: obtain editing location information corresponding to the collaboration identifier based on the collaboration identifier generated for the collaboration content data generated for the pre-editing operation, wherein the editing location information is used to indicate the location of the collaboration content data in the shared document; and delete the collaboration content data based on the location indicated by the editing location information in the shared document.

[0184] In one embodiment, the processing module 1102 is further configured to: generate a collaborative identifier for the collaborative content data generated by the pre-editing operation; construct a mapping relationship between the editing position information of the collaborative content data and the collaborative identifier; wherein the editing position information includes any one of the following: insertion position, update position.

[0185] In one embodiment, the processing module 1102 is further configured to: detect whether there is an insertion confirmation event for inserting collaborative content data into a shared document; if so, use the collaborative data generated based on the collaborative content data as the first collaborative data, and use the current update position of the collaborative content data record as the collaborative position of the first collaborative data; wherein, the insertion confirmation event includes any one or more of the following: text input confirmation event, multimedia data upload confirmation event, speech conversion completion event, and image editing completion event.

[0186] In one embodiment, the processing module 1102 is further configured to: update the pre-editing instruction information to obtain updated pre-editing instruction information; wherein the updated pre-editing instruction information includes: pre-editing instruction information obtained by replacing the insertion position with the updated position; and / or, pre-editing instruction information obtained by editing and updating the content data to be coordinated in the pre-editing instruction information in response to the detected editing operation.

[0187] In one embodiment, if the shared editing instruction information is server-side shared instruction information, then the processing module 1102 is specifically used to: perform operation conversion processing on the shared editing instruction information based on the pre-editing instruction information to obtain converted shared editing instruction information, and perform operation conversion processing on the pre-editing instruction information based on the shared editing instruction information to obtain converted pre-editing instruction information, wherein the converted pre-editing instruction information includes the update position of the content data to be collaborated on.

[0188] In one embodiment, if the shared editing instruction information is local shared instruction information, then the processing module 1102 is specifically used to: generate a pending cancellation instruction information corresponding to the pending cancellation operation on the pending content data in the pre-edited instruction information; perform operation conversion processing on the pending cancellation instruction information and the local shared instruction information to obtain the converted local shared instruction information; determine the addition instruction information corresponding to the addition operation of adding the pending content data again after the pending cancellation operation; and perform operation conversion processing on the addition instruction information and the converted local shared instruction information to obtain the update position of the pending content data. The operation conversion processing involved belongs to the processing logic of the position processing rules.

[0189] In one embodiment, the processing module 1102 is further configured to: output the converted local sharing indication information; wherein the local sharing indication information includes: local shared content data generated by the local shared editing operation, and the initial position of the local shared content data in the shared document, and the converted local sharing indication information includes: local shared content data generated by the local shared editing operation, and the shared position of the converted local shared content data in the shared document.

[0190] In one embodiment, before outputting the converted local sharing indication information, the processing module 1102 is further configured to: if a local sharing cancellation operation is detected on the local sharing content data included in the local sharing indication information, generate local sharing cancellation indication information; perform operation conversion processing on the cancellation indication information to be coordinated and the local sharing indication information to obtain the converted cancellation indication information to be coordinated; perform operation conversion processing on the local sharing cancellation indication information and the converted cancellation indication information to be coordinated to obtain the converted local sharing cancellation indication information; and store the converted local sharing cancellation indication information into the cancellation stack so as to revoke the local sharing content data generated by the local sharing editing operation through the converted local sharing cancellation indication information. The operation conversion processing involved belongs to the processing logic of the position processing rules.

[0191] It is understood that the functions of each functional module of the data processing device for shared documents described in the embodiments of this application can be specifically implemented according to the methods in the above method embodiments, and the specific implementation process can be referred to the relevant descriptions in the above method embodiments, which will not be repeated here. In addition, the beneficial effects of using the same method will not be repeated here either.

[0192] Please see Figure 12 , Figure 12 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. The computer device 1200 may include one or more independent devices (such as servers, nodes, terminals, etc.), or it may include components within independent devices (such as chips, software modules, or hardware modules). The computer device 1200 may include at least one processor 1201 and a communication interface 1202. Further optionally, the computer device 1200 may also include at least one memory 1203 and a bus 1204. The processor 1201, communication interface 1202, and memory 1203 are connected via the bus 1204.

[0193] The processor 1201 is a module that performs arithmetic and / or logical operations. Specifically, it can be one or a combination of processing modules such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor unit (MPU), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a complex programmable logic device (CPLD), a coprocessor (to assist the central processing unit in completing corresponding processing and applications), and a microcontroller unit (MCU).

[0194] The communication interface 1202 can be used to provide information input or output to at least one processor. And / or, the communication interface 1202 can be used to receive data sent from outside and / or send data to outside, and can be a wired link interface including such as an Ethernet cable, or a wireless link interface (Wi-Fi, Bluetooth, general wireless transmission, vehicle short-range communication technology and other short-range wireless communication technologies, etc.).

[0195] The memory 1203 provides storage space, in which data such as the operating system and computer programs can be stored. The memory 1203 can be one or a combination of several of the following: random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), or compact disc read-only memory (CD-ROM).

[0196] At least one processor 1201 in the computer device 1200 is used to invoke a computer program stored in at least one memory 1203 to execute the aforementioned data processing method for shared documents, such as the aforementioned Figure 3 , Figure 5 , Figure 8 The illustrated embodiment describes a data processing method for shared documents.

[0197] In one possible implementation, the processor 1201 in the computer device 1200 is configured to call a computer program stored in at least one memory 1203 to perform the following operations: responding to a pre-editing operation on a shared document via a communication interface, acquires pre-editing instruction information corresponding to the pre-editing operation, the pre-editing instruction information recording the collaborative content data generated by the pre-editing operation and the insertion position of the collaborative content data in the shared document; before acquiring the first collaborative data corresponding to the collaborative content data, if a shared editing instruction information for the shared document is received, the pre-editing instruction information and the shared editing instruction information are processed according to position processing rules to obtain the update position of the collaborative content data; if it is determined that the first collaborative data corresponding to the collaborative content data has been acquired, collaborative instruction information is generated, the collaborative instruction information including: the first collaborative data and the collaborative position of the first collaborative data obtained according to the update position; wherein, the shared editing instruction information includes the editing position of the second collaborative data and the second collaborative data in the shared document.

[0198] In one embodiment, the processor 1201 is specifically configured to: determine the update position of the content data to be coordinated as the coordination position of the first coordination data; delete the content data to be coordinated, and generate coordination indication information including the first coordination data corresponding to the content data to be coordinated and the coordination position of the first coordination data.

[0199] In one embodiment, the processor 1201 is specifically configured to: obtain editing location information corresponding to the collaboration identifier based on the collaboration identifier generated for the collaboration content data generated for the pre-editing operation, wherein the editing location information is used to indicate the location of the collaboration content data in the shared document; and delete the collaboration content data based on the location indicated by the editing location information in the shared document.

[0200] In one embodiment, the processor 1201 is further configured to: generate a collaborative identifier for the collaborative content data generated by the pre-editing operation; construct a mapping relationship between the editing position information of the collaborative content data and the collaborative identifier; wherein the editing position information includes any one of the following: insertion position, update position.

[0201] In one embodiment, the processor 1201 is further configured to: detect whether there is an insertion confirmation event for inserting collaborative content data into a shared document; if so, use the collaborative data generated based on the collaborative content data as the first collaborative data, and use the update position of the current time record of the collaborative content data as the collaborative position of the first collaborative data; wherein, the insertion confirmation event includes any one or more of the following: text input confirmation event, multimedia data upload confirmation event, speech conversion completion event, and image editing completion event.

[0202] In one embodiment, the processor 1201 is further configured to: update the pre-editing instruction information to obtain updated pre-editing instruction information; wherein the updated pre-editing instruction information includes: pre-editing instruction information obtained by replacing the insertion position with the updated position; and / or, pre-editing instruction information obtained by editing and updating the content data to be coordinated in the pre-editing instruction information in response to a detected editing operation.

[0203] In one embodiment, if the shared editing instruction information is server-side shared instruction information, then the processor 1201 is specifically configured to: perform operation conversion processing on the shared editing instruction information based on the pre-editing instruction information to obtain converted shared editing instruction information, and perform operation conversion processing on the pre-editing instruction information based on the shared editing instruction information to obtain converted pre-editing instruction information, wherein the converted pre-editing instruction information includes the update position of the content data to be collaborated on.

[0204] In one embodiment, if the shared editing instruction information is local shared instruction information, then the processor 1201 is specifically configured to: generate a pending cancellation instruction information corresponding to a pending cancellation operation on the pending content data in the pre-edited instruction information; perform operation conversion processing on the pending cancellation instruction information and the local shared instruction information to obtain the converted local shared instruction information; determine the addition instruction information corresponding to an addition operation that adds the pending content data again after the pending cancellation operation; and perform operation conversion processing on the addition instruction information and the converted local shared instruction information to obtain the update position of the pending content data. The operation conversion processing involved belongs to the processing logic of the position processing rules.

[0205] In one embodiment, the processor 1201 is further configured to: output converted local sharing indication information; wherein the local sharing indication information includes: local shared content data generated by the local shared editing operation, and the initial position of the local shared content data in the shared document, and the converted local sharing indication information includes: local shared content data generated by the local shared editing operation, and the shared position of the converted local shared content data in the shared document.

[0206] In one embodiment, before outputting the converted local sharing indication information, the processor 1201 is further configured to: if a local sharing cancellation operation is detected on the local sharing content data included in the local sharing indication information, generate local sharing cancellation indication information; perform operation conversion processing on the cancellation indication information to be coordinated and the local sharing indication information to obtain the converted cancellation indication information to be coordinated; perform operation conversion processing on the local sharing cancellation indication information and the converted cancellation indication information to be coordinated to obtain the converted local sharing cancellation indication information; and store the converted local sharing cancellation indication information into a cancellation stack so as to cancel the local sharing content data generated by the local sharing editing operation through the converted local sharing cancellation indication information. The operation conversion processing involved belongs to the processing logic of the position processing rules.

[0207] It should be understood that the computer device 1200 described in the embodiments of this application can execute the data processing method for the shared document described in the corresponding embodiments above, and can also execute the methods described above. Figure 11 The description of the data processing device 1100 for the shared documents in the corresponding embodiments will not be repeated here. Furthermore, the beneficial effects of using the same method will also not be repeated here.

[0208] Furthermore, it should be noted that an exemplary embodiment of this application also provides a storage medium storing a computer program for the aforementioned data processing method for shared documents. This computer program includes program instructions that, when loaded and executed by one or more processors, can implement the data processing method for shared documents described in the embodiments, which will not be repeated here. The beneficial effects of employing the same method will also not be repeated here. It is understood that the program instructions can be deployed on one or more computer devices capable of communicating with each other for execution.

[0209] The aforementioned computer-readable storage medium can be the data processing apparatus for shared documents provided in any of the foregoing embodiments, or the internal storage unit of the aforementioned computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium can also be an external storage device of the computer device, such as a plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, etc., provided on the computer device. Furthermore, the computer-readable storage medium may include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium can also be used to temporarily store data that has been output or will be output.

[0210] This application also provides a computer program product or computer program that includes 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 method provided in the foregoing embodiments.

[0211] The steps in the method of this application embodiment can be adjusted, combined, or deleted according to actual needs.

[0212] The modules in the device of this application embodiment can be merged, divided, and deleted according to actual needs.

[0213] The above-disclosed embodiments are merely some examples of the present invention and should not be construed as limiting the scope of the invention. Those skilled in the art will understand that implementing all or part of the above-described embodiments and making equivalent changes in accordance with the claims of the present invention are still within the scope of the invention.

Claims

1. A data processing method for shared documents, characterized in that, The method includes: In response to a pre-editing operation on a shared document, pre-editing instruction information corresponding to the pre-editing operation is obtained. The pre-editing instruction information records the content data to be collaborated generated by the pre-editing operation and the insertion position of the content data to be collaborated on in the shared document. Before obtaining the first collaborative data corresponding to the content data to be collaborated on, if a shared editing instruction information for the shared document is received, the pre-editing instruction information and the shared editing instruction information are processed according to the location processing rules to obtain the updated position of the content data to be collaborated on. If it is determined that the first collaborative data corresponding to the content data to be collaboratively obtained is obtained, then collaborative indication information is generated. The collaborative indication information includes: the first collaborative data and the collaborative position of the first collaborative data obtained according to the updated position.

2. The method as described in claim 1, characterized in that, The generation of collaborative instruction information includes: The update position of the content data to be coordinated is determined as the coordination position of the first coordinated data; Delete the content data to be coordinated and generate coordination indication information including the first coordination data corresponding to the content data to be coordinated and the coordination position of the first coordination data.

3. The method as described in claim 2, characterized in that, The deletion of the content data to be collaborated on includes: Based on the collaborative identifier generated for the collaborative content data produced by the pre-editing operation, the editing position information corresponding to the collaborative identifier is obtained, and the editing position information is used to indicate the position of the collaborative content data in the shared document; The content data to be collaborated on is deleted based on the location indicated by the edit location information within the shared document.

4. The method as described in claim 1, characterized in that, The method further includes: Generate a collaboration identifier for the collaboration-to-be-collaborated content data generated by the pre-editing operation; Construct a mapping relationship between the editing position information of the content data to be collaborated on and the identifier to be collaborated on; wherein, the editing position information includes any one of the following: the insertion position and the update position.

5. The method according to any one of claims 1-4, characterized in that, The method further includes: Detect whether there is an insertion confirmation event for inserting the content data to be collaborated into the shared document; If so, the collaborative data generated based on the content data to be collaborated on will be used as the first collaborative data, and the update position recorded in the content data to be collaborated on at the current time will be used as the collaborative position of the first collaborative data. The insertion confirmation event includes any one or more of the following: text input confirmation event, multimedia data upload confirmation event, voice conversion completion event, and image editing completion event.

6. The method as described in claim 5, characterized in that, The method further includes: The pre-editing instruction information is updated to obtain the updated pre-editing instruction information; The updated pre-editing instruction information includes at least one of the following: pre-editing instruction information obtained by replacing the insertion position with the updated position; and pre-editing instruction information obtained by editing and updating the content data to be coordinated in the pre-editing instruction information in response to the detected editing operation.

7. The method as described in claim 1, characterized in that, If the shared editing instruction information is server-side shared instruction information, then the step of performing operation conversion processing on the pre-editing instruction information and the shared editing instruction information according to the location processing rules to obtain the update location of the content data to be collaborated on includes: Based on the pre-editing instruction information, the shared editing instruction information is processed for conversion to obtain the converted shared editing instruction information; Based on the shared editing instruction information, the pre-editing instruction information is processed to obtain the converted pre-editing instruction information, which includes the update position of the content data to be collaborated on.

8. The method as described in claim 1, characterized in that, If the shared editing instruction information is local shared instruction information, then the step of performing operation conversion processing on the pre-editing instruction information and the shared editing instruction information according to the location processing rules to obtain the update position of the content data to be collaborated on includes: Generate collaborative cancellation instruction information corresponding to the collaborative cancellation operation performed on the collaborative content data in the pre-edited instruction information; The pending collaborative cancellation indication information and the local shared indication information are processed by operation conversion to obtain the converted local shared indication information; Determine the addition instruction information corresponding to the addition operation of adding the content data to be collaborated with again after the collaboration cancellation operation is performed; The added instruction information and the converted local shared instruction information are processed to obtain the update position of the content data to be coordinated.

9. The method as described in claim 8, characterized in that, The method further includes: Output the converted local shared indication information; The local sharing indication information includes: local shared content data generated by local shared editing operations and the initial position of the local shared content data in the shared document. The converted local sharing indication information includes: local shared content data generated by local shared editing operations and the converted and determined sharing position of the local shared content data in the shared document.

10. The method as described in claim 9, characterized in that, Before outputting the converted local shared indication information, the method further includes: If a local sharing cancellation operation is detected on the local shared content data included in the local sharing indication information, then local sharing cancellation indication information is generated; The collaborative cancellation indication information and the local shared indication information are processed by operation conversion to obtain the converted collaborative cancellation indication information; The local shared cancellation instruction information and the converted cancellation instruction information to be coordinated are processed to obtain the converted local shared cancellation instruction information. The converted local shared undo instruction information is stored in the undo stack so that the local shared content data generated by the local shared editing operation can be undone using the converted local shared undo instruction information.

11. A data processing apparatus for shared documents, characterized in that, The device includes: The acquisition module is used to acquire pre-editing instruction information corresponding to the pre-editing operation in response to a pre-editing operation on a shared document. The pre-editing instruction information records the content data to be collaborated generated by the pre-editing operation and the insertion position of the content data to be collaborated on in the shared document. The processing module is configured to, before acquiring the first collaborative data corresponding to the content data to be collaborated on, if receiving shared editing instruction information for the shared document, perform operation conversion processing on the pre-editing instruction information and the shared editing instruction information according to the position processing rules to obtain the update position of the content data to be collaborated on; if it is determined that the first collaborative data corresponding to the content data to be collaborated on has been acquired, generate collaborative instruction information, the collaborative instruction information including: the first collaborative data and the collaborative position of the first collaborative data obtained according to the update position.

12. A computer device, characterized in that, include: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide network communication functions, the memory is used to store program code, and the processor is used to call the program code to execute the data processing method for shared documents according to any one of claims 1 to 10.

13. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the data processing method for shared documents as described in any one of claims 1 to 10.

14. A computer program product, characterized in that, The computer program product includes a computer program or computer instructions that, when executed by a processor, implement the steps of the data processing method for shared documents as described in any one of claims 1 to 10.