CN114357949A - Text collaborative editing method and related device, electronic equipment and storage medium - Google Patents

Text collaborative editing method and related device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114357949A
CN114357949A CN202111539208.7A CN202111539208A CN114357949A CN 114357949 A CN114357949 A CN 114357949A CN 202111539208 A CN202111539208 A CN 202111539208A CN 114357949 A CN114357949 A CN 114357949A
Authority
CN
China
Prior art keywords
text
data
local
content
modification
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
CN202111539208.7A
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.)
Anhui Tingjian Technology Co ltd
Original Assignee
Anhui Tingjian 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 Anhui Tingjian Technology Co ltd filed Critical Anhui Tingjian Technology Co ltd
Priority to CN202111539208.7A priority Critical patent/CN114357949A/en
Publication of CN114357949A publication Critical patent/CN114357949A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Document Processing Apparatus (AREA)

Abstract

The application discloses a text collaborative editing method, a related device, electronic equipment and a storage medium, wherein the text collaborative editing method comprises the following steps: the method comprises the steps that a local terminal obtains local terminal modification data and a plurality of other terminal modification data, wherein the local terminal modification data and the other terminal modification data are generated by modifying basic text data, and the basic text data comprise a plurality of text units; integrating the modified content of the same text unit in the local modified data and the plurality of other modified data to obtain target modified content corresponding to the text unit; updating the text unit in the base text data based on the target modified content of the text unit. By the scheme, the text collaborative editing can be realized at the local terminal.

Description

