CN113221507B - Document editing operation synchronization method, computing device and storage medium - Google Patents

Document editing operation synchronization method, computing device and storage medium Download PDF

Info

Publication number
CN113221507B
CN113221507B CN202110594360.9A CN202110594360A CN113221507B CN 113221507 B CN113221507 B CN 113221507B CN 202110594360 A CN202110594360 A CN 202110594360A CN 113221507 B CN113221507 B CN 113221507B
Authority
CN
China
Prior art keywords
character
line
target
document
layout
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.)
Active
Application number
CN202110594360.9A
Other languages
Chinese (zh)
Other versions
CN113221507A (en
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.)
Zhangyue Technology Co Ltd
Original Assignee
Zhangyue 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 Zhangyue Technology Co Ltd filed Critical Zhangyue Technology Co Ltd
Priority to CN202110594360.9A priority Critical patent/CN113221507B/en
Publication of CN113221507A publication Critical patent/CN113221507A/en
Application granted granted Critical
Publication of CN113221507B publication Critical patent/CN113221507B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/109Font handling; Temporal or kinetic typography
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting

Abstract

The invention discloses a document editing operation synchronization method, a computing device and a storage medium, wherein the document editing operation synchronization method comprises the following steps: responding to the document editing operation executed by a user on a target line in a streaming interface, editing the target line, acquiring line content of the target line edited in the streaming document, and analyzing the edited line content to obtain editing operation information of the target line; searching a character list of a pre-stored target line and format information of the target line; updating each character and each character position in the character list according to the editing operation information; and updating the format information of the target line according to the edited line content and the updated character list. The scheme conveniently realizes the synchronization of the editing operation information of the user aiming at the streaming document to the layout document, and effectively ensures the consistency of the line segment structure between the streaming document and the layout document.

Description

