Text generation method and device, equipment and storage medium

By using a rich text editor and operation conversion algorithms to generate consistent document content, the problem of chaotic document formatting and conflicts in multi-person collaboration in traditional interfaces has been solved, achieving efficient structured document management and annotation control.

CN121145809APending Publication Date: 2025-12-16CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511229508.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-08-29
Publication Date
2025-12-16

AI Technical Summary

Technical Problem

Traditional interface documentation formats are often disorganized and involve a lot of repetitive work. When multiple people collaborate, data loss and work conflicts are likely to occur, making it difficult to achieve real-time, conflict-free collaboration.

Method used

The system generates structured documents using a pre-built rich text editor, receives multi-user operation sequences, merges operations using an operation transformation algorithm, generates consistent text content, and supports annotation management and multi-format export.

Benefits of technology

It improves the collaboration efficiency and structured management capabilities of interface documents, ensuring the consistency of document content and access control of annotation information when multiple people collaborate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121145809A_ABST
    Figure CN121145809A_ABST
Patent Text Reader

Abstract

The invention discloses a text generation method and device, equipment and a storage medium, and the method comprises the steps: carrying out the dynamic binding of an obtained predefined document template or a document template uploaded by a user through a preset rich text editor, and generating a structured document capable of editing rich text content; application documents sent by multiple users are received, the application documents are generated according to operation sequences carried out by the users in the structured documents, and the operation sequences comprise insertion, deletion, format modification and timestamps; the application documents are merged and concurrently operated through an operation conversion algorithm, a target text is generated, the target text is consistent text content, and the problem that in the related technology, in the aspect of current traditional interface documents, the text content is not consistent is solved. The technical problems that in the prior art, the format is disordered, the labor is repeated, and it cannot be ensured that multiple persons edit and operate the same document, code or project resource at the same time for real-time collaboration without conflicts are solved, and the collaboration efficiency and the structured management capacity of the interface document are remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of text processing, specifically to a method, apparatus, device, and computer-readable storage medium for generating text. Background Technology

[0002] Currently, traditional interface documentation suffers from prominent issues such as inconsistent formatting and repetitive work. Furthermore, ensuring conflict-free collaboration becomes a significant challenge in real-time team collaboration scenarios, especially in teams of hundreds. As teams grow, the frequency of multiple people simultaneously editing and manipulating the same document, code, or project resources increases dramatically, drastically raising the probability of conflicts. Traditional collaboration methods, such as file-sharing-based collaboration, easily lead to situations where later saves overwrite earlier saves, resulting in data loss and work conflicts. Summary of the Invention

[0003] This application provides a text generation method, apparatus, device, and computer-readable storage medium, which can solve the technical problems existing in the current traditional interface documents, such as chaotic formatting, repetitive work, and inability to ensure real-time collaboration without conflicts when multiple people simultaneously edit and operate the same document, code, or project resources.

[0004] In a first aspect, embodiments of this application provide a method for generating text, characterized in that the method for generating text includes: By dynamically binding the obtained predefined document template or the user-uploaded document template to a pre-built rich text editor, a structured document with editable rich text content is generated. The document template contains the structured information of the interface document. The system receives application documents sent by multiple users, wherein the application documents are generated based on a sequence of operations performed by each user in the structured document, the sequence of operations including insertion, deletion, format modification, and timestamp. Multiple application documents are merged concurrently using an operation transformation algorithm to generate target text, wherein the target text contains consistent text content.

[0005] In conjunction with the first aspect, in one implementation, the step of dynamically binding the acquired predefined document template or the user-uploaded document template to a pre-built rich text editor to generate a structured document with editable rich text content includes: The obtained predefined or user-uploaded document templates are parsed to extract the title styles, font formats, and parameter table information from the document templates; Based on the extracted title style, font format, and parameter table information, an editable document is generated; The document is dynamically bound to a rich text editor to generate a structured document with editable rich text content.