Text collaborative editing method and related device, electronic equipment and storage medium
Technical Field
The present application relates to the field of information processing technologies, and in particular, to a text collaborative editing method, a related apparatus, an electronic device, and a storage medium.
Background
With the development of communication technology, text transmission can be realized through the internet, so that other users can acquire a text edited by a local user, but when a plurality of users edit a document at the same time, each user can only learn about the modification of the user, and cannot update the text according to the editing of the text by other users. In view of this, how to implement text collaborative editing at the home terminal becomes an urgent problem to be solved.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a text collaborative editing method, a related device, an electronic device and a storage medium, which can realize text collaborative editing at a local terminal.
In order to solve the above technical problem, a first aspect of the present application provides a text collaborative editing method, including: the method comprises the steps that a local terminal obtains local terminal modification data and a plurality of other terminal modification data, wherein the local terminal modification data and the other terminal modification data are generated by modifying basic text data, and the basic text data comprise a plurality of text units; integrating the modified content of the same text unit in the local modified data and the plurality of other modified data to obtain target modified content corresponding to the text unit; updating the text unit in the base text data based on the target modified content of the text unit.
In order to solve the above technical problem, a second aspect of the present application provides a text collaborative editing apparatus, including: the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring local terminal modification data and a plurality of other terminal modification data, the local terminal modification data and the other terminal modification data are generated by modifying basic text data, and the basic text data comprises a plurality of text units; the integration module is used for integrating the modified content of the same text unit in the local modified data and the plurality of other modified data to obtain target modified content corresponding to the text unit; and the updating module is used for updating the text unit in the basic text data based on the target modification content of the text unit.
In order to solve the above technical problem, a third aspect of the present application provides an electronic device, which includes a memory and a processor coupled to each other, where the processor is configured to execute program instructions stored in the memory to implement the text collaborative editing method in the first aspect.
In order to solve the above technical problem, a fourth aspect of the present application provides a computer-readable storage medium storing program instructions executable by a processor, the program instructions being configured to implement the text collaborative editing method in the first aspect.
According to the scheme, the local terminal modification data and the other terminal modification data are generated by modifying basic text data, namely the basis of all the modification data is the same, so that after the local terminal acquires the local terminal modification data and a plurality of other terminal modification data, the local terminal modification data and the plurality of other terminal modification data integrate the modification content of the same text unit in the local terminal modification data and the plurality of other terminal modification data, and the target modification content corresponding to the text unit can be obtained, and finally the text unit in the basic text data is updated based on the target modification content of the text unit, so that the modification data of all the terminals are integrated on the basis of the basic text data, and further the text collaborative editing is realized at the local terminal.
Drawings
FIG. 1 is a schematic flowchart of an embodiment of a collaborative editing method for text according to the present application;
FIG. 2 is a schematic flowchart of another embodiment of a collaborative editing method for text according to the present application;
FIG. 3 is a schematic diagram of a framework of an embodiment of a collaborative editing apparatus for text according to the present application;
FIG. 4 is a block diagram of an embodiment of an electronic device of the present application;
FIG. 5 is a block diagram of an embodiment of a computer-readable storage medium of the present application.
Detailed Description
The following describes in detail the embodiments of the present application with reference to the drawings attached hereto.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as particular system structures, interfaces, techniques, etc. in order to provide a thorough understanding of the present application.
The terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship. Further, the term "plurality" herein means two or more than two.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a text collaborative editing method according to an embodiment of the present application. Specifically, the method may include the steps of:
step S11: the local terminal acquires the local terminal modification data and a plurality of other terminal modification data.
The local terminal modification data and the other terminal modification data are generated by modifying the basic text data, that is, modification objects of the local terminal modification data and the other terminal modification data are the same. The basic text data can be obtained by text conversion of the conference recording audio and is cached at the local end and the other end. For example, in an implementation scenario, a local user updates local basic text data stored locally at a local terminal to obtain local modified data, and a plurality of other users update local basic text data stored locally at other terminals to obtain other modified data, where the local basic text data stored locally at the local terminal and the local basic text data stored locally at other terminals are the same and are obtained by performing text conversion on conference recording audio in the same conference. The basic text data includes a plurality of text units, which may be text components such as paragraphs and sentences, and are not limited herein.
In a disclosed embodiment, when obtaining the local modification data, the local text data and the basic text data may be obtained, where the local text data is obtained by modifying the basic text data by the local user, and then the text unit of the local text data and the text unit of the basic text data are compared to determine the modification content of each text unit, and the local modification data may be generated based on the modification content of each text unit, so that the local modification data is a result of comparing the local text data and the basic text data, and reflects the modification content of the local user on the basic text data. Similarly, the other end modification data is obtained by obtaining other end text data and basic text data for the other end, the other end text data is obtained by modifying the basic text data by the other end user, then the text units of the other end text data and the text units of the basic text data are compared, the modification content of each text unit is determined, the other end modification data can be generated based on the modification content of each text unit, and then the local end receives a plurality of other end modification data sent by the server, wherein the other end modification data is sent to the server corresponding to the other end.
The local terminal and/or the other terminal may be a communication terminal such as a smart phone, a Personal Computer (PC), a Personal Digital Assistant (PDA), or a tablet Computer, and is not limited herein.
Step S12: and integrating the modified content of the same text unit in the local terminal modified data and the modified data of the plurality of other terminals to obtain the target modified content corresponding to the text unit.
The local terminal modification data and the other terminal modification data are generated by modifying the basic text data, and the basic text data comprises a plurality of text units, so that if the local terminal modification data and the other terminal modification data modify the same text unit, the local terminal can integrate the modification content of the same text unit in the local terminal modification data and the plurality of other terminal modification data, and the target modification content corresponding to the text unit is obtained. When the cooperative text editing is realized through an OT (operation transformation) algorithm, a local editor needs to be modified, the local editor needs to record operation information of a local user by monitoring the editor, the operation information comprises a position of a modified content corresponding to a text, a modified type (deleted or added), a length of the deleted content, specific content added and the like, then each end of the local and other ends sends modified data to a server, and the server converts the operation information, so that the requirement on the local editor is high, the editor needs to perform a lot of monitoring processing, if a multi-user cooperative editing function is added, other functions existing at the local end need to be modified in a large amount, and therefore, when the local and other ends modify the same text, the local and other ends need to send the modified content of the same text unit to the server, the server integrates the modified content, the scheme can realize the integration of the modified content of the same text unit at the home terminal, has low functional requirements on the home terminal editor, does not need to acquire the modified content by monitoring the editor, and has small influence on the original function.
Step S13: the text units in the base text data are updated based on the target modified content of the text units.
And after the target modification content of the text unit is acquired, the text unit in the basic text data can be updated. And when the local terminal modifies the same text unit with the local terminal modification data and the other terminal modification data, determining that modification conflict exists, integrating the modification content of the local terminal modification data and the other terminal modification data for the same text unit to obtain target modification content corresponding to the text unit, and replacing the content of the text unit with the target modification content, so that updating of the basic text data is realized, and the updated text unit can be displayed on a local terminal interface.
According to the scheme, the local terminal modification data and the other terminal modification data are generated by modifying the basic text data, namely the basis of all the modification data is the same, so that after the local terminal acquires the local terminal modification data and a plurality of other terminal modification data, the local terminal modification data and the plurality of other terminal modification data integrate the modification content of the same text unit in the local terminal modification data and the plurality of other terminal modification data, the target modification content corresponding to the text unit can be obtained, and finally the text unit in the basic text data is updated based on the target modification content of the text unit, so that the modification data of all the terminals are integrated on the basis of the basic text data, and further the text collaborative editing is realized at the local terminal.
To further clearly explain how to obtain the local modification data, please refer to fig. 2, and fig. 2 is a schematic flowchart of another embodiment of the text collaborative editing method according to the present application. Specifically, the method may include the steps of:
step S21: and acquiring local text data and basic text data.
The local text data is obtained by modifying the basic text data by the local user. The modification of the basic text data by the home terminal user can be no modification of the text unit, deletion of the text unit, modification of the text unit and new addition of the text unit. The local text data and the basic text data are respectively structured data obtained by carrying out structured processing on the local interface text and the basic text, so that the text data is converted into a structure form which can be recognized by the local, and the local can conveniently recognize and compare the texts. For example, the basic text data is cached data stored locally at the home terminal, and the home terminal text data is a home terminal interface text displayed on the home terminal interface, so that before the home terminal user modifies the home terminal interface text on the home terminal interface, the home terminal text data and the basic text data are the same, and after the home terminal user modifies the home terminal interface text on the home terminal interface, the home terminal text data and the basic text data are different, at this time, the basic text data remains unchanged, and the home terminal text data is obtained by searching all text units of the home terminal interface text displayed on the home terminal interface, and the home terminal text data is a result of the home terminal user updating the home terminal interface text in real time, so that the home terminal text data and the basic text data are obtained to determine the modified content of the home terminal user in the following.
Step S22: and comparing the text unit of the local text data with the text unit of the basic text data to obtain the modification type of each text unit.
The modification type includes at least one of: content is unmodified, deleted, content is modified and added. In the modification type, the content is not modified, and the text content of the text unit in the local text data and the text unit in the basic text data are the same; deleting the text units which indicate that the local text data does not exist and the basic text data is deleted, wherein the content is modified to indicate that the text content of the text units in the local text data and the basic text data is the same; the addition of text units indicating that the text data of the home terminal is present but not the basic text data is increased. The method for comparing the text unit of the local text data with the text unit of the basic text data can be any existing method, and whether the text content of the text unit is modified or not can be determined.
In order to facilitate comparison of text units, each text unit of text data such as basic text data, local text data or other end text data generates an identifier for uniquely representing the text unit based on the same identifier generation method, and uniformity and uniqueness of identifier generation are guaranteed. For example, it may include generating an identification of each text unit in the form of MD5(Message-Digest Algorithm 5). In a disclosed embodiment, when the text unit of the local text data and the text unit of the basic text data are compared to obtain the modification type of each text unit, the text units with the same identification in the local text data and the basic text data can be searched, if the text contents of the text units with the same identification are the same, the modification type of the text units is determined to be unmodified, and if the text contents of the text units with the same identification are different, the modification type of the text units is determined to be modified; if the identification of the text unit in the text data of the local terminal does not exist in the basic text data, determining that the modification type of the text unit is newly added; and if the identification of the text unit in the basic text data does not exist in the text data of the home terminal interface, determining that the modification type of the text unit is deletion. Therefore, compared with word-by-word comparison, the text unit is used as comparison data, the text content comparison frequency and the transmission data size can be reduced, and the modification type of the text unit can be determined simply and quickly by combining the comparison of the identification and the text content.
In an actual scene, basic text data is obtained by performing text conversion on a conference recording audio and is cached at the local terminal and the other terminal, the basic text data is composed of a plurality of text units, and the text units are paragraphs, so that when the basic text data is obtained, a local terminal interface text displayed on a local terminal interface is read, and the paragraphs are used as the minimum unit for performing data storage to form basic text data, so that the basic text data is suitable for a local terminal interface text which just enters a conference and already exists; or the section is used as a minimum unit to store the identification content of the conference recording audio to form basic text data, and the method is suitable for updating the basic text data in real time in the conference process. When the local terminal and a plurality of other terminals need to segment the conference recording audio for text conversion, the identifier of each paragraph is generated in an MD5 mode, and because the content of the same conference recording audio after text conversion is the same, the way of generating the identifier of each terminal is the same, so that the basic text data of each terminal is the same and the identifier of each paragraph in the basic text data is the same. Therefore, the paragraph is used as the minimum comparison unit, the text content comparison frequency and the transmission data size can be reduced, and the text collaborative editing is applied to the conference scene, so that the collaborative editing of the basic text data obtained by converting the conference recording audio by multiple users is realized.
Step S23: and acquiring local terminal difference information corresponding to the text unit with the modified content.
And when the modification type of the text unit is that the content is modified, acquiring local terminal difference information corresponding to the modified text unit belonging to the content. The local-end difference information represents a difference of the text unit between the local-end text data and the basic text data. The acquisition mode and the expression form of the local terminal difference information representation are not particularly limited, and the difference of the text unit in the local terminal text data and the basic text data can be represented.
In a disclosed embodiment, when the home terminal difference information corresponding to the text unit with the modified content is obtained, the home terminal difference information corresponding to the text unit with the modified content may be obtained by using a DIFF algorithm. The DIFF algorithm may calculate a difference between different text units and generate local difference information to represent the text difference, specifically, find out whether a first word is the same between a text unit of local text data and a text unit of basic text data from a beginning and an end, if the first word is the same as the first word, continue to find downwards, and if the first word is different from the last word, divide the text content into two text contents, find downwards by using the same method, where a modification flag of a text content in which the text unit of the local text data is the same as the text unit of the basic text data is 0 (indicating that the corresponding text content is an unmodified content in the local text data), a modification flag of a text content in which the text unit of the basic text data exists but does not exist in the text unit of the local text data is-1 (indicating that the corresponding text content is a deleted content in the local text data), the modification flag of the text content that exists in the text unit of the local text data but does not exist in the text unit of the basic text data is 1 (indicating that the corresponding text content is the newly added content in the local text data). For example, the text unit of the local text data is "text execution conversion", the text unit of the basic text data is "text operation conversion", and the local difference information is [ [0, text ], [1, operation ], [ -1, execution ] [0, conversion ] ].
The local terminal difference information may include a plurality of groups of content difference data, where each group of content difference data includes text content of a text unit and a modification identifier, the plurality of groups of content difference data are ordered according to a position of the text content in the text unit obtained correspondingly, and the modification identifier is used to indicate that the corresponding text content is unmodified content in the local terminal text data, the corresponding text content is newly added content in the local terminal text data, and the corresponding text content is deleted content in the local terminal text data. Taking local difference information of [ [0, text ], [1, operation ], [ -1, execution ] [0, conversion ], [0, text ], [1, operation ], [ -1, execution ], [0, conversion ] are content difference data respectively and are sorted according to the position of the corresponding obtained text content in the text unit, wherein [0, text ] is taken as an example, 0 ' in [0, text ] is taken as a modification identifier, and ' text ' in [0, text ] is taken as a text content.
Therefore, when the text unit of the text data at the local end is compared with the text unit of the basic text data, and the modification content of each text unit is determined, the text unit of the text data at the local end and the text unit of the basic text data are compared firstly, the modification type of each text unit is obtained, and then the local end difference information corresponding to the text unit with the modified content is obtained. In addition, the local terminal can find out the difference between the local terminal text data and the basic text data by using the DIFF algorithm by taking the text unit as the minimum comparison unit to obtain local terminal difference information, and the local terminal difference information comprises text content and a modification identifier, so that the subsequent local terminal can conveniently realize the integration of the modification content.
By acquiring the local difference information corresponding to the text unit with modified content in the above manner, local modification data may be generated based on the modified content of each text unit, specifically refer to step S24 and step S25 below.
Step S24: and taking the identification information of the text unit with unmodified or deleted content as composition data, taking the text content and the position information of the newly added text unit as composition data, and taking the local difference content as composition data.
The composition data forming the local modification data are also different under the modification types of unmodified content, deleted content, modified content and newly added different text units. And if the modification type of the text unit is that the content is not modified or deleted, using the identification information of the text unit with unmodified or deleted content as the composition data without storing other information. And if the modification type of the text unit is newly increased, using the text content and the position information of the newly increased text unit as the composition data. And if the modification type of the text unit is that the content is modified, using the local difference content as the composition data.
In a disclosed embodiment, under the condition that the local text data and the basic text data are structured data obtained by respectively performing structural processing on the local interface text and the basic text, the local text data and the basic text data often have a lot of label information. For example, the existing one-end text data is "< ins data-required ═ 1h2j12b '> which is the newly generated content", where "< ins data-required ═ 1h2j12 b' >" and "</ins >" are both label information, and "this is the newly generated content" is the text content of the one-end text data, the modification type to which each text unit belongs is obtained by comparing the text unit of the one-end text data with the text unit of the basic text data, and the modification type is found to be that the content is modified, and when the one-end difference information corresponding to the text unit to which the content is modified is obtained, the label information and the text content are both executed to obtain the one-end difference information corresponding to the text unit to which the content is modified. In order to accelerate the text comparison speed and quickly obtain the local-end difference content, before the local-end difference content of the local-end text data and the basic text data of the text unit with modified content is obtained, the label information in the local-end text data and the basic text data can be converted into special characters, and a data dictionary is generated by utilizing the corresponding relation between the label information and the special characters, so that the local-end difference content and the data dictionary are used as the composition data when the local-end difference content is used as the composition data. The data dictionary is used for restoring the special characters into the label information based on the data dictionary when the basic text data is updated.
In a real scene, the text data of the home terminal is used "<ins data-unquied=’1h2j12b’>This is the newly generated content</ins>", basic text data is"<ins data-unquied=’1h2j12b’>Newly generated speech content</ins>For example, the local text data and the basic text data are label information in the local text data "<ins data-unquied=’1h2j12b’>"and"</ins>Respectively converted into special characters
Figure BDA0003413420110000091
And
Figure BDA0003413420110000092
then the text data of the home terminal is updated "
Figure BDA0003413420110000093
This is the newly generated content
Figure BDA0003413420110000094
", basic text data is updated, and"
Figure BDA0003413420110000095
Newly generated speech content
Figure BDA0003413420110000096
"generating a data dictionary as a chinese book by using correspondence between label information and special characters
Figure BDA0003413420110000097
<ins data-unquied=’1h2j12b’>,
Figure BDA0003413420110000098
</ins>And thus, using the DIFF algorithm, the local end difference information belonging to the text unit whose content is modified is obtained as [ [0,
Figure BDA0003413420110000099
][1 ] this is]0, newly generated]And [ -1 ] speaking]0, content
Figure BDA00034134201100000910
]]When the local-end difference content is used as the composition data, the local-end difference content and the data dictionary are used as the composition data, and then the special characters are restored to the tag information based on the data dictionary when the basic text data is updated, so that the workload of local-end difference data processing on the tag information is reduced, unnecessary influence on the displayed text content in the comparison process of the local-end text data and the basic text data by the tag information is prevented, and the comparison error is reduced.
Step S25: and summarizing the data to obtain the local modified data.
And summarizing the composition data to obtain all contents of the modification of the basic text data by the home terminal user, so that the home terminal modified data can be obtained.
Step S26: and acquiring a plurality of other-end modification data.
In order to implement multi-user collaborative editing, both the local terminal and the other terminal can obtain the modified data of the corresponding terminal in the manner from the step S21 to the step S25, and the local terminal sends the modified data of the local terminal to the servers connected to the local terminal and the plurality of other terminals, so that the servers forward the modified data of the local terminal to the other terminal.
The local terminal can receive a plurality of other terminal modification data sent by the server when acquiring the plurality of other terminal modification data, wherein the other terminal modification data is sent to the server corresponding to the other terminal and contains other terminal text data and modification contents of each text unit in the basic text data. The other-end modified data may be, as with the local-end modified data, composed data of identification information of text units whose contents are not modified or deleted, composed data of text contents and position information of newly added text units, composed data of local-end difference contents, and composed data of local-end difference contents and a data dictionary, including modified contents of each text unit in the local-end text data and the basic text data, so that the local-end modified data and the plurality of local-end modified data can be integrated more conveniently and quickly in the subsequent process. In a disclosed embodiment, the acquisition of the modification data of the other end can also be that the other end directly sends the modification data to the local end in an implementable manner. In a disclosed embodiment, the other-end modified data may also be generated at the local end by replacing the local-end text data in the steps S21 to S25 with the other-end text data after the local end receives the other-end text data, so that the local-end modified data and the other-end modified data are both generated at the same local end, and a difference in processing of different user-end data is avoided. The local terminal receives the other terminal modification data from the server, and the other terminal modification data comprises other terminal text data and modification contents of each text unit in the basic text data, so that the modification contents can be quickly integrated when the local terminal and the other terminal modify the same text unit.
The sequence of the above steps S21 to S25 for obtaining the local modification data and the step S26 for obtaining the several other modification data is not limited in particular.
After the local terminal obtains the local terminal modification data and the other terminal modification data in the above manner, the modification content of the same text unit in the local terminal modification data and the other terminal modification data can be integrated to obtain the target modification content corresponding to the text unit, which is specifically referred to in step S27 and step S28.
Step S27: and acquiring local terminal difference information of the text unit based on the local terminal modification data, and acquiring other terminal difference information of the same text unit based on the other terminal modification data.
The local-end difference information represents a difference of the text unit between the local-end text data and the basic text data, and the other-end difference information represents a difference of the text unit between the other-end text data and the basic text data. The local terminal difference information and the other terminal difference data may include a plurality of groups of content difference data, where each group of content difference data includes text content of a text unit and a modification identifier, the plurality of groups of content difference data are ordered according to the position of the text content in the text unit, and the modification identifier is used to indicate that the corresponding text content is unmodified content in the local terminal text data, the corresponding text content is newly added content in the local terminal text data, and the corresponding text content is deleted content in the local terminal text data.
Step S28: and determining the local terminal modification content and the local terminal modification position of the local terminal to the text unit based on the local terminal difference information, and determining the other terminal modification content and the other terminal modification position of the other terminal to the text unit based on the other terminal difference information.
Based on the local terminal difference information, the local terminal modification content and the local terminal modification position of the local terminal to the text unit can be determined, and based on the other terminal difference information, the other terminal modification content and the other terminal modification position of the other terminal to the text unit can also be determined, the difference between the local terminal text data and the basic text data and the difference between the other terminal text data and the basic text data are respectively obtained, and the modification content and the modification position are respectively determined, so that the subsequent same basic text data are combined and processed with the modification content, and the conflict combination of the modification content can be realized without locking the text unit like the prior art. For the explanation of the local terminal difference information and the other terminal difference information, reference may be made to the step S23, which is not described herein again.
In a real scene, the basic text data is "
Figure BDA0003413420110000111
Newly generated speech content
Figure BDA0003413420110000112
", the text data at the home terminal is"
Figure BDA0003413420110000113
This is the newly generated content
Figure BDA0003413420110000114
", the local difference information is obtained as [ [0,
Figure BDA0003413420110000115
][1 ] this is]0, newly generated]And [ -1 ] speaking]0, content
Figure BDA0003413420110000116
]]That is, the local user adds "this is" and deletes "speak", so that based on the local difference information, it can be determined that the local modifies the local content of the text unit and the local modification position are added "this is" and is in the first position of the cache data, and delete "speak" and is in the fifth position of the cache data; the basic text data of the other end is the same as that of the home end "
Figure BDA0003413420110000121
Newly generated speech content
Figure BDA0003413420110000122
", other end text data is"
Figure BDA0003413420110000123
Newly generated spoken content 123
Figure BDA0003413420110000124
", the other end difference information is obtained as [ [0,
Figure BDA0003413420110000125
newly generated speech content],[1,123],[0,
Figure BDA0003413420110000126
]]That is, the other end user adds "123", and based on the other end difference information, it is determined that the other end modified content of the other end to the text unit and the other end modified position are added "123" and are in the ninth position of the cache data.
Step S29: and updating the text unit in the basic text data based on the local terminal modification content, the local terminal modification position, the other terminal modification content and the other terminal modification position.
After the target modification content corresponding to the text unit is obtained in steps S27 and S28, when the text unit in the basic text data is updated based on the target modification content of the text unit, the text unit in the basic text data can be updated based on the local modification content, the local modification position, the other-end modification content, and the other-end modification position, so that multiple users modify the same text unit, and it is determined that there is a conflict in the modification, and at this time, the text unit does not need to be locked, and the modified content can be automatically merged. After updating the text units in the basic text data, the local terminal may send the updated basic text data to the other terminal, so that the other terminal directly receives the updated basic text data and then updates the basic text data of the other terminal, or the local terminal and the other terminal receive a plurality of other terminal modification data sent by the server, and update the text units in the basic text data through steps S27 to S29.
Because the local end user and the plurality of other end users modify the same basic text data to generate local end modification data and a plurality of other end modification data, and the obtaining modes of the local end difference information and the other end difference information can be the same, the local end modification content, the local end modification position, the other end modification content and the other end modification position can be based on the local end modification content, the local end modification position, the other end modification content and the other end modification position, and the text units in the basic text data can be updated. In the basic text data, taking the actual scene of step S28 as an example "
Figure BDA0003413420110000127
Newly generated speech content
Figure BDA0003413420110000128
On the basis of 'adding' this is 'and in the first position of the cache data, deleting' speaking 'and in the fifth position of the cache data, adding' 123 'and in the ninth position of the cache data, obtaining an updated text unit of'
Figure BDA0003413420110000129
This is the newly generated content 123
Figure BDA00034134201100001210
". Wherein the special character
Figure BDA00034134201100001211
And
Figure BDA00034134201100001212
not occupying the position.
When the local terminal and a plurality of other terminals modify the same text unit, if the modification positions of the terminals are different, the text unit in the basic text data is updated based on the local terminal modification content, the local terminal modification position, the other terminal modification content and the other terminal modification position; and if the modification positions of the ends are the same, sequentially updating the text units in the basic text data based on the sequence of the ends. The sequence of each end may be a time sequence of the local end acquiring the local end modification data and the plurality of other end modification data, or a preset sequence of each end.
In a disclosed embodiment, in order to ensure that the cursor position on the home terminal interface is consistent before and after the text unit is modified, when the content of the text unit is modified, if the modified content of the other terminal modified data is located behind the cursor position recorded before the update of the home terminal interface text, the cursor is displayed on the updated home terminal interface text according to the cursor position recorded before the update, and if the modified content of the other terminal modified data is located before the cursor position recorded before the update, the cursor position recorded before the update is added to the length of the modified content of the other terminal modified data to obtain the latest cursor position, and the cursor is displayed on the updated home terminal interface text according to the latest cursor position, so that the cursor is displayed back. The length of the modified content does not include the length of the special character. Compared with the prior art that modification of the text style needs to be processed independently when the OT algorithm is used for realizing text collaborative editing, the scheme can realize the playback of the original cursor position no matter the modification content of the other end is positioned behind or in front of the cursor position recorded before updating of the interface text of the home end when the text collaborative editing is realized at the home end.
Steps S27 to S29 are directed to the case where the modification type is that the content is modified, that is, the same text unit is modified by a plurality of users, and besides, the modification type to which the text unit belongs may be that the content is not modified, deleted, or added. If the modification type to which the text unit belongs is content unmodified or deleted, the identification information belonging to the text unit whose content is unmodified or deleted is used as composition data, as described in step S24; if the modification type of the text unit is newly added, the text content and the position information belonging to the newly added text unit are used as composition data, so in a disclosed embodiment, after the local modification data is obtained, the local modification data can be used for obtaining the identification information of the text unit deleted by the local, and the text unit belonging to the identification information in the basic text data is deleted; and/or utilizing the local terminal to modify the data, acquiring the text content of the newly added text unit at the local terminal and the local terminal position information, and adding the text content of the newly added text unit at the local terminal to the basic text data based on the local terminal position information. Similarly, after the other end modification data is obtained, the other end modification data can be used to obtain the identification information of the text unit deleted by the other end, and the text unit belonging to the identification information in the basic text data is deleted; and/or utilizing the local terminal to modify the data, acquiring the text content of the newly added text unit of the other terminal and the position information of the other terminal, and adding the text content of the newly added text unit of the other terminal to the basic text data based on the position information of the other terminal. Because the conflict of processing in the same text unit does not exist between the deletion and the newly added modification types, the text unit belonging to the identification information in the basic text data can be deleted directly according to the identification information of the text unit, the text content of the newly added text unit can be added into the basic text data directly based on the position information, and because the deletion or the addition of the text unit by a plurality of users is not influenced mutually, the basic text data can be updated directly according to the modification of the local end and the other end, and the efficiency of text collaborative editing is improved. In a disclosed embodiment, the local terminal may send the local terminal modification data to the server, so that the server aggregates the local terminal modification data and the other terminal modification data sent to the server, and forwards the aggregated local terminal modification data and the other terminal modification data to the local terminal or the other terminal, so that when the local terminal obtains the local terminal modification data and the other terminal modification data, the local terminal receives the local terminal modification data and the other terminal modification data sent by the server, and based on this, the local terminal modification data and the other terminal modification data sent by the server are respectively used as current modification data, and whether the current modification data is the local terminal modification data is determined, if so, the text unit of the basic text data is updated based on the local terminal modification data, and if not, the local terminal modification data is obtained, and the subsequent steps S27 to S29 are performed to update the text unit in the basic text data.
In a disclosed embodiment, in order to differently display modifications of basic text data by different users, after the local terminal modification data and the plurality of other terminal modification data are acquired, modification contents in the plurality of other terminal modification data may be updated to a local terminal interface text displayed on a local terminal interface, and then the modification contents at each terminal in the updated local terminal interface text are differentially displayed. For example, when the modification type of the text unit is newly added, the text content of the newly added text unit is differentially displayed; for another example, when the modification type of the text unit is content modification, the other-end modified content and the other-end modified position of the text unit by the other end are determined based on the other-end difference information, and when the other-end modified content is increased, the increased other-end modified content is displayed in a distinguishing manner, for example, the other-end text data is "
Figure BDA0003413420110000141
Newly generated spoken content 123
Figure BDA0003413420110000142
", the other end difference information is obtained as [ [0,
Figure BDA0003413420110000143
newly generated speech content],[1,123],[0,
Figure BDA0003413420110000144
]]That is, if the other end user adds "123", the "123" is displayed differently. The different display modes comprise various modes such as bold, underline, inclination, color highlight and the like, different users can respectively correspond to different display modes, or different users respectively correspond to different color highlights, and the users can conveniently compare and view the modified contents of other users. In an actual scene, basic text data is obtained by performing text conversion on conference recording audio and is cached at a local terminal and other terminals, in order to distinguish and display the modified content of each user on the basic text data on an interface of the local terminal and distinguish the display mode into color highlight, the conference entering time of the local terminal user and a plurality of other terminal users is obtained, and the highlight color corresponding to the user is determined based on the conference entering time and a preset highlight color rule. The time of entering the conference can be customized according to the situation, such as the time of modifying the basic text data, the time of opening the home terminal interface and the like. The preset highlight color rule includes the ranking of the meeting entering time and the corresponding highlight color, for example, if the meeting entering time is the first name, the highlight color is red, and the like. Therefore, the modification of the text style can be realized, and special business processing is not required for the modification of the style.
In the scheme, the local text data and the basic text data are obtained, the text unit of the local text data and the text unit of the basic text data are compared to obtain the modification type of each text unit, the local difference information corresponding to the text unit with the modified content is obtained when the modification type of the text unit is the modified content, the local difference information is not determined when the content is not modified, deleted and newly added, the data processing time is saved, and the efficiency is improved; then, the identification information belonging to the text unit of which the content is not modified or deleted is used as composition data, the text content belonging to the newly added text unit and the position information are used as composition data, the local difference content is used as composition data, and the composition data is summarized to obtain local modification data. After the local terminal modification data and the plurality of other terminal modification data are obtained, the local terminal difference information of the text unit is obtained based on the local terminal modification data, the other terminal difference information of the same text unit is obtained based on the other terminal modification data, the local terminal modification content and the local terminal modification position of the local terminal to the text unit are determined based on the local terminal difference information, the other terminal modification content and the other terminal modification position of the other terminal to the text unit are determined based on the other terminal difference information, and the text unit in the basic text data can be updated based on the local terminal modification content, the local terminal modification position, the other terminal modification content and the other terminal modification position.
Referring to fig. 3, fig. 3 is a schematic diagram of a framework of an embodiment of the text collaborative editing apparatus 30 according to the present application. The text collaborative editing device 30 comprises an acquisition module 31, an integration module 32 and an update module 33; an obtaining module 31, configured to obtain local modification data and a plurality of other modification data, where the local modification data and the other modification data are generated by modifying basic text data, and the basic text data includes a plurality of text units; the integration module 32 is configured to integrate modification contents of the same text unit in the local modification data and the plurality of other end modification data to obtain target modification contents corresponding to the text unit; and an updating module 33, configured to update the text unit in the basic text data based on the target modified content of the text unit.
In the above scheme, since the local modification data and the other modification data are generated by modifying the basic text data, that is, the basis of all the modification data is the same, after the acquisition module 31 acquires the local modification data and a plurality of other modification data, the acquisition module 31 integrates the modification content of the same text unit in the local modification data and the plurality of other modification data, so as to obtain the target modification content corresponding to the text unit, and finally the update module 33 updates the text unit in the basic text data based on the target modification content of the text unit, so as to integrate the modification data of all the terminals based on the basic text data, thereby implementing text collaborative editing at the local terminal.
In some disclosed embodiments, the obtaining module 31 is configured to, when obtaining the local modification data, further obtain local text data and basic text data, where the local text data is obtained by modifying the basic text data by the local user; comparing the text unit of the local text data with the text unit of the basic text data, and determining the modified content of each text unit; and generating local modification data based on the modification content of each text unit.
Therefore, the local modification data is the result of comparing the local text data with the basic text data, and reflects the modification content of the local user to the basic text data.
In some disclosed embodiments, the obtaining module 31 is configured to compare a text unit of the text data at the home terminal with a text unit of the basic text data, and when determining the modification content of each text unit, further compare the text unit of the text data at the home terminal with the text unit of the basic text data, to obtain a modification type to which each text unit belongs, where the modification type includes at least one of: the content is not modified, deleted, modified and newly added; acquiring local terminal difference information corresponding to the text unit with the modified content, wherein the local terminal difference information represents the difference of the text unit in the local terminal text data and the basic text data; the obtaining module 31 is configured to, when generating local modified data based on modified content of each text unit, further use identification information of a text unit whose content is not modified or deleted as composition data, use text content and location information of a newly added text unit as composition data, and use local difference content as composition data; and summarizing the data to obtain the local terminal modification data.
Therefore, when the text unit of the text data at the local end is compared with the text unit of the basic text data, and the modification content of each text unit is determined, the text unit of the text data at the local end and the text unit of the basic text data are compared firstly, the modification type of each text unit is obtained, and then the local end difference information corresponding to the text unit with the modified content is obtained.
In some disclosed embodiments, the obtaining module 31 is configured to compare a text unit of the text data at the home terminal with a text unit of the basic text data, and when a modification type to which each text unit belongs is obtained, search for a text unit having the same identifier in the text data at the home terminal and the basic text data, if the text contents of the text units having the same identifier are the same, determine that the modification type to which the text unit belongs is content-unmodified, and if the text contents of the text units having the same identifier are different, determine that the modification type to which the text unit belongs is content-modified; if the identification of the text unit in the text data of the local terminal does not exist in the basic text data, determining that the modification type of the text unit is newly added; and if the identification of the text unit in the basic text data does not exist in the text data of the home terminal interface, determining that the modification type of the text unit is deletion.
Therefore, by combining the comparison of the identification and the text content, the modification type to which the text unit belongs can be determined simply and quickly.
In some disclosed embodiments, the local-end difference information includes a plurality of groups of content difference data, where each group of content difference data includes text content of a text unit and a modification identifier, the plurality of groups of content difference data are ordered according to the position of the text content in the text unit obtained correspondingly, the modification identifier is used to indicate that the corresponding text content is unmodified content in the local-end text data, the corresponding text content is newly added content in the local-end text data, and the corresponding text content is deleted content in the local-end text data; and/or, the obtaining module 31 is configured to, when obtaining the home terminal difference information corresponding to the text unit with the modified content, obtain the home terminal difference information of the text unit with the modified content by using a DIFF algorithm.
Therefore, the local terminal can find out the difference between the local terminal text data and the basic text data by using the DIFF algorithm with the text unit as the minimum comparison unit to obtain the local terminal difference information, and the local terminal difference information comprises the text content and the modification identifier, so that the modified content can be conveniently integrated when the subsequent local terminal realizes the text collaborative editing.
In some disclosed embodiments, the local text data and the basic text data are structured data obtained by respectively carrying out structuring processing on a local interface text and a basic text; before the obtaining module 31 is configured to obtain the local difference content in the local text data and the basic text data of the text unit with modified content, the obtaining module is further configured to convert the tag information in the local text data and the basic text data into a special character, and generate a data dictionary by using the corresponding relationship between the tag information and the special character; and when the local difference content is used as the composition data, the local difference content and the data dictionary are also used as the composition data, and the data dictionary is used for restoring the special characters into the label information based on the data dictionary when the basic text data is updated.
Therefore, the label information is converted into the special characters before the local terminal difference content is obtained, the workload of local terminal difference data processing on the label information can be reduced, meanwhile, unnecessary influence on the displayed text content in the local terminal text data and basic text data comparison process of the label information is prevented, and the comparison error is reduced.
In some disclosed embodiments, the obtaining module 31 is configured to, when obtaining a plurality of other end modification data, further receive the plurality of other end modification data sent by the server, where the other end modification data is sent to the server corresponding to the other end and includes modification contents of each text unit in the other end text data and the basic text data.
Therefore, the local terminal receives the other terminal modification data from the server, and the other terminal modification data contains the other terminal text data and the modification content of each text unit in the basic text data, so that the modification content can be quickly integrated when the local terminal and the other terminal modify the same text unit.
In some disclosed embodiments, the integration module 32 is configured to integrate modification contents of the same text unit in the local modification data and the multiple other modification data to obtain target modification contents corresponding to the text unit, and is further configured to obtain local difference information of the text unit based on the local modification data and obtain other difference information of the same text unit based on the other modification data, where the local difference information represents a difference between the local text data and the basic text data of the text unit, and the other difference information represents a difference between the other text data and the basic text data of the text unit; determining the local terminal modification content and the local terminal modification position of the local terminal to the text unit based on the local terminal difference information, and determining the other terminal modification content and the other terminal modification position of the other terminal to the text unit based on the other terminal difference information; the updating module 33 is configured to update the text unit in the basic text data based on the target modified content of the text unit and based on the local modified content, the local modified position, the other modified content, and the other modified position.
Therefore, the difference between the local text data and the basic text data and the difference between the other end text data and the basic text data are respectively obtained, and the modified content and the modified position are respectively determined, so that the modified content is combined and processed on the same basic text data, and the conflict combination of the modified content can be realized without locking a text unit as in the prior art.
In some disclosed embodiments, after the obtaining module 31 obtains the local modification data, the obtaining module is further configured to obtain, by using the local modification data, identification information of a text unit deleted by the local, and delete a text unit belonging to the identification information in the basic text data; and/or utilizing the local terminal to modify the data, acquiring the text content of the newly added text unit at the local terminal and the local terminal position information, and adding the text content of the newly added text unit at the local terminal to the basic text data based on the local terminal position information; after the obtaining module 31 obtains the other-end modification data, the obtaining module is further configured to obtain, by using the other-end modification data, the identification information of the text unit deleted by the other end, and delete the text unit belonging to the identification information in the basic text data; and/or utilizing the local terminal to modify the data, acquiring the text content of the newly added text unit of the other terminal and the position information of the other terminal, and adding the text content of the newly added text unit of the other terminal to the basic text data based on the position information of the other terminal.
Therefore, because the deletion or addition of the text units by a plurality of users is not influenced mutually, the basic text data can be directly updated according to the modification of the local terminal and the other terminal, and the efficiency of text collaborative editing is improved.
In some disclosed embodiments, after the obtaining module 31 obtains the local terminal modification data and the plurality of other terminal modification data, the obtaining module is further configured to update modification contents in the plurality of other terminal modification data to a local terminal interface text displayed on the local terminal interface; the modified contents of each end in the updated local interface text are displayed in a distinguishing way; and/or if the modified content of the modified data of the other end is positioned behind the cursor position recorded before the updating of the interface text of the local end, displaying the cursor on the updated interface text of the local end according to the cursor position recorded before the updating, and if the modified content of the modified data of the other end is positioned before the cursor position recorded before the updating, adding the length of the modified content of the modified data of the other end to the cursor position recorded before the updating to obtain the latest cursor position, and displaying the cursor on the updated interface text of the local end according to the latest cursor position.
Therefore, compared with the existing method that the modification of the text style when the cooperative text editing is realized through the OT algorithm needs to be processed independently and the cooperative text editing is realized at the local terminal, the modified content at each terminal can be displayed in a distinguishing manner, the modification of the text style is realized, the modification of the style does not need to be processed by special business, and the user can conveniently compare and check the modified content at each terminal. In addition, the back display of the original cursor position can be realized no matter the other end modified content is positioned behind or in front of the cursor position recorded before the updating of the interface text of the home end.
In some disclosed embodiments, the text units are paragraphs; and/or the basic text data is obtained by performing text conversion on the conference recording audio and is cached at the local end and the other end.
Therefore, the paragraph is used as the minimum comparison unit, the text content comparison frequency and the transmission data size can be reduced, and the text collaborative editing is applied to the conference scene, so that the collaborative editing of the basic text data obtained by converting the conference recording audio by multiple users is realized.
Referring to fig. 4, fig. 4 is a schematic block diagram of an embodiment of an electronic device 40 according to the present application. The electronic device 40 includes a memory 41 and a processor 42 coupled to each other, where the memory 41 stores program instructions, and the processor 42 is configured to execute the program instructions to implement the steps in any of the embodiments of the text collaborative editing method described above. Specifically, the electronic device 40 may include, but is not limited to: desktop computers, notebook computers, servers, mobile phones, tablet computers, and the like, without limitation.
Specifically, the processor 42 is configured to control itself and the memory 41 to implement the steps in any one of the above embodiments of the text collaborative editing method. Processor 42 may also be referred to as a CPU (Central Processing Unit). The processor 42 may be an integrated circuit chip having signal processing capabilities. The Processor 42 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 42 may be commonly implemented by an integrated circuit chip.
According to the scheme, the local terminal modification data and the other terminal modification data are generated by modifying the basic text data, namely the basis of all the modification data is the same, so that after the local terminal acquires the local terminal modification data and a plurality of other terminal modification data, the local terminal modification data and the plurality of other terminal modification data integrate the modification content of the same text unit in the local terminal modification data and the plurality of other terminal modification data, the target modification content corresponding to the text unit can be obtained, and finally the text unit in the basic text data is updated based on the target modification content of the text unit, so that the modification data of all the terminals are integrated on the basis of the basic text data, and further the text collaborative editing is realized at the local terminal.
Referring to fig. 5, fig. 5 is a block diagram illustrating an embodiment of a computer-readable storage medium 50 according to the present application. The computer readable storage medium 50 stores program instructions 51 capable of being executed by the processor, and the program instructions 51 are used for implementing the steps in any one of the embodiments of the text collaborative editing method.
According to the scheme, the local terminal modification data and the other terminal modification data are generated by modifying the basic text data, namely the basis of all the modification data is the same, so that after the local terminal acquires the local terminal modification data and a plurality of other terminal modification data, the local terminal modification data and the plurality of other terminal modification data integrate the modification content of the same text unit in the local terminal modification data and the plurality of other terminal modification data, the target modification content corresponding to the text unit can be obtained, and finally the text unit in the basic text data is updated based on the target modification content of the text unit, so that the modification data of all the terminals are integrated on the basis of the basic text data, and further the text collaborative editing is realized at the local terminal.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
The foregoing description of the various embodiments is intended to highlight various differences between the embodiments, and the same or similar parts may be referred to each other, and for brevity, will not be described again herein.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.

Claims (14)

1. A text collaborative editing method is characterized by comprising the following steps:
the method comprises the steps that a local terminal obtains local terminal modification data and a plurality of other terminal modification data, wherein the local terminal modification data and the other terminal modification data are generated by modifying basic text data, and the basic text data comprise a plurality of text units;
integrating the modified content of the same text unit in the local modified data and the plurality of other modified data to obtain target modified content corresponding to the text unit;
updating the text unit in the base text data based on the target modified content of the text unit.
2. The method of claim 1, wherein obtaining the local modification data comprises:
acquiring local text data and the basic text data, wherein the local text data is obtained by modifying the basic text data by a local user;
comparing the text unit of the local text data with the text unit of the basic text data, and determining the modification content of each text unit;
and generating the local modification data based on the modification content of each text unit.
3. The method of claim 2, wherein the comparing the text unit of the local text data with the text unit of the basic text data to determine the modified content of each text unit comprises:
comparing the text unit of the local text data with the text unit of the basic text data to obtain a modification type of each text unit, wherein the modification type comprises at least one of the following types: the content is not modified, deleted, modified and newly added; and the number of the first and second groups,
acquiring local terminal difference information corresponding to the text unit with the modified content, wherein the local terminal difference information represents the difference of the text unit in the local terminal text data and the basic text data;
generating the local modification data based on the modification content of each text unit, including:
taking the identification information belonging to the unmodified or deleted text unit of the content as composition data, taking the text content and the position information belonging to the newly added text unit as composition data, and taking the local difference content as composition data;
and summarizing the composition data to obtain the local terminal modification data.
4. The method of claim 3, wherein the comparing the text unit of the local text data with the text unit of the basic text data to obtain the modification type of each text unit comprises:
searching text units with the same identification in the local text data and the basic text data, if the text contents of the text units with the same identification are the same, determining that the modification type of the text units is the unmodified content, and if the text contents of the text units with the same identification are different, determining that the modification type of the text units is the modified content;
if the identification of the text unit in the local text data does not exist in the basic text data, determining that the modification type of the text unit is the new addition;
and if the identification of the text unit in the basic text data does not exist in the text data of the home terminal interface, determining that the modification type of the text unit is the deletion.
5. The method according to claim 3, wherein the local-end difference information includes a plurality of sets of content difference data, each set of content difference data includes text content of the text unit and a modification identifier, the plurality of sets of content difference data are sorted according to a position of the corresponding obtained text content in the text unit, and the modification identifier is used for indicating that the corresponding text content is unmodified content in the local-end text data, the corresponding text content is newly added content in the local-end text data, and the corresponding text content is deleted content in the local-end text data;
and/or, the obtaining of the local terminal difference information corresponding to the text unit with the modified content includes:
obtaining the local difference information belonging to the text unit of which the content is modified by using a DIFF algorithm.
6. The method according to claim 4, wherein the local text data and the basic text data are structured data obtained by respectively performing structuring processing on a local interface text and a basic text; before the obtaining of the local difference content of the text unit belonging to the modified content in the local text data and the basic text data, the method further includes:
converting the label information in the local text data and the basic text data into special characters, and generating a data dictionary by using the corresponding relation between the label information and the special characters;
the taking the local terminal difference content as composition data comprises the following steps:
and taking the local-end difference content and the data dictionary as the composition data, wherein the data dictionary is used for restoring the special characters into the label information based on the data dictionary when the basic text data is updated.
7. The method of claim 1, wherein obtaining the number of other-end modification data comprises:
receiving a plurality of other-end modification data sent by a server, wherein the other-end modification data is sent to the server corresponding to other ends and comprises other-end text data and modification contents of each text unit in the basic text data.
8. The method according to claim 1, wherein the integrating of the modified content of the same text unit in the local modified data and the plurality of other modified data to obtain the target modified content corresponding to the text unit comprises:
acquiring local terminal difference information of the text unit based on the local terminal modification data, and acquiring other terminal difference information of the same text unit based on the other terminal modification data, wherein the local terminal difference information represents the difference of the text unit in the local terminal text data and the basic text data, and the other terminal difference information represents the difference of the text unit in the other terminal text data and the basic text data;
determining the local terminal modification content and the local terminal modification position of the local terminal to the text unit based on the local terminal difference information, and determining the other terminal modification content and the other terminal modification position of the other terminal to the text unit based on the other terminal difference information;
the updating the text unit in the basic text data based on the target modified content of the text unit comprises:
and updating the text unit in the basic text data based on the local terminal modification content, the local terminal modification position, the other terminal modification content and the other terminal modification position.
9. The method of claim 1, wherein after obtaining the local modification data, the method further comprises:
utilizing the local terminal to modify data, acquiring identification information of the text unit deleted by the local terminal, and deleting the text unit belonging to the identification information in the basic text data; and/or the presence of a gas in the gas,
acquiring the text content of the newly added text unit at the local terminal and the local terminal position information by utilizing the local terminal modification data, and adding the text content of the newly added text unit at the local terminal to the basic text data based on the local terminal position information;
after obtaining the other end modification data, the method further comprises:
utilizing the other end modification data to acquire identification information of the text unit deleted by the other end, and deleting the text unit belonging to the identification information in the basic text data; and/or the presence of a gas in the gas,
and acquiring the text content of the newly added text unit of the other end and the position information of the other end by utilizing the local end modification data, and adding the text content of the newly added text unit of the other end to the basic text data based on the position information of the other end.
10. The method of claim 1, wherein after the obtaining the local modification data and the number of other modification data, the method further comprises:
updating the modified contents in the modified data of the other ends to a local interface text displayed on a local interface;
the updated modified content of each end in the local interface text is displayed in a distinguishing way; and/or the presence of a gas in the gas,
if the modified content of the other end modified data is located behind the cursor position recorded before the updating of the local end interface text, displaying the cursor on the updated local end interface text according to the cursor position recorded before the updating, and if the modified content of the other end modified data is located before the cursor position recorded before the updating, adding the cursor position recorded before the updating and the length of the modified content of the other end modified data to obtain the latest cursor position, and displaying the cursor on the updated local end interface text according to the latest cursor position.
11. The method of claim 1, wherein the unit of text is a paragraph;
and/or the basic text data is obtained by performing text conversion on the conference recording audio and is cached at the local terminal and the other terminal.
12. A text collaborative editing apparatus, characterized in that the apparatus comprises:
the system comprises an acquisition module, a processing module and a display module, wherein the acquisition module is used for acquiring local terminal modification data and a plurality of other terminal modification data, the local terminal modification data and the other terminal modification data are generated by modifying basic text data, and the basic text data comprises a plurality of text units;
the integration module is used for integrating the modified content of the same text unit in the local modified data and the plurality of other modified data to obtain target modified content corresponding to the text unit;
and the updating module is used for updating the text unit in the basic text data based on the target modification content of the text unit.
13. An electronic device, comprising a memory and a processor coupled to each other, wherein the processor is configured to execute program instructions stored in the memory to implement the text collaborative editing method according to any one of claims 1 to 11.
14. A computer-readable storage medium having stored thereon program instructions executable by a processor, the program instructions, when executed by the processor, implementing the method of collaborative editing of text according to any of claims 1 to 11.
CN202111539208.7A 2021-12-15 2021-12-15 Text collaborative editing method and related device, electronic equipment and storage medium Pending CN114357949A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111539208.7A CN114357949A (en) 2021-12-15 2021-12-15 Text collaborative editing method and related device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111539208.7A CN114357949A (en) 2021-12-15 2021-12-15 Text collaborative editing method and related device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114357949A true CN114357949A (en) 2022-04-15

Family

ID=81098930

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111539208.7A Pending CN114357949A (en) 2021-12-15 2021-12-15 Text collaborative editing method and related device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114357949A (en)

Similar Documents

Publication Publication Date Title
CN109254733B (en) Method, device and system for storing data
US9087049B2 (en) System and method for context translation of natural language
US8997041B2 (en) Method of managing script, server performing the same and storage media storing the same
CN117056471A (en) Knowledge base construction method and question-answer dialogue method and system based on generation type large language model
CN109817210B (en) Voice writing method, device, terminal and storage medium
JP2010009251A (en) Apparatus and method for supporting document data search
CN111263186A (en) Video generation, playing, searching and processing method, device and storage medium
CN107798143A (en) A kind of information search method, device, terminal and readable storage medium storing program for executing
CA3061623C (en) File sending in instant messaging applications
CN112988784B (en) Data query method, query statement generation method and device
CN111813747A (en) File batch renaming method, electronic equipment and computer readable storage medium
US20240169972A1 (en) Synchronization method and apparatus for audio and text, device, and medium
CN112559913B (en) Data processing method, device, computing equipment and readable storage medium
CN108337357B (en) audio playing method and device
CN108509059B (en) Information processing method, electronic equipment and computer storage medium
CN114357949A (en) Text collaborative editing method and related device, electronic equipment and storage medium
CN111783433A (en) Text retrieval error correction method and device
CN116303937A (en) Reply method, reply device, electronic equipment and readable storage medium
CN112989011B (en) Data query method, data query device and electronic equipment
CN108664535B (en) Information output method and device
CN114239501A (en) Contract generation method, apparatus, device and medium
JP6178119B2 (en) Data migration system and data migration method
CN113254819A (en) Page rendering method, system, equipment and storage medium
CN111984359A (en) Dynamic generation and rendering method and device for control
CN111309884A (en) Robot dialogue method, device, medium, and electronic apparatus

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