Document editing operation synchronization method, computing device and storage medium
Technical Field
The invention relates to the technical field of information processing, in particular to a document editing operation synchronization method, a computing device and a storage medium.
Background
The layout document refers to an electronic document with a fixed layout presentation effect, and the presentation effect of the electronic document is not changed due to changes of software and hardware environments, operators, reading equipment and the like. In order to be able to better adapt to different reading devices for display, the format document needs to be converted into a streaming document. Generally, document conversion software and the like can be used for identifying the content of the format document and automatically generating a corresponding streaming document according to the identification result, and due to the limited identification accuracy of the document identification technology, users such as proofreading personnel and the like need to perform proofreading on the generated streaming document and perform editing processing such as adding and deleting on the document content in the streaming document. However, after the user edits the streaming document, the line segment structure of the document content is likely to be damaged, so that the line segment structure of the streaming document content is different from the line segment structure of the layout document content, which may cause a problem and failure in editing when the user performs an editing operation such as associated annotation, and bring inconvenience to the user.
Disclosure of Invention
In view of the above, the present invention has been made to provide a document editing operation synchronization method, a computing device, and a storage medium that overcome or at least partially solve the above-mentioned problems.
According to an aspect of the present invention, there is provided a document editing operation synchronization method, including:
responding to the document editing operation executed by a user on a target line in a streaming interface, editing the target line, acquiring line content of the target line edited in the streaming document, and analyzing the edited line content to obtain editing operation information of the target line; the streaming interface is used for displaying streaming documents;
searching a character list of a pre-stored target line and format information of the target line; the character list records each character included in the layout document by the target line and the character position of each character in the layout document;
updating each character and each character position in the character list according to the editing operation information;
and updating the format information of the target line according to the edited line content and the updated character list.
According to another aspect of the present invention, there is provided a computing device comprising: the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the following operations:
responding to the document editing operation executed by a user on a target line in a streaming interface, editing the target line, acquiring line content of the target line edited in the streaming document, and analyzing the edited line content to obtain editing operation information of the target line; the streaming interface is used for displaying streaming documents;
searching a character list of a pre-stored target line and format information of the target line; the character list records each character included in the layout document by the target line and the character position of each character in the layout document;
updating each character and each character position in the character list according to the editing operation information;
and updating the format information of the target line according to the edited line content and the updated character list.
According to another aspect of the embodiments of the present invention, there is provided a computer storage medium, in which at least one executable instruction is stored, and the executable instruction causes a processor to execute operations corresponding to the above document editing operation synchronization method.
According to the technical scheme provided by the invention, the line content of the target line after being edited in the streaming document is analyzed, the editing operation information of the target line can be conveniently obtained, updating the character list of the pre-stored target line according to the editing operation information, so that each character and the character position of each character which are currently included in the target line are clearly recorded in the updated character list, then according to the edited line content and the updated character list, the format information of the target line which is stored in advance is updated, thereby conveniently realizing the purpose of synchronizing the editing operation information of the user aiming at the streaming document into the format document, the consistency of the line segment structure between the streaming document and the format document is effectively ensured, the problem in editing operation is avoided, and the convenience and the efficiency of user proofreading are greatly improved.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flowchart illustrating a document editing operation synchronization method according to a first embodiment of the present invention;
FIG. 2a is a flowchart illustrating a document editing operation synchronization method according to a second embodiment of the present invention;
FIG. 2b shows diagram one of a character list of rows;
FIG. 2c shows a first schematic diagram of a collation interface;
FIG. 2d shows a second schematic of the collation interface;
FIG. 2e shows diagram two of a character list of rows;
fig. 3 is a schematic structural diagram of a computing device according to a fourth embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Example one
Fig. 1 is a flowchart illustrating a document editing operation synchronization method according to a first embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, responding to the document editing operation executed by the user aiming at the target line in the streaming interface, editing the target line, acquiring the line content of the target line after being edited in the streaming document, and analyzing the edited line content to obtain the editing operation information of the target line.
The streaming interface displays a streaming document, and the streaming document is obtained by converting the format of the layout document in advance. In order to facilitate a user to intuitively know the line segment structure of each paragraph in the streaming document in the streaming interface, the present embodiment may display the paragraph content according to the line segment information of each paragraph in the layout document in the streaming interface. The user may perform document editing operations on any of the rows presented in the streaming interface, where the document editing operations may include: add character operations, delete character operations, modify character operations, and the like. In this embodiment, a line corresponding to a document editing operation is referred to as a target line, the target line is edited according to the document editing operation in response to the document editing operation, the line content of the target line edited in the streaming document is acquired, the line content is analyzed to obtain editing operation information of the target line, and what processing is specifically performed on which character or characters in the target line can be known according to the editing operation information.
Step S102, searching a character list of a target line and layout information of the target line which are stored in advance.
In order to facilitate synchronization of the editing operation information of the streaming document by a user to the layout document, each paragraph in the layout document may be identified in advance, and line segment information of each paragraph and a character style included in each paragraph are identified, where the line segment information of a paragraph is used to reflect each character included in each line of the paragraph in the layout document and a character position of each character in the layout document, so as to obtain a character list of each line in each paragraph and the layout information of each line. The line character list records each character included in the layout document by the line and the character position of each character in the layout document, and the line layout information records each character included in the line, the character position of each character in the layout document and the character style of each character.
In step S102, the character list of the target line and the layout information of the target line are searched for from the character list of each line and the layout information of each line stored in advance. The character list of the target line records each character included in the layout document by the target line and the character position of each character in the layout document. The layout information of the target line records each character included in the line, a character position of each character in the layout document, and a character style of each character.
Step S103, updating each character and each character position in the character list according to the editing operation information.
After the editing operation information of the target line and the character list of the target line are obtained, each character and each character position in the character list can be updated according to the editing operation information, so that an updated character list is obtained. Specifically, if it is known that the user adds a character to the target line according to the editing operation information, generating a new character position at a corresponding position in the character list and filling the added character to the new character position; if the user deletes the character in the target line according to the editing operation information, deleting the corresponding character position and the character originally filled in the character position in the character list; if the user is known to modify a certain character or certain characters into other characters in the target line according to the editing operation information, setting character positions with corresponding quantity at corresponding positions in the character list and filling the modified characters to the corresponding character positions.
And step S104, updating the layout information of the target line according to the edited line content and the updated character list.
After the updated character list is obtained, the line content of the target line edited in the streaming document may be matched with the updated character list, and each line object included in the target line may be updated according to the matching result, for example, the line object may be deleted, the content attribute and the position attribute of the line object may be updated, and thus, the updated layout information of the target line may be obtained.
By using the document editing operation synchronization method provided by the embodiment, the line content of the target line after being edited in the streaming document is analyzed, so that the editing operation information of the target line can be conveniently obtained, updating the character list of the pre-stored target line according to the editing operation information, so that each character and the character position of each character which are currently included in the target line are clearly recorded in the updated character list, then according to the edited line content and the updated character list, the format information of the target line which is stored in advance is updated, thereby conveniently realizing the purpose of synchronizing the editing operation information of the user aiming at the streaming document into the format document, the consistency of the line segment structure between the streaming document and the format document is effectively ensured, the problem in editing operation is avoided, and the convenience and the efficiency of user proofreading are greatly improved.
Example two
Fig. 2a is a flowchart illustrating a document editing operation synchronization method according to a second embodiment of the present invention, and as shown in fig. 2a, the method includes the following steps:
step S201, identifying line segment information of each paragraph in the layout document and a character style contained in each paragraph.
Identifying document contents of the layout document, identifying paragraphs included in the layout document, further identifying lines included in the paragraphs, characters included in each line and the like, and accordingly obtaining line segment information of each paragraph in the layout document; in addition, the character style of each character in each paragraph needs to be identified. Specifically, the line segment information of the paragraph may record each character included in each line of the paragraph in the layout document and a character position of each character in the layout document.
Step S202, according to the line segment information of each paragraph, each paragraph is split according to the lines, each character included in each line and the character position of each character in the layout document are determined, and a character list of each line is obtained.
And for each paragraph, splitting the paragraph according to the line segment information of the paragraph to obtain at least one line of the paragraph, and determining each character included in each line and the character position of each character in each line in the layout document according to the line segment information of the paragraph, thereby obtaining a character list of each line. The character list of the line records each character included in the layout document of the line and the character position of each character in the layout document, fig. 2b shows a schematic diagram of the character list of the line, as shown in fig. 2b, a rectangle in the character list represents the character position of each character in the line, each character is filled into the corresponding rectangle according to the character position of each character, the line includes 6 characters, and the 6 characters are A, B, C, D, E and F from left to right.
Step S203, aiming at each line in the layout document, obtaining the layout information of each line according to each character included in the line, the character position of each character in the layout document and the character style of each character.
In this embodiment, the layout information of a line may be embodied by a line object, wherein the line object is divided according to the character style of each character in the line. Specifically, characters with adjacent character positions and the same character style in the line correspond to the same line object. Configuring the content attribute and the position attribute of the line object of the line according to each character in the line and the character position of each character in the layout document, wherein the character corresponding to the line object is recorded in the content attribute, and the character position of the character corresponding to the line object is recorded in the position attribute; in addition, the style attribute of the line object can be configured for the line object according to the character style corresponding to each line object, so that which characters in the line, the character positions of the characters and the character styles of the characters correspond to the line object can be clearly known according to the content attribute, the position attribute and the style attribute of the line object.
Step S204, storing the character list of each line and the layout information of each line in the layout document.
The character list of each line and the layout information of each line in the layout document can be stored in a database, so that the character list of the target line and the layout information of the target line can be searched for later.
In the prior art, a streaming document is generally constructed in an HTML5 manner, and a tag language is adopted, so that a source file corresponding to the streaming document obtained after conversion of a layout document can be updated according to a line object in layout information of each line in the obtained layout document, specifically, according to a line object in the layout information of each line, a tag is added to a character corresponding to each line object in the source file corresponding to the streaming document and a tag identifier is set, the tag identifier and the line object have a corresponding relationship, and the tag identifier can be a tag ID. In a source file corresponding to a streaming document, where < span > tags are typically used to combine inline elements in the document, then < span > tags may be added for the characters corresponding to the individual line objects. And displaying the streaming document in the streaming interface according to the updated source file.
Step S205, in response to the document editing operation executed by the user on the target line in the streaming interface, edit the target line, acquire the line content of the target line edited in the streaming document, and analyze the edited line content to obtain the editing operation information of the target line.
In order to facilitate the user to collate the streaming document, the embodiment provides a collation interface, as shown in fig. 2c, the collation interface includes a chapter catalog display interface, a layout interface, and a streaming interface. The chapter catalog display interface is configured to display chapter catalog information, where the chapter catalog information may include chapter information corresponding to at least one chapter of the layout document, and the chapter information may include related information such as a sequence number and a title of the chapter, such as chapter 1 to chapter 10 chapter information shown in fig. 2c, so that a user can select and view the chapter information, where "X" represents a character. And displaying the document contents corresponding to any chapter information in the layout interface and the streaming interface in a one-to-one correspondence manner according to the paragraphs. Before the user does not perform the trigger operation on the layout interface or the streaming interface, as shown in fig. 2c, each paragraph is shown as a whole in the layout interface and the streaming interface in the form of a paragraph. After the user performs a trigger operation on a certain paragraph in the layout interface or the streaming interface, the paragraph content of the paragraph can be presented in the streaming interface according to the line. For example, the 4 th paragraph currently exposed in the layout interface and streaming interface shown in FIG. 2c includes the character w1To w9After the user triggers the paragraph, as shown in fig. 2d, the characters included in the paragraph are displayed in the streaming interface according to lines, so that the user can visually see that the first line in the paragraph includes the character w1To w5The second row comprising the character w6To w9
After a user performs a trigger operation on a certain paragraph in a layout interface or a streaming interface, the paragraph enters an editing mode, and the user may perform a document editing operation on any line of the paragraph in the streaming interface, where a line corresponding to the document editing operation is referred to as a target line, and the document editing operation may include: add character operations, delete character operations, modify character operations, and the like. And responding to the document editing operation, editing the target line according to the document editing operation, acquiring the original line content and the edited line content of the target line in the streaming document, and comparing the edited line content with the original line content to obtain the editing operation information of the target line. It is known from the editing operation information what processing is specifically performed on which character or characters in the target line.
Step S206, searching the character list of the target line and the layout information of the target line which are stored in advance.
The character list of the target line and the layout information of the target line can be searched from the character list of each line and the layout information of each line in the layout document stored in the database according to the line identification information of the target line. Recording each character included in the layout document by the target line and the character position of each character in the layout document by the character list of the target line; the layout information of the target line records each line object included in the target line, each line object is at least configured with a content attribute and a position attribute, the content attribute records characters corresponding to the line object, and the position attribute records character positions of the characters corresponding to the line object.
Step S207, updating each character and each character position in the character list according to the editing operation information.
And determining the edited target character and the adjacent character of the target character according to the editing operation information. Wherein, what processing is specifically performed on which character or characters in the target line can be known according to the editing operation information, and the character added, deleted or modified in the target line is called the edited target character.
For example, the editing operation information records that a character H is added between a character a and a character B, then the target character is the added character H, and the adjacent characters of the target character include the character a and the character B; for another example, the editing operation information records a character C between the deleted character B and the character D, then the target character is the deleted character C, and the adjacent characters of the target character include the character B and the character D; for another example, the editing operation information records that the characters D and E are modified into the characters I, J, and K, and then the target character is a modified character, and specifically includes the characters I, J, and K.
And if the target character is an increased character, generating a new character position between the character positions of the adjacent characters in the character list, and filling the target character to the new character position, wherein the generated new character position corresponds to the increased number of characters. For example, when the target character includes two added characters, two new character positions are generated between the character positions of adjacent characters in the character list, and the two added characters are filled in the two new character positions, respectively.
And if the target character is the deleted character, deleting the character position of the target character and the target character filled in the character position of the target character in the character list.
If the target character is a modified character, character positions with the number meeting the character number of the target character are set between the character positions of adjacent characters in the character list, and the target character is filled to the set character positions. Considering that the operation of modifying characters substantially includes the operation of deleting characters and the operation of adding characters, the case that the target character is the modified character can be subdivided into two cases according to whether the number of characters corresponding to the operation of deleting characters is equal to the number of words corresponding to the operation of adding characters. When the number of characters corresponding to the character deleting operation is equal to the number of words corresponding to the character adding operation, the position of the character is not required to be newly added or deleted in the character list, and the target character is only required to be filled to the original character position of the deleted character. When the number of characters corresponding to the delete character operation is not equal to the number of words corresponding to the add character operation, the character positions in the character list need to be updated so that the number of character positions existing between the character positions of adjacent characters of the target character is equal to the number of characters of the target character, and then the target character is filled to the character position existing between the character positions of adjacent characters of the target character.
And step S208, updating the layout information of the target line according to the edited line content and the updated character list.
The edited line content comprises tags and tag identifications of a target line in a source file corresponding to the streaming document and characters corresponding to each tag identification; the label identification of the target line has a corresponding relation with the line object in the format information of the target line. In step S208, matching the characters corresponding to each tag identifier in the edited line content with each character in the updated character list, determining the character position of the character corresponding to each tag identifier in the layout document, and then updating the content attribute and the position attribute of the line object in the layout information of the target line according to the character corresponding to each tag identifier and the character position of the character corresponding to each tag identifier in the layout document.
It is assumed that, before a document editing operation is performed, in a source file corresponding to a streaming document, original line content of a target line includes 3 tags, tag identifications of the 3 tags are ID1, ID2 and ID3, respectively, wherein characters corresponding to ID1 include characters a, characters corresponding to ID2 include characters B and C, and characters corresponding to ID3 include characters D, E and F; correspondingly, the layout information of the target line script includes 3 line objects, where the 3 line objects are line object 1 to line object 3, where line object 1 corresponds to ID1, line object 2 corresponds to ID2, line object 3 corresponds to ID3, the content attribute of line object 1 records character a, the position attribute of line object 1 records character position of character a, the content attribute of line object 2 records character B, C, the position attribute of line object 2 records character position of character B, C, the content attribute of line object 3 records characters D, E and F, and the position attribute of line object 3 records character positions of characters D, E and F; the character list of the target line script is shown in fig. 2 b.
The user performs a document editing operation on the target line, and in the source file corresponding to the streaming document, the edited line content still includes 3 tags, wherein the character corresponding to the ID1 includes the character a, the character corresponding to the ID2 is updated to the characters G, J and K, the character corresponding to the ID3 includes the characters D, E and F, which indicates that the user modifies the character B, C into the characters G, J and K, and the updated character list may be as shown in fig. 2 e. And matching the characters corresponding to the label identifications in the edited line content with the characters in the updated character list, and finding the character positions of the characters corresponding to the IDs 1, 2 and 3 in the layout document from the updated character list. As can be seen from the edited line content and the updated character list, if the character and the character position corresponding to the ID2 change, the content attribute and the position attribute of the line object 2 in the format information of the target line are updated according to the character positions of the character corresponding to the ID2 and the character corresponding to the ID2 in the format document, that is, the content attribute of the line object 2 is updated to the character corresponding to the ID2 in the edited line content, and the position attribute of the line object 2 is updated to the character position of the character corresponding to the ID2 in the format document found from the updated character list, so that the update of the format information of the target line is completed.
By using the document editing operation synchronization method provided by the embodiment, the character list, the format information, the editing operation information and the line content are managed in a row unit, so that the high-efficiency management of the related information of each row in the document is realized; and updating the pre-stored character list of the target line according to the editing operation information of the target line, and then updating the pre-stored format information of the target line according to the edited line content and the updated character list. According to the scheme, on the premise of ensuring convenience of stream type document editing, the editing operation information of the user for the stream type document is conveniently and rapidly synchronized into the format document, the consistency of the line segment structure between the stream type document and the format document is effectively ensured, the problem is avoided when the editing operation is carried out, and convenience and correction efficiency of user correction are greatly improved.
EXAMPLE III
The third embodiment of the present invention provides a nonvolatile storage medium, where the storage medium stores at least one executable instruction, and the executable instruction may execute the document editing operation synchronization method in any of the above method embodiments.
The executable instructions may be specifically configured to cause the processor to: responding to the document editing operation executed by a user on a target line in a streaming interface, editing the target line, acquiring line content of the target line edited in the streaming document, and analyzing the edited line content to obtain editing operation information of the target line; the streaming interface is used for displaying streaming documents; searching a character list of a pre-stored target line and format information of the target line; the character list records each character included in the layout document by the target line and the character position of each character in the layout document; updating each character and each character position in the character list according to the editing operation information; and updating the format information of the target line according to the edited line content and the updated character list.
In an alternative embodiment, the executable instructions further cause the processor to: and comparing the edited line content with the original line content of the target line to obtain the editing operation information of the target line.
In an alternative embodiment, the executable instructions further cause the processor to: identifying line segment information of each paragraph in the layout document and character styles contained in each paragraph; according to the line segment information of each paragraph, splitting each paragraph according to the lines, and determining each character included in each line and the character position of each character in the format document to obtain a character list of each line; aiming at each line in the layout document, obtaining layout information of each line according to each character included in the line, the character position of each character in the layout document and the character style of each character; and storing the character list of each line and the layout information of each line in the layout document.
In an alternative embodiment, the executable instructions further cause the processor to: and configuring at least one line object for each line in the layout document according to the character style of each character in the line, and configuring the content attribute and the position attribute of the line object of the line according to each character in the line and the character position of each character in the layout document.
In an alternative embodiment, the executable instructions further cause the processor to: determining the edited target character and the adjacent character of the target character according to the editing operation information; if the target character is an increased character, generating a new character position between the character positions of adjacent characters in the character list, and filling the target character to the new character position; if the target character is the deleted character, deleting the character position of the target character and the target character filled in the character position of the target character in the character list; if the target character is a modified character, character positions with the number meeting the character number of the target character are set between the character positions of adjacent characters in the character list, and the target character is filled to the set character positions.
In an optional implementation manner, the edited line content includes a tag in a source file corresponding to the streaming document in a target line, a tag identifier, and a character corresponding to each tag identifier; the label identification of the target line has a corresponding relation with the line object in the format information of the target line; the executable instructions further cause the processor to: matching characters corresponding to all label identifications in the edited line content with all characters in the updated character list, and determining the character positions of the characters corresponding to all label identifications in the layout document; and updating the content attribute and the position attribute of the line object in the layout information of the target line according to the characters corresponding to the label identifications and the character positions of the characters corresponding to the label identifications in the layout document.
Example four
Fig. 3 is a schematic structural diagram of a computing device according to a fourth embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 3, the computing device may include: a processor (processor)302, a communication Interface 304, a memory 306, and a communication bus 308.
Wherein:
the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 308.
A communication interface 304 for communicating with network elements of other devices, such as clients or other servers.
The processor 302 is configured to execute the program 310, and may specifically execute the relevant steps in the above-described document editing operation synchronization method embodiment.
In particular, program 310 may include program code comprising computer operating instructions.
The processor 302 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 310 may specifically be configured to cause the processor 302 to perform the following operations: responding to the document editing operation executed by a user on a target line in a streaming interface, editing the target line, acquiring line content of the target line edited in the streaming document, and analyzing the edited line content to obtain editing operation information of the target line; the streaming interface is used for displaying streaming documents; searching a character list of a pre-stored target line and format information of the target line; the character list records each character included in the layout document by the target line and the character position of each character in the layout document; updating each character and each character position in the character list according to the editing operation information; and updating the format information of the target line according to the edited line content and the updated character list.
In an alternative embodiment, program 310 further causes processor 302 to: and comparing the edited line content with the original line content of the target line to obtain the editing operation information of the target line.
In an alternative embodiment, program 310 further causes processor 302 to: identifying line segment information of each paragraph in the layout document and character styles contained in each paragraph; according to the line segment information of each paragraph, splitting each paragraph according to the lines, and determining each character included in each line and the character position of each character in the format document to obtain a character list of each line; aiming at each line in the layout document, obtaining layout information of each line according to each character included in the line, the character position of each character in the layout document and the character style of each character; and storing the character list of each line and the layout information of each line in the layout document.
In an alternative embodiment, program 310 further causes processor 302 to: and configuring at least one line object for each line in the layout document according to the character style of each character in the line, and configuring the content attribute and the position attribute of the line object of the line according to each character in the line and the character position of each character in the layout document.
In an alternative embodiment, program 310 further causes processor 302 to: determining the edited target character and the adjacent character of the target character according to the editing operation information; if the target character is an increased character, generating a new character position between the character positions of adjacent characters in the character list, and filling the target character to the new character position; if the target character is the deleted character, deleting the character position of the target character and the target character filled in the character position of the target character in the character list; if the target character is a modified character, character positions with the number meeting the character number of the target character are set between the character positions of adjacent characters in the character list, and the target character is filled to the set character positions.
In an optional implementation manner, the edited line content includes a tag in a source file corresponding to the streaming document in a target line, a tag identifier, and a character corresponding to each tag identifier; the label identification of the target line has a corresponding relation with the line object in the format information of the target line; program 310 further causes processor 302 to perform the following: matching characters corresponding to all label identifications in the edited line content with all characters in the updated character list, and determining the character positions of the characters corresponding to all label identifications in the layout document; and updating the content attribute and the position attribute of the line object in the layout information of the target line according to the characters corresponding to the label identifications and the character positions of the characters corresponding to the label identifications in the layout document.
For specific implementation of each step in the program 310, reference may be made to the description corresponding to the corresponding step in the above document editing operation synchronization embodiment, which is not described herein again. It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the above-described device may refer to the corresponding process description in the foregoing method embodiment, and is not described herein again.
Through the scheme provided by the embodiment, the editing operation information of the user for the streaming document is conveniently synchronized to the format document, the consistency of the line segment structure between the streaming document and the format document is effectively ensured, the problem in the editing operation is avoided, and the convenience and the correction efficiency of user correction are greatly improved.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the claims, any of the claimed embodiments may be used in any combination.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.