[0006] In conjunction with the first aspect, in one implementation, the step of merging and concurrently operating on multiple application documents using an operation transformation algorithm to generate target text includes: Obtain a first operation performed by a first user at a first location in a first application document and a second operation performed by a second user at a first location in a second application document, wherein the first operation includes timestamp and content information and the second operation includes timestamp and content information; Compare the timestamps of the first operation and the second operation; If the timestamp of the first operation is greater than or equal to the timestamp of the second operation, then the first position of the second operation is adjusted based on the operation conversion algorithm to generate the adjusted operation sequence; Based on the adjusted operation sequence, the target text is generated.

[0007] In conjunction with the first aspect, in one implementation, after comparing the timestamps of the first operation and the second operation, the method further includes: If the timestamp of the first operation is less than the timestamp of the second operation, the first position of the first operation is adjusted based on the operation conversion algorithm to generate an adjusted operation sequence. Based on the adjusted operation sequence, the target text is generated.

[0008] In conjunction with the first aspect, in one implementation, adjusting the first position of the second operation based on the operation transformation algorithm to generate an adjusted operation sequence includes: Based on the operation transformation algorithm, the first position of the second operation is adjusted to generate the adjusted second operation, wherein the adjusted second operation includes updated position information; The first operation and the adjusted second operation are combined to generate an adjusted operation sequence.

[0009] In conjunction with the first aspect, in one implementation, after generating the target text, the method further includes: Obtain annotation information from the target text, wherein the annotations are generated based on the sequence of operations performed by each user in the structured document; The permissions of the annotation information are set based on preset role permissions, wherein the annotation information is associated with the content of the target text; Export target text in multiple formats according to the preset format, and the target text retains rich text style and annotation information.

[0010] In conjunction with the first aspect, in one implementation, exporting target text in multiple formats according to a preset format includes: Obtain the export format selected by the user from preset formats, wherein the preset formats include PDF, Word, or Markdown; Convert the rich text content in the target text to the target format, preserving the style and annotation information; Add a digital watermark to the target text to be exported in multiple formats, wherein the digital watermark includes a user identifier and a timestamp; Generate target text containing annotation information, wherein the annotation information is displayed in the form of footnotes or sidebars.

[0011] Secondly, embodiments of this application provide a text generation apparatus, the text generation apparatus comprising: The first generation module is used to dynamically bind the obtained predefined document template or the user-uploaded document template to a pre-set rich text editor to generate a structured document with editable rich text content, wherein the document template contains the structured information of the interface document. A receiving module is used to receive application documents sent by multiple users, wherein the application documents are generated based on the operation sequence performed by each user in the structured document, and the operation sequence includes insertion, deletion, format modification and timestamp; The second generation module is used to perform concurrent operations on multiple application documents through an operation conversion algorithm to generate target text, wherein the target text is consistent text content.

[0012] Thirdly, embodiments of this application provide a text generation device, which includes a processor, a memory, and a text generation program stored in the memory and executable by the processor, wherein when the text generation program is executed by the processor, it implements the steps of the text generation method described above.

[0013] Fourthly, embodiments of this application provide a computer-readable storage medium storing a text generation program, wherein when the text generation program is executed by a processor, it implements the steps of the text generation method described above.

[0014] The beneficial effects of the technical solutions provided in this application include: By dynamically binding predefined document templates or user-uploaded document templates to a pre-built rich text editor, a structured document with editable rich text content is generated. The document template contains structured information about the interface document. Multiple application documents sent by users are received. These application documents are generated based on a sequence of operations performed by each user in the structured document, including insertion, deletion, format modification, and timestamps. Multiple application documents are merged and concurrently processed using an operation transformation algorithm to generate a target text with consistent content. This approach solves the technical problems of format chaos, repetitive work, and the inability to ensure real-time, conflict-free collaboration when multiple users simultaneously edit and operate the same document, code, or project resources in traditional interface documents. It significantly improves the collaboration efficiency and structured management capabilities of interface documents. Attached Figure Description

[0015] Figure 1 This is a flowchart illustrating the first embodiment of the text generation method of this application; Figure 2 This is a schematic diagram of the functional modules of an embodiment of the text generation apparatus of this application; Figure 3 This is a schematic diagram of the hardware structure of the text generation device involved in the embodiments of this application. Detailed Implementation

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

[0017] First, some of the technical terms used in this application will be explained to help those skilled in the art understand this application.

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.

[0019] Firstly, embodiments of this application provide a method for generating text.

[0020] In one embodiment, reference is made to Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the text generation method of this application. Figure 1 As shown, the methods for generating text include: Step S10: Dynamically bind the obtained predefined document template or the user-uploaded document template to a pre-set rich text editor to generate a structured document with editable rich text content, wherein the document template contains the structured information of the interface document; Step S20: Receive application documents sent by multiple users, wherein the application documents are generated based on the operation sequence performed by each user in the structured document, and the operation sequence includes insertion, deletion, format modification and timestamp; Step S30: Perform concurrent operations on multiple application documents using an operation conversion algorithm to generate target text, wherein the target text is consistent text content.

[0021] The exemplary text template management module includes a pre-built library of interface document templates (such as API request templates and error code description templates), supporting user-defined template structures and placeholders. Templates are dynamically bound to a rich text editor; after a user selects a template, placeholders are automatically filled and a structured form is generated. Custom template files can also be uploaded. Templated document creation: After a user selects a template, the system references the template's title style, font format, table format, and other basic document template information into the interface document content, automatically rendering it as rich text content. Templates can be pre-built or uploaded by the user.

[0022] When user A edits a document, the sequence of operations (such as insertion and deletion) is broadcast to other users via WebSocket. The OT algorithm merges the operations from multiple devices to ensure content consistency. Basic operations in collaborative editing include: Insert, Delete, and Format. Each operation is accompanied by the following metadata: Position: the specific character position where the operation is applied; Content: the text content inserted or deleted; Timestamp: the logical time at which the operation was generated.

[0023] The core of the OT algorithm is to define a transformation function, which is used to adjust the execution order of two concurrent operations so that the results are consistent when applied to different document copies.

[0024] For example, if user A inserts "abc" at position 5 and user B inserts "def" at position 5, the conversion function must ensure that the result after insertion is "abcdef" or "defabc", rather than overwriting or misinterpreting.

[0025] Convergence: All users ultimately see the same document content. Intention Preservation: The effect of each action is as close as possible to the user's expectations.

[0026] For example, the following scenario illustrates the execution flow of the OT algorithm using two users (User A and User B) simultaneously editing the same document: Step 1: User A generates an operation Op_A locally (e.g., inserting "abc" at position 5) and applies it immediately to the local document.

[0027] Step 2: User A sends Op_A to the server, while User B generates an operation Op_B (e.g., inserts "def" at position 5), applies it to the local document, and then sends it to the server.

