CN115270731A - Collaborative editing method and device for mixed document - Google Patents

Collaborative editing method and device for mixed document Download PDF

Info

Publication number
CN115270731A
CN115270731A CN202210771349.XA CN202210771349A CN115270731A CN 115270731 A CN115270731 A CN 115270731A CN 202210771349 A CN202210771349 A CN 202210771349A CN 115270731 A CN115270731 A CN 115270731A
Authority
CN
China
Prior art keywords
document
collaborative
atomic operation
instance
extended
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210771349.XA
Other languages
Chinese (zh)
Inventor
马兴驰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Dingtalk China Information Technology Co Ltd
Original Assignee
Dingtalk China Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Dingtalk China Information Technology Co Ltd filed Critical Dingtalk China Information Technology Co Ltd
Priority to CN202210771349.XA priority Critical patent/CN115270731A/en
Publication of CN115270731A publication Critical patent/CN115270731A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/174Form filling; Merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Health & Medical Sciences (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Artificial Intelligence (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Document Processing Apparatus (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

One or more embodiments of the present specification provide a collaborative editing method for a mixed document, which is applied to a client for collaboratively editing the mixed document in a document collaborative editing system, where the mixed document includes document content objects corresponding to multiple types of document editors; the method comprises the following steps: creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; determining an original atomic operation corresponding to a collaborative editing instruction of a collaborative document instance in the mixed document; expanding the original atomic operation into an expanded atomic operation for the mixed document; and sending the extended atomic operation to a server of the document collaborative editing system so as to share the extended atomic operation to other clients for collaboratively editing the mixed document.

Description

Collaborative editing method and device for mixed document
Technical Field
One or more embodiments of the present disclosure relate to the field of collaborative editing, and in particular, to a collaborative editing method and apparatus for a mixed document.
Background
In real life, multiple people are often required to edit the same document. The traditional processing mode repeatedly transfers and updates the document among users, but the traditional processing mode has the problems of document loss, incorrect document version and the like, so that the working efficiency is low and the requirement cannot be met. In order to solve the defects, document collaborative editing is proposed.
In the related technology, the collaborative editing of the document realizes that multiple users edit a single document only containing one collaborative document model at the same time through a collaborative scheduling algorithm.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a collaborative editing method and apparatus for a hybrid document, which can implement collaborative editing of a hybrid document including document contents corresponding to a plurality of different editors.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of one or more embodiments of the present specification, a collaborative editing method for a mixed document is provided, which is applied to a client for collaboratively editing the mixed document in a document collaborative editing system, where the mixed document includes document content objects corresponding to multiple types of document editors; the method comprises the following steps:
creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are different;
determining an original atomic operation corresponding to a collaborative editing instruction of a collaborative document instance in the mixed document;
expanding the original atomic operation into an expanded atomic operation aiming at the mixed document, wherein the expanded atomic operation comprises an instance identifier of a collaborative document instance for generating the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance and the original atomic operation;
and sending the extended atomic operation to a server of the document collaborative editing system so as to share the extended atomic operation to other clients performing collaborative editing on the mixed document.
According to a second aspect of one or more embodiments of the present specification, a collaborative editing method for a mixed document is provided, which is applied to a client for collaboratively editing the mixed document in a collaborative editing system for a document, where the mixed document includes document content objects corresponding to multiple types of document editors; creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are different; the method comprises the following steps:
receiving an extended atomic operation aiming at the mixed document and sent by a server side of a document collaborative editing system; the extended atomic operation is obtained by extending an original atomic operation corresponding to a collaborative editing instruction of a collaborative document instance in the mixed document, and comprises an instance identifier of the collaborative document instance generating the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation;
analyzing the extended atomic operation based on the type information of the collaborative document model contained in the extended atomic operation;
and sending the atomic operation obtained by analysis to the collaborative document instance corresponding to the instance identifier contained in the extended atomic operation for processing.
According to a third aspect of one or more embodiments of the present specification, there is provided a collaborative editing apparatus for a mixed document, which is applied to a client for collaboratively editing the mixed document in a document collaborative editing system, where the mixed document includes document content objects corresponding to a plurality of types of document editors; the device comprises:
an instance creating unit, configured to create, for each document content object in the mixed document, a corresponding collaborative document instance, where the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are different;
an original atomic operation determining unit, configured to determine an original atomic operation corresponding to a collaborative editing instruction for a collaborative document instance in the mixed document;
an original atomic operation extension unit, configured to extend the original atomic operation to an extended atomic operation for the mixed document, where the extended atomic operation includes an instance identifier of a collaborative document instance that generates the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation;
and the extended atomic operation sending unit is used for sending the extended atomic operation to a server of the document collaborative editing system so as to share the extended atomic operation to other clients for collaboratively editing the mixed document.
According to a fourth aspect of one or more embodiments of the present specification, there is provided a collaborative editing apparatus for a mixed document, which is applied to a client for collaboratively editing the mixed document in a document collaborative editing system, wherein the mixed document includes document content objects corresponding to multiple types of document editors; creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are different; the device comprises:
the extension atomic operation receiving unit is used for receiving extension atomic operation aiming at the mixed document and sent by a server side of the document collaborative editing system; the extended atomic operation is obtained by extending an original atomic operation corresponding to a collaborative editing instruction of a collaborative document instance in the mixed document, and comprises an instance identifier of the collaborative document instance generating the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation;
the extended atomic operation analysis unit is used for analyzing the extended atomic operation based on the type information of the collaborative document model contained in the extended atomic operation;
and the atomic operation sending unit is used for sending the analyzed atomic operation to the collaborative document instance corresponding to the instance identifier contained in the extended atomic operation for processing.
According to a fifth aspect of one or more embodiments herein, there is provided an electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method according to the first aspect or the second aspect by executing the executable instructions.
According to a sixth aspect of one or more embodiments of the present specification, a computer-readable storage medium is presented, on which computer instructions are stored, which instructions, when executed by a processor, implement the steps of the method according to the first or second aspect.
As can be seen from the above technical solutions, in one or more embodiments of the present description, a client in a document collaborative editing system for collaboratively editing a mixed document creates the mixed document into a plurality of separate collaborative document instances, simulates a hybrid collaborative document model supporting a plurality of collaborative document models, so that the mixed document can adapt to a collaborative editing scenario, determines a protocol editing instruction initiated by a local user for the mixed document as an original atomic operation for the collaborative document instances in the mixed document, and expands the original atomic operation into an extended atomic operation, so that collaborative document instances corresponding to each original atomic operation can be distinguished and the collaborative document models of the collaborative document instances can be indicated, and then the extended atomic operation is sent to a server in the document collaborative editing system to be shared to other clients performing collaborative editing on the mixed document, so that other clients can accurately issue corresponding atomic operations to each collaborative document instance according to the received extended atomic operation, thereby completing the collaborative editing instruction initiated by the local user, and implementing collaborative editing on the mixed document.
Drawings
Fig. 1 is a schematic architecture diagram of a document collaborative editing system supporting collaborative editing of a hybrid document according to an exemplary embodiment.
Fig. 2 is a flowchart of a collaborative editing method applied to a mixed document of a client that collaboratively edits the mixed document in a document collaborative editing system according to an exemplary embodiment.
Fig. 3 is a schematic structural diagram of a client for collaborative editing of a hybrid document according to an exemplary embodiment.
Fig. 4 is a flowchart of a collaborative editing method applied to a mixed document of a client that collaboratively edits the mixed document in a document collaborative editing system according to an exemplary embodiment.
Fig. 5 is a schematic structural diagram of an apparatus according to an exemplary embodiment.
Fig. 6 is a block diagram of a collaborative editing apparatus for a blended document applied to a client that collaboratively edits the blended document in a document collaborative editing system according to an exemplary embodiment.
Fig. 7 is a block diagram of a collaborative editing apparatus for a mixed document, which is applied to a client that collaboratively edits the mixed document in a document collaborative editing system according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the methods may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
The existing document collaborative editing has realized that two or more persons edit the same single document only containing one collaborative document model at the same time, the editing operations of the two persons do not interfere with each other and can automatically solve conflicts, but because different collaborative editing models are adopted for different document types, for example, the atomic operation of a text editor is the addition and deletion modification of characters and paragraphs, the atomic operation of a form editor is the editing of cells and forms, and the collaborative editing model can only correspond to one collaborative document type, the existing collaborative editing technology cannot carry out collaborative editing on a mixed document containing contents corresponding to different collaborative editing models.
Therefore, in order to solve the problem, the present specification provides a collaborative editing scheme for a mixed document, which can implement collaborative editing for the mixed document and meet the requirement of everything interconnection.
To further illustrate one or more embodiments of the present disclosure, the following examples are provided:
fig. 1 is a schematic architecture diagram of a document collaborative editing system supporting collaborative editing of a hybrid document according to an exemplary embodiment. As shown in fig. 1, terminal device 11, terminal device 12, terminal device 13, and server 14 may be included.
The terminal devices 11, 12, and 13 are one type of electronic devices that can be used by the user, but the electronic devices used by the user are not limited thereto, and may include: a mobile phone, a tablet device, a notebook computer, a Personal Digital Assistants (PDAs), a wearable device (such as smart glasses, a smart watch, etc.), etc., which are not limited in this specification. In operation, a client program for document collaborative editing is run on the terminal device 11, 12, 13, so that the terminal device 11, 12, 13 is configured as a client of the document collaborative application. The client program may implement a partitioning function that partitions a blended document containing document content corresponding to a plurality of different document editors into a number of collaborative document instances, such that the client may segregate the blended document into a plurality of collaborative document instances corresponding to different collaborative document models based on the partitioning function. The client program may further implement an extension function of extending an original atomic operation for the collaborative document instance in the hybrid document to an extended atomic operation for the hybrid document, and a parsing function of parsing the extended atomic operation for the hybrid document to an atomic operation for the collaborative document instance in the hybrid document, so that the client may implement collaborative editing of the hybrid document based on the extension function and the parsing function.
The server 14 may be a physical server comprising a separate host, or the server 14 may be a virtual server hosted by a cluster of hosts. The server 14 runs a server program for collaborative editing of the document, so that the server 14 is configured as a server for collaborative editing of the document. The server program may be adapted to the client, for example, receive and store an extended atomic operation for the mixed document sent by the client installed on the terminal device 11, so as to send the extended atomic operation to the clients installed on the terminal device 12 and the terminal device 13, or send the stored extended atomic operation for the mixed document generated by the clients installed on the terminal device 12 and the terminal device 13 to the client installed on the terminal device 11, so that the clients in the document collaborative editing system can all execute collaborative editing instructions initiated by each user, thereby implementing collaborative editing of the mixed document.
The interaction between the terminal devices 11, 12, and 13 and the server 14 may include various types of wired or wireless interactions, which is not limited in this specification.
Fig. 2 is a flowchart of a collaborative editing method applied to a mixed document of a client that collaboratively edits the mixed document in a document collaborative editing system according to an exemplary embodiment. As shown in fig. 2, the method is applied to a client for performing collaborative editing on the mixed document in a document collaborative editing system, and may include the following steps:
step 202, respectively creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by the corresponding collaborative document instances are also different.
In the technical solution of this specification, document contents may be edited by corresponding document editors, different types of document contents adopt different document editors, for example, document contents of a text type may be edited by a text type editor (i.e., a text editor), document contents of a table type may be edited by a table type editor (i.e., a table editor), document contents of a brain type may be edited by a brain type editor (i.e., a brain editor), and document contents of a presentation slide type may be edited by a presentation slide type editor (i.e., a presentation slide editor); of course, this description does not limit the type of document editor.
When a document contains document contents corresponding to multiple types of document editors, the document may be referred to as a mixed document as described above, for example, a mixed document may contain at least two document contents of text, table, brain diagram, presentation slide, and the like at the same time. The document contents corresponding to the same type of document editor in a certain mixed document may be taken as one document content object, or may be further divided into a plurality of document content objects. For example, all the characters contained in a mixed document may be regarded as a document content object as a whole, or each segment, each line, or part of characters divided based on other ways may be regarded as a document content object; other types of document content, such as tables, brain maps, presentation slides, etc., may be similar, and one or more document content objects may be generated.
For each document content object contained in the hybrid document, a corresponding collaborative document instance may be created, respectively, such that there is a one-to-one correspondence between the document content object and the collaborative document instance. The collaborative document instance runs the contained collaborative document model, and can participate in collaborative editing based on the processing logic of the collaborative document model, so that the document content corresponding to the collaborative document instance is collaboratively edited. For any collaborative document instance, the adopted collaborative document model is related to the document content object corresponding to the collaborative document instance: if a certain document content object corresponds to the document content of the character type, creating a corresponding collaborative document instance aiming at the document content object, and then carrying out collaborative editing aiming at the document content of the character type by a collaborative document model adopted by the collaborative document instance; if the document content object corresponds to the document content of the form type, creating a corresponding collaborative document instance for the document content object, and then performing collaborative editing for the document content of the form type by using a collaborative document model adopted by the collaborative document instance; similarly, for document content objects corresponding to other types of document contents, such as a brain diagram, a presentation slide, and the like, the collaborative document model adopted by the correspondingly created collaborative document instance is used for collaborative editing of the corresponding types of document contents, which is not described herein any more.
Therefore, for a collaborative editing scene of a mixed document, the description may respectively create corresponding collaborative document instances for different document content objects in the mixed document, so that collaborative document models adopted by each collaborative document instance are independent and do not affect each other, and collaborative editing can be respectively performed for different types of document content objects in the mixed document.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a client for collaborative editing of a hybrid document according to an exemplary embodiment. As shown in fig. 3, the client for collaborative editing of the hybrid document may include a collaboration engine layer 31, a hybrid collaboration model layer 32, a collaborative document instance in the hybrid document 33, and an external storage 34, and may interact with the server 30. The collaborative engine layer 31 is configured to receive, send and process an extended atomic operation, the hybrid collaborative model layer 32 is configured to extend each original atomic operation generated by the collaborative document instance 33 in the hybrid document to an extended atomic operation, and parse the extended atomic operation sent by the collaborative engine layer 31 into an atomic operation, and the external storage 34 is configured to implement persistent storage.
In the collaborative document instance 33 in the hybrid document shown in fig. 3, it is possible that the collaborative document models adopted by each collaborative document instance are different, that is, one collaborative document model corresponds to one collaborative document instance, for example, in one text document, a table is embedded to obtain one hybrid document a, an original text document is used as a document content object, a collaborative document instance 1 adopting the text collaborative document model is correspondingly created, an embedded table is used as a document content object, and a collaborative document instance 2 adopting the table collaborative document model is correspondingly created; it is also possible that multiple collaborative document instances use the same collaborative document model, that is, one collaborative document model corresponds to multiple collaborative document instances, for example, in one text document, two tables (table 1 and table 2) are embedded to obtain a mixed document B, the original text document is used as a document content object, a collaborative document instance 1 using the text collaborative document model is correspondingly created, the embedded table 1 is used as a document content object, a collaborative document instance 2 using the table collaborative document model is correspondingly created, and the embedded table 2 is used as a document content object, another collaborative document instance 3 using the table collaborative document model is correspondingly created.
Step 204, determining an original atomic operation corresponding to the collaborative editing instruction of the collaborative document instance in the mixed document.
And the client acquires the collaborative editing instruction sent by the local user aiming at the mixed document through the man-machine interaction between the local users. For example, the client may provide a corresponding interactive interface to the local user, so that the local user may input the collaborative editing instruction through the interactive interface; of course, the above interaction process may also be completed in other manners such as voice, and this specification does not limit this.
After creating a plurality of collaborative document instances for each document content object in the mixed document, the client may locate the collaborative editing instruction issued by the local user for the mixed document to a certain collaborative document instance in the manner described above, and generate, by the collaborative document instance, the original atomic operation for the collaborative editing instance in the mixed document corresponding to the collaborative editing instruction for the mixed document.
Taking the architecture of the document collaborative editing system shown in figure 1 as an example,
the user a initiates a collaborative editing instruction for the mixed document B using the terminal device 11: the first cell of table 1 in the mixed document B is entered with "name", and the first two digits of the literal document in the mixed document B are modified to "collaborative editing". After receiving a collaborative editing instruction initiated by a user a, a client, which is loaded on a terminal device 11 and used for collaboratively editing a mixed document, determines an original atomic operation, which is generated by a collaborative document instance in the mixed document and corresponds to the collaborative editing instruction initiated by the user a, and includes:
original atomic operation a1 generated by collaborative document instance 2 in hybrid document B: inserting a "name" in the first cell;
original atomic operation a2 generated by collaborative document instance 1 in mixed document B: the first two characters are deleted and inserted into "collaborative editing".
The user B initiates a collaborative editing instruction for the mixed document B using the terminal device 12: the "mixed document" is input after the third character of the text document in the mixed document B. After receiving a collaborative editing instruction initiated by a user b, a client, which is loaded on a terminal device 12 and performs collaborative editing on a mixed document, determines an original atomic operation, which is generated by a collaborative document instance in the mixed document and corresponds to the collaborative editing instruction initiated by the user b, and includes:
original atomic operation B1 generated by collaborative document instance 1 in mixed document B: the third character is inserted followed by the "mixed document".
The user c initiates a collaborative editing instruction for the mixed document B using the terminal device 13: the first two digits of the character document in the mixed document B are deleted, and "gender" is entered in the first cell in table 2 in the mixed document B. After receiving a collaborative editing instruction initiated by a user c, a client, which is loaded on a terminal device 13 and performs collaborative editing on a mixed document, determines an original atomic operation, which is generated by a collaborative document instance in the mixed document and corresponds to the collaborative editing instruction initiated by the user c, and includes:
original atomic operation c1 generated by collaborative document instance 1 in hybrid document B: deleting the first two characters;
original atomic operation c2 generated by collaborative document instance 3 in hybrid document B: insert "gender" in the first cell.
Step 206, expanding the original atomic operation into an expanded atomic operation for the mixed document, where the expanded atomic operation includes an instance identifier of a collaborative document instance that generates the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation.
In the technical solution of this specification, each original atomic operation determined in step 204 is expanded, and an instance identifier of a collaborative document instance corresponding to the original atomic operation and type information of a collaborative document model adopted by the collaborative document instance are added, so that a collaborative document instance corresponding to each original atomic operation can be distinguished and a collaborative document model of the collaborative document instance is indicated, and thus no interference is generated to other collaborative document instances.
In addition, since the collaborative scheduling algorithm only corresponds to one collaborative document model, in order to complete collaborative editing of a mixed document without modifying the collaborative scheduling algorithm, the formats of extended atomic operations obtained by extending each original atomic operation should be unified, so that each extended atomic operation seems to belong to the same collaborative document model.
The example identifier of the collaborative document example corresponds to only one collaborative document example, and is a unique indication identifier of the collaborative example document, and the example identifier may be a string of randomly generated character strings, or may be composed of a mixed document name and an example number, which is not limited in this specification; the type information of the collaborative document model may indicate a collaborative document model adopted by the collaborative document instance, and the type information may be a name of the collaborative document model or a name of a document editor corresponding to the collaborative document model, which is not limited in this specification.
Continuing the example from the above example, the hybrid collaboration model layer 32 in the client loaded on each terminal device expands the original atomic operation, which is generated by each collaborative document instance in the hybrid document B and corresponds to the collaborative editing instruction initiated by the user, adds the instance identifier of the collaborative document instance corresponding to the original atomic operation and the type information of the collaborative document model adopted by the collaborative document instance, and obtains the expanded atomic operation for the hybrid document B.
The hybrid collaboration model layer 32 in the client loaded on the terminal device 11 expands the original atomic operations a1, a2, resulting in an expanded atomic operation a1: { instance identification: b2; type information of the collaborative document model: a table collaborative document model; original atomic operation: insert "name" in the first cell, and expand atomic operation a2 for blend document B: { example identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: the first two characters are deleted and inserted into the "collaborative edit".
The hybrid collaboration model layer 32 in the client loaded on the terminal device 12 expands the original atomic operation B1, resulting in an expanded atomic operation B1 for the hybrid document B: { example identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: a "mixed document" is inserted after the third character.
The mixing cooperation model layer 32 in the client loaded on the terminal device 13 expands the original atomic operations c1, c2, resulting in an expanded atomic operation c1 for the mixed document B: { example identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: deleting the first two digits of characters }, and performing an extended atomic operation c2 on the mixed document B: { instance identification: b3; type information of the collaborative document model: a table collaborative document model; original atomic operation: insert "gender" in the first cell.
And 208, sending the extended atomic operation to a server of the document collaborative editing system to be shared to other clients performing collaborative editing on the mixed document.
And sending the expanded atomic operations corresponding to the original atomic operations after the expansion is completed to a server side in the document collaborative editing system, so that other clients for collaboratively editing the mixed document can receive the expanded atomic operations corresponding to the collaborative editing instruction for the mixed document, which is initiated by a local user, through the server side, and then accurately send the corresponding atomic operations to each collaborative document instance according to the expanded atomic operations, thereby completing the collaborative editing instruction initiated by the local user and realizing the collaborative editing of the mixed document.
It should be noted that the client may send the extended atomic operation to the server every time an extended atomic operation is generated, may also aggregate a plurality of extended atomic operations generated within a preset time into an extended atomic operation sequence, and send the extended atomic operation sequence to the server, and may also send the generated extended atomic operation to the server when a preset number of extended atomic operations are generated, which does not limit the manner in which the client sends the extended atomic operation to the server.
Continuing the example from the above example, the collaboration engine layer 31 in the client installed on the terminal device 11 aggregates the generated extended atomic operations a1 and a2 into an extended atomic operation sequence, and sends the extended atomic operation sequence to the server 14, so that the server 14 sends the extended atomic operation generated by the local device to the terminal device 12 and the client installed on the terminal device 13 and performing collaborative editing on the mixed document B.
The collaboration engine layer 31 in the client loaded on the terminal device 12 sends the generated extended atomic operation B1 to the server 14, so that the server 14 sends the extended atomic operation generated by the local terminal device to the terminal device 11 and the client loaded on the terminal device 13 for collaboratively editing the mixed document B.
The collaboration engine layer 31 in the client loaded on the terminal device 13 aggregates the generated extended atomic operations c1 and c2 into an extended atomic operation sequence, and sends the extended atomic operation sequence to the server 14, so that the server 14 sends the extended atomic operation generated by the local terminal device to the terminal device 11 and the client loaded on the terminal device 12 for collaboratively editing the mixed document B.
In the above embodiment, in addition to instantiating the mixed document and simulating a mixed document model supporting multiple collaborative document models, the mixed document is enabled to adapt to a collaborative editing scene, and the original atomic operation corresponding to the collaborative editing instruction initiated by the user is further expanded into an expanded atomic operation, so that the collaborative document instance corresponding to each original atomic operation can be distinguished and the collaborative document model of the collaborative document instance can be indicated, so that other clients can accurately issue the corresponding atomic operation to each collaborative document instance according to the received expanded atomic operation, thereby completing the collaborative editing instruction initiated by the local user and implementing the collaborative editing of the mixed document.
Optionally, in order to ensure the integrity and transferability of the mixed document and distinguish the execution objects, in a case that the original mixed document (i.e., the mixed document that has not been edited by the user) has been persistently stored, after the collaborative document instance that generates the original atomic operation executes the original atomic operation, the original update data that is generated by the collaborative document instance and marked as being related to the collaborative document instance that generates the original atomic operation may be persistently stored; specifically, the original update data may be expanded into corresponding expanded update data including the original update data and an instance identifier of the collaborative document instance that generated the original update data, and the expanded update data may be persistently stored.
In the case that the original mixed document is not persistently stored, before the collaborative document instance of the mixed document performs the original atomic operation, the original mixed document may be persistently stored, the original update data generated by the collaborative document instance and marked as being related to the collaborative document instance generating the original atomic operation may be persistently stored, the original update data may be further extended to corresponding extended update data including the original update data and an instance identifier of the collaborative document instance generating the original update data, and the extended update data may be persistently stored. Of course, after the collaborative document instance of the hybrid document performs the original atomic operation, the updated hybrid document may be persistently stored, and the generated original update data and the instance identifier of the collaborative document instance generating the original update data may be recorded.
And expanding the original updating data generated by the collaborative document instance in the mixed document, so that the expanded updating data comprises the original updating data and the instance identifier of the collaborative document instance generating the original updating data, and conveniently selecting a serialization strategy or an deserialization strategy in a pertinence manner according to the instance identifier to finish the persistent storage of the data.
Continuing the example from the above example, after each collaborative document instance in the mixed document B on each terminal device executes a corresponding original atomic operation generated by a collaborative editing instruction initiated by a local user, each collaborative document instance generates original update data that can indicate a specific operation and an operation object, and the original update data is persistently stored. For example, after the collaborative document instance 1 in the mixed document B on the terminal device 11 executes the original atomic operation a2, the collaborative document instance 1 generates original update data which can indicate "modify the first two bits of the collaborative document instance 1 into 'collaborative editing'," and persistently stores the original update data; further, the original update data may be expanded into corresponding expanded update data including the original update data and the instance identifier of the collaborative document instance that generated the original update data, that is, "modify the first two bits of the collaborative document instance 1 to 'collaborative edit' -B1", and store the expanded update data persistently.
Fig. 4 is a flowchart of a collaborative editing method applied to a mixed document of a client that collaboratively edits the mixed document in a document collaborative editing system according to an exemplary embodiment. As shown in fig. 4, the method is applied to a client for performing collaborative editing on the mixed document in a document collaborative editing system, and as shown in fig. 3, the method may include the following steps:
step 402, receiving an extended atomic operation aiming at the mixed document, which is sent by a server of a document collaborative editing system; the extended atomic operation is obtained by extending an original atomic operation corresponding to a collaborative editing instruction for a collaborative document instance in the mixed document, and includes an instance identifier of the collaborative document instance that generates the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation.
In the technical solution of the present specification, as described above, a mixed document contains document content objects corresponding to a plurality of types of document editors; creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by the corresponding collaborative document instances are also different.
For the same mixed document, multiple users can initiate collaborative editing instructions on the mixed document on multiple terminal devices. In order to enable the local terminal device to synchronize the collaborative editing instruction initiated by other users on the mixed document, the client on the local terminal device may receive a remote operation sent by the server in the document collaborative editing system, that is, an extended atomic operation containing an instance identifier, type information of the collaborative document model, and an original atomic operation, which is generated by the other clients for the collaborative editing instruction initiated by the mixed document by the other users.
In the document collaborative editing system architecture shown in fig. 1, the collaboration engine layer 31 in the client loaded on the terminal device 11 can receive remote operations generated on other terminal devices sent by the server, that is, extended atomic operations generated by the client loaded on the terminal device 12 and the terminal device 13 for the mixed document B; the collaboration engine layer 31 in the client loaded on the terminal device 12 may receive the remote operations generated on other terminal devices sent by the server, that is, the extended atomic operations generated by the client loaded on the terminal device 11 and the terminal device 13 for the mixed document B; the collaboration engine layer 31 in the client loaded on the terminal device 13 may receive the remote operations generated on the other terminal devices sent by the server, that is, the extended atomic operations generated by the client loaded on the terminal device 11 and the terminal device 12 for the mixed document B.
Continuing with the embodiment shown in fig. 2, the client installed on the terminal device 11 may receive the extended atomic operation B1 for the hybrid document B sent by the server: { instance identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: insert "blend document" after the third character, for the extended atomic operation c1 of blend document B: { example identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: deleting the first two digits of characters }, and operating c2 on the expanded atom of the mixed document B: { instance identification: b3; type information of the collaborative document model: a table collaborative document model; original atomic operation: insert "gender" in the first cell.
The client loaded on the terminal device 12 may receive the extended atomic operation a1 for the mixed document B sent by the server: { instance identification: b2; type information of the collaborative document model: a table collaborative document model; original atomic operation: insert "name" in the first cell, for the extended atomic operation a2 of the mixed document B: { example identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: deleting the first two characters and inserting 'collaborative editing' }, aiming at the expanded atomic operation c1 of the mixed document B: { instance identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: deleting the first two digits of characters }, and performing an extended atomic operation c2 on the mixed document B: { example identification: b3; type information of the collaborative document model: a tabular collaborative document model; original atomic operation: insert "gender" in the first cell.
The client loaded on the terminal device 13 may receive the extended atomic operation a1 for the mixed document B sent by the server: { example identification: b2; type information of the collaborative document model: a table collaborative document model; original atomic operation: insert "name" in the first cell, for the extended atomic operation a2 of the mixed document B: { example identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: deleting and inserting the first two characters into 'collaborative editing' }, and performing an extended atomic operation B1 on the mixed document B: { instance identification: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: a "mixed document" is inserted after the third character.
Step 404, analyzing the extended atomic operation based on the type information of the collaborative document model included in the extended atomic operation.
And step 406, sending the analyzed atomic operation to a collaborative document instance corresponding to the instance identifier included in the extended atomic operation for processing.
The extended atomic operation comprises an instance identifier and type information of the collaborative document model, so that after the client receives the extended atomic operation sent by the server, for each extended atomic operation, a correct algorithm can be called according to the type information of the collaborative document model to analyze the extended atomic operation so as to obtain an accurate atomic operation, and the accurate atomic operation is sent to an accurate collaborative document instance to be processed according to the instance identifier without influencing other collaborative document instances, thereby completing data synchronization of the mixed document and realizing collaborative editing of the mixed document.
Optionally, in this specification, for an extended atomic operation that needs to perform operation transformation or operation inversion, after receiving the extended atomic operation, the extended atomic operation may be subjected to operation transformation or operation inversion, and then, based on type information of a collaborative document model included in the extended atomic operation, the extended atomic operation after the operation transformation or operation inversion is analyzed to obtain an atomic operation and send the atomic operation to a collaborative document instance corresponding to an instance identifier, so that each client that performs collaborative editing on the mixed document obtains a mixed document with consistent document content after performing each atomic operation.
If two or more users initiate mutually exclusive collaborative editing instructions for the same collaborative document instance, for each user, operation transformation needs to be performed on the received remote operation (i.e., the original extended operation generated by other clients and corresponding to the collaborative editing instruction initiated by the user). For example, there is a collaborative document instance "1246", user a enters character 3 after the second character using terminal device 1 to get string "12346", and user b enters character 5 after the third character using terminal device 2 to get string "123456". When a client loaded on the terminal device 1 receives a remote operation triggered by a user b, the operation is converted to obtain a converted operation: entering character 5 after the fourth character, i.e., entering character 5 after the fourth character of string "12346" results in string "123456'". When a client loaded on the terminal device 2 receives a remote operation triggered by a user a, the operation is converted to obtain a converted operation: entering character 3 after the second character, i.e., entering character 3 after the second character of string "12456" results in string "123456".
If two or more users initiate mutually exclusive collaborative editing instructions for the same collaborative document instance, for each user, operation inversion needs to be performed on the received remote operation (i.e., the original extended operation generated by other clients and corresponding to the collaborative editing instruction initiated by the user). For example, there is a collaborative document instance "1246", user a uses terminal device 1 to get string "12" after deleting the last two characters "46", and user b uses terminal device 2 to modify the last two characters to "34" to get string "1234". If the user a triggers the operation first, after a client loaded on the terminal device 1 receives a remote operation triggered by the user b, the remote operation is converted into null operation (null), no operation is executed on the character string, and finally the character string "12" is obtained; when the client loaded on the terminal device 2 receives the remote operation triggered by the user a, the local operation triggered by the user b is cancelled to obtain the character string "1246", and then the remote operation triggered by the user a is executed to finally obtain the character string "12". If the user b triggers the operation first, after receiving the remote operation triggered by the user b, the client loaded on the terminal device 1 cancels the local operation triggered by the user a to obtain a character string '1246', and then executes the remote operation triggered by the user b to finally obtain a character string '1234'; when the client installed on the terminal device 2 receives the remote operation triggered by the user a, the remote operation is converted into null operation (null), and no operation is performed on the character string, so that the character string "1234" is finally obtained.
Continuing the example following the above example, assuming that the user a initiates the collaborative editing instruction first, then the user b initiates the collaborative editing instruction, and finally the user c initiates the collaborative editing instruction, the order of generating the extended atomic operation is: an extended atomic operation a1, an extended atomic operation a2, an extended atomic operation b1, an extended atomic operation c1, and an extended atomic operation c2.
After the collaboration engine layer 31 in the client loaded on the terminal device 11 receives the extended atomic operation B1, the extended atomic operation c1, and the extended atomic operation c2 for the mixed document B sent by the server, because the extended atomic operation a2 and the extended atomic operation B1 are for the same collaborative document instance, the extended atomic operation B1 is subjected to operation transformation, that is, the extended atomic operation B1 is transformed into a { instance identifier: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: insert "mixed document" after the fifth character; since the extended atomic operation a2 and the extended atomic operation c1 are mutually exclusive and the extended atomic operation a2 and the extended atomic operation c1 are performed first, the extended atomic operation c1 is inverted in operation, that is, the extended atomic operation c1 is converted into a null operation (that is, no operation is performed). And then the extended atomic operation b1 after the operation extension, the extended atomic operation c1 after the operation inversion, and the extended atomic operation c2 are sent to the mixed cooperation model layer 32, so as to complete the analysis of the extended atomic operation. After receiving the extended atomic operation, the hybrid collaborative model layer 32 calls an algorithm of the text collaborative document model to analyze the extended atomic operation b1 according to the instance identifier and the type information of the collaborative document model included in the extended atomic operation b1 after the operation is extended, so as to obtain an atomic operation: inserting a 'mixed document' behind the fifth character, and sending the atomic operation to a collaborative document instance 1 in the mixed document B for processing; according to the instance identification contained in the extended atomic operation c1 after operation inversion and the type information of the collaborative document model, calling an algorithm of a character collaborative document model to analyze the extended atomic operation c1 to obtain an atomic operation: performing null operation, and sending the atomic operation to the collaborative document instance 1 in the mixed document B for processing; according to the instance identifier contained in the extended atomic operation c2 and the type information of the collaborative document model, calling an algorithm of the table collaborative document model to analyze the extended atomic operation c2, and obtaining an atomic operation: insert "gender" in the first cell and send the atomic operation to the collaborative document instance 3 in the blended document B for processing.
After the collaboration engine layer 31 in the client loaded on the terminal device 12 receives the extended atomic operation a1, the extended atomic operation a2, the extended atomic operation c1, and the extended atomic operation c2 for the mixed document B sent by the server, because the extended atomic operation a2 and the extended atomic operation B1 are for the same collaborative document instance, the extended atomic operation a2 is subjected to operation transformation, that is, the extended atomic operation a2 is transformed into a { instance identifier: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: deleting the first two characters and inserting a 'collaborative editing' }; since the extended atomic operation a2 and the extended atomic operation c1 are mutually exclusive and the extended atomic operation a2 and the extended atomic operation c1 are performed first, the extended atomic operation c1 is inverted, that is, the extended atomic operation c1 is converted into a null operation (that is, no operation is performed). And then the extended atomic operation a1, the extended atomic operation a2 after the operation transformation, the extended atomic operation c1 after the operation inversion, and the extended atomic operation c2 are sent to the mixed cooperation model layer 32, so as to complete the analysis of the extended atomic operation. After receiving the extended atomic operation, the hybrid collaborative model layer 32 invokes an algorithm of the table collaborative document model to analyze the extended atomic operation a1 according to the instance identifier included in the extended atomic operation a1 and the type information of the collaborative document model, so as to obtain an atomic operation: inserting a name in the first cell, and sending the atomic operation to a collaborative document instance 2 in the mixed document B for processing; according to the instance identification contained in the expanded atomic operation a2 after operation transformation and the type information of the collaborative document model, calling an algorithm of the text collaborative document model to analyze the expanded atomic operation a2 to obtain an atomic operation: deleting the first two characters and inserting the characters into 'collaborative editing'; according to the instance identification contained in the extended atomic operation c1 after operation inversion and the type information of the collaborative document model, calling an algorithm of the text collaborative document model to analyze the extended atomic operation c1 to obtain an atomic operation: performing null operation, and sending the atomic operation to the collaborative document instance 1 in the mixed document B for processing; according to the instance identifier contained in the extended atomic operation c2 and the type information of the collaborative document model, calling an algorithm of the table collaborative document model to analyze the extended atomic operation c2, and obtaining an atomic operation: insert "gender" in the first cell and send the atomic operation to the collaborative document instance 3 in the blended document B for processing.
The collaboration engine layer 31 in the client installed on the terminal device 13 receives the extended atomic operation a1, the extended atomic operation a2, and the extended atomic operation B1 for the mixed document B sent by the server, and since the extended atomic operation a2 and the extended atomic operation B1 are for the same collaborative document instance and the extended atomic operation a2 and the extended atomic operation B1 are first performed, the extended atomic operation B1 is subjected to operation transformation, that is, the extended atomic operation B1 is transformed into a { instance identifier: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: insert "mixed document" after the fifth character; because the extended atomic operation a2 and the extended atomic operation c1 are mutually exclusive and the extended atomic operation a2 is first compared with the extended atomic operation c1, the extended atomic operation a2 is inverted, that is, the extended atomic operation a2 is transformed into { instance id: b1; type information of the collaborative document model: a text collaborative document model; original atomic operation: and deleting the first two characters, and inserting the deleted first two characters into the 'collaborative editing' (namely, canceling the original atomic operation c1 and then executing the original atomic operation a 2). And then the extended atomic operation a1, the extended atomic operation a2 after the operation inversion, and the extended atomic operation b1 after the operation transformation are sent to the mixed coordination model layer 32, so as to complete the analysis of the extended atomic operation. After receiving the extended atomic operation, the hybrid collaborative model layer 32 invokes an algorithm of the table collaborative document model to analyze the extended atomic operation a1 according to the instance identifier included in the extended atomic operation a1 and the type information of the collaborative document model, so as to obtain an atomic operation: inserting a name into a first cell, and sending the atomic operation to a collaborative document instance 2 in the mixed document B for processing; according to the instance identification contained in the extended atomic operation a2 after operation inversion and the type information of the collaborative document model, calling an algorithm of the text collaborative document model to analyze the extended atomic operation a2 to obtain an atomic operation: canceling and deleting the first two characters, deleting the first two characters and inserting the first two characters into 'collaborative editing'; according to the instance identification contained in the extended atomic operation b1 after the operation transformation and the type information of the collaborative document model, calling an algorithm of the text collaborative document model to analyze the extended atomic operation c1 to obtain an atomic operation: insert "blend document" after the fifth character and send the atomic operation to the collaborative document instance 1 in blend document B for processing.
It should be noted that the server may send the extended atomic operation to the client every time the server receives one extended atomic operation, may also aggregate multiple extended atomic operations received within a preset time into an extended atomic operation sequence, and send the extended atomic operation sequence to the client, and may also send the received extended atomic operation to the client when receiving a preset number of extended atomic operations, which does not limit the manner in which the server sends the extended atomic operation to the client.
In the above embodiment, in addition to determining a plurality of extended atomic operations for the same collaborative document instance according to the instance identifiers included in the extended atomic operations, and further performing operation transformation or operation inversion on the extended atomic operations according to the sequence generated by the extended atomic operations to ensure that each client can obtain a mixed document with consistent document content, the method may also analyze the extended atomic operations according to the type information of the collaborative document model included in the extended atomic operations (the extended atomic operations subjected to the operation transformation or operation inversion, and the unprocessed extended atomic operations), so as to obtain accurate atomic operations, and further accurately issue the atomic operations obtained by analysis to the corresponding collaborative document instance according to the instance identifiers included in the extended atomic operations without affecting other collaborative document instances, complete data synchronization of the mixed document, and implement collaborative editing of the mixed document.
Optionally, when the client receives a plurality of extended atomic operations for the mixed document sent by the server of the document collaborative editing system, the plurality of extended atomic operations that are adjacent to each other and include the instance identifier of the same collaborative document instance are divided into the same group; the method introduced in the step 404 and the step 406 is adopted for a plurality of extended atomic operations in the same group to perform unified processing, so that the atomic operations do not need to be issued to the same collaborative document instance continuously for a plurality of times, and the efficiency of collaborative editing of the mixed document is improved.
Continuing with the above example, after the collaboration engine layer 31 in the client installed on the terminal device 11 receives the extended atomic operation B1, the extended atomic operation c1, and the extended atomic operation c2, since the extended atomic operation B1 and the extended atomic operation c1 are adjacent and both are directed to the collaborative document instance 1 in the mixed document B, the extended atomic operation B1 and the extended atomic operation c1 are divided into the same group.
After the collaboration engine layer 31 in the client installed on the terminal device 12 receives the extended atomic operation a1, the extended atomic operation a2, the extended atomic operation c1, and the extended atomic operation c2, since the extended atomic operation a2, the extended atomic operation B1, and the extended atomic operation c1 are adjacent and all target at the collaborative document instance 1 in the mixed document B, the extended atomic operation a2, the extended atomic operation B1, and the extended atomic operation c2 are divided into the same group.
After the collaboration engine layer 31 in the client installed on the terminal device 13 receives the extended atomic operation a1, the extended atomic operation a2, and the extended atomic operation B1, because the extended atomic operation a2 and the extended atomic operation B1 are adjacent and both aim at the collaborative document instance 1 in the mixed document B, the extended atomic operation a2 and the extended atomic operation B1 are divided into the same group.
Optionally, in this specification, in order to ensure the integrity and transferability of the mixed document and distinguish the execution objects, in the case that the original mixed document (i.e., the mixed document that has not been edited by the user) has been persistently stored, after the collaborative document instance corresponding to the extended atomic operation performs the atomic operation obtained by parsing, the original update data that is generated by the collaborative document instance and is marked as being related to the collaborative document instance that performs the atomic operation obtained by parsing may be persistently stored; specifically, the original update data may be expanded into corresponding expanded update data including the original update data and an instance identifier of the collaborative document instance that generated the original update data, and the expanded update data may be persistently stored.
In the case that the original mixed document is not persistently stored, before the collaborative document instance of the mixed document performs the original atomic operation, the original mixed document may be persistently stored, the original update data generated by the collaborative document instance and marked as being related to the collaborative document instance generating the original atomic operation may be persistently stored, the original update data may be further extended to corresponding extended update data including the original update data and an instance identifier of the collaborative document instance generating the original update data, and the extended update data may be persistently stored. Of course, after the collaborative document instance of the hybrid document performs the original atomic operation, the updated hybrid document may be persistently stored, and the generated original update data and the instance identifier of the collaborative document instance generating the original update data may be recorded.
Continuing the example from the above example, after each collaborative document instance in the mixed document B on each terminal device executes an original atomic operation corresponding to the received extended atomic operation generated by another client, each collaborative document instance generates original update data that can indicate a specific operation and an operation object, and the original update data is persistently stored. For example, after the collaborative document instance 1 in the hybrid document B on the terminal device 11 executes the original atomic operation B1, the collaborative document instance 1 generates original update data indicating that "the hybrid document" is inserted after the fifth character of the collaborative document instance 1, and the original update data is persistently stored; further, the original update data may be expanded into corresponding expanded update data containing the original update data and the instance identifier of the collaborative document instance that generated the original update data, i.e., "insert ' mixed document ' -B1 ' after the fifth bit character of collaborative document instance 1", and store the expanded update data persistently.
And expanding the original updating data generated by the collaborative document instance in the mixed document, so that the expanded updating data comprises the original updating data and the instance identifier of the collaborative document instance generating the original updating data, and conveniently selecting a serialization strategy or an deserialization strategy in a pertinence manner according to the instance identifier to finish the persistent storage of the data.
FIG. 5 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to fig. 5, at the hardware level, the apparatus includes a processor 502, an internal bus 504, a network interface 506, a memory 508, and a nonvolatile memory 510, but may include hardware required for other functions. One or more embodiments of the present description may be implemented in software, such as by processor 502 reading corresponding computer programs from non-volatile storage 510 into memory 508 and then running. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 6, the collaborative editing apparatus for mixed documents may be applied to the device shown in fig. 5 to implement the technical solution of the present specification. The collaborative editing apparatus for a mixed document is applied to a client for collaboratively editing the mixed document in a document collaborative editing system, and may include:
an instance creating unit 601, configured to create, for each document content object in the mixed document, a corresponding collaborative document instance, where the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by the corresponding collaborative document instances are also different.
An original atomic operation determining unit 602, configured to determine an original atomic operation corresponding to the collaborative editing instruction for the collaborative document instance in the mixed document.
An original atomic operation expanding unit 603, configured to expand the original atomic operation into an expanded atomic operation for the mixed document, where the expanded atomic operation includes an instance identifier of a collaborative document instance that generates the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation.
An extended atomic operation sending unit 604, configured to send the extended atomic operation to a server of the document collaborative editing system, so as to share the extended atomic operation to other clients that perform collaborative editing on the mixed document.
Optionally, the method further includes:
a first persistence unit 605, configured to perform persistent storage on original update data generated by the collaborative document instance after the collaborative document instance that generates the original atomic operation executes the original atomic operation;
wherein the persisted original update data is marked as relevant to the collaborative document instance that produced the original atomic operation.
Optionally, the first persistent unit 605 is specifically configured to:
expanding the original updating data into corresponding expanded updating data, wherein the expanded updating data comprises the original updating data and an instance identifier of a collaborative document instance generating the original updating data;
and performing persistent storage on the extension updating data.
Referring to fig. 7, the collaborative editing apparatus for mixing documents may be applied to the device shown in fig. 5 to implement the technical solution of the present specification. The collaborative editing apparatus for a mixed document is applied to a client for collaboratively editing the mixed document in a document collaborative editing system, and may include:
an extended atomic operation receiving unit 701, configured to receive an extended atomic operation for the mixed document, where the extended atomic operation is sent by a server of the document collaborative editing system; the extended atomic operation is obtained by extending an original atomic operation corresponding to a collaborative editing instruction for a collaborative document instance in the mixed document, and includes an instance identifier of the collaborative document instance generating the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation.
An extended atomic operation parsing unit 702, configured to parse the extended atomic operation based on type information of the collaborative document model included in the extended atomic operation.
And an atomic operation sending unit 703, configured to send the analyzed atomic operation to a collaborative document instance corresponding to the instance identifier included in the extended atomic operation for processing.
Optionally, the method further includes:
an extended atomic operation processing unit 704, configured to perform operation transformation or operation inversion on the extended atomic operation after receiving the extended atomic operation; analyzing the extended atomic operation based on the type information of the collaborative document model included in the extended atomic operation, including:
and analyzing the extended atomic operation after the operation transformation or the operation inversion is finished based on the type information of the collaborative document model contained in the extended atomic operation.
Optionally, the method further includes:
an extended atomic operation grouping unit 705, configured to, when receiving multiple extended atomic operations for the mixed document sent by a server of the document collaborative editing system, divide multiple extended atomic operations that are adjacent and include an instance identifier of the same collaborative document instance into the same group; and uniformly processing the plurality of extended atomic operations in the same group.
Optionally, the method further includes:
a second persistence unit 706, configured to perform persistent storage on original update data generated by the collaborative document instance after the atomic operation obtained by parsing is executed on the collaborative document instance corresponding to the extended atomic operation; wherein the persisted raw update data is marked as relevant to a collaborative document instance that performed the parsed atomic operation.
Optionally, the second persistence unit 706 is specifically configured to:
expanding the original updating data into corresponding expanded updating data, wherein the expanded updating data comprises the original updating data and an instance identifier of a collaborative document instance generating the original updating data;
and performing persistent storage on the extension updating data.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, laptop, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium, that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising the element.
The foregoing description of specific embodiments has been presented for purposes of illustration and description. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims can be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of one or more embodiments herein. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (12)

1. A collaborative editing method of a mixed document is characterized in that the collaborative editing method is applied to a client side which carries out collaborative editing on the mixed document in a document collaborative editing system, and the mixed document comprises document content objects corresponding to a plurality of types of document editors; the method comprises the following steps:
creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are different;
determining an original atomic operation corresponding to a collaborative editing instruction of a collaborative document instance in the mixed document;
expanding the original atomic operation into an expanded atomic operation aiming at the mixed document, wherein the expanded atomic operation comprises an instance identifier of a collaborative document instance generating the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance and the original atomic operation;
and sending the extended atomic operation to a server of the document collaborative editing system so as to share the extended atomic operation to other clients for collaboratively editing the mixed document.
2. The method of claim 1, further comprising:
after the original atomic operation is executed by the collaborative document instance generating the original atomic operation, the original updating data generated by the collaborative document instance is stored in a persistent mode;
wherein the persisted original update data is marked as relevant to the collaborative document instance that produced the original atomic operation.
3. The method of claim 2, wherein the persisting the hybrid document comprises:
expanding the original updating data into corresponding expanded updating data, wherein the expanded updating data comprises the original updating data and an instance identifier of a collaborative document instance for generating the original updating data;
and performing persistent storage on the extension updating data.
4. A collaborative editing method of a mixed document is characterized in that the collaborative editing method is applied to a client side which carries out collaborative editing on the mixed document in a document collaborative editing system, and the mixed document comprises document content objects corresponding to a plurality of types of document editors; creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are different; the method comprises the following steps:
receiving an extended atomic operation aiming at the mixed document and sent by a server side of the document collaborative editing system; the extended atomic operation is obtained by extending an original atomic operation corresponding to a collaborative editing instruction of a collaborative document instance in the mixed document, and includes an instance identifier of the collaborative document instance generating the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation;
analyzing the extended atomic operation based on the type information of the collaborative document model contained in the extended atomic operation;
and sending the atomic operation obtained by analysis to the collaborative document instance corresponding to the instance identifier contained in the extended atomic operation for processing.
5. The method of claim 4,
the method further comprises the following steps: after the extended atomic operation is received, performing operation transformation or operation inversion on the extended atomic operation;
analyzing the extended atomic operation based on the type information of the collaborative document model included in the extended atomic operation, including:
and analyzing the extended atomic operation after the operation transformation or the operation inversion is finished based on the type information of the collaborative document model contained in the extended atomic operation.
6. The method of claim 4, further comprising:
under the condition that a plurality of extension atomic operations aiming at the mixed document and sent by a server side of a document collaborative editing system are received, dividing a plurality of extension atomic operations which are adjacent and contain instance identifications of the same collaborative document instance into the same group;
and uniformly processing the plurality of extended atomic operations in the same group.
7. The method of claim 4, further comprising:
after the collaborative document instance corresponding to the extended atomic operation executes the atomic operation obtained by analysis, the original update data generated by the collaborative document instance is subjected to persistent storage;
wherein the persisted raw update data is marked as relevant to the collaborative document instance that performed the parsed atomic operation.
8. The method of claim 7, wherein the persisting the raw update data generated by the collaborative document instance comprises:
expanding the original updating data into corresponding expanded updating data, wherein the expanded updating data comprises the original updating data and an instance identifier of a collaborative document instance generating the original updating data;
and performing persistent storage on the extension updating data.
9. The collaborative editing device of the mixed document is characterized by being applied to a client side which carries out collaborative editing on the mixed document in a document collaborative editing system, wherein the mixed document comprises document content objects corresponding to a plurality of types of document editors; the device comprises:
an instance creating unit, configured to create, for each document content object in the mixed document, a corresponding collaborative document instance, where the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are also different;
an original atomic operation determining unit, configured to determine an original atomic operation corresponding to a collaborative editing instruction for a collaborative document instance in the mixed document;
an original atomic operation extension unit, configured to extend the original atomic operation to an extended atomic operation for the mixed document, where the extended atomic operation includes an instance identifier of a collaborative document instance that generates the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation;
and the extended atomic operation sending unit is used for sending the extended atomic operation to a server of the document collaborative editing system so as to share the extended atomic operation to other clients for collaboratively editing the mixed document.
10. The collaborative editing device of the mixed document is characterized by being applied to a client side which carries out collaborative editing on the mixed document in a document collaborative editing system, wherein the mixed document comprises document content objects corresponding to a plurality of types of document editors; creating a corresponding collaborative document instance for each document content object in the mixed document, wherein the collaborative document instance participates in collaborative editing through a collaborative document model; for a plurality of document content objects adopting different types of document editors, the collaborative document models adopted by corresponding collaborative document instances are different; the device comprises:
the extension atomic operation receiving unit is used for receiving an extension atomic operation aiming at the mixed document and sent by a server side of the document collaborative editing system; the extended atomic operation is obtained by extending an original atomic operation corresponding to a collaborative editing instruction of a collaborative document instance in the mixed document, and includes an instance identifier of the collaborative document instance generating the original atomic operation, type information of a collaborative document model adopted by the collaborative document instance, and the original atomic operation;
the extended atomic operation analysis unit is used for analyzing the extended atomic operation based on the type information of the collaborative document model contained in the extended atomic operation;
and the atomic operation sending unit is used for sending the analyzed atomic operation to the collaborative document instance corresponding to the instance identifier contained in the extended atomic operation for processing.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any of claims 1-3 or 4-8 by executing the executable instructions.
12. A computer-readable storage medium having stored thereon computer instructions, which when executed by a processor, perform the steps of the method of any one of claims 1-3 or 4-8.
CN202210771349.XA 2022-06-30 2022-06-30 Collaborative editing method and device for mixed document Pending CN115270731A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210771349.XA CN115270731A (en) 2022-06-30 2022-06-30 Collaborative editing method and device for mixed document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210771349.XA CN115270731A (en) 2022-06-30 2022-06-30 Collaborative editing method and device for mixed document

Publications (1)

Publication Number Publication Date
CN115270731A true CN115270731A (en) 2022-11-01

Family

ID=83762835

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210771349.XA Pending CN115270731A (en) 2022-06-30 2022-06-30 Collaborative editing method and device for mixed document

Country Status (1)

Country Link
CN (1) CN115270731A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117422054A (en) * 2023-12-18 2024-01-19 浙江大学 Data collaborative management method and device supporting multi-task multi-document production

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117422054A (en) * 2023-12-18 2024-01-19 浙江大学 Data collaborative management method and device supporting multi-task multi-document production
CN117422054B (en) * 2023-12-18 2024-04-09 浙江大学 Data collaborative management method and device supporting multi-task multi-document production

Similar Documents

Publication Publication Date Title
CN110334152B (en) Data synchronization method and device and server
US10255108B2 (en) Parallel execution of blockchain transactions
EP2283439B1 (en) Document synchronization over stateless protocols
CN107315764B (en) Method and system for updating non-relational database associated data
CN111143368B (en) Relational database data comparison method and system
CN110119473A (en) A kind of construction method and device of file destination knowledge mapping
US10812568B2 (en) Graphical user interface facilitating uploading of electronic documents to shared storage
US20180157676A1 (en) Managing activity data related to collaboratively edited electronic documents
CN112905441A (en) Test case generation method, test method, device and equipment
CN113177095A (en) Enterprise knowledge management method, system, electronic equipment and storage medium
US10872085B2 (en) Recording lineage in query optimization
CN115270731A (en) Collaborative editing method and device for mixed document
CN112860264B (en) Method and device for reconstructing abstract syntax tree
CN116778124A (en) Three-dimensional scene editing method, system, equipment and storage medium
CN111125216B (en) Method and device for importing data into Phoenix
CN110989999A (en) Code generation method and device, electronic equipment and medium
CN116304079A (en) Timing-based profile data management method, apparatus, and readable storage medium
CN116431601A (en) Data table creation method and device
CN105183491A (en) Cross-platform desktop GIS and starting method thereof
CN110555070A (en) Method and apparatus for outputting information
US10545742B2 (en) Annotation-driven framework for generating state machine updates
CN117827802B (en) Hbase-based data processing system, method and device
CN111414162B (en) Data processing method, device and equipment thereof
CN110865809B (en) Method and device for importing data into illusion engine
CN116821143A (en) Data updating method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination