Text collaborative editing method and collaborative editing device, electronic device and storage medium
By separating concurrent text incremental logs and performing data playback and merging in the real-time collaborative editing system, the problem of low collaborative editing efficiency under a large number of user operations is solved, and efficient collaborative editing of text data is achieved.
Patent Information
- Application Number
- CN202211150574.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-21
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2042-09-21
AI Technical Summary
When a large number of users operate simultaneously in existing real-time collaborative editing systems, the entire text data is edited synchronously, which causes the server to need to store a large amount of multiple versions of concurrent data, reducing the efficiency of collaborative editing.
By establishing communication connections with multiple user terminals, text incremental logs are obtained and data conflict comparison is performed. The log sets are separated into those that require and those that do not require conflict comparison, and data are replayed and merged separately, and the target text incremental data is sent to the user terminal.
It improves the efficiency of collaborative editing of text data and reduces the storage requirements and processing time consumption on the server side.
Smart Images

Figure CN115455917B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a text collaborative editing method and collaborative editing device, electronic equipment, and storage medium. Background Art
[0002] In current real-time collaborative editing systems, when a large number of users operate on the same data at the same time, the existing collaborative editing method is to synchronously edit the entire text data, which requires the server to store and record a large number of multiple versions of concurrent data, reducing the efficiency of collaborative editing of text data. Summary of the Invention
[0003] The main purpose of the embodiments of the present application is to propose a text collaborative editing method and collaborative editing device, electronic device and storage medium, aiming to improve the efficiency of collaborative editing of text data.
[0004] To achieve the above objectives, a first aspect of an embodiment of the present application provides a text collaborative editing method, the method comprising:
[0005] Establishing communication connections with a plurality of initial user terminals, and obtaining a query request for basic text data from each of the initial user terminals according to the communication connections;
[0006] matching the basic text data from a pre-stored document database according to the query request, and setting a version identifier of the basic text data to a first version number;
[0007] Acquire multiple text incremental logs for editing the basic text data within a preset incremental time interval, each of the text incremental logs including the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and an action timestamp;
[0008] Performing data conflict comparison on the plurality of text incremental logs according to the numbers of the basic text data and the incremental action information to determine a first incremental log set and a second incremental log set; wherein the first incremental log set is used to represent a set of the text incremental logs that need to be compared for data conflicts, and the second incremental log set is used to represent a set of the text incremental logs that do not need to be compared for data conflicts;
[0009] Replaying each text incremental log in the first incremental log set according to the number of the initial user terminal and the action timestamp to obtain first text incremental data;
[0010] Replaying data of each of the text incremental logs in the second incremental log set to obtain second text incremental data;
[0011] Merging the first text incremental data and the second text incremental data to obtain target text incremental data;
[0012] The target text incremental data is sent to each of the initial user terminals for data change.
[0013] In some embodiments, after obtaining a plurality of text incremental logs of editing the basic text data within a preset incremental time interval, the method further includes:
[0014] Modify the version identifier of the edited basic text data to a second version number;
[0015] Compare the second version number with the version identifiers of all current initial user terminals, and select the initial user terminal with a version identifier smaller than the second version number as a candidate user terminal;
[0016] Synchronize the text incremental log of the second version number to each of the candidate user terminals.
[0017] In some embodiments, performing data conflict comparison on the plurality of text incremental logs according to the serial number of the basic text data and the incremental action information to determine the first incremental log set and the second incremental log set includes:
[0018] Determining the incremental operation line and data operation type of each text incremental log according to the incremental action information;
[0019] performing a data conflict comparison on the plurality of text incremental logs according to the number of the basic text data, the incremental operation line, and the data operation type; and adding the text incremental log to the first incremental log set when the comparison result indicates that at least two text incremental logs use the same data operation type to edit the same incremental operation line;
[0020] When the comparison result indicates that at least two of the text incremental logs use different data operation types to edit the same incremental operation line, or at least two of the text incremental logs use the same data operation type to edit different incremental operation lines, the text incremental log is added to the second incremental log set.
[0021] In some embodiments, the data operation type includes a deletion operation type, a new addition operation type, and a modification operation type. The replaying each text incremental log in the first incremental log set according to the number of the initial user terminal and the action timestamp to obtain the first text incremental data includes:
[0022] If the data operation type of the text incremental log is the deletion operation type, performing a merge judgment on each of the text incremental logs according to the incremental operation row, and replaying data of each of the text incremental logs in the first incremental log set according to the judgment result to obtain first text incremental data;
[0023] If the data operation type of the text incremental log is the new operation type, replaying data for each of the text incremental logs in the first incremental log set according to a predefined new data row rule, the number of the basic text data, the number of the initial user terminal, and the action timestamp to obtain the first text incremental data;
[0024] If the data operation type of the text incremental log is the modification operation type, data is replayed for each text incremental log in the first incremental log set according to the pre-defined modification data row rules, the number of the basic text data, the number of the initial user terminal and the action timestamp to obtain the first text incremental data.
[0025] In some embodiments, the merging and judging each of the text incremental logs according to the incremental operation row, and replaying data of each of the text incremental logs in the first incremental log set according to the judgment result to obtain the first text incremental data, includes:
[0026] Acquire the text incremental log in the first incremental log set, in which the data operation type is the deletion operation type, to obtain a first incremental log subset;
[0027] Performing a merge judgment on each of the text incremental logs in the first incremental log subset according to the incremental operation row;
[0028] When the result of the judgment indicates that at least two of the text incremental logs delete the same incremental operation line, merging the text incremental logs that delete the same incremental operation line to obtain a merged incremental log, and adding the merged incremental log to the first incremental log subset;
[0029] Data is replayed on each of the text incremental logs and each of the merged incremental logs in the first incremental log subset to obtain first text incremental data.
[0030] In some embodiments, the step of replaying data of each text incremental log in the first incremental log set according to a predefined new data row rule, the number of the basic text data, the number of the initial user terminal, and the action timestamp to obtain the first text incremental data includes:
[0031] Acquire the text incremental log in the first incremental log set, in which the data operation type is the newly added operation type, to obtain a second incremental log subset;
[0032] Arrange the text incremental logs corresponding to the same incremental operation row in the second incremental log subset in descending order according to the action timestamp to obtain a first list;
[0033] According to the number of the basic text data, the number of the initial user terminal and the first list, data of each text incremental log is played back to obtain the first text incremental data.
[0034] In some embodiments, if the data operation type of the text incremental log is the modification operation type, data playback is performed on each of the text incremental logs in the first incremental log set according to a predefined modification data row rule, the number of the basic text data, the number of the initial user terminal, and the action timestamp to obtain the first text incremental data, including:
[0035] Acquire the text incremental log in the first incremental log set, in which the data operation type is the modification operation type, to obtain a third incremental log subset;
[0036] Arrange the text incremental logs corresponding to the same incremental operation row in the third incremental log subset in ascending order according to the action timestamp to obtain a second list;
[0037] According to the number of the basic text data, the number of the initial user terminal and the second list, data of each text incremental log is played back to obtain the first text incremental data.
[0038] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a text collaborative editing device, the device comprising:
[0039] a connection establishing module, configured to establish communication connections with a plurality of initial user terminals, and obtain a query request for basic text data from each of the initial user terminals according to the communication connections;
[0040] a basic text matching module, configured to match the basic text data from a pre-stored document database according to the query request, and set a version identifier of the basic text data to a first version number;
[0041] A text incremental log acquisition module is used to acquire multiple text incremental logs for editing the basic text data within a preset incremental time interval, each of the text incremental logs including the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and an action timestamp;
[0042] A data conflict comparison module is configured to perform data conflict comparison on the plurality of text incremental logs according to the number of the basic text data and the incremental action information, and determine a first incremental log set and a second incremental log set; wherein the first incremental log set is used to represent a set of the text incremental logs that need to be compared for data conflicts, and the second incremental log set is used to represent a set of the text incremental logs that do not need to be compared for data conflicts;
[0043] A first data playback module is configured to play back each text incremental log in the first incremental log set according to the number of the initial user terminal and the action timestamp to obtain first text incremental data;
[0044] A second data playback module is configured to play back each of the text incremental logs in the second incremental log set to obtain second text incremental data;
[0045] A data merging module, configured to merge the first text incremental data and the second text incremental data to obtain target text incremental data;
[0046] The data change module is used to send the target text incremental data to each of the initial user terminals for data change.
[0047] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the method described in the first aspect when executing the computer program.
[0048] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.
[0049] The present application proposes a collaborative text editing method, collaborative editing device, electronic device, and storage medium. The method establishes communication connections with multiple initial user terminals and obtains query requests for basic text data from each initial user terminal based on the communication connections. The method then matches basic text data from a pre-stored document database based on the query requests and sets the version identifier of the basic text data to a first version number. The method then obtains multiple text incremental logs for editing the basic text data within a preset incremental time interval. Each text incremental log includes the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and an action timestamp. Data conflicts are compared between the multiple text incremental logs based on the number of the basic text data and the incremental action information to determine a first incremental log set and a second incremental log set. The first incremental log set represents a set of text incremental logs that require data conflict comparison, while the second incremental log set represents a set of text incremental logs that do not require data conflict comparison. Data is then replayed for each text incremental log in the first incremental log set based on the number of the initial user terminal and the action timestamp to obtain first text incremental data. Data is then replayed for each text incremental log in the second incremental log set to obtain second text incremental data. Afterwards, the first text incremental data and the second text incremental data are merged to obtain target text incremental data, and the target text incremental data is sent to each initial user terminal for data modification. The embodiment of the present application can improve the efficiency of collaborative editing of text data. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Figure 1 This is a first flow chart of the text collaborative editing method provided by an embodiment of the present application;
[0051] Figure 2 This is a second flow chart of the text collaborative editing method provided by an embodiment of the present application;
[0052] Figure 3 yes Figure 1 Flowchart of step S140 in FIG.
[0053] Figure 4 This is a third flow chart of the text collaborative editing method provided in an embodiment of the present application;
[0054] Figure 5 This is a fourth flow chart of the text collaborative editing method provided in an embodiment of the present application;
[0055] Figure 6 This is a fifth flow chart of the text collaborative editing method provided by an embodiment of the present application;
[0056] Figure 7 This is a schematic diagram of the structure of a text collaborative editing device provided in an embodiment of the present application;
[0057] Figure 8 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0059] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.
[0060] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0061] First, let’s analyze some of the terms used in this application:
[0062] The WebSocket communication protocol is a full-duplex communication protocol over a single Transmission Control Protocol (TCP) connection. In the WebSocket API, the browser and server only need to complete a single handshake to establish a persistent connection and enable bidirectional data transmission. This simplifies data exchange between client and server devices and allows the server to actively push data to the client device.
[0063] Extensible Messaging and Presence Protocol (XMPP): can be used for streaming XML data elements in service-based real-time messaging, presence, and demand-response services.
[0064] Message Queuing Telemetry Transport (MQTT): It is a message protocol based on the publish / subscribe paradigm under the ISO standard (ISO / IEC PRF 20922). It is a client-server based message publish / subscribe transmission protocol.
[0065] Traditional editing methods can ensure data consistency by addressing multi-terminal data editing, data reading, and document data management. However, real-time collaborative editing requires high concurrency and high throughput, which traditional distributed editing methods cannot meet.
[0066] Currently, real-time collaborative editing systems not only have to deal with complex and lengthy data formats, but also face competing data operations from different end users on the same data object at the same time. When a large number of users are working on the same data simultaneously, existing collaborative editing methods require the server to store and record a large amount of concurrent data, requiring simultaneous editing of the entire text data. This reduces the efficiency of collaborative editing.
[0067] Based on this, the embodiments of the present application provide a text collaborative editing method and collaborative editing device, electronic device and storage medium, aiming to improve the efficiency of collaborative editing of text data.
[0068] The text collaborative editing method and collaborative editing device, electronic device and storage medium provided in the embodiments of the present application are specifically illustrated through the following embodiments. First, the text collaborative editing method in the embodiments of the present application is described.
[0069] The text collaborative editing method provided in the embodiments of the present application can be applied to a terminal, can be applied to a server side, and can also be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or as a server cluster or distributed system composed of multiple physical servers, or as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms; the software can be an application that implements the text collaborative editing method, etc., but is not limited to the above forms.
[0070] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, and the like. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, and the like that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments in which tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0071] It should be noted that in each specific embodiment of the present application, when it comes to the need to perform relevant processing based on data related to the user's identity or characteristics, such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of such data will comply with the relevant laws, regulations, and standards of the relevant countries and regions. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0072] See also Figure 1 , Figure 1 This is an optional flowchart of the text collaborative editing method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S110 to S180:
[0073] Step S110: establishing communication connections with multiple initial user terminals, and obtaining a query request for basic text data from each initial user terminal according to the communication connections;
[0074] Step S120, matching basic text data from a pre-stored document database according to the query request, and setting a version identifier of the basic text data to a first version number;
[0075] Step S130, obtaining multiple text incremental logs of editing the basic text data within a preset incremental time interval, each text incremental log including the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and the action timestamp;
[0076] Step S140, performing data conflict comparison on the plurality of text incremental logs according to the numbers of the basic text data and the incremental action information, and determining a first incremental log set and a second incremental log set;
[0077] Step S150, replaying each text incremental log in the first incremental log set according to the number and action timestamp of the initial user terminal to obtain first text incremental data;
[0078] Step S160, replaying data of each text incremental log in the second incremental log set to obtain second text incremental data;
[0079] Step S170, merging the first text incremental data and the second text incremental data to obtain target text incremental data;
[0080] Step S180: Send the target text incremental data to each initial user terminal for data modification.
[0081] In steps S110 to S180 of the embodiment of the present application, a communication connection is established with multiple initial user terminals, and a query request for basic text data from each initial user terminal is obtained based on the communication connection, thereby matching basic text data from a pre-stored document database based on the query request, and setting the version identifier of the basic text data to a first version number. Then, multiple text incremental logs are obtained for editing the basic text data within a preset incremental time interval, each text incremental log including the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and an action timestamp. Data conflicts are compared on the multiple text incremental logs based on the number of the basic text data and the incremental action information to determine a first incremental log set and a second incremental log set. The first incremental log set is used to represent a set of text incremental logs that require data conflict comparison, and the second incremental log set is used to represent a set of text incremental logs that do not require data conflict comparison. Data playback is performed on each text incremental log in the first incremental log set based on the number of the initial user terminal and the action timestamp to obtain first text incremental data. Data playback is performed on each text incremental log in the second incremental log set to obtain second text incremental data. Afterwards, the first text incremental data and the second text incremental data are merged to obtain target text incremental data, and the target text incremental data is sent to each initial user terminal for data modification. The embodiment of the present application can improve the efficiency of collaborative editing of text data.
[0082] It should be noted that the application scenarios of the embodiments of the present application may include user-end devices and server-end devices. The user-end device is used to send a query request for basic text data to the server-end device, and the server-end device is used to execute the text collaborative editing method provided by the embodiments of the present application. After obtaining the query request for basic text data sent by the user-end device, the text collaborative editing method of the present application is executed.
[0083] In step S110 of some embodiments, if the server device is used as the executor of the text collaborative editing method provided in the embodiments of the present application, first, a communication connection is established between the server and multiple initial user terminals, and a query request for basic text data from each initial user terminal is obtained based on the communication connection.
[0084] It should be noted that after user A logs into the editing system, a communication connection can be established between the initial user terminal corresponding to user A and the server terminal via the WebSocket communication protocol, thereby obtaining a connection session P1. For example, when user A enters document directory D on the initial user terminal and selects basic text data W1, thereby entering the editing mode for basic text data W1, the initial user terminal will form a query request for basic text data W1 based on this operation and send this query request to the server terminal. The server terminal then obtains the query request for basic text data from each initial user terminal based on the connection session S1 of the communication connection.
[0085] It should be noted that the server device can communicate with at least one initial client, and can simultaneously establish multiple WebSocket communication connections and their corresponding connection sessions.
[0086] It should be noted that the communication connection method between the server device and the initial user device can also be based on XMPP, MQTT protocol, etc., which is not specifically limited here.
[0087] It should be noted that a user terminal device can also be used as the execution subject of the text collaborative editing method provided in the embodiment of the present application, which is not described in detail here.
[0088] In step S120 of some embodiments, a document database is pre-stored in the server-side device, and the document database is used to store all document data that can be edited in real time on the user side. Then, when a query request is received, the basic text data can be matched from the pre-stored document database according to the query request, and the version identifier of the basic text data is set to the first version number, which can be recorded as V1. It should be noted that the first version number V1 is used to indicate that the initial user side currently connected to the server side uses the basic text data as the basic version when currently editing, that is, the basic text data can be the initial version of the document or a changed version. When all initial changes have been made, the changed version of the document data is used as the basic text data for the next edit.
[0089] It should be noted that, for example, when user A enters document directory D on an initial user terminal and selects basic text data W1, the server will query the full data of the current basic text data W1 and record the first version number V1 of user A's basic text data W1.
[0090] In step S130 of some embodiments, in order to send the edited incremental data to the client in the form of a log in real time for change, the server presets an incremental time interval, that is, a plurality of text incremental logs for editing the basic text data are obtained within the incremental time interval, and each text incremental log indicates that a certain initial user terminal has made a change to that line of the basic text data to generate a text incremental log. Each text incremental log includes the number of the basic text data, the first version number, the incremental action information, the number of the initial user terminal, and the action timestamp. The embodiment of the present application can effectively improve the efficiency of collaborative editing of text data by sending the changed text incremental log to the server for data change, thereby reducing the time consumption of the call.
[0091] It should be noted that each paragraph added, deleted or modified by the initial user end will be marked with the corresponding user token (ie user tag), and the time when the action occurred will be recorded, ie the action timestamp.
[0092] It should be noted that the format of the text incremental log can be recorded as "the number of the basic text data: the first version number: the incremental action information: the number of the initial user terminal: the action timestamp", wherein the format of the text incremental log is used to indicate which initial user terminal executed which incremental action information at what action timestamp with what first version number of the basic text data. For example, the format of a text incremental log is "W1:V1:AddL1C33:S1:UserID1:T1", wherein AddL1C33:S1 is used to indicate that the character string S1 is added after the 33rd character in the first line. Then the format of the text incremental log is used to indicate that the initial user terminal numbered UserID1 added the character string S1 after the 33rd character in the first line of the V1 version of the basic text data W1 at the T1 action timestamp. For another example, the format of a text incremental log is "W1:V1:DelL1C3C10:UserID2:T2", where DelL1C3C10 is used to indicate deleting characters from the third character in the first line to the tenth character. The format of this text incremental log is used to indicate that the initial user end numbered UserID2 deleted characters from the third character in the first line to the tenth character in the V1 version of the basic text data W1 at the action timestamp T2. For another example, the format of a text incremental log is "W1:V1:NewL1:UserID3:T3", where NewL1 is used to indicate adding a new line after the first line. The format of this text incremental log is used to indicate that the initial user end numbered UserID3 added a new line after the first line in the V1 version of the basic text data W1 at the action timestamp T3.
[0093] It should be noted that the server can obtain multiple text incremental logs from an initial user terminal, and the acquisition form can be that the initial user terminal generates a text incremental log and transmits it to the server one by one, or after all changes are completed, the multiple text incremental logs generated can be transmitted to the server together. There is no specific limitation here.
[0094] See also Figure 2 , Figure 2 This is another optional flow chart of the text collaborative editing method provided by the embodiment of the present application. In some embodiments, after step S130, the method provided by the embodiment of the present application may further include but is not limited to steps S210 to S230:
[0095] Step S210, modifying the version identifier of the edited basic text data to a second version number;
[0096] Step S220: compare the second version number with the version identifiers of all current initial user terminals, and select the initial user terminals with version identifiers smaller than the second version number as candidate user terminals;
[0097] Step S230: Synchronize the text increment log of the second version number to each candidate user terminal.
[0098] In step S210 of some embodiments, when the server records that the basic text data has been edited by an initial user terminal, the version representation of the basic text data currently being edited by the initial user terminal is modified to a second version number, which can facilitate the distinction between the edited text data at this time and the basic text data with the first version number.
[0099] In step S220 to step S230 of some embodiments, the second version number is compared with the version identification of all current initial user terminals, that is, all initial user terminals currently in conversation are screened at the server, and the initial user terminals that are currently reading the same basic text data and whose version identification is less than the second version number are found, and these initial user terminals are used as candidate user terminals. At the same time, the text incremental log of the second version number is synchronized to each candidate user terminal to achieve the playback synchronization of the incremental data after the basic text data is changed to all candidate user terminals. For example, when user A adds, deletes, and modifies certain characters to the basic text data W1 of version V1, and the version identification of the modified incremental text data is modified to V2, the text incremental log generated under the V2 version about the basic text data W1 is sent to all candidate user terminals for data playback to ensure real-time synchronization of all user terminals connected to the server.
[0100] See also Figure 3 In some embodiments, step S140 may specifically include but is not limited to steps S310 to S330:
[0101] Step S310, determining the incremental operation line and data operation type of each text incremental log according to the incremental action information;
[0102] Step S320: performing data conflict comparison on multiple text incremental logs based on the numbers of the basic text data, the incremental operation lines, and the data operation types. If the comparison result indicates that at least two text incremental logs use the same data operation type to edit the same incremental operation line, the text incremental log is added to the first incremental log set.
[0103] Step S330, when the comparison result indicates that at least two text incremental logs use different data operation types to edit the same incremental operation line, or at least two text incremental logs use the same data operation type to edit different incremental operation lines, the text incremental log is added to the second incremental log set.
[0104] In step S310 of some embodiments, since the operations of multiple initial user terminals connected to the same server are all based on the basic text data with the version identification V1, the server will have multiple operations of multiple user terminals at the same time, thereby generating data conflicts when replaying the data of the text incremental log. It is necessary to perform conflict arbitration on the multiple conflicts generated to improve the efficiency of collaborative editing of text data. Specifically, the incremental operation line and data operation type of each text incremental log are determined based on the incremental action information. The incremental operation line is used to confirm whether multiple user terminals are operating on the same line of data, and the data operation type is used to confirm whether multiple user terminals have performed the same operation.
[0105] In step S320 of some embodiments, the first incremental log set is used to represent a collection of text incremental logs that require data conflict comparison.
[0106] It should be noted that the first incremental log set includes multiple groups of first incremental log combinations, and each group of first incremental log combinations represents a text incremental log that uses the same data operation type to edit the same incremental operation line.
[0107] In step S330 of some embodiments, the second incremental log set is used to represent a collection of text incremental logs that do not require data conflict comparison.
[0108] In some embodiments, the data operation type includes a deletion operation type, a new addition operation type, and a modification operation type. Step S150 may specifically include, but is not limited to, at least one of the following situations:
[0109] If the data operation type of the text incremental log is a delete operation type, each text incremental log is merged and judged according to the incremental operation line, and data of each text incremental log in the first incremental log set is replayed according to the judgment result to obtain the first text incremental data;
[0110] If the data operation type of the text incremental log is a new operation type, replaying data of each text incremental log in the first incremental log set according to a pre-defined new data row rule, the number of the basic text data, the number of the initial user terminal, and the action timestamp to obtain first text incremental data;
[0111] If the data operation type of the text incremental log is a modification operation type, data is replayed for each text incremental log in the first incremental log set according to the pre-specified modification data row rules, the number of the basic text data, the number of the initial user terminal and the action timestamp to obtain the first text incremental data.
[0112] See also Figure 4In some embodiments, if the data operation type of the text incremental log is a delete operation type, the method provided in the embodiment of the present application may further include but is not limited to steps S410 to S440:
[0113] Step S410: Obtain text incremental logs whose data operation type is a delete operation type in the first incremental log set to obtain a first incremental log subset;
[0114] Step S420, performing a merge judgment on each text incremental log in the first incremental log subset according to the incremental operation row;
[0115] Step S430: When the result of the judgment indicates that at least two text incremental logs have deleted the same incremental operation line, the text incremental logs that have deleted the same incremental operation line are merged to obtain a merged incremental log, and the merged incremental log is added to the first incremental log subset;
[0116] Step S440 : replaying each text incremental log and each merged incremental log in the first incremental log subset to obtain first text incremental data.
[0117] In some embodiments, in steps S410 to S440, if the data operation type of the text incremental log is a deletion operation type, first obtain the text incremental log with the data operation type of the deletion operation type in the first incremental log set to obtain the first incremental log subset. Then, each text incremental log in the first incremental log subset is merged and judged according to the incremental operation line, that is, first judge whether the text of each text incremental log in the first incremental log subset deletes the same incremental operation line. When the result of the judgment indicates that at least two text incremental logs delete the same incremental operation line, the text incremental logs that delete the same incremental operation line are merged to obtain a merged incremental log, and the merged incremental log is added to the first incremental log subset. At the same time, the single text incremental log corresponding to the merged incremental log is deleted in the first incremental log subset to avoid repeated operations that reduce the efficiency of data playback. Finally, data playback is performed on each text incremental log and each merged incremental log in the first incremental log subset, that is, data is deleted from each text incremental log and each merged incremental log in the first incremental log subset according to the action timestamp to obtain the first text incremental data.
[0118] It should be noted that, when the result of the judgment indicates that each text incremental log deletes different incremental operation lines, the text incremental log remains unchanged in the first incremental log subset.
[0119] It should be noted that after data playback, the deletion operation of the basic text data can be displayed on the user-side interface as adding a strikethrough in the middle of the text and marking the user token corresponding to the initial user side. The user token can be a set user avatar or custom image, etc.; it is also possible not to display the deleted text data and only mark the user token of the initial user side. No specific limitation is made here.
[0120] It should be noted that the mark of the delete operation, add operation or modify operation displayed on the initial user end will only be displayed for a period of time, that is, the previous mark will be cleared at the next operation.
[0121] See also Figure 5 In some embodiments, if the data operation type of the text incremental log is a new operation type, the method provided in the embodiment of the present application may further include but is not limited to steps S510 to S530:
[0122] Step S510: Obtain text incremental logs whose data operation type is a new operation type in the first incremental log set to obtain a second incremental log subset;
[0123] Step S520 , arranging the text incremental logs corresponding to the same incremental operation line in the second incremental log subset in descending order according to the action timestamp to obtain a first list;
[0124] Step S530 : replaying each text incremental log according to the number of the basic text data, the number of the initial user terminal and the first list to obtain first text incremental data.
[0125] In steps S510 to S530 of some embodiments, if the data operation type of the text incremental log is a new operation type, first, the text incremental log of the data operation type of the new operation type in the first incremental log set is obtained to obtain a second incremental log subset. The incremental data row operated on each text incremental log in the second incremental log subset is judged to determine the log combination of the text incremental log corresponding to the same incremental operation row in the second incremental log subset. The pre-defined rule of the new data row is that for the text incremental log of the same incremental operation row, the one with the latest time modification is added first when displayed. Specifically, the log combination corresponding to the same incremental operation row is arranged in descending order according to the action timestamp to obtain a first list, that is, the first one in the first list is the text incremental log with the latest new operation time. According to the number of the basic text data, the number of the initial user terminal and the first list, data playback is performed on each text incremental log, that is, the incremental data of the text incremental log with the latest time is added to the front, and so on, to obtain the first text incremental data. For example, if the original incremental operation behavior is A, and new data is added after A, the text incremental log at time T1 corresponds to incremental data B, and the text incremental log at time T2 corresponds to incremental data C. If time T1 is later than time T2, the first text incremental data obtained is ABC. The embodiment of the present application adds data according to the pre-defined new data row rules, thereby improving the efficiency of collaborative editing of text data.
[0126] See also Figure 6 In some embodiments, if the data operation type of the text incremental log is a modification operation type, the method provided in the embodiment of the present application may further include but is not limited to steps S610 to S630:
[0127] Step S610: Obtain text incremental logs whose data operation type is a modification operation type in the first incremental log set to obtain a third incremental log subset;
[0128] Step S620, arranging the text incremental logs corresponding to the same incremental operation line in the third incremental log subset in ascending order according to the action timestamp to obtain a second list;
[0129] Step S630 : replaying each text incremental log according to the number of the basic text data, the number of the initial user terminal, and the second list to obtain first text incremental data.
[0130] In some embodiments, in steps S510 to S530, if the data operation type of the text incremental log is a modification operation type, first, the text incremental logs with the modification operation type in the first incremental log set are obtained to obtain a third incremental log subset. The characters of the incremental data operated on each text incremental log in the third incremental log subset are judged to determine the log combination of the text incremental logs corresponding to the same starting character of the same incremental operation line in the third incremental log subset. The pre-defined modification data line rule is that for the text incremental logs with the same starting character of the same incremental operation line, the text incremental logs modified first are changed first. Specifically, the text incremental logs corresponding to the same incremental operation line in the third incremental log subset are sorted in ascending order according to the action timestamp to obtain a second list, i.e., the first text incremental log in the second list is the text incremental log with the earliest modification operation time. According to the number of the basic text data, the number of the initial user terminal, and the second list, data playback is performed for each text incremental log, i.e., the incremental data of the text incremental log with the earliest time is used to modify the original data line first, and so on, to obtain the first text incremental data. For example, the original incremental operation behavior is A, and A is modified. The text incremental log at time T1 modifies A to A1, and the text incremental log at time T2 modifies A to A2. T1 is later than T2, so the first text incremental data obtained is A1, A2.
[0131] It should be noted that after the initial user end before the action timestamp completes the modification of the same starting character of the same incremental operation line, the modification of the same position by the next initial user end will be invalid. It can be not displayed, or the record of the second modification can be added after the record modified by the previous initial user end, thereby retaining the modification record of each initial user end.
[0132] In step S160 of some embodiments, if there is no data conflict between the text incremental logs stored in the second incremental log set, data of each text incremental log is replayed according to the action timestamp to obtain second text incremental data.
[0133] It should be noted that the text incremental logs stored in the second incremental log set may be of different data operation types, or the deletion may not be the same incremental data row, or the addition may not be after the same incremental data row, or different characters of the same incremental data row may be modified.
[0134] In step S170 of some embodiments, the first text incremental data and the second text incremental data are merged to obtain target text incremental data.
[0135] In step S180 of some embodiments, the target text incremental data is sent to each initial user terminal for data modification, that is, it is merged into one target text incremental data and sent to each initial user terminal for display.
[0136] It should be noted that the row or string generated by the data playback operation will carry the user token of the initial user end performing the operation, and will be marked separately with a different color background during the page rendering stage.
[0137] See also Figure 7 The present application also provides a text collaborative editing device that can implement the above text collaborative editing method. The device includes:
[0138] The connection establishment module 710 is used to establish communication connections with multiple initial user terminals and obtain a query request for basic text data from each initial user terminal based on the communication connections;
[0139] A basic text matching module 720 is configured to match basic text data from a pre-stored document database according to a query request, and set a version identifier of the basic text data to a first version number;
[0140] The text incremental log acquisition module 730 is used to acquire multiple text incremental logs of editing the basic text data within a preset incremental time interval, each text incremental log including the number of the basic text data, the first version number, the incremental action information, the number of the initial user terminal, and the action timestamp;
[0141] A data conflict comparison module 740 is configured to perform data conflict comparison on multiple text incremental logs based on the numbers of the basic text data and the incremental action information, and determine a first incremental log set and a second incremental log set; wherein the first incremental log set is used to represent a set of text incremental logs that need to be compared for data conflicts, and the second incremental log set is used to represent a set of text incremental logs that do not need to be compared for data conflicts;
[0142] The first data playback module 750 is configured to play back each text incremental log in the first incremental log set according to the number and action timestamp of the initial user terminal to obtain first text incremental data;
[0143] The second data playback module 760 is configured to play back each text incremental log in the second incremental log set to obtain second text incremental data;
[0144] A data merging module 770 is configured to merge the first text incremental data and the second text incremental data to obtain target text incremental data;
[0145] The data change module 780 is used to send the target text incremental data to each initial user terminal for data change.
[0146] The specific implementation of the text collaborative editing device is basically the same as the specific embodiment of the above-mentioned text collaborative editing method, and will not be repeated here.
[0147] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned text collaborative editing method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.
[0148] See also Figure 8 , Figure 8 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:
[0149] The processor 810 may be implemented as a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is configured to execute relevant programs to implement the technical solutions provided in the embodiments of the present application.
[0150] The memory 820 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 820 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 820 and is called by the processor 810 to execute the text collaborative editing method of the embodiments of this application.
[0151] Input / output interface 830, used to implement information input and output;
[0152] Communication interface 840, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);
[0153] bus 850 , which transmits information between the various components of the device (e.g., processor 810 , memory 820 , input / output interface 830 , and communication interface 840 );
[0154] The processor 810 , the memory 820 , the input / output interface 830 and the communication interface 840 are connected to each other in communication within the device via a bus 850 .
[0155] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the above-mentioned text collaborative editing method.
[0156] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely arranged relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0157] The embodiment of the present application provides a text collaborative editing method and collaborative editing device, electronic device and storage medium, which establishes a communication connection with multiple initial user terminals and obtains a query request for basic text data from each initial user terminal based on the communication connection, thereby matching basic text data from a pre-stored document database based on the query request, and setting the version identifier of the basic text data to a first version number. Then, multiple text incremental logs for editing the basic text data within a preset incremental time interval are obtained, each text incremental log including the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and the action timestamp. The version identifier of the edited basic text data is modified to a second version number, the second version number is numerically compared with the version identifiers of all current initial user terminals, and the initial user terminal with a version identifier less than the second version number is used as a candidate user terminal, and the text incremental log of the second version number is synchronized to each candidate user terminal to ensure real-time synchronization of all user terminals connected to the server. According to the number of the basic text data and the incremental action information, a data conflict comparison is performed on multiple text incremental logs to determine the first incremental log set and the second incremental log set. The first incremental log set is used to characterize the set of text incremental logs that need to be compared for data conflicts, and the second incremental log set is used to characterize the set of text incremental logs that do not need to be compared for data conflicts. According to the number and action timestamp of the initial user terminal, data playback is performed on each text incremental log in the first incremental log set to obtain the first text incremental data. Data playback is performed on each text incremental log in the second incremental log set to obtain the second text incremental data. Afterwards, the first text incremental data and the second text incremental data are merged to obtain the target text incremental data, and the target text incremental data is sent to each initial user terminal for data change. In the page presentation stage of the user terminal, it is separately marked with a background of different colors according to the different operating user terminals. The embodiment of the present application adopts a multi-mode approach, that is, including the processing of text incremental logs with and without data conflict comparisons, and adopts a multi-mode arbitration mechanism to avoid the disadvantages of the full addition of traditional collaborative systems. In scenarios where the same data, or even the same row, is modified concurrently, this embodiment of the application will arbitrate playback sequence based on the user action timestamp and the initial user ID, recording data changes in an incremental log format. This avoids the server-side issue of using large amounts of storage to record multiple versions of concurrent data, improving the efficiency of collaborative editing of text data. At the presentation layer, when replaying logs, this embodiment of the application can visually label the operation results of different users based on their UserID, preventing the user from being unable to avoid repeatedly modifying the same data.
[0158] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.
[0159] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0160] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.
[0161] Those skilled in the art will appreciate that all or some of the steps in the methods, systems, and functional modules / units in the devices disclosed above may be implemented as software, firmware, hardware, or appropriate combinations thereof.
[0162] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0163] It should be understood that in this application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0164] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0165] The units described above as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0166] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0167] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0168] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.
Claims
1. A text collaborative editing method, characterized in that: The method comprises: Establishing communication connections with a plurality of initial user terminals, and obtaining a query request for basic text data from each of the initial user terminals according to the communication connections; matching the basic text data from a pre-stored document database according to the query request, and setting a version identifier of the basic text data to a first version number; Acquire multiple text incremental logs for editing the basic text data within a preset incremental time interval, each of the text incremental logs including the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and an action timestamp; Performing data conflict comparison on the plurality of text incremental logs according to the numbers of the basic text data and the incremental action information to determine a first incremental log set and a second incremental log set; wherein the first incremental log set is used to represent a set of the text incremental logs that need to be compared for data conflicts, and the second incremental log set is used to represent a set of the text incremental logs that do not need to be compared for data conflicts; Replaying each text incremental log in the first incremental log set according to the number of the initial user terminal and the action timestamp to obtain first text incremental data; Replaying data of each of the text incremental logs in the second incremental log set to obtain second text incremental data; Merging the first text incremental data and the second text incremental data to obtain target text incremental data; The target text incremental data is sent to each of the initial user terminals for data change.
2. The method according to claim 1, characterized in that After acquiring a plurality of text incremental logs for editing the basic text data within a preset incremental time interval, the method further includes: Modify the version identifier of the edited basic text data to a second version number; Compare the second version number with the version identifiers of all current initial user terminals, and select the initial user terminal with a version identifier smaller than the second version number as a candidate user terminal; Synchronize the text incremental log of the second version number to each of the candidate user terminals.
3. The method according to claim 1 or 2, characterized in that The step of comparing the plurality of text incremental logs for data conflicts based on the numbers of the basic text data and the incremental action information to determine a first incremental log set and a second incremental log set includes: Determining the incremental operation line and data operation type of each text incremental log according to the incremental action information; performing a data conflict comparison on the plurality of text incremental logs according to the number of the basic text data, the incremental operation line, and the data operation type; and adding the text incremental log to the first incremental log set when the comparison result indicates that at least two text incremental logs use the same data operation type to edit the same incremental operation line; When the comparison result indicates that at least two of the text incremental logs use different data operation types to edit the same incremental operation line, or at least two of the text incremental logs use the same data operation type to edit different incremental operation lines, the text incremental log is added to the second incremental log set.
4. The method according to claim 3, characterized in that The data operation type includes a deletion operation type, a new addition operation type, and a modification operation type. The data is played back for each text incremental log in the first incremental log set according to the number of the initial user terminal and the action timestamp to obtain first text incremental data, including: If the data operation type of the text incremental log is the deletion operation type, performing a merge judgment on each of the text incremental logs according to the incremental operation row, and replaying data of each of the text incremental logs in the first incremental log set according to the judgment result to obtain first text incremental data; If the data operation type of the text incremental log is the new operation type, replaying data for each of the text incremental logs in the first incremental log set according to a predefined new data row rule, the number of the basic text data, the number of the initial user terminal, and the action timestamp to obtain the first text incremental data; If the data operation type of the text incremental log is the modification operation type, data is replayed for each text incremental log in the first incremental log set according to the pre-defined modification data row rules, the number of the basic text data, the number of the initial user terminal and the action timestamp to obtain the first text incremental data.
5. The method according to claim 4, characterized in that The step of merging and judging each of the text incremental logs according to the incremental operation row, and replaying data of each of the text incremental logs in the first incremental log set according to the judgment result to obtain first text incremental data includes: Acquire the text incremental log in the first incremental log set, in which the data operation type is the deletion operation type, to obtain a first incremental log subset; Performing a merge judgment on each of the text incremental logs in the first incremental log subset according to the incremental operation row; When the result of the judgment indicates that at least two of the text incremental logs delete the same incremental operation line, merging the text incremental logs that delete the same incremental operation line to obtain a merged incremental log, and adding the merged incremental log to the first incremental log subset; Data is replayed on each of the text incremental logs and each of the merged incremental logs in the first incremental log subset to obtain first text incremental data.
6. The method according to claim 4, characterized in that The step of replaying data of each text incremental log in the first incremental log set according to a predefined new data row rule, the number of the basic text data, the number of the initial user terminal, and the action timestamp to obtain the first text incremental data includes: Acquire the text incremental log in the first incremental log set, in which the data operation type is the newly added operation type, to obtain a second incremental log subset; Arrange the text incremental logs corresponding to the same incremental operation row in the second incremental log subset in descending order according to the action timestamp to obtain a first list; According to the number of the basic text data, the number of the initial user terminal and the first list, data of each text incremental log is played back to obtain the first text incremental data.
7. The method according to claim 4, characterized in that If the data operation type of the text incremental log is the modification operation type, replaying data for each text incremental log in the first incremental log set according to a predefined modification data row rule, the number of the basic text data, the number of the initial user terminal, and the action timestamp to obtain the first text incremental data includes: Acquire the text incremental log in the first incremental log set, in which the data operation type is the modification operation type, to obtain a third incremental log subset; Arrange the text incremental logs corresponding to the same incremental operation row in the third incremental log subset in ascending order according to the action timestamp to obtain a second list; According to the number of the basic text data, the number of the initial user terminal and the second list, data of each text incremental log is played back to obtain the first text incremental data.
8. A text collaborative editing device, characterized in that: The device comprises: a connection establishing module, configured to establish communication connections with a plurality of initial user terminals, and obtain a query request for basic text data from each of the initial user terminals according to the communication connections; a basic text matching module, configured to match the basic text data from a pre-stored document database according to the query request, and set a version identifier of the basic text data to a first version number; A text incremental log acquisition module, configured to acquire a plurality of text incremental logs for editing the basic text data within a preset incremental time interval, each of the text incremental logs including the number of the basic text data, the first version number, incremental action information, the number of the initial user terminal, and an action timestamp; A data conflict comparison module is configured to perform data conflict comparison on the plurality of text incremental logs according to the number of the basic text data and the incremental action information, and determine a first incremental log set and a second incremental log set; wherein the first incremental log set is used to represent a set of the text incremental logs that need to be compared for data conflicts, and the second incremental log set is used to represent a set of the text incremental logs that do not need to be compared for data conflicts; A first data playback module is configured to play back each text incremental log in the first incremental log set according to the number of the initial user terminal and the action timestamp to obtain first text incremental data; A second data playback module is configured to play back each of the text incremental logs in the second incremental log set to obtain second text incremental data; A data merging module, configured to merge the first text incremental data and the second text incremental data to obtain target text incremental data; The data change module is used to send the target text incremental data to each of the initial user terminals for data change.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Collaborative real-time editing method and device, electronic equipment and storage medium
CN109766093A
Multi-person online code editing method, device and equipment and readable storage medium
CN114564187A