[0028] Step 3: After receiving Op_A and Op_B, the server finds that they are concurrent operations (i.e., they are unaware of each other's existence) and needs to be converted.

[0029] Step 4: Based on the OT conversion rules, generate the adjusted operations Op_A' and Op_B', such that if Op_A is applied first and then Op_B' is applied, the result is consistent with the result if Op_B is applied first and then Op_A' is applied.

[0030] Original operation: Op_A: Insert(5, "abc") Op_B: Insert(5, "def") Conversion logic: Since both Op_A and Op_B insert content at position 5, the position of one of the operations needs to be adjusted. If Op_A arrives at the server first, the position of Op_B' will be adjusted to 5 + len("abc") = 8, that is, Op_B' = Insert(8, "def"). The final document content is "abcdef".

[0031] Step 5: The server broadcasts the converted operations Op_A' and Op_B' to all clients.

[0032] Step 6: After receiving Op_A', User B needs to convert it to the locally applied Op_B to ensure that the local document state is consistent with the server.

[0033] Annotation Lifecycle Management: The core objective of annotation management is to allow users to add multimodal annotations (text, images, voice, etc.) to document content, and to achieve permission control, status tracking, and collaborative processing of annotations. After a user adds an annotation, the system triggers a notification to the relevant responsible person. When the annotation status changes, the document status is automatically updated and a log is generated. The core process is as follows: 1. Add annotation → 2. Storage and association → 3. Status update and notification → 4. Permission verification → 5. Export and display User Operation: Users select text or a region in the document and trigger the annotation addition interface via right-click menu, toolbar button, or keyboard shortcut. They enter annotation content (text, upload image, record voice), select the annotation type (e.g., "Question" or "Suggestion"), and submit. Anchor Point: Records the document position associated with the annotation (e.g., starting character offset, paragraph ID, or DOM node path). Rich Text Editor Extension: A plugin based on Quill.js or Slate.js that supports inserting annotation markers (e.g., highlight background color or icon) into the selected area. Annotation information includes text, images, or voice; records the starting and ending offsets of the annotation information; verifies user access permissions for annotations based on preset role permissions; generates notifications based on the annotation status and pushes them to relevant users. The system stores annotations in the database, recording the start and end offsets of each annotation, including: a unique identifier for each annotation, associated with a specific version of the document; anchor point information for each annotation, including start and end offsets; storing annotation content as structured data, including annotation type and status; pushing the storage status of annotations to relevant users via WebSocket; and updating the document's metadata to record the association relationships between annotations. It also records the version history of document modifications, generating a difference comparison, including: recording the differences in each document modification based on the Git protocol; generating a version history difference comparison, displaying the modified content and operator information; retrieving the target version selected by the user and performing a rollback operation; and storing version metadata in the database, including the version number and modification time. Supports exporting documents in multiple formats, preserving rich text styles and annotation information, including: obtaining the user-selected export format, including PDF, Word, or Markdown; converting rich text content to the target format, preserving styles and annotation status; adding digital watermarks to the exported document, including user identifiers and timestamps; verifying the integrity of the exported document based on cryptographic signatures; and generating a document with annotations, displayed as footnotes or sidebars.

[0034] Data structure design: Comment sheet: CREATE TABLE Comment ( id UUID PRIMARY KEY, -- Unique identifier for annotation doc_id UUID REFERENCES Document(id), -- The associated document ID content TEXT, -- Text content (JSON stores image / audio paths) type ENUM('text', 'image', 'voice'), status ENUM('pending', 'resolved', 'closed'), created_by UUID REFERENCES User(id), created_at TIMESTAMP, resolved_by UUID, resolved_at TIMESTAMP ); Association table (Comment_Anchor): CREATE TABLE Comment_Anchor ( comment_id UUID REFERENCES Comment(id), start_offset INT, -- Starting character offset end_offset INT, -- End character offset version INT REFERENCES Document_Version(version) -- Associated document version ); Backend processing: Receives annotation data submitted by the frontend, verifies user permissions (whether adding annotations is allowed), stores the annotation content in the database, and records the associated document location and version information.

[0035] Status transition: Pending → Resolved → Closed.

[0036] Users (such as developers) can modify the status, and the system records the operation log.

[0037] Real-time notifications: Push status changes to relevant users (e.g., comment creators) via WebSocket. Email / Message Queues: For asynchronous notifications, use RabbitMQ or Kafka to trigger emails or in-site messages.

[0038] Based on the RBAC model: Role definitions: Viewer: Can only view comments. Editor: Can add / modify comments. Admin: Can delete comments.

[0039] The front-end hides / shows action buttons based on the user's role. The back-end API verifies user permissions (such as role information in a JWT token).

[0040] Export processing: PDF / Word export: Annotations are displayed in the form of footnotes, endnotes, or sidebars, including status markers (such as "resolved"). Markdown export: Annotations are converted into comment syntax (<!-- Annotation content -->).

[0041] Sidebar panel: Lists all annotations and supports filtering by status and type. Interactive floating window: When clicking on the annotation marker, a floating window pops up, showing detailed information and operation buttons. Annotation generation interface document mechanism: Use annotations such as @EnableAPI, @Api, @ApiOperation, @ApiResponce, @ApiParam, @ApiModel, @ApiModelProperty, etc. to complete the definition of the data required for the interface.

[0042] The specific process is as follows: Create a configuration class to complete the definition of the global information of the interface document

[0043] Add Api annotations to the Controller and interface methods

[0044] Use annotations in the DTO / Model class to describe fields

[0045] Secure export mechanism: Automatically add digital watermarks (such as user ID, timestamp) during export and encrypt and sign the file to prevent tampering.

[0046] In this embodiment, a predefined document template or a document template uploaded by a user is dynamically bound through a preset rich text editor to generate a structured document with editable rich text content. Among them, the document template contains the structured information of the interface document; receive application documents sent by multiple users. Among them, the application document is generated according to the operation sequences of each user in the structured document, and the operation sequences include insertion, deletion, format modification, and timestamp; perform merge and concurrent operations on multiple application documents through an operation conversion algorithm to generate a target text, where the target text is consistent text content, solving the technical problems of format chaos, repetitive labor, and inability to ensure real-time collaboration without conflicts when multiple people edit and operate the same document, code, or project resources simultaneously in the current traditional interface document in the related technology, and significantly improving the collaboration efficiency and structured management ability of the interface document.

[0047] In the second aspect, the embodiment of the present application also provides a text generation device.

[0048] In one embodiment, refer to Figure 2 , Figure 2 This is a schematic diagram of the functional modules of an embodiment of the text generation apparatus of this application. Figure 2 As shown, the text generation device includes: The first generation module 10 is used to dynamically bind the obtained predefined document template or the user-uploaded document template to a pre-set rich text editor to generate a structured document with editable rich text content, wherein the document template contains the structured information of the interface document. The receiving module 20 is used to receive application documents sent by multiple users, wherein the application documents are generated based on the operation sequence performed by each user in the structured document, and the operation sequence includes insertion, deletion, format modification and timestamp; The second generation module 30 is used to perform concurrent operations on multiple application documents through an operation conversion algorithm to generate target text, wherein the target text is consistent text content.

[0049] Furthermore, in one embodiment, the first generation module 10 is used to: The obtained predefined or user-uploaded document templates are parsed to extract the title styles, font formats, and parameter table information from the document templates; Based on the extracted title style, font format, and parameter table information, an editable document is generated; The document is dynamically bound to a rich text editor to generate a structured document with editable rich text content.

[0050] Furthermore, in one embodiment, the second generation module 30 is used for: Obtain a first operation performed by a first user at a first location in a first application document and a second operation performed by a second user at a first location in a second application document, wherein the first operation includes timestamp and content information and the second operation includes timestamp and content information; Compare the timestamps of the first operation and the second operation; If the timestamp of the first operation is greater than or equal to the timestamp of the second operation, then the first position of the second operation is adjusted based on the operation conversion algorithm to generate the adjusted operation sequence; Based on the adjusted operation sequence, the target text is generated.

[0051] Furthermore, in one embodiment, the text generation apparatus further includes a new module for: The / xx module is used for: If the timestamp of the first operation is less than the timestamp of the second operation, the first position of the first operation is adjusted based on the operation conversion algorithm to generate an adjusted operation sequence. Based on the adjusted operation sequence, the target text is generated.

[0052] Furthermore, in one embodiment, the text generation apparatus further includes a new module for: The / xx module is used for: Based on the operation transformation algorithm, the first position of the second operation is adjusted to generate the adjusted second operation, wherein the adjusted second operation includes updated position information; The first operation and the adjusted second operation are combined to generate an adjusted operation sequence.

[0053] Furthermore, in one embodiment, the text generation apparatus further includes a new module for: The / xx module is used for: Obtain annotation information from the target text, wherein the annotations are generated based on the sequence of operations performed by each user in the structured document; The permissions of the annotation information are set based on preset role permissions, wherein the annotation information is associated with the content of the target text; Export target text in multiple formats according to the preset format, and the target text retains rich text style and annotation information.

[0054] Furthermore, in one embodiment, the text generation apparatus further includes a new module for: The / xx module is used for: Obtain the export format selected by the user from preset formats, wherein the preset formats include PDF, Word, or Markdown; Convert the rich text content in the target text to the target format, preserving the style and annotation information; Add a digital watermark to the target text to be exported in multiple formats, wherein the digital watermark includes a user identifier and a timestamp; Generate target text containing annotation information, wherein the annotation information is displayed in the form of footnotes or sidebars.

[0055] The functions of each module in the above-mentioned text generation device correspond to the steps in the above-mentioned text generation method embodiment, and their functions and implementation processes will not be described in detail here.

[0056] Thirdly, embodiments of this application provide a text generation device, which can be a personal computer (PC), laptop computer, server, or other device with data processing capabilities.

[0057] Reference Figure 3 , Figure 3This is a schematic diagram of the hardware structure of the text generation device involved in the embodiments of this application. In the embodiments of this application, the text generation device may include a processor, a memory, a communication interface, and a communication bus.

[0058] The communication bus can be of any type and is used to interconnect the processor, memory, and communication interface.

[0059] Communication interfaces include input / output (I / O) interfaces, physical interfaces, and logical interfaces used for interconnecting internal components of the text-generating device, as well as interfaces used for interconnecting the text-generating device with other devices (such as other computing devices or user equipment). Physical interfaces can be Ethernet interfaces, fiber optic interfaces, ATM interfaces, etc.; user equipment can be displays, keyboards, etc.

[0060] Memory can be various types of storage media, such as random access memory (RAM), read-only memory (ROM), non-volatile RAM (NVRAM), flash memory, optical storage, hard disk, programmable ROM (PROM), erasable PROM (EPROM), electrically erasable PROM (EEPROM), etc.

[0061] The processor can be a general-purpose processor, which can call a text generation program stored in memory and execute the text generation method provided in the embodiments of this application. For example, the general-purpose processor can be a central processing unit (CPU). The method executed when the text generation program is called can be referred to in the various embodiments of the text generation method of this application, and will not be repeated here.

[0062] Those skilled in the art will understand that Figure 3 The hardware structure shown does not constitute a limitation of this application and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0063] Fourthly, embodiments of this application also provide a computer-readable storage medium.

[0064] The present application provides a computer-readable storage medium storing a text generation program, wherein when the text generation program is executed by a processor, it implements the steps of the text generation method described above.

[0065] The method implemented when the text generation program is executed can be referred to in various embodiments of the text generation method of this application, and will not be repeated here.

[0066] It should be noted that the sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0067] The terms "comprising" and "having," and any variations thereof, in the specification, claims, and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the listed steps or units, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to such process, method, product, or apparatus. The terms "first," "second," and "third," etc., are used to distinguish different objects, etc., and do not indicate a sequence, nor do they limit "first," "second," and "third" to different types.

[0068] In the description of the embodiments of this application, terms such as "exemplary," "for example," or "for instance" are used to indicate examples, illustrations, or explanations. Any embodiment or design described as "exemplary," "for example," or "for instance" in the embodiments of this application should not be construed as being more preferred or advantageous than other embodiments or designs. Specifically, the use of terms such as "exemplary," "for example," or "for instance" is intended to present the relevant concepts in a concrete manner.

[0069] In the description of the embodiments of this application, unless otherwise stated, " / " means "or". For example, A / B can mean A or B. The "and / or" in the text is merely a description of the relationship between related objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. In addition, in the description of the embodiments of this application, "multiple" means two or more.

[0070] In some processes described in the embodiments of this application, multiple operations or steps are included in a specific order. However, it should be understood that these operations or steps may not be executed in the order they appear in the embodiments of this application, or they may be executed in parallel. The sequence number of the operation is only used to distinguish different operations, and the sequence number itself does not represent any execution order. In addition, these processes may include more or fewer operations, and these operations or steps may be executed sequentially or in parallel, and these operations or steps may be combined.

[0071] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device to execute the methods described in the various embodiments of this application.

[0072] The above are merely preferred embodiments of this application and do not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.

Claims

1. A method for generating text, characterized in that, The method for generating the text includes: By dynamically binding the obtained predefined document template or the user-uploaded document template to a pre-built rich text editor, a structured document with editable rich text content is generated, wherein the document template contains the structured information of the interface document; The system receives application documents sent by multiple users, wherein the application documents are generated based on a sequence of operations performed by each user in the structured document, the sequence of operations including insertion, deletion, format modification, and timestamp. Multiple application documents are merged concurrently using an operation transformation algorithm to generate target text, wherein the target text contains consistent text content.

2. The text generation method as described in claim 1, characterized in that, The step of dynamically binding the acquired predefined document template or user-uploaded document template to a pre-built rich text editor to generate a structured document with editable rich text content includes: The obtained predefined or user-uploaded document templates are parsed to extract the title styles, font formats, and parameter table information from the document templates; Based on the extracted title style, font format, and parameter table information, an editable document is generated; The document is dynamically bound to a rich text editor to generate a structured document with editable rich text content.

3. The text generation method as described in claim 1, characterized in that, The step of merging and concurrently operating multiple application documents using an operation transformation algorithm to generate target text includes: Obtain a first operation performed by a first user at a first location in a first application document and a second operation performed by a second user at a first location in a second application document, wherein the first operation includes timestamp and content information and the second operation includes timestamp and content information; Compare the timestamps of the first operation and the second operation; If the timestamp of the first operation is greater than or equal to the timestamp of the second operation, then the first position of the second operation is adjusted based on the operation conversion algorithm to generate the adjusted operation sequence; Based on the adjusted operation sequence, the target text is generated.

4. The text generation method as described in claim 3, characterized in that, After comparing the timestamps of the first operation and the second operation, the method further includes: If the timestamp of the first operation is less than the timestamp of the second operation, the first position of the first operation is adjusted based on the operation conversion algorithm to generate an adjusted operation sequence. Based on the adjusted operation sequence, the target text is generated.

5. The text generation method as described in claim 3, characterized in that, The step of adjusting the first position of the second operation based on the operation transformation algorithm to generate the adjusted operation sequence includes: Based on the operation transformation algorithm, the first position of the second operation is adjusted to generate the adjusted second operation, wherein the adjusted second operation includes updated position information; The first operation and the adjusted second operation are combined to generate an adjusted operation sequence.

6. The text generation method as described in claim 1, characterized in that, After generating the target text, the process also includes: Obtain annotation information from the target text, wherein the annotations are generated based on the sequence of operations performed by each user in the structured document; The permissions of the annotation information are set based on preset role permissions, wherein the annotation information is associated with the content of the target text; Export target text in multiple formats according to the preset format, and the target text retains rich text style and annotation information.

7. The text generation method as described in claim 6, characterized in that, The step of exporting target text in multiple formats according to a preset format includes: Obtain the export format selected by the user from preset formats, wherein the preset formats include PDF, Word, or Markdown; Convert the rich text content in the target text to the target format, preserving the style and annotation information; Add a digital watermark to the target text to be exported in multiple formats, wherein the digital watermark includes a user identifier and a timestamp; Generate target text containing annotation information, wherein the annotation information is displayed in the form of footnotes or sidebars.

8. A text generation apparatus, characterized in that, The text generation device includes: The first generation module is used to dynamically bind the obtained predefined document template or the user-uploaded document template to a pre-set rich text editor to generate a structured document with editable rich text content, wherein the document template contains the structured information of the interface document. A receiving module is used to receive application documents sent by multiple users, wherein the application documents are generated based on the operation sequence performed by each user in the structured document, and the operation sequence includes insertion, deletion, format modification and timestamp; The second generation module is used to perform concurrent operations on multiple application documents through an operation conversion algorithm to generate target text, wherein the target text is consistent text content.

9. A text generation device, characterized in that, The text generation device includes a processor, a memory, and a text generation program stored in the memory and executable by the processor, wherein when the text generation program is executed by the processor, it implements the steps of the text generation method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a text generation program, wherein when the text generation program is executed by a processor, it implements the steps of the text generation method as described in any one of claims 1 to 7.