Claims (11)

1. A document editing operation synchronization method includes:
responding to a document editing operation executed by a user on a target line in a streaming interface, editing the target line, acquiring line content edited by the target line in a streaming document, and analyzing the edited line content to obtain editing operation information of the target line; the streaming interface is used for displaying streaming documents;
searching a pre-stored character list of the target line and the layout information of the target line; the character list records each character included in the layout document by the target line and the character position of each character in the layout document;
updating each character and each character position in the character list according to the editing operation information;
updating the format information of the target line according to the edited line content and the updated character list;
wherein, prior to the document editing operation performed in response to the user in the streaming interface for the target line, the method further comprises:
identifying line segment information of each paragraph in the layout document and character styles contained in each paragraph;
according to the line segment information of each paragraph, splitting each paragraph according to the lines, and determining each character included in each line and the character position of each character in the layout document to obtain a character list of each line;
for each line in the layout document, obtaining layout information of each line according to each character included in the line, the character position of each character in the layout document and the character style of each character;
and storing the character list of each line and the layout information of each line in the layout document.
2. The method of claim 1, the analyzing the edited line content for editing operation information of the target line further comprising:
and comparing the edited row content with the original row content of the target row to obtain the editing operation information of the target row.
3. The method of claim 1, wherein for each line in the layout document, obtaining layout information of each line according to each character included in the line, a character position of each character in the layout document, and a character style of each character further comprises:
and configuring at least one line object for each line in the layout document according to the character style of each character in the line, and configuring the content attribute and the position attribute of the line object of the line according to each character in the line and the character position of each character in the layout document.
4. The method according to any one of claims 1-3, wherein the updating each character and each character position in the character list according to the editing operation information further comprises:
determining the edited target character and the adjacent character of the target character according to the editing operation information;
if the target character is an increased character, generating a new character position between the character positions of adjacent characters in the character list, and filling the target character to the new character position;
if the target character is a deleted character, deleting the character position of the target character and the target character filled in the character position of the target character in the character list;
if the target character is a modified character, setting character positions with the number meeting the character number of the target character between the character positions of adjacent characters in the character list, and filling the target character to the set character positions.
5. The method according to any one of claims 1-3, wherein the edited line content comprises tags, tag identifications and characters corresponding to each tag identification in the source file corresponding to the stream document of the target line; the label identification of the target line has a corresponding relation with a line object in the format information of the target line;
the updating the layout information of the target line according to the edited line content and the updated character list further includes:
matching characters corresponding to all label identifications in the edited row content with all characters in an updated character list, and determining character positions of the characters corresponding to all label identifications in the layout document;
and updating the content attribute and the position attribute of the line object in the format information of the target line according to the character corresponding to each label identification and the character position of the character corresponding to each label identification in the format document.
6. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to:
responding to a document editing operation executed by a user on a target line in a streaming interface, editing the target line, acquiring line content edited by the target line in a streaming document, and analyzing the edited line content to obtain editing operation information of the target line; the streaming interface is used for displaying streaming documents;
searching a pre-stored character list of the target line and the layout information of the target line; the character list records each character included in the layout document by the target line and the character position of each character in the layout document;
updating each character and each character position in the character list according to the editing operation information;
updating the format information of the target line according to the edited line content and the updated character list;
wherein the executable instructions further cause the processor to:
identifying line segment information of each paragraph in the layout document and character styles contained in each paragraph;
according to the line segment information of each paragraph, splitting each paragraph according to the lines, and determining each character included in each line and the character position of each character in the layout document to obtain a character list of each line;
for each line in the layout document, obtaining layout information of each line according to each character included in the line, the character position of each character in the layout document and the character style of each character;
and storing the character list of each line and the layout information of each line in the layout document.
7. The computing device of claim 6, the executable instructions further cause the processor to:
and comparing the edited row content with the original row content of the target row to obtain the editing operation information of the target row.
8. The computing device of claim 6, the executable instructions further cause the processor to:
and configuring at least one line object for each line in the layout document according to the character style of each character in the line, and configuring the content attribute and the position attribute of the line object of the line according to each character in the line and the character position of each character in the layout document.
9. The computing device of any of claims 6-8, the executable instructions further causing the processor to:
determining the edited target character and the adjacent character of the target character according to the editing operation information;
if the target character is an increased character, generating a new character position between the character positions of adjacent characters in the character list, and filling the target character to the new character position;
if the target character is a deleted character, deleting character positions between character positions of adjacent characters and the target character filled in the character positions in the character list;
if the target character is a modified character, setting character positions with the number meeting the character number of the target character between the character positions of adjacent characters in the character list, and filling the target character to the set character positions.
10. The computing device of any of claims 6-8, wherein the edited line content includes a tag in a source file corresponding to the streaming document, a tag identification, and a character corresponding to each tag identification of the target line; the label identification of the target line has a corresponding relation with a line object in the format information of the target line;
the executable instructions further cause the processor to:
matching characters corresponding to all label identifications in the edited row content with all characters in an updated character list, and determining character positions of the characters corresponding to all label identifications in the layout document;
and updating the content attribute and the position attribute of the line object in the format information of the target line according to the character corresponding to each label identification and the character position of the character corresponding to each label identification in the format document.
11. A computer storage medium having stored therein at least one executable instruction for causing a processor to perform operations corresponding to the document editing operation synchronization method of any one of claims 1-5.
CN202110594360.9A 2021-05-28 2021-05-28 Document editing operation synchronization method, computing device and storage medium Active CN113221507B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110594360.9A CN113221507B (en) 2021-05-28 2021-05-28 Document editing operation synchronization method, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110594360.9A CN113221507B (en) 2021-05-28 2021-05-28 Document editing operation synchronization method, computing device and storage medium

Publications (2)

Publication Number Publication Date
CN113221507A CN113221507A (en) 2021-08-06
CN113221507B true CN113221507B (en) 2022-02-11

Family

ID=77099250

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110594360.9A Active CN113221507B (en) 2021-05-28 2021-05-28 Document editing operation synchronization method, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN113221507B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069767A (en) * 2019-04-23 2019-07-30 掌阅科技股份有限公司 Composition method, electronic equipment and computer storage medium based on e-book
CN112329419A (en) * 2020-11-05 2021-02-05 深圳壹账通智能科技有限公司 Document editing method, device, server, terminal and storage medium
CN112667438A (en) * 2020-12-24 2021-04-16 万兴科技集团股份有限公司 Text saving and restoring method and device, computer equipment and storage medium

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102211B (en) * 2007-07-09 2010-07-14 中兴通讯股份有限公司 A method for sharing the document in data conference and its system
US9176953B2 (en) * 2008-06-04 2015-11-03 Tianjin Sursen Investment Co., Ltd. Method and system of web-based document service
CN102214162A (en) * 2011-06-14 2011-10-12 汉王科技股份有限公司 Document displaying method, electric reader and system
CN104462036B (en) * 2013-09-25 2017-10-17 北大方正集团有限公司 A kind of method and system of the format information of synchro edit document
US9355313B2 (en) * 2014-03-11 2016-05-31 Microsoft Technology Licensing, Llc Detecting and extracting image document components to create flow document
CN104951429A (en) * 2014-03-26 2015-09-30 阿里巴巴集团控股有限公司 Recognition method and device for page headers and page footers of format electronic document
CN105446946B (en) * 2014-07-17 2019-08-02 阿里巴巴集团控股有限公司 Rearrangement method, system and the electronic reading terminal of format document
CN106708801B (en) * 2016-11-29 2020-08-28 深圳市天朗时代科技有限公司 Proofreading method for text
US10565168B2 (en) * 2017-05-02 2020-02-18 Oxygen Cloud, Inc. Independent synchronization with state transformation
CN110287465B (en) * 2019-06-22 2022-04-05 广州视源电子科技股份有限公司 Text processing method, device, equipment and storage medium
CN111291572B (en) * 2020-01-20 2023-06-09 Oppo广东移动通信有限公司 Text typesetting method and device and computer readable storage medium
CN111611776B (en) * 2020-05-22 2023-07-25 北京信息科技大学 Method and device for compatible edition flow document content and supporting synchronous reading

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110069767A (en) * 2019-04-23 2019-07-30 掌阅科技股份有限公司 Composition method, electronic equipment and computer storage medium based on e-book
CN112329419A (en) * 2020-11-05 2021-02-05 深圳壹账通智能科技有限公司 Document editing method, device, server, terminal and storage medium
CN112667438A (en) * 2020-12-24 2021-04-16 万兴科技集团股份有限公司 Text saving and restoring method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN113221507A (en) 2021-08-06

Similar Documents

Publication Publication Date Title
CN109508191B (en) Code generation method and system
CN105183760B (en) Webpage component loading method and device
US7720814B2 (en) Repopulating a database with document content
CN110334326B (en) A kind of method and system for identifying recipe file and being converted into XML file
CN111797351A (en) Page data management method and device, electronic equipment and medium
CN113312033A (en) Template protocol generation and management method
WO2020010724A1 (en) Front-end static resource management method, apparatus, computer device and storage medium
CN111078580A (en) Test case management method and device, storage medium and electronic equipment
CN104052626A (en) Method, device and system for configuring network element data
CN109165332A (en) A kind of webpage information acquisition methods, device and equipment
CN113518187B (en) Video editing method and device
CN112785248B (en) Human resource data cross-organization interaction method, device, equipment and storage medium
CN113221507B (en) Document editing operation synchronization method, computing device and storage medium
CN113177392B (en) Method for synchronizing row segment information in proofreading interface, computing device and storage medium
CN113177391B (en) Method for redirecting operation cursor in streaming interface, computing equipment and storage medium
JP2019101889A (en) Test execution device and program
EP3671487A2 (en) Generation of a video file
US8589426B1 (en) Simultaneous file editor
CN116452123A (en) Method and device for generating characteristic value of inventory item and computer equipment
CN105426676A (en) Drilling data processing method and system
CN110795915A (en) Method, system, equipment and computer-readable storage medium for modifying xml file in batch
CN111651531B (en) Data importing method, device, equipment and computer storage medium
US20160224918A1 (en) Business influenced part extraction method and business influenced part extraction device based on business variation
JP2018036843A (en) Device, method, and program
CN112052222A (en) Heterogeneous object storage cluster access method, device, equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant