Document processing method and device, computer device and computer readable storage medium

CN122595993APending Publication Date: 2026-08-18TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510173642.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-17
Publication Date
2026-08-18

AI Technical Summary

Technical Problem

[0004]然而,相关技术中的文档导入方式存在文档处理效率低的问题

Benefits of technology

[0055] The document processing method provided in this embodiment of the present disclosure includes: obtaining a set of document data elements corresponding to a first document segment to be imported, wherein the set of document data elements includes multiple document data elements generated based on the document content of the first document segment; generating multiple document content insertion operations based on the multiple document data elements to obtain a first document editing operation set; obtaining a second document editing operation set for at least one second document segment, wherein the second document segment includes document segments that have been imported before the first document segment; performing conflict resolution on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set; and importing the first document segment based on the third document editing operation set.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122595993A_ABST
    Figure CN122595993A_ABST
Patent Text Reader

Abstract

The present disclosure provides a document processing method, device, computer equipment and computer readable storage medium. The method comprises: obtaining a set of document data elements corresponding to a first document fragment to be imported; generating a plurality of document content insertion operations based on a plurality of document data elements to obtain a first set of document editing operations; obtaining a second set of document editing operations on at least one second document fragment; performing conflict processing on the first set of document editing operations based on the second set of document editing operations to obtain a third set of document editing operations after conflict processing; and importing the first document fragment based on the third set of document editing operations. The method can edit the document during the document importing process, and improve the document processing efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of artificial intelligence technology, and in particular to a document processing method, apparatus, computer device, and computer-readable storage medium. Background Technology

[0002] With the continuous development of internet technology, internet applications have permeated all aspects of social life, such as learning, work, travel, and entertainment. The rapid development of internet applications has greatly improved people's quality of life.

[0003] Document applications are an important branch of internet applications, playing a vital role in daily office and educational activities, and improving the efficiency of information processing in learning and work. Document applications support various document types, such as text documents, spreadsheets, and presentation documents. They also support both online and local document modes, and document import can convert local documents into online documents.

[0004] However, the document import methods in related technologies suffer from low document processing efficiency. Summary of the Invention

[0005] This disclosure provides a document processing method, apparatus, computer device, and computer-readable storage medium. The document processing method enables document editing during the document editing process, thereby improving document processing efficiency.

[0006] The first aspect of this disclosure provides a document processing method, the method comprising:

[0007] Obtain the set of document data elements corresponding to the first document segment to be imported, wherein the set of document data elements includes multiple document data elements generated based on the document content of the first document segment;

[0008] Based on the multiple document data elements, multiple document content insertion operations are generated to obtain a first document editing operation set;

[0009] Obtain a set of second document editing operations on at least one second document segment, the second document segment including document segments that have been imported prior to the first document segment;

[0010] Based on the second set of document editing operations, the first set of document editing operations is conflict-handled to obtain a third set of document editing operations after conflict handling.

[0011] The first document fragment is imported based on the third set of document editing operations.

[0012] A second aspect of this disclosure provides a document processing apparatus, the apparatus comprising:

[0013] The first acquisition unit is used to acquire a set of document data elements corresponding to the first document segment to be imported, wherein the set of document data elements includes multiple document data elements generated based on the document content of the first document segment;

[0014] The generation unit is used to generate multiple document content insertion operations based on the multiple document data elements to obtain a first document editing operation set.

[0015] The second acquisition unit is used to acquire a set of second document editing operations on at least one second document segment, wherein the second document segment includes a document segment that has been imported before the first document segment;

[0016] The conflict handling unit is used to perform conflict handling on the first document editing operation set based on the second document editing operation set to obtain a third document editing operation set after conflict handling.

[0017] The import unit is used to import the first document fragment based on the third document editing operation set.

[0018] Optionally, in some embodiments, the conflict processing unit includes:

[0019] The first generation subunit is used to generate document content position change information based on the document editing operations in the second document editing operation set;

[0020] The first determining subunit is used to determine the document editing operation change information of the first document editing operation set based on the document content position change information;

[0021] The first update subunit is used to update the first document editing operation set based on the document editing operation change information to obtain the third document editing operation set.

[0022] Optionally, in some embodiments, the generating subunit includes:

[0023] The extraction module is used to extract the operation type and corresponding location information of each document editing operation in the second document editing operation set;

[0024] The determination module is used to determine document content location change information based on the operation type and the location information.

[0025] Optionally, in some embodiments, the first determining subunit includes:

[0026] The first determining module is used to determine the set element change information and the position attribute change information of each set element based on the document content position change information and the position information corresponding to the document editing operation in the first document editing operation set.

[0027] The first update subunit includes:

[0028] The update module is used to update the first document editing operation set based on the change information of the set elements and the change information of the position attributes, so as to obtain the third document editing operation set.

[0029] Optionally, in some embodiments, the first acquisition unit includes:

[0030] The first acquisition subunit is used to acquire the document content corresponding to the first document segment to be imported;

[0031] The first splitting subunit is used to split the document content into multiple types of element units, and to determine a document data element set based on the multiple document data elements obtained from the splitting.

[0032] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0033] The second splitting subunit is used to split the local document to be imported into a first document fragment sequence;

[0034] The first document segment to be imported is determined based on the import progress of importing the first document segment sequence piece by piece.

[0035] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0036] The first display sub-unit is used to display a list of local documents in response to a local document import operation;

[0037] The second display subunit is used to display the online document interface corresponding to the target local document in response to the selection operation of the target local document in the local document list. The online document interface includes an import progress indicator label.

[0038] The document processing apparatus provided in this disclosure also includes:

[0039] The second update subunit is used to receive editing operations based on the online document interface when the import progress indicator label indicates that the target local document is in the import process, and to update the online document corresponding to the target local document according to the editing operations.

[0040] Optionally, in some embodiments, the generation unit includes:

[0041] The second acquisition subunit is used to acquire the document element content information and document element position information corresponding to the plurality of document data elements;

[0042] The second generation subunit is used to generate multiple document content insertion operations based on the document element content information and the document element position information, thereby obtaining a first document editing operation set.

[0043] Optionally, in some embodiments, the second acquisition subunit includes:

[0044] The acquisition module is used to acquire the document element content information of each document data element, wherein the document element content information includes element type information and element attribute information;

[0045] The second determining module is used to determine the position range corresponding to each document data element based on the element type information, the element attribute information, and the sequential relationship between the plurality of document data elements, so as to obtain the document element position information of each document data element.

[0046] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0047] The third acquisition subunit is used to acquire the second document fragment sequence of the online document to be imported;

[0048] The second determining subunit is used to determine the first document segment to be imported based on the import progress of importing the second document segment sequence segment by segment.

[0049] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0050] The fourth acquisition subunit is used to acquire the sorting position of the first document fragment in the document fragment sequence corresponding to the document to be imported;

[0051] The editing subunit is used to edit the document based on the first document editing operation set when the sorting position indicates that the first document segment is the first document segment in the document segment sequence, so as to obtain the first screen document data.

[0052] A third aspect of this disclosure provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the document processing method as described in the first aspect.

[0053] This fourth aspect of the disclosure provides a computer device including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the document processing method as described in the first aspect.

[0054] The fifth aspect of this disclosure provides a computer program product comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the document processing method as described in the first aspect.

[0055] The document processing method provided in this embodiment of the present disclosure includes: obtaining a set of document data elements corresponding to a first document segment to be imported, wherein the set of document data elements includes multiple document data elements generated based on the document content of the first document segment; generating multiple document content insertion operations based on the multiple document data elements to obtain a first document editing operation set; obtaining a second document editing operation set for at least one second document segment, wherein the second document segment includes document segments that have been imported before the first document segment; performing conflict resolution on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set; and importing the first document segment based on the third document editing operation set.

[0056] This embodiment constructs document fragments based on document data elements. During the document import process, it can construct document editing operations for importing document fragments based on document data elements, transforming the document import process into a document editing process. Thus, this embodiment enables document editing during the document import process, improving document processing efficiency.

[0057] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objectives and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description

[0058] The accompanying drawings are provided to further understand the technical solutions of this disclosure and constitute a part of the specification. They are used together with the embodiments of this disclosure to explain the technical solutions of this disclosure and do not constitute a limitation on the technical solutions of this disclosure.

[0059] Figure 1 A system architecture diagram for the document processing method used in embodiments of this disclosure;

[0060] Figure 2 A flowchart illustrating the document processing method provided in this disclosure;

[0061] Figure 3A schematic diagram of a document import interface provided in an embodiment of this disclosure;

[0062] Figure 4 Another schematic diagram of the document import interface provided in this embodiment of the disclosure;

[0063] Figure 5 A schematic diagram of a set of document data elements provided in an embodiment of this disclosure;

[0064] Figure 6A A schematic diagram illustrating a document content insertion operation provided in an embodiment of this disclosure;

[0065] Figure 6B A schematic diagram illustrating a document content deletion operation provided in an embodiment of this disclosure;

[0066] Figure 6C A schematic diagram illustrating document content attribute modification operations provided in this embodiment of the disclosure;

[0067] Figure 7 A flowchart illustrating a document processing method provided in an embodiment of this disclosure;

[0068] Figure 8 Another schematic diagram of the document processing method provided in this disclosure embodiment;

[0069] Figure 9 A schematic diagram illustrating the overall inventive concept of the document processing method provided in the embodiments of this disclosure;

[0070] Figure 10 A schematic diagram of the correction algorithm for document editing operations provided in the embodiments of this disclosure;

[0071] Figure 11 A schematic diagram of the structure of the document processing apparatus provided in the embodiments of this disclosure;

[0072] Figure 12 This is a terminal structure diagram for implementing various methods according to an embodiment of the present disclosure;

[0073] Figure 13 This is a server structure diagram illustrating the implementation of various methods according to an embodiment of the present disclosure. Detailed Implementation

[0074] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and are not intended to limit the scope of this disclosure.

[0075] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations:

[0076] Streaming data model: Streaming data is a data sequence that can continuously change and grow over time, similar to a data stream. In this embodiment of the disclosure, the streaming data model is a data model used to describe the document data structure. The basic elements of the document (such as text, images, and tables) are arranged linearly according to the document import order. Each basic document element serves as a node in the streaming data model, and the node carries the element attribute information corresponding to each basic document element (such as element position, text content, image size, and table format).

[0077] With the development of internet technology, internet applications have become increasingly diversified, offering more comprehensive and personalized functional services. Document applications, a crucial branch of internet applications, improve the efficiency of information processing in learning and work. Document applications support various document types, such as text documents, spreadsheets, and presentation documents. They also support both online and local document modes. Online documents offer more features, such as collaborative editing, and document import can convert local documents into online documents. Current document import methods parse the entire document data and construct a Document Object Model Tree (DOM) based on the parsed data before importing the document data. However, these methods cannot properly handle document changes generated during document data parsing and DOM construction. Performing document editing operations during import can disrupt the DOM construction logic, leading to layout issues, abnormal element display, and incorrect imported content. Therefore, current document import methods cannot edit already imported portions of the document, resulting in low document processing efficiency.

[0078] To address the issue of low document processing efficiency in the aforementioned scenarios, this disclosure provides a document processing method aimed at improving document processing efficiency under these circumstances, enabling editing of already imported portions of the document during the document import process.

[0079] System architecture and scenario description of the embodiments disclosed herein

[0080] Figure 1 This is a system architecture diagram applied to the document processing method according to embodiments of the present disclosure. It includes a terminal 140, an Internet 130, a gateway 120, a server 110, etc.

[0081] Terminal 140 can take various forms, including desktop computers, laptops, PDAs (personal digital assistants), mobile phones, in-vehicle terminals, home theater terminals, dedicated terminals, intelligent voice interaction devices, smart home appliances, or even aircraft. Furthermore, it can be a single device or a collection of multiple devices. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.

[0082] Server 110 refers to a computer system capable of providing certain services to terminal 140. Compared to ordinary terminal 140, server 110 has higher requirements in terms of stability, security, and performance. Server 110 can be a single high-performance computer in a network platform, a cluster of multiple high-performance computers, a portion of a single high-performance computer (e.g., a virtual machine), or a combination of portions of multiple high-performance computers (e.g., virtual machines). In this embodiment, server 110 specifically provides storage functionality; that is, server 110 can be a database node in a distributed database, and this disclosure includes a cluster of multiple servers 110 forming a distributed database.

[0083] Gateway 120, also known as an internetwork connector or protocol converter, is a computer system or device that acts as a translator, enabling network interconnection at the transport layer. It bridges the gap between two systems using different communication protocols, data formats, languages, or even completely different architectures. Gateways can also provide filtering and security functions. Messages sent from terminal 140 to server 110 are forwarded to the corresponding server 110 via gateway 120. Messages sent from server 110 to terminal 140 are also forwarded to the corresponding terminal 140 via gateway 120. In this embodiment, terminal 140 sends a data access request to server 110 via gateway 120, and server 110 returns the data access result to terminal 140 via gateway 120.

[0084] The document processing method provided in this embodiment can be implemented in terminal 140, server 110, or partly in terminal 140 and partly in server 110.

[0085] When the document processing method provided in this embodiment is implemented in terminal 140, terminal 140 obtains a set of document data elements corresponding to the first document segment to be imported; then, terminal 140 generates multiple document content insertion operations based on multiple document data elements to obtain a first document editing operation set; further, terminal 140 obtains a second document editing operation set for at least one second document segment; performs conflict resolution on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set; finally, terminal 140 imports the first document segment based on the third document editing operation set.

[0086] When the document processing method provided in this embodiment is implemented in server 110, server 110 obtains a set of document data elements corresponding to the first document segment to be imported; then, server 110 generates multiple document content insertion operations based on multiple document data elements to obtain a first document editing operation set; further, server 110 obtains a second document editing operation set for at least one second document segment; performs conflict resolution on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set; finally, server 110 imports the first document segment based on the third document editing operation set.

[0087] When the document processing method provided in this embodiment is partially implemented in the terminal 140 and partially implemented in the server 110, the terminal 140 obtains a set of document data elements corresponding to the first document segment to be imported; then, the terminal 140 sends the set of document data elements to the server 110, and the server 110 generates multiple document content insertion operations based on multiple document data elements to obtain a first document editing operation set; further, the server 110 obtains a second document editing operation set for at least one second document segment; based on the second document editing operation set, the first document editing operation set is conflict-handled to obtain a conflict-handled third document editing operation set; finally, the terminal 140 imports the first document segment based on the third document editing operation set.

[0088] The document processing method provided in this disclosure can be applied to document processing tasks in various document applications, specifically to document processing tasks in text document applications, document processing tasks in table document applications, and document processing tasks in demonstration document applications. It can also be applied to document processing tasks in local documents and online documents.

[0089] For example, when the document processing method provided in this embodiment is applied to a document processing task in a text document application, when an operation instruction is received for an object to open or import a text document in the text document application, a set of document data elements corresponding to the first document segment to be imported can be obtained. The set of document data elements includes multiple document data elements generated based on the document content of the first document segment. Multiple document content insertion operations are generated based on the multiple document data elements to obtain a first document editing operation set. A second document editing operation set for at least one second document segment is obtained. The second document segment includes document segments that have been imported before the first document segment. Conflict handling is performed on the first document editing operation set based on the second document editing operation set to obtain a third document editing operation set after conflict handling. The first document segment of the text document is imported based on the third document editing operation set.

[0090] For example, when this embodiment of the present disclosure is applied to a document processing task in a spreadsheet document, when an operation instruction is received to open or import a spreadsheet document in a spreadsheet document application, a set of document data elements corresponding to the first document segment to be imported can be obtained. The set of document data elements includes multiple document data elements generated based on the document content of the first document segment. Multiple document content insertion operations are generated based on the multiple document data elements to obtain a first document editing operation set. A second document editing operation set for at least one second document segment is obtained, where the second document segment includes document segments that have been imported before the first document segment. Conflict resolution is performed on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set. The first document segment of the spreadsheet document is imported based on the third document editing operation set.

[0091] The above examples do not limit the scope of protection in this case.

[0092] General Description of Embodiments in this Disclosure

[0093] According to one embodiment of this disclosure, a document processing method is provided. For example... Figure 2 The diagram shown is a flowchart illustrating a document processing method provided in this disclosure. This method can be applied to a document processing device, which can be integrated into a computer device, specifically a terminal. The document processing method may include:

[0094] Step 210: Obtain the set of document data elements corresponding to the first document segment to be imported.

[0095] As described above, the document processing method provided in this disclosure can be applied to document processing scenarios in various document applications. Specifically, this includes, but is not limited to, text document processing scenarios, table document processing scenarios, and presentation document processing scenarios, and may also include online document processing scenarios and local document processing scenarios. Specifically, the document processing method in this disclosure embodiment refers to a method for editing documents during the document import process, that is, editing the portion of the document that has already been imported during the document import process.

[0096] Specifically, the document to be imported can be obtained and sliced ​​into multiple document fragments. Document slicing can include various methods. For example, it can be based on the number of pages in the document; if the document has 23 pages, it can be divided into 23 document fragments. Alternatively, it can be based on the page layout information, such as the paper size. For instance, if the paper size is A4, the number of characters or lines per page can be determined, for example, each page can hold 2,000 characters. Further, based on the number of characters or lines per page, the document can be divided into multiple document fragments. After slicing the document, multiple document fragments are obtained, and then the document is imported based on these fragments. For documents with large amounts of data, document slicing can improve import speed and enhance the user experience.

[0097] Furthermore, the set of document data elements corresponding to the first document segment to be imported can be obtained. The first document segment is the document segment to be imported from among multiple document segments of the document to be imported when importing sequentially. The set of document data elements can include multiple document data elements corresponding to the first document segment. These multiple document data elements can be generated based on the document content corresponding to the first document segment. Document data elements represent the basic units and structured language that constitute the document content, such as tags representing different types of document content. The types of document data elements can include text, images, tables, formulas, and field codes. Each document data element can include its position in the document, its content, and other attributes, such as the font, size, and color of text, the size of images, and the number of rows and columns in tables. Different types of documents can contain one or more types of document data elements; for example, a text document can simultaneously include document data elements of text, images, and tables.

[0098] In some embodiments, obtaining the set of document data elements corresponding to the first document fragment to be imported may include the following steps:

[0099] Retrieve the document content corresponding to the first document segment to be imported;

[0100] The document content is split into multiple types of element units, and the document data element set is determined based on the multiple document data elements obtained from the splitting.

[0101] Specifically, the document content corresponding to the first document fragment is obtained. This document content can include text, tables, images, and formulas from the document to be imported. For example, text can include titles, tables of contents, and body text; images can include photos, icons, and graphics; and tables can include headers, cells, and worksheets. Text documents can include text, tables, images, formulas, and field codes; table documents can include cells and multiple worksheets; and presentation documents can include images and icons. The type of element unit can include text element units, image element units, table element units, and field code element units. The element unit type of the document content is determined; for example, titles and body text belong to the text element type, and icons belong to the image element type. The element unit type corresponding to the document content can be determined through a preset mapping relationship (e.g., a mapping table), which is not limited here. Further, after determining the element unit type corresponding to the document content, the document content can be split into multiple document data elements. For example, one text element corresponds to one document data element, and one image element corresponds to one document data element. Then, the set of document data elements corresponding to the first document fragment can be determined based on these multiple document data elements. Converting document fragments into document data elements for import allows for more accurate determination of document content and its corresponding locations. This facilitates the correction of element position and content information during document editing operations, laying the foundation for document editability.

[0102] In some embodiments, before obtaining the document content corresponding to the first document segment to be imported, the document processing method provided in this disclosure further includes the following steps:

[0103] Split the local document to be imported into a first document fragment sequence;

[0104] The first document segment to be imported is determined based on the import progress of importing the first document segment sequence segment by segment.

[0105] This disclosure can be applied to importing local documents. Specifically, the local document is split into a first document fragment sequence composed of multiple document fragments arranged in sequence. The order of the document fragments is the import order, which may include the document page order. The sorting position of the document fragments can be identified by an identifier, which can be set for each document fragment when processing the document to be imported. Splitting the local document to be imported into the first document fragment sequence enables the conversion of the local document into an online document.

[0106] In some embodiments, before splitting the local document to be imported into a first document fragment sequence, the document processing method provided in this disclosure further includes the following steps:

[0107] In response to a local document import operation, display a list of local documents;

[0108] In response to the selection of a target local document in the local document list, the online document interface corresponding to the target local document is displayed;

[0109] Correspondingly, the document processing methods provided in this disclosure also include:

[0110] When the import progress indicator label indicates that the target local document is in the import process, the system receives editing operations based on the online document interface and updates the online document corresponding to the target local document according to the editing operations.

[0111] Specifically, in this embodiment, the document user can import the document on any terminal device. The document application can be opened via an application, a mini-program, or a web browser, and the document can be imported by clicking the "Open File" or "Import File" control. In response to the local document import operation, a local document list is displayed, including multiple candidate local documents. Furthermore, the document user can select the target local document to import from the local document list via mouse click, voice control, or pupil trajectory recognition. In response to the user's selection of the target local document, the online document interface corresponding to the target local document is displayed. The online document interface may include a read-only interface and an editable interface. The online document interface may include commonly used document function controls, such as controls for adjusting document page attributes, adjusting document content attributes, and adjusting document view. The online document interface may also include an import progress indicator label, which can be used to display the current import status of the document (e.g., displaying "Start Import" and "Import Complete") and the import progress (e.g., displaying the document import progress as a percentage). The import progress indicator label may include a document loading progress bar.

[0112] For example, please refer to Figure 3 As shown in the figure, the document import interface 300 is a read-only interface. Users can select the desired document range within the document import interface 300 and quickly find and navigate to the target document range by swiping the page, entering the target page number or keywords in the search box, etc. The user can return to the local document list using the back control, and can also manipulate the document using other functional controls. For example... Figure 3 The document function controls shown enable uploading documents to the cloud, sharing documents to other applications, or opening documents in other applications. Users can also click on more settings controls to perform other operations on the document, such as printing. At the bottom of the document import interface 300, a document loading progress bar 301 displays the current import progress of the document; as shown in the figure, the current document import progress is 30%.

[0113] For example, please refer to Figure 4 As shown in the figure, the document import interface 300 is an editable interface. The document is currently in an editable state. Users can position the cursor to locate the editing area, exit the document editing mode using the cancel control, undo the editing operation using the undone control, and save the document using the save control. The figure shows the first line of document content "XXXX" selected, with the cursor positioned at the end of the first line. During the document import process, the object can switch between read-only mode and editable mode.

[0114] In this embodiment of the disclosure, when the import progress indicator tag indicates that the target local document is in the import process, the online document corresponding to the target local document can be updated based on the document editing operations received in the online document interface. The import progress indicator tag indicates that the target local document is in the import process; for example, the document loading progress bar shows that it is loading, the percentage has not reached 100%, etc., at which time the document is in an editable state. Document editing operations received in the online document interface, such as inserting text and inserting images, can be detected, and the modified document content can be synchronously updated in the online document corresponding to the target local document.

[0115] Furthermore, after splitting the local document to be imported into a first document fragment sequence, the first document fragment can be determined based on the import progress of importing the first document fragment sequence piece by piece. Specifically, the import progress can be represented by the number of document fragments imported or the amount of document data imported. For example, if the local document to be imported is divided into thirty document fragments, and the four document fragments identified by identifiers 1 to 4 have been imported, then according to the import order of each document fragment in the first document fragment sequence, the first document fragment to be imported is the fifth document fragment corresponding to identifier 5 in the first document fragment sequence. After determining the first document fragment to be imported, the document content corresponding to the first document fragment can be obtained. Further, the document content is split into multiple types of element units, and the document data element set is determined based on the multiple document data elements obtained from the splitting.

[0116] In other embodiments, before obtaining the set of document data elements corresponding to the first document fragment to be imported, the document processing method provided in this disclosure may further include the following steps:

[0117] Obtain the second document fragment sequence of the online document to be imported;

[0118] The first document segment to be imported is determined based on the import progress of importing the second document segment sequence piece by piece.

[0119] Specifically, since online documents can be stored in fragmented form, such as in a distributed file system or cloud object storage system, each document fragment has an independent storage identifier and storage location. When importing online documents, no additional document splitting operation is required; the second document fragment sequence of the online document to be imported can be directly obtained. This second fragment sequence includes multiple sequentially arranged document fragments corresponding to the online document. Furthermore, based on the aforementioned steps, the first document fragment can be determined according to the import progress of the document fragments in the second fragment sequence being imported piece by piece.

[0120] In some embodiments, after determining the first document fragment to be imported through the aforementioned steps and obtaining the document content corresponding to the first document fragment to be imported, the document content can be further split according to various types of element units. Specifically, as described above, the element unit type corresponding to the document content can be determined first, and then the document content can be split into multiple document data elements based on the element unit type. Each document data element can include element content and element position. Then, the multiple document data elements obtained from the splitting can be linearly arranged according to the import order to obtain an element range composed of multiple consecutive and ordered document data elements. In this way, the set of document data elements corresponding to the first document fragment can be determined.

[0121] For example, such as Figure 5 As shown, the document content of the first document segment includes the text "Online documents enable multi-user collaboration," an image, two tables, and four fields. Dividing the aforementioned document content based on various element types yields text elements, image elements, table elements, and field code elements. Furthermore, the multiple document data elements obtained from the splitting are linearly arranged according to the document import order to determine the corresponding interval position for each document data element.

[0122] Step 220: Generate multiple document content insertion operations based on multiple document data elements to obtain the first document editing operation set.

[0123] In this embodiment, the first document editing operation set includes multiple document content insertion operations. The first document editing operation set can be represented as a set corresponding to operations that insert multiple document data elements. Each document data element includes corresponding element content information and element position information. Each document content insertion operation can include the insertion position (Position) and the inserted content (Text). For example, inserting nine characters at position 0 in the document range, with a character length of 9, and the inserted text being "Online documents enable multi-person collaboration"; or, for another example, inserting an image at positions 25 to 45 in the document range. Thus, the inserted content corresponding to the document content insertion operation can be determined based on the element content information corresponding to the document data element, and the insertion position corresponding to the document content insertion operation can be determined based on the element position information corresponding to the document data element. In this embodiment of the disclosure, the first document editing operation set can be represented by document import cmd, where cmd can represent a set of one or more document change models (or operations), that is, a set of multiple editing operations. The document segments are imported in sequence, that is, the first document editing operation set corresponding to each document segment is applied in sequence to generate the corresponding document page. Further, the first document editing operation set can be represented in the order of document segments as document import operation set 1, document import operation set 2, and document import operation set 3, etc., and is simply referred to as document import cmd1, document import cmd2, and document import cmd3.

[0124] In some embodiments, generating multiple document content insertion operations based on multiple document data elements to obtain a first document editing operation set may include the following steps:

[0125] Retrieve document element content information and document element position information corresponding to multiple document data elements;

[0126] Multiple document content insertion operations are generated based on the document element content information and document element position information, resulting in the first document editing operation set.

[0127] Specifically, after obtaining the set of document data elements for the first document segment, document element content information and document element position information corresponding to multiple document data elements can be obtained. The document element content information represents the document content corresponding to each document data element, and the document element position information represents the insertion position of the document content corresponding to each document data element during the import process. A document content insertion operation can be described by a single operation, which may include the insertion position and the insertion content. The insertion content for each document content insertion operation is determined based on the document element content information, and the insertion position for each document content insertion operation is determined based on the document element position information. It should be noted that each document content insertion operation can include inserting one or more document data elements into the document data set. In this case, a document content insertion operation can be generated based on the document element content information and document element position information corresponding to two or more document data elements. For example, for a continuous string of text, the document content operation can include inserting the corresponding text sequentially in the positional order within the document index range of 0 to 5, or it can include inserting two images sequentially in the positional order within the document index range of 10 to 60, or inserting two tables sequentially in the positional order within the document index range of 65 to 100, such as Table 1 and Table 2. This embodiment of the disclosure constructs document fragments based on document data elements. During the document import process, it can construct document editing operations for importing document fragments based on document data elements, converting the document import process into a document editing process, thereby realizing editability during the document import process.

[0128] In some embodiments, obtaining document element content information and document element location information corresponding to multiple document data elements may include the following steps:

[0129] Retrieve the document element content information for each document data element;

[0130] Based on element type information, element attribute information, and the sequential relationship between multiple document data elements, determine the position range corresponding to each document data element, and obtain the document element position information of each document data element.

[0131] Specifically, in this embodiment of the disclosure, the document element content information of each document data element may include element type information and element attribute information. The element type information represents the type information of the element unit corresponding to each document data element, such as text type, image type, table type, and field code type. The element attribute information may represent the attribute information of each document data element. For example, the element attribute information corresponding to a text element may include text size, text color, and font. The image element may include image size, image type, and image resolution. For example, a table element may include the number of cells, the number of rows and columns of the table, and the attributes of each cell, such as fill color and border, cell content, and cell content attributes.

[0132] Furthermore, the position range corresponding to each document data element can be determined based on element type information, element attribute information, and the sequential relationship between multiple document data elements, wherein the sequential relationship between document data elements can be determined based on the import order. For example, please refer to... Figure 5 The sequential relationship between multiple document data elements is as follows: text elements, image elements, table elements, and field code elements. The text elements include five characters for "online document can," occupying document interval positions 0 to 5. The image elements include one image, occupying document interval positions 6 to 30. The table elements include Table 1 and Table 2, with Table 1 corresponding to interval positions 31 to 55 and Table 2 to interval positions 56 to 70. The document position interval for each table element is 31 to 70. The field code elements include four fields, corresponding to document interval positions 71 to 74. The document element position information can then be determined based on the position interval corresponding to each document data element.

[0133] In some embodiments, after generating multiple document content insertion operations based on multiple document data elements to obtain a first document editing operation set, the method provided in this disclosure embodiment further includes the following steps:

[0134] Get the sort position of the first document fragment in the document fragment sequence corresponding to the document to be imported;

[0135] When the sorting position indicates that the first document fragment is the first document fragment in the document fragment sequence, document editing is performed based on the first document editing operation set to obtain the first screen document data.

[0136] In this embodiment of the disclosure, as described above, when dividing the document to be imported into multiple document fragments, an identifier corresponding to each document fragment can be generated to identify the import order of the document fragments. Thus, the sorting position of the first document fragment to be imported in the document fragment sequence can be determined based on the identifier. When splitting the document to be imported into a document fragment sequence, a mapping table can be constructed to store the sorting position of each document fragment in the document fragment sequence. The document corresponding to the first sorted document fragment is 0 or 1, or a special identifier can be used to identify the first sorted document fragment.

[0137] When importing documents in segments, if an object edits a portion of the already imported document, subsequent imported document segments may conflict with the content or position of the document modified by the object's editing operations. However, when importing the first document segment in the document segment sequence, there are no editing conflicts arising from editing previously imported document segments, and the first document segment can be directly imported using the first document editing operation set. This allows the document data element set of the first document segment to be inserted at the corresponding position on the document import page, resulting in the initial screen document data. The initial screen document data refers to the document content displayed on the terminal screen of the first document segment in the document segment sequence when the object imports the document.

[0138] Step 230: Obtain a set of second document editing operations for at least one second document segment.

[0139] When importing any document fragment after the first document fragment in a document fragment sequence, the changes to document data elements resulting from editing operations performed on document fragments that have already been imported may conflict with the changes to document data elements to be implemented by the document editing operations corresponding to the first document editing operation set corresponding to the first document fragment. For example, if the first document fragment is the fourth in the document fragment sequence, and the object can perform document editing operations on any of the first, second, or third imported document fragments, the executed document editing operations may conflict with the first document editing operation set.

[0140] In this embodiment of the disclosure, document editing operations performed by an object on at least one second document fragment can be detected and recorded in real time to obtain a set of second document editing operations. The at least one second document fragment includes document fragments that have already been imported before the first document fragment is imported. For example, if the first document fragment to be imported is the third document fragment in the document fragment sequence, then the second document fragment can be the document fragment ranked first or second in the document fragment sequence.

[0141] The second document editing operation set can include document editing operations performed by a document user on at least one second document segment. The operation types of these operations can include insertion, deletion, and modification. Each document editing operation can include one or more operation types and is represented by one or more document change models. Each document editing operation corresponds to a document editing command (cmd). The document change model describes the document modification data that alters the document and is defined by the document change type, the scope of the document editing operation, and the content of the document change.

[0142] Specifically, the document insertion operation can correspond to the document content insertion operation, such as... Figure 6A As shown, the document content insertion operation (Insert) can include the insertion position (Pos) and the content to be inserted (Text). For example, the position index corresponding to the insertion position is 3, and the content to be inserted is "XXXX"; Figure 6B As shown, a document content deletion operation (Delete) can include: the starting deletion position (Begin) and the ending deletion position (End) of the document content; as... Figure 6C As shown, a document content property modification operation (ModifyProperty) can include the range of document content property modifications and the corresponding document content property. The range of modifications can be determined by the start and end index values ​​of the document content, for example, a start index of 5 and an end index of 100. Modified document content properties can include text size, font, color, underline, strikethrough, highlight, etc., as well as image size, resolution, cropping, and replacement, or table cell count or cell format, etc. The document editing operations are recorded according to their chronological order to obtain a second set of document editing operations.

[0143] In other embodiments, when the first document fragment is the second-ranked document fragment in the document fragment sequence, the second document fragment is the first-ranked document fragment in the document fragment sequence. The second document editing operation set includes document editing operations performed by the object on the first-ranked document fragment that has already been imported. For example, if the object deletes document data elements corresponding to positions 3 to 5 in the second document fragment, assuming this document editing operation is A, then when the first document fragment is imported, document editing operation A is conflict-handled with the first document editing operation set to obtain a corrected document editing operation A'. When the first document fragment is the third-ranked document fragment in the document fragment sequence or any document fragment after the third document fragment, the second document editing operation set includes the conflict-corrected document editing operations and document editing operations performed by the object on the imported document after the first document fragment is imported. The document editing operations in the second document editing operation set are recorded in the order of execution time.

[0144] For example, such as Figure 7 As shown, the object opens the original document in a document application, browser webpage, or mini-program. The original document can be an online document or a local document, as mentioned above. Taking a local document as an example, when the object receives the instruction to open the original document, the original document is sliced ​​into a document fragment sequence. Further, a corresponding first document editing operation set is generated based on the document content corresponding to each document fragment, resulting in multiple document import operation sets, i.e., multiple document import cmds. The document import cmds can be sorted based on the arrangement order of the document fragments, for example, document import operation set 1 (document import cmd1), document import operation set 2 (document import cmd2), and document import operation set 3 (document import cmd3). Applying document import cmd1, the document element data set corresponding to the first document fragment is inserted based on the first document editing operation set to obtain the first screen document data. After obtaining the first screen document data, the document editing operations performed by the object in the first screen are detected and recorded in real time. For example, if the object performs document editing operation A, document editing cmdA is recorded.

[0145] When importing the second document fragment in the document fragment sequence, document import cmd2 is applied. Document import cmd2 conflicts with document editing cmdA. Conflict resolution is performed on document import cmd2 and document editing cmdA. Then, the corrected document editing operation A' is recorded, and a document import operation set 2' (document import cmd2') after conflict resolution is generated. Document import cmd2' is applied to generate the document page corresponding to the second document fragment. Further, after the first and second document fragments are imported, document editing operations performed by the object on the imported document content are detected in real time. For example, if the object performs document editing operation B on the first and second document fragments, a corresponding document editing cmdB is generated. Combined with the corrected document editing operation A' obtained in the previous steps, document editing operation B is recorded sequentially.

[0146] Further, upon receiving document import cmd3, a second document editing operation set for the second document segment is obtained. The second document segment includes the first and second document segments imported in the aforementioned steps. The recorded second document editing operation set includes document editing operations A' and B. Since the second document editing operation set conflicts with document import cmd3, conflict resolution is performed, resulting in a conflict-resolved document import operation set 3' (document import cmd3') and corrected document editing operations A" and B'. Applying the conflict-resolved document import cmd3' retrieves the document page corresponding to the third document segment in the document sequence. The corrected document editing operations A" and B' are recorded in chronological order. Document editing operations A" and B' are used to resolve conflicts with document import cmd4 when the fourth document segment is imported. The specific process and results of conflict resolution will be described in detail later.

[0147] Step 240: Based on the second set of document editing operations, perform conflict resolution on the first set of document editing operations to obtain the third set of document editing operations after conflict resolution.

[0148] In this embodiment of the disclosure, there is a conflict between the second document editing operation set of the document segment that has been imported before the first document segment is imported and the first document editing operation set corresponding to the first document segment to be imported. The conflict between document editing operations can be represented as two document editing operations existing at the same document position, such as inserting two different document element contents at the same document position.

[0149] To illustrate the conflict between the first and second document editing operation sets, consider this example: The first document fragment's editing operations include importing 50 characters (e.g., numbers 1 to 50) from position 1. When importing the second document fragment, suppose the second document fragment's first document editing operation set includes importing fifty characters (e.g., numbers 51 to 100) from position 51. If the object edits the content of the already imported document fragment before importing the second document fragment (e.g., inserting 3 characters at document index 0), then all document data elements after these 3 characters will shift three characters to the right. The last three characters in the first document fragment will move to the next document fragment's page, occupying the position of document data elements in the second document fragment (e.g., numbers 48 to 50 will move to the next page for display). The second document fragment should have inserted numbers 51 to 100. However, because numbers 48 to 50 from the first page occupied the first three character positions of the second page, positions 0 to 2 on the second page, which should have contained numbers 51 to 53, were instead changed to numbers 48 to 50. This means that for the same document position range, there are two document editing operations, and the document data elements inserted in the same document position range are different, resulting in a conflict. When importing the second document fragment, the content inserted in each document editing operation in the second document editing operation set is updated from 51 to 100 to 51 to 97, and the insertion position range corresponding to the document data elements is also shifted forward by three characters. Therefore, during document import, it is necessary to handle the conflict between the first document editing operation set corresponding to the first document fragment to be imported and the second document editing operation set.

[0150] Based on the aforementioned example, when importing the first document fragment, the first document editing operation set corresponding to the first document fragment can be conflict-handled with the second document editing operation set corresponding to at least one already imported second document fragment, resulting in a conflict-handled third document editing operation set. Further, the third document editing operation set is applied to generate the final document page corresponding to the first document fragment. For example... Figure 7 As shown, taking the first and second document segments as examples, the second document editing operation set is document editing cmdA. When the first document segment is imported, that is, when document import cmd2 is applied, conflict resolution can be performed on document import cmd2 and document editing cmdA to obtain the third document editing operation set after conflict resolution, that is, document import cmd2'. Then, document import cmd2' is applied to generate the document page corresponding to the second document segment.

[0151] In some embodiments, performing conflict resolution on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set may include the following steps:

[0152] Generate document content location change information based on document editing operations in the second set of document editing operations;

[0153] The document editing operation change information for the first document editing operation set is determined based on the document content location change information;

[0154] The first set of document editing operations is updated based on the changes in document editing operations to obtain the third set of document editing operations.

[0155] The second document editing operation set can include a collection of document editing operations performed on imported document fragments. These operations are ordered chronologically by execution time. Each operation includes changes to document element content and their corresponding position information for the imported document fragment. Document content position change information is generated based on these operations. This information can include changes to document data elements in any subsequent document fragment (after the second document fragment) and the position change information for each element. Any subsequent document fragment can be either the first document fragment to be imported or the second document fragment itself.

[0156] In this embodiment of the disclosure, if the editing operations in the second document editing operation set only modify the content of document elements, and the length of the document element content before and after modification does not change, the second document fragment can be directly updated using the second document editing operation set, and the first document fragment can be imported using the first document editing operation set. When performing editing operations on the imported document fragment,

[0157] In other embodiments, insertion and deletion operations change the position of document data elements in the first and second document segments. Modifications to document content attributes may also change document element positions; for example, if the modified document content is longer or shorter than before, it will affect the document element positions. For instance, if two characters are inserted at position 2 in the second document segment, the position indices of all document data elements after position 2 will increase by 2 accordingly, and the position information of each document data element in the first document segment will also change accordingly. This embodiment can generate document content position change information based on document editing operations in the second document editing operation set, update the second document segment, and further update the first document editing operation set of the first document segment based on the document content position change information. This ensures the accuracy of the imported document content and allows for editing of the imported portion of the document during the import process.

[0158] In some embodiments, generating document content location change information based on document editing operations in the second set of document editing operations may include the following steps:

[0159] Extract the operation type and corresponding location information of each document editing operation in the second set of document editing operations;

[0160] Document content location change information is determined based on operation type and location information.

[0161] As mentioned earlier, document editing operations performed on already imported document fragments will affect the element position information of document data elements in subsequently imported document fragments. Therefore, it is necessary to determine the document content position change information through a second set of document editing operations. Specifically, this can be determined by the operation type and corresponding position information of each document editing operation in the second set of document editing operations. Furthermore, the document content position change information generated by the second set of document editing operations can be used to determine the document editing operation change information that updates the first set of document editing operations, resolving conflicts between the first and second sets of document editing operations, ensuring the accuracy of the imported document content, and thus enabling editing of already imported document content during the document import process.

[0162] Specifically, in this embodiment of the disclosure, each document editing operation in the second document editing operation set includes an operation type and corresponding position information. It may also include the total document length up to the current document segment and all document segments preceding it. The total document length can be represented by the baseline length (base_len). For example, when the first document segment is imported, the total document length is 100, so the baseline length base_len is 100. When the second document segment is imported, the total document length of the second document segment is 100. After the second document segment is imported, the total document length becomes 200.

[0163] It can obtain the operation type and its corresponding location information. The operation type is a change type, such as the aforementioned insertion, deletion, and modification types. The location information can include the insertion position, the start deletion position, the end deletion position, and the modification position range. Examples of determining document content location change information based on the operation type and location information are as follows: For document content insertion, the length of the position range occupied by the inserted content can be obtained, and the position range corresponding to the document data elements after the insertion position in the second document segment is increased accordingly by this position range length; for document content deletion, the position range length can be determined based on the start and end deletion positions, and the position range corresponding to the document data elements after the insertion position in the second document segment is decreased accordingly by this position range length; for document content attribute modification, it can first be determined whether the length of the modified content causes a change in the element's location information. If a change occurs, the document content location change information is determined by referring to the document content insertion or deletion operation. Deletion and insertion operations affect the document data elements contained in the second document segment and subsequent document segments. For document content attribute modification operations, if the length of the modified document content remains unchanged compared to before the modification, the content of the document data elements in the document segment where the editing operation was performed needs to be changed. If the length of the modified document content changes compared to before the modification, the content of the document data elements in the document segment where the editing operation was performed and subsequent document segments all need to be changed. Thus, based on the element content change information and element position change information of document editing operations, the document content position change information can be determined. Furthermore, the document editing operation change information of the first document editing operation set can be determined.

[0164] In some embodiments, determining the document editing operation change information of the first document editing operation set based on document content location change information includes the following steps:

[0165] Based on the document content location change information and the location information corresponding to the document editing operations in the first document editing operation set, determine the set element change information of the first document editing operation set and the location attribute change information of each set element;

[0166] Accordingly, the first set of document editing operations is updated based on the document editing operation change information to obtain the third set of document editing operations, including:

[0167] The first document editing operation set is updated based on the change information of set elements and the change information of position attributes to obtain the third document editing operation set.

[0168] Specifically, the document editing operations in the first document editing operation set can include the document data element set corresponding to the first document segment and the insertion position information corresponding to each document data element, with a one-to-one correspondence between document data elements and position intervals. As described above, the change information of the set element corresponding to each document content insertion operation in the first document editing operation set can be determined based on the document content position change information, and the position attribute change information corresponding to each set element can be determined based on the document content position change information and the position information of the document editing operations in the first document editing operation set. For example, if three document segments have been imported, and the object adds three texts to the first document segment, the document data elements in the third document segment will occupy the position document interval of the fourth document segment to be imported, causing some document data elements in the fourth document segment to change. At this time, the document data elements in the document data element set of the fourth document segment can be changed according to the text insertion position and the number of inserted texts. In addition, the position interval corresponding to each set element in the first document editing operation set is also increased by 3 accordingly. For example, the position attribute change information may change from inserting the number 20 at document position index 10 to inserting the number 20 at document position index 13. The above examples are only for text-based changes. When the content being changed is a table or an image, the document data elements contained in the first document editing operation set can also be updated based on the document content location change information to determine the change information of the set elements and the corresponding location attribute change information.

[0169] After determining the changes to the collection elements and their positions, the document editing operation changes corresponding to the first document editing operation set can be identified based on these changes. Then, the document content insertion operations within the first document editing operation set are updated according to these changes. This resolves conflicts between the first and second document editing operation sets, ensures the correctness of the imported document content, and allows for editing of already imported portions of the document during the import process, thus improving document editing efficiency.

[0170] Step 250: Import the first document fragments based on the third document editing operation set.

[0171] After updating the first document editing operation set based on the document editing operation change information to obtain the conflict-resolved third document editing operation set, corresponding document data elements can be inserted into the corresponding document positions based on the document data elements contained in the third document editing operation set and their corresponding position attribute information, thereby importing the first document fragment. The aforementioned steps are repeated to sequentially import each document fragment in the document fragment sequence, while simultaneously implementing editable functionality during the document import process.

[0172] The document processing method provided in this embodiment of the present disclosure includes: obtaining a set of document data elements corresponding to a first document segment to be imported, wherein the set of document data elements includes multiple document data elements generated based on the document content of the first document segment; generating multiple document content insertion operations based on the multiple document data elements to obtain a first document editing operation set; obtaining a second document editing operation set for at least one second document segment, wherein the second document segment includes document segments that have been imported before the first document segment; performing conflict resolution on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set; and importing the first document segment based on the third document editing operation set.

[0173] This embodiment constructs document fragments based on document data elements. During the import process, it can construct document editing operations for importing document fragments based on document data elements, transforming the document import process into a document editing process. Thus, this embodiment enables document editing during the document import process, improving document processing efficiency.

[0174] This disclosure provides a detailed description of the embodiments in conjunction with specific application scenarios.

[0175] like Figure 8 The diagram shown is another flowchart illustrating the document processing method provided in this disclosure. This embodiment will use a local document import scenario as an example to describe the document processing method in detail, focusing on the execution entities of each step. The method specifically includes the following steps:

[0176] Step 801: The computer device splits the local document to be imported into a first document fragment sequence.

[0177] In this embodiment, the document processing method provided by this disclosure will be described in detail using a local document import scenario as an example. When the amount of local document data to be imported is large, using a segmented import method can improve the document import speed and enhance the document user experience. In related technologies, during document import, the object can only view a portion of the document content and cannot edit the document. This disclosure provides a streaming data model and a document change model describing the document data structure, and on this basis, provides a document editing operation correction algorithm for importing and editing simultaneously. This enables editing of the already imported document content during the document import process, significantly shortening the editable time and improving document processing efficiency. The editable time refers to the time from the start of document import to the point where document editing is possible. The computing device in this embodiment can be a terminal, which can be any of the following: a personal computer, a mobile device, a wearable smart device, an in-vehicle device, or a server device.

[0178] This embodiment first designs the document data structure as a streaming data structure, with corresponding document data element attributes attached to the streaming data nodes. A document editing operation set for editing the document is defined through a document change model. During the document import phase, the document data is parsed to generate the document editing operation set for importing the document. Simultaneously, the document editing operations performed by the objects are detected and recorded in real time. In the subsequent document fragment import process, the document editing operation set is corrected according to a conflict resolution algorithm to support the function of importing and editing simultaneously while the document is open.

[0179] like Figure 9 As shown, the original file is split into multiple document fragments, resulting in a document fragment sequence, with a total of five document fragments. Further, a document import change set, i.e., a document import cmd, is generated based on the document data corresponding to each document fragment. Required placeholders describe the basic data structure of the ooxml document, such as sections, main streams, and sub-streams; therefore, each document data structure corresponding to a completed import has a required placeholder. After importing the first document fragment data in the document fragment sequence, the first screen document data is generated. After the first screen document data is generated, document editing operations on the object are detected and recorded in real time, obtaining local editing data, which is defined as the document editing cmd, for example, editing the first and second document fragments that have already been imported. When importing any subsequent document fragment from the first screen document data, i.e., when obtaining the first document fragment to be imported, in... Figure 9The first document segment is the third document segment in the document segment sequence. Conflict resolution is performed between the previously recorded document editing cmd and the imported document segment. The conflict-resolved document import cmd is applied, and corrected local editing data is generated. This corrected local editing data can be considered as document editing operations performed after the import of this document segment, and the corrected document editing cmd is recorded as the new document editing cmd. Document editing operations performed after the import of this document segment are also added to the above records in chronological order until the import notification for the next document segment is received. In this way, any subsequent import cmd notification can be processed using the aforementioned steps until all document segments have been imported.

[0180] Specifically, in this embodiment of the disclosure, the computer device splits the local document to be imported into a first document fragment sequence, the first document fragment sequence including multiple document fragments that are split according to the document content of the document to be imported and arranged in order.

[0181] Step 802: The computer device determines the first document segment to be imported based on the import progress of importing the first document segment sequence segment by segment, and obtains the document content corresponding to the first document segment.

[0182] Furthermore, after splitting the local document to be imported into a first document fragment sequence, the current first document fragment to be imported can be determined based on the import progress of importing the first document fragment sequence piece by piece, such as... Figure 9 As shown, the first document fragment to be imported is the third document fragment in the document fragment sequence. When a computer device imports local documents in fragments, it can detect and record the import progress in real time. The computer device can detect information such as the number of successfully imported document fragments and their order in the document fragment sequence. For example, if the document to be imported is divided into 10 fragments, and the first 5 fragments have been successfully imported, the current import progress is 5 / 10. Based on the import progress, the computer device can determine that the first document fragment to be imported is the 6th document fragment.

[0183] After determining the first document fragment, the computer device obtains the document content of the first document fragment. The computer device can read the document content data corresponding to the document fragment from the corresponding storage location based on information such as the storage path and identifier of the document fragment.

[0184] Step 803: The computer device splits the document content into multiple document data elements according to various types of element units.

[0185] Document data elements are the core data describing the document structure of a document. Document data elements can include images, text, and tables, etc. This disclosure embodiment designs a corresponding document data model and document change model based on the document's basic structure. Specifically, the computer device splits the document content corresponding to the first document fragment into basic document elements such as text, images, and tables according to various types of element units. The document data model is formed by linearly arranging the split basic document elements, then creating a continuous document interval, called a streaming data model. In this way, the computer device can split the document content corresponding to the first document fragment according to the aforementioned steps to obtain multiple document data elements.

[0186] Step 804: The computer device obtains the document element content information and document element location information corresponding to multiple document data elements.

[0187] In this embodiment, each document data element includes document element content information and document element location information. Determining the location information of the document data element facilitates subsequent document import and editing operations. The document element location information can be determined using identifiers (e.g., numbers), mapping tables, or database tables. The computer device can obtain the document element location information corresponding to each document data element using the aforementioned examples. Figure 5 As shown, each document data element can include the corresponding document element content and the corresponding document range position.

[0188] Step 805: The computer device generates multiple document content insertion operations based on document element content information and document element position information, thus obtaining the first document editing operation set.

[0189] After obtaining the document element content information and document element position information corresponding to each document data element, multiple document content insertion operations can be performed on the first document segment based on the document element content information and document element position information. The document content operations can include the document data elements corresponding to the first document segment and their corresponding document insertion positions. The first document editing operation set can be represented as a document import command.

[0190] Step 806: The computer device obtains the sorting position of the first document fragment in the first document fragment sequence.

[0191] As mentioned earlier, when importing the first document segment, there is a conflict between the first document editing operation set corresponding to the first document segment and the document editing operations performed by the object on document segments that have already been imported. Therefore, before receiving the import notification for the next document segment, the document editing operations performed by the object on document segments that have already been imported before the first document segment can be detected and recorded in real time. This allows for subsequent conflict resolution of the first document editing operation set and correction of previously recorded document editing operations. However, for the first document segment imported in the first document segment sequence, since there are no document segments imported before it, the first document editing operation set can be directly applied to import the document segment without conflict resolution.

[0192] To determine the document fragment that is first in the sequence of first document fragments corresponding to the local document, we can first obtain the sorting position of the first document fragment within the sequence. As described in the previous steps, when the local document is split into multiple document fragments, the import order of each document fragment has already been determined, i.e., the sorting position of each document fragment within the sequence of first document fragments. Therefore, the computer device can directly obtain the sorting position of the first document fragment.

[0193] Step 807: When the sorting position indicates that the first document fragment is the first document fragment in the first document fragment sequence, the computer device performs document editing based on the first document editing operation set to obtain the first screen document data.

[0194] After obtaining the sorting position of the first document fragment, the computer device determines whether the sorting position corresponding to the first document fragment is the first one. When the sorting position indicates that the first document fragment is the first document fragment in the first document fragment sequence, the computer obtains the first document editing operation set corresponding to that document fragment, and imports the document data element set corresponding to the first document fragment according to the first document editing operation set to obtain the first screen document data.

[0195] Step 808: The computer device acquires a set of second document editing operations on at least one second document segment.

[0196] After generating the initial document data, for any document segment imported after the first document segment, a check can be performed to see if there is a conflict between the first document editing operation set and the previously recorded document editing operation set. A conflict is indicated if two different document editing operations exist for the same document position range. For example, if document positions in the range of 1 to 5 include both inserting numbers 1 to 5 and inserting numbers 6 to 10, a conflict is considered to exist. Figure 9As shown, if a conflict exists. Specifically, the computer device can obtain a set of second document editing operations for at least one second document segment, wherein the second document segment is a document segment that has been imported before the first document segment, and the set of second document editing operations is a set of operations corresponding to document editing operations detected and recorded by the computer device in chronological order of execution before receiving the import notification of the first document segment.

[0197] Step 809: The computer device extracts the operation type and corresponding location information of each document editing operation in the second document editing operation set, and determines the document content location change information based on the operation type and location information.

[0198] Furthermore, after acquiring the second document editing operation, the computer device can extract the operation type and corresponding location information of each document editing operation in the second document editing operation set. The operation type corresponding to each document editing operation is the corresponding document change model type, such as... Figures 6A to 6C The document content insertion, deletion, and attribute modification operations in this disclosure determine the increment or decrement of endpoint values ​​in the document position range corresponding to document data elements based on the operation type. For example, for a document content insertion operation, the document position range corresponding to document data elements after the insertion position should be shifted accordingly, i.e., the endpoint value should be increased. Furthermore, the computer can obtain position information corresponding to each document editing operation, which specifically includes the insertion position, start deletion position, end deletion position, and the document position range corresponding to the document content attribute modification range. In the aforementioned example, the value of the increased endpoint value can be determined based on the length of the inserted document content. Specifically, if document content with a length of 2 characters is inserted at position 3, the document position index value corresponding to document data elements after position 3 should be increased by 2 accordingly. The above is merely an example of the document editing operation conflict resolution method provided in this disclosure and does not limit the embodiments of this disclosure.

[0199] In this embodiment of the disclosure, after the computer device obtains the operation type and corresponding location information of each document editing operation in the second document editing operation set, as in the aforementioned example, it can determine document content location change information based on the operation type and location information. Specifically, the document content location change information may include location change information corresponding to document data elements after the document editing position corresponding to the document editing operation. Specifically, it may include the document segment corresponding to the document editing operation and the location change information corresponding to document data elements in the document segment imported after the document segment, and may also include change information of document data elements in the document segment. In this way, document content location change information can be determined, providing a basis for subsequent conflict handling and resolving document editing conflicts caused by editing operations performed during document import and document import operations.

[0200] Step 810: The computer device determines the change information of the set elements of the first document editing operation set and the change information of the position attributes of each set element based on the document content position change information and the position information corresponding to the document editing operations in the first document editing operation set.

[0201] Specifically, after determining the document content location change information, the computer device can update the first document editing operation set based on the document content location change information. First, the computer device can obtain the location information corresponding to the document editing operations in the first document editing operation set. The location information is the same as the content covered by the location information described above, and will not be repeated here.

[0202] In this embodiment, the computer device modifies the set element change information of the first document editing operation set based on document content location change information and the location information corresponding to the document editing operations in the first document editing operation set. The set element change information may include changes to document data elements in the first document editing operation set. For example, due to the insertion or deletion of document data elements in the second document editing operation set, the document data elements in the document segment corresponding to the second document editing operation set and any subsequent document segment will also change. The specific reasons for these changes have been described in the preceding embodiments and will not be repeated here. Computer equipment can determine the change information of set elements in the first document editing operation set based on the position change information of document data elements in the document content position change information. For example, after inserting five characters into the document position range of 1 to 5, the range length becomes 1 to 10. The original imported document data elements (e.g., numbers 1 to 100) in the document position range of 1 to 100 are moved to the next document segment for display due to the document content insertion operation. Thus, the document data elements corresponding to the document segment have changed. For the first document segment to be imported, assuming that the first document editing operation set corresponding to the first document segment is to insert the numbers 101 to 200 into the document position range of 101 to 200, since the document data elements in the previously imported document segment occupy the element position range of the document data elements in the first document segment, the document data elements corresponding to the first document editing operation set change from numbers 101 to 200 to numbers 101 to 190. This allows us to determine the changes to the elements in the collection corresponding to the first document editing operation set.

[0203] Furthermore, the computer device can also determine the position attribute change information corresponding to each set element based on the document content position change information and the position information corresponding to the document editing operations in the first document editing operation set. Specifically, continuing with the example in step 810, the document data elements corresponding to the first document editing operation set change to 101 to 190, and the original document position range is 101 to 200. Since the position range 101 to 110 is occupied by the document data elements inserted in the previous document segment, the document position range corresponding to the document data elements in the current document segment is 111 to 200. In this way, the position change attribute information can be determined.

[0204] Step 811: The computer device updates the first document editing operation set based on the set element change information and the position attribute change information to obtain the third document editing operation set.

[0205] In this embodiment of the disclosure, after determining the set element change information and position attribute change information corresponding to the first document editing operation set through the aforementioned steps, the computer device can update the document editing operations in the first document editing operation set based on this information. Specifically, it updates the document data elements and corresponding position attributes corresponding to the document editing operations. For example, in step 810, the first document editing operation set includes inserting the numbers 101 to 200 at positions in the document position range of 101 to 200. Updating the first document editing operation set yields a third document editing operation set, which specifically includes inserting the numbers 101 to 190 sequentially at positions in the document position range of 111 to 200.

[0206] It should be noted that the third set of document editing operations is obtained by updating the first set of document editing operations to be imported, i.e., by resolving conflicts, and is used to import the first document fragment. The computer device can also modify the second set of document editing operations based on document content change information. As mentioned earlier, the document editing operations in the second set of operations include a baseline length, which represents the total length of the document up to the current document fragment. Therefore, the document editing operations in the second set of operations can also include the baseline length. Figure 7 Taking document editing operation A as an example, when document editing operation A is the document content insertion operation exemplified in step 810, document editing operation A can be represented as "insert 1, length 5, base_len 100", that is, insert 5 characters at the document position index 1 (or the length of the inserted document data element is 5), and the document length is 100. The corrected document editing operation A' is "insert 1, length 5, base_len 200", and the document length is 200.

[0207] Please refer to Figure 10As shown in the figure, the computer device splits the document to be imported into multiple document fragments and generates a document import operation set for each document fragment based on its content, resulting in multiple document import operation sets. The figure shows three document import operation sets as an example. Further, local document editing operations are introduced. Specifically, the computer device executes the document import operations in document import operation set V1. After importing the first document fragment, the object executes a document content deletion operation V2. The computer device detects and records the local document editing operation V2. Then, the computer device executes the document import operations in document import operation set V3. After importing the second document fragment, the object executes a document content insertion operation V4. The computer device detects and records the local document editing operation V4. Document import operation set V3 and document content deletion operation V2 are conflict-handled, and the second document fragment is imported after conflict resolution. After conflict resolution, the baseline length of document content deletion operation V2 is corrected to the total length of the first and second document fragments, resulting in document content deletion operation V3'. Similarly, the baseline length of document content insertion operation V4 is corrected to the total length of the first and second document fragments, resulting in document content insertion operation V4'. Furthermore, the computer device records the corrected document content deletion operation V3' and document content insertion operation V4', and conflicts between V3' and V4' are handled with the subsequent set of document import operations.

[0208] Furthermore, after correcting the local document editing operations, the computer device performs a rebase based on the document import operation set corresponding to the first two document shards. The rebase operation is based on the original document import operation set corresponding to the document shards. In a distributed version control system (such as Git), rebase is an operation that moves a series of commit records (local document editing operations in this embodiment) sequentially from the end of one branch (the document editing process branch) to the end of another branch (the document import process branch), as if these commits were performed directly on the target branch. This makes the commit history more linear, avoids excessive merge commits, and makes the codebase history appear more concise and clear. In this embodiment, the corrected document content deletion operation V3' and document content insertion operation V4' are sequentially moved after the original document import operation set through the rebase operation, so that the corrected document editing operations appear to be document editing operations performed after applying the document import operation set. The original versions V1 and V2 based on document fragment import can be regarded as a set of document import operations. The document import operation set V5 obtained by merging the corrected document editing operations can be regarded as the document import operation set V5 executed after the document import operation set obtained by merging V1 and V2.

[0209] Step 812: The computer device imports the first document fragment based on the third document editing operation set.

[0210] The computer device parses the third document editing operation set obtained from conflict resolution to obtain the document data elements contained in the first document fragment and the position range corresponding to each document data element. Then, it imports the first document fragment based on the document data elements and position ranges. Each time an import notification for the first document fragment to be imported is received (except for the first document fragment), steps 808 to 812 are repeated until all document fragments in the document fragment sequence corresponding to the document to be imported have been imported.

[0211] Description of apparatus and devices according to embodiments of this disclosure

[0212] It is understood that although the steps in the above flowcharts are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in this embodiment, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the above flowcharts may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps.

[0213] It should be noted that in the various specific embodiments of this disclosure, when processing is required based on data related to the characteristics of the target object, such as target object attribute information or a set of attribute information, the permission or consent of the target object will be obtained first. Furthermore, the collection, use, and processing of this data will comply with the relevant laws, regulations, and standards of the relevant regions. In addition, when this application embodiment needs to obtain target object attribute information, separate permission or consent from the target object will be obtained through pop-up windows or redirection to a confirmation page. Only after obtaining the target object's separate permission or consent will the necessary target object-related data for the normal operation of this application embodiment be obtained.

[0214] Figure 11 A schematic diagram of the structure of a document processing apparatus 1100 provided in an embodiment of this disclosure. The apparatus includes:

[0215] The first acquisition unit 1101 is used to acquire a set of document data elements corresponding to the first document segment to be imported. The set of document data elements includes multiple document data elements generated based on the document content of the first document segment.

[0216] The generation unit 1102 is used to generate multiple document content insertion operations based on multiple document data elements to obtain a first document editing operation set;

[0217] The second acquisition unit 1103 is used to acquire a set of second document editing operations on at least one second document segment, wherein the second document segment includes document segments that have been imported before the first document segment;

[0218] Conflict handling unit 1104 is used to perform conflict handling on the first document editing operation set based on the second document editing operation set to obtain a third document editing operation set after conflict handling.

[0219] Import unit 1105 is used to import first document fragments based on the third document editing operation set.

[0220] Optionally, in some embodiments, the conflict processing unit includes:

[0221] The first generation subunit is used to generate document content position change information based on the document editing operations in the second set of document editing operations;

[0222] The first determining subunit is used to determine the document editing operation change information of the first document editing operation set based on the document content position change information;

[0223] The first update subunit is used to update the first document editing operation set based on the document editing operation change information to obtain the third document editing operation set.

[0224] Optionally, in some embodiments, generating sub-units includes:

[0225] The extraction module is used to extract the operation type and corresponding location information of each document editing operation in the second set of document editing operations;

[0226] The determination module is used to determine document content location change information based on operation type and location information.

[0227] Optionally, in some embodiments, the first determining subunit includes:

[0228] The first determining module is used to determine the set element change information of the first document editing operation set and the position attribute change information of each set element based on the document content position change information and the position information corresponding to the document editing operation in the first document editing operation set.

[0229] The first update subunit includes:

[0230] The update module is used to update the first document editing operation set based on the change information of the set elements and the change information of the position attributes, so as to obtain the third document editing operation set.

[0231] Optionally, in some embodiments, the first acquisition unit includes:

[0232] The first acquisition subunit is used to acquire the document content corresponding to the first document segment to be imported;

[0233] The first splitting subunit is used to split the document content into multiple types of element units, and the document data element set is determined based on the multiple document data elements obtained from the splitting.

[0234] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0235] The second splitting subunit is used to split the local document to be imported into a first document fragment sequence;

[0236] The first document segment to be imported is determined based on the import progress of importing the first document segment sequence segment by segment.

[0237] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0238] The first display sub-unit is used to display a list of local documents in response to a local document import operation;

[0239] The second display subunit is used to display the online document interface corresponding to the target local document in response to the selection operation of the target local document in the local document list. The online document interface includes an import progress indicator label.

[0240] The document processing apparatus provided in this disclosure also includes:

[0241] The second update subunit is used to receive editing operations based on the online document interface when the import progress indicator label indicates that the target local document is in the import process, and to update the online document corresponding to the target local document according to the editing operations.

[0242] Optionally, in some embodiments, the generation unit includes:

[0243] The second acquisition subunit is used to acquire document element content information and document element position information corresponding to multiple document data elements;

[0244] The second generation subunit is used to generate multiple document content insertion operations based on document element content information and document element position information, thus obtaining the first document editing operation set.

[0245] Optionally, in some embodiments, the second acquisition subunit includes:

[0246] The acquisition module is used to acquire the document element content information of each document data element. The document element content information includes element type information and element attribute information.

[0247] The second determining module is used to determine the position range corresponding to each document data element based on element type information, element attribute information, and the sequential relationship between multiple document data elements, so as to obtain the document element position information of each document data element.

[0248] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0249] The third acquisition subunit is used to acquire the second document fragment sequence of the online document to be imported;

[0250] The second determining subunit is used to determine the first document segment to be imported based on the import progress of importing the second document segment sequence segment by segment.

[0251] Optionally, in some embodiments, the document processing apparatus provided in this disclosure further includes:

[0252] The fourth acquisition subunit is used to obtain the sorting position of the first document fragment in the document fragment sequence corresponding to the document to be imported;

[0253] The editing subunit is used to edit the document based on the first document editing operation set when the sorting position indicates that the first document fragment is the first document fragment in the document fragment sequence, so as to obtain the first screen document data.

[0254] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0255] Reference Figure 12 , Figure 12 To illustrate the structural block diagram of a portion of the terminal 140 implementing the document processing method of this embodiment, the terminal 140 includes: a radio frequency (RF) circuit 1210, a memory 1215, an input unit 1230, a display unit 1240, a sensor 1250, an audio circuit 1260, a wireless fidelity (WiFi) module 1270, a processor 1280, and a power supply 1290, among other components. Those skilled in the art will understand that... Figure 12 The terminal 140 structure shown does not constitute a limitation on a mobile phone or computer, and may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0256] The RF circuit 1210 can be used to receive and transmit signals during information transmission or calls. In particular, it receives downlink information from the base station and processes it with the processor 1280; in addition, it transmits uplink data to the base station.

[0257] The memory 1215 can be used to store software programs and modules. The processor 1280 executes various terminal functions and document editing by running the software programs and modules stored in the memory 1215.

[0258] The input unit 1230 can be used to receive input numeric or character information, and to generate key signal inputs related to the terminal's settings and function control. Specifically, the input unit 1230 may include a touch panel 1231 and other input devices 1232.

[0259] The display unit 1240 can be used to display input or provided information, as well as various menus of the terminal. The display unit 1240 may include a display panel 1241.

[0260] Audio circuitry 1260, speaker 1261, and microphone 1262 provide an audio interface.

[0261] In this embodiment, the processor 1280 included in the terminal 140 can execute the document processing method of the previous embodiment.

[0262] The terminal 140 in this disclosure includes, but is not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, etc.

[0263] Figure 13 This is a partial structural block diagram of a server 110 for implementing the document processing method of this disclosure embodiment. The server 110 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 1322 (e.g., one or more processors) and storage devices 1332, and one or more storage media 1330 (e.g., one or more mass storage devices) for storing application programs 1342 or data 1344. The storage devices 1332 and storage media 1330 may be temporary or persistent storage. The program stored in the storage media 1330 may include one or more modules (not shown in the figure), each module including a series of instruction operations on the server 110. Furthermore, the CPU 1322 may be configured to communicate with the storage media 1330 and execute the series of instruction operations in the storage media 1330 on the server 110.

[0264] Server 110 may also include one or more power supplies 1326, one or more wired or wireless network interfaces 1350, one or more input / output interfaces 1358, and / or one or more operating systems 1341, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0265] The central processing unit 1322 in server 110 can be used to execute the document processing method of the present disclosure embodiments.

[0266] This disclosure also provides a computer-readable storage medium for storing program code for executing the document processing methods of the foregoing embodiments.

[0267] This disclosure also provides a computer program product comprising a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the document processing method described above.

[0268] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in this disclosure and the foregoing drawings are used to distinguish similar objects and are not necessarily used to describe a particular order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “including,” and any variations thereof, 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 necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.

[0269] It should be understood that in this disclosure, "at least one item" means one or more, and "more than one" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0270] It should be understood that in the description of the embodiments disclosed herein, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.

[0271] In the several embodiments provided in this disclosure, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0272] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0273] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0274] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of this disclosure, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this disclosure. The aforementioned computer-readable storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0275] It should also be understood that the various implementation methods provided in this disclosure can be combined arbitrarily to achieve different technical effects.

[0276] The above is a detailed description of the embodiments of this disclosure. However, this disclosure is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this disclosure. All such equivalent modifications or substitutions are included within the scope defined by the claims of this disclosure.

Claims

1. A document processing method, characterized in that, The method includes: Obtain the set of document data elements corresponding to the first document segment to be imported, wherein the set of document data elements includes multiple document data elements generated based on the document content of the first document segment; Based on the multiple document data elements, multiple document content insertion operations are generated to obtain a first document editing operation set; Obtain a set of second document editing operations on at least one second document segment, the second document segment including document segments that have been imported prior to the first document segment; Based on the second set of document editing operations, the first set of document editing operations is conflict-handled to obtain a third set of document editing operations after conflict handling. The first document fragment is imported based on the third set of document editing operations.

2. The method according to claim 1, characterized in that, The step of performing conflict resolution on the first document editing operation set based on the second document editing operation set to obtain a conflict-resolved third document editing operation set includes: Generate document content location change information based on the document editing operations in the second set of document editing operations; The document editing operation change information of the first document editing operation set is determined based on the document content location change information; The first document editing operation set is updated based on the document editing operation change information to obtain the third document editing operation set.

3. The method according to claim 2, characterized in that, The step of generating document content location change information based on document editing operations in the second set of document editing operations includes: Extract the operation type and corresponding location information of each document editing operation in the second document editing operation set; Based on the operation type and the location information, the document content location change information is determined.

4. The method according to claim 2, characterized in that, The step of determining the document editing operation change information of the first document editing operation set based on the document content position change information includes: Based on the document content location change information and the location information corresponding to the document editing operations in the first document editing operation set, determine the set element change information of the first document editing operation set and the location attribute change information of each set element; The step of updating the first document editing operation set based on the document editing operation change information to obtain the third document editing operation set includes: The first document editing operation set is updated based on the change information of the set elements and the change information of the position attributes to obtain the third document editing operation set.

5. The method according to claim 1, characterized in that, The step of obtaining the set of document data elements corresponding to the first document fragment to be imported includes: Retrieve the document content corresponding to the first document segment to be imported; The document content is split into multiple types of element units, and a document data element set is determined based on the multiple document data elements obtained from the splitting.

6. The method according to claim 5, characterized in that, Before obtaining the document content corresponding to the first document segment to be imported, the process also includes: Split the local document to be imported into a first document fragment sequence; The first document segment to be imported is determined based on the import progress of importing the first document segment sequence piece by piece.

7. The method according to claim 6, characterized in that, Before splitting the local document to be imported into a first document fragment sequence, the process also includes: In response to a local document import operation, display a list of local documents; In response to the selection of a target local document in the local document list, the online document interface corresponding to the target local document is displayed, and the online document interface includes an import progress indicator label; The document processing method further includes: When the import progress indicator label indicates that the target local document is in the import process, the editing operation is received based on the online document interface, and the online document corresponding to the target local document is updated according to the editing operation.

8. The method according to claim 5, characterized in that, The step of generating multiple document content insertion operations based on the multiple document data elements to obtain a first document editing operation set includes: Obtain the document element content information and document element position information corresponding to the multiple document data elements; Multiple document content insertion operations are generated based on the document element content information and the document element position information to obtain a first document editing operation set.

9. The method according to claim 8, characterized in that, The step of obtaining the document element content information and document element position information corresponding to the plurality of document data elements includes: Obtain the document element content information for each document data element, wherein the document element content information includes element type information and element attribute information; Based on the element type information, the element attribute information, and the sequential relationship between the multiple document data elements, the position range corresponding to each document data element is determined, and the document element position information of each document data element is obtained.

10. The method according to claim 1, characterized in that, Before obtaining the set of document data elements corresponding to the first document fragment to be imported, the method further includes: Obtain the second document fragment sequence of the online document to be imported; The first document segment to be imported is determined based on the import progress of importing the second document segment sequence piece by piece.

11. The method according to claim 1, characterized in that, After generating multiple document content insertion operations based on the multiple document data elements to obtain a first document editing operation set, the method further includes: Obtain the sort position of the first document fragment in the document fragment sequence corresponding to the document to be imported; When the sorting position indicates that the first document fragment is the first document fragment in the document fragment sequence, document editing is performed based on the first document editing operation set to obtain the first screen document data.

12. A document processing apparatus, characterized in that, The device includes: The first acquisition unit is used to acquire a set of document data elements corresponding to the first document segment to be imported, wherein the set of document data elements includes multiple document data elements generated based on the document content of the first document segment; The generation unit is used to generate multiple document content insertion operations based on the multiple document data elements to obtain a first document editing operation set. The second acquisition unit is used to acquire a set of second document editing operations on at least one second document segment, wherein the second document segment includes a document segment that has been imported before the first document segment; The conflict handling unit is used to perform conflict handling on the first document editing operation set based on the second document editing operation set to obtain a third document editing operation set after conflict handling. The import unit is used to import the first document fragment based on the third document editing operation set.

13. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the document processing method according to any one of claims 1 to 11.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the document processing method according to any one of claims 1 to 11.

15. A computer program product comprising a computer program that is read and executed by a processor of a computer device, causing the computer device to perform the document processing method according to any one of claims 1 to 11.