Document synchronization method and device, storage medium and electronic equipment
By acquiring and determining the set of change operations, synchronization instructions are generated to update cloud document content, solving the problem of low efficiency in local document synchronization and achieving efficient data synchronization.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2024-11-04
- Publication Date
- 2026-05-08
AI Technical Summary
Currently, the data transmission efficiency of synchronizing local documents to cloud servers is low, which cannot meet the object's need for efficient and fast synchronization.
By obtaining the content of the target local document to be synchronized and the document content version of the target cloud document, the set of change operations is determined, and a synchronization instruction is generated to update the content of the target cloud document, transmitting only the changed data and reducing redundant data transmission.
It improves data consistency and integrity during the data synchronization process, avoids data loss or overwriting errors in cloud documents, and enhances synchronization efficiency.
Smart Images

Figure CN121996724A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data synchronization, and more particularly to a document synchronization method, apparatus, storage medium, and electronic device. Background Technology
[0002] With the rapid development of internet and cloud computing technologies, cloud services have become a core component of modern information services. Cloud services provide various computing resources and services via the internet, allowing access anytime, anywhere without the need to install software on local devices.
[0003] Data synchronization to a cloud server refers to the process of uploading and storing data (such as files, photos, documents, etc.) from a local device to a cloud server. The purpose of this is to enable data backup, sharing, and cross-device access.
[0004] However, the current data transmission efficiency of synchronizing local documents to cloud servers is low, which cannot meet the object's need for efficient and fast synchronization. Summary of the Invention
[0005] This disclosure provides a document synchronization method, apparatus, storage medium, and electronic device, which can improve document synchronization efficiency.
[0006] The first aspect of this disclosure provides a document synchronization method, including:
[0007] Get the first document content of the target local document to be synchronized, and get the document content version of the target cloud document corresponding to the target local document in the current cloud storage;
[0008] The content of the second document is determined based on the document content version, and the set of change operations for the first document is determined based on the differences between the content of the first document and the content of the second document.
[0009] Generate first document synchronization instructions based on the first document change operation set;
[0010] Send a first document synchronization command to the target server so that the target server updates the content of the target cloud document based on the first document synchronization command.
[0011] A second aspect of this disclosure provides a document synchronization apparatus, comprising:
[0012] The acquisition unit is used to acquire the first document content of the target local document to be synchronized, and to acquire the document content version of the target cloud document corresponding to the target local document in the current cloud storage;
[0013] The determining unit is used to determine the content of the second document based on the document content version, and to determine the set of change operations for the first document based on the differences between the content of the first document and the content of the second document;
[0014] The generation unit is used to generate a first document synchronization instruction based on the first document change operation set.
[0015] The sending unit is used to send a first document synchronization instruction to the target server, so that the target server updates the content of the target cloud document based on the first document synchronization instruction.
[0016] Optionally, the acquisition unit includes:
[0017] The first display subunit is used to display the first document page of the target local document;
[0018] The first generation subunit is used to generate a document synchronization request in response to a document synchronization trigger operation received on the first document page. The document synchronization request indicates that the target local document be synchronized to cloud storage.
[0019] Optionally, generating sub-units includes:
[0020] The first display module is used to display the document synchronization area on the first document page;
[0021] The first generation module is used to generate a document synchronization request in response to a document synchronization instruction received in the document synchronization area.
[0022] Optionally, the first generation module includes:
[0023] The first display submodule is used to display the first document synchronization control in the document synchronization area;
[0024] The first generation submodule is used to generate a document synchronization request in response to the trigger operation of the first document synchronization control.
[0025] Optionally, the first generation module includes:
[0026] The second display submodule is used to display the document tags corresponding to the target local document on the first document page;
[0027] The second generation submodule is used to generate a document synchronization request in response to a drag operation where a document tag is dragged into the document synchronization area.
[0028] Optionally, the first generating subunit includes:
[0029] The second display module is used to display a file menu control on the first document page; in response to a trigger operation on the file menu control, a file menu list is displayed, which contains a second document synchronization control;
[0030] The second generation module is used to generate a document synchronization request in response to the triggering operation of the second document synchronization control.
[0031] Optionally, the first generating subunit includes:
[0032] The first acquisition module is used to acquire keyboard operation commands received from the first document page;
[0033] The third generation module is used to generate a document synchronization request when the keyboard operation command matches the preset operation command corresponding to document synchronization.
[0034] Optionally, the determined unit includes:
[0035] The first acquisition subunit is used to acquire multiple version information of the target local document stored locally, and determine the target version with the latest update time based on the update time corresponding to the multiple version information.
[0036] The first determining subunit is used to determine the content of the second document based on the document content version and the target version.
[0037] Optionally, the first determined subunit includes:
[0038] The first determining module is used to determine the document content corresponding to the target version as the second document content when the document content version is the same as the target version.
[0039] The second determining module is used to obtain the difference data between the document content version and the target version when the document content version is different from the target version, and to determine the second document content based on the difference data and the document content of the target version.
[0040] Optionally, the second determining module includes:
[0041] The sending submodule is used to send document update requests to the target server. The document update request includes the target version.
[0042] The receiving submodule is used to receive the difference data returned by the target server based on the document update request;
[0043] The determination submodule is used to determine the content of the second document based on the difference data and the document content of the target version.
[0044] Optionally, the determined unit includes:
[0045] The second generation subunit is used to handle the conflict between the difference data and the content of the first document when there is a conflict between the difference data and the content of the first document, and generate the content of the third document.
[0046] The second determining subunit is used to determine the set of first document change operations based on the differences between the content of the third document and the content of the second document;
[0047] The third determining subunit is used to determine the set of first document change operations based on the differences between the content of the first document and the content of the second document when there is no conflict between the difference data and the content of the first document.
[0048] Optionally, the second generating subunit includes:
[0049] The third display module is used to display the conflict content when there is a conflict between the difference data and the content of the first document;
[0050] The second acquisition module is used to acquire the selection operation received from the conflict content display interface and generate the third document content based on the selection operation.
[0051] Optionally, the acquisition unit includes:
[0052] The second acquisition subunit is used to obtain the document link of the target cloud document;
[0053] The second display subunit is used to display the cloud document editing interface based on the document link, and to display the content of the first document in the cloud document editing interface.
[0054] Optionally, the second display subunit includes:
[0055] The fourth display module is used to display the sharing control in the cloud document editing interface;
[0056] The fifth display module is used to respond to the triggering operation of the sharing control in the cloud document editing interface and display the sharing interface, which is used to select the sharing method for the target cloud document.
[0057] Optionally, the acquisition unit includes:
[0058] The receiving subunit is used to receive a second document synchronization instruction sent by the target server. The second document synchronization instruction includes a second document change set.
[0059] The update sub-unit is used to update the content of the first document based on the second document change set.
[0060] Optionally, the transmitting unit includes:
[0061] The encoding subunit is used to serialize the first document synchronization instruction to obtain the first encoded data;
[0062] The sending subunit is used to send the first encoded data to the target server.
[0063] Optionally, the coding subunit includes:
[0064] The conversion module is used to convert the first document synchronization instruction into first structure data with a preset data structure.
[0065] The compilation module is used to compile the first structure data into code data;
[0066] The encoding module is used to serialize the code data to obtain the first encoded data.
[0067] A third aspect of this disclosure provides a storage medium storing a computer program that, when executed by a processor, implements the document synchronization method as described in the first aspect.
[0068] This fourth aspect of the disclosure provides an electronic device including a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the document synchronization method as described in the first aspect.
[0069] The fifth aspect of this disclosure provides a computer program product comprising a computer program that is read and executed by a processor of an electronic device, causing the electronic device to perform the document synchronization method as described in the first aspect.
[0070] Therefore, the document synchronization method provided in this application obtains the first document content of the target local document to be synchronized, and obtains the document content version of the target cloud document corresponding to the target local document in the current cloud storage; determines the second document content based on the document content version, and determines the first document change operation set according to the difference between the first document content and the second document content; generates a first document synchronization instruction according to the first document change operation set; and sends the first document synchronization instruction to the target server so that the target server updates the content of the target cloud document based on the first document synchronization instruction.
[0071] This method determines the change operation based on the cloud document version and then sends the change operation to the target server, transmitting only the changed data. This greatly reduces redundant data and meaningless time consumption caused by full synchronization. At the same time, the change operation is re-determined based on the content of the second document indicated by the cloud document version, which can avoid data loss or overwriting errors in the cloud document and improve data consistency and integrity during the data synchronization process.
[0072] 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
[0073] 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.
[0074] Figure 1 This is a schematic diagram illustrating the synchronization between a local document and a cloud document in an embodiment of this disclosure;
[0075] Figure 2 This is a system architecture diagram of one embodiment of the present disclosure;
[0076] Figure 3 This is a flowchart illustrating a document synchronization method in an embodiment of this disclosure.
[0077] Figure 4 This is a schematic diagram of the first document page in an embodiment of this disclosure;
[0078] Figure 5 This is another schematic diagram of the first document page in an embodiment of this disclosure;
[0079] Figure 6 This is a schematic diagram of the document synchronization area in an embodiment of this disclosure;
[0080] Figure 7 This is a schematic diagram of the first document synchronization control in an embodiment of this disclosure;
[0081] Figure 8 This is a schematic diagram of document tags in an embodiment of this disclosure;
[0082] Figure 9 This is a schematic diagram of document synchronization based on the file menu in an embodiment of this disclosure;
[0083] Figure 10 This is a schematic diagram illustrating document synchronization based on keyboard operation commands in an embodiment of this disclosure;
[0084] Figure 11 This is a schematic diagram of the conflict content display interface in an embodiment of this disclosure;
[0085] Figure 12 This is a schematic diagram of synchronization in an embodiment of this disclosure;
[0086] Figure 13 This is a schematic diagram of the cloud document editing interface in an embodiment of this disclosure;
[0087] Figure 14 This is a schematic diagram illustrating the sharing method in an embodiment of this disclosure;
[0088] Figure 15 This is another flowchart illustrating the document synchronization method in this embodiment of the present disclosure;
[0089] Figure 16 This is a schematic diagram illustrating the conversion of change data into operational behavior data in an embodiment of this disclosure.
[0090] Figure 17This is a schematic diagram of the data structure model in the embodiments of this disclosure;
[0091] Figure 18 This is a schematic diagram of the document function in an embodiment of this disclosure;
[0092] Figure 19 This is a schematic diagram illustrating the use of atomic operations to describe a document in an embodiment of this disclosure.
[0093] Figure 20 A flowchart illustrating the encoding of atomic operations in the embodiments of this disclosure;
[0094] Figure 21 This is a schematic diagram illustrating how the server updates data based on incremental data from the terminal in an embodiment of this disclosure.
[0095] Figure 22 This is a schematic diagram of the document update process in an embodiment of this disclosure;
[0096] Figure 23 This is a schematic diagram illustrating the synchronization of local and cloud documents in an embodiment of this disclosure;
[0097] Figure 24 This is a schematic diagram of document synchronization in an embodiment of this disclosure;
[0098] Figure 25 This is another schematic diagram illustrating document synchronization in an embodiment of this disclosure;
[0099] Figure 26 This is a schematic diagram of another document synchronization process in an embodiment of this disclosure;
[0100] Figure 27 This is a schematic diagram of another document synchronization process in an embodiment of this disclosure;
[0101] Figure 28 This is a schematic diagram of the interface display during the local document editing process in an embodiment of this disclosure;
[0102] Figure 29 This is a schematic diagram of the structure of a document synchronization device according to an embodiment of the present disclosure;
[0103] Figure 30 This is a terminal structure diagram for implementing various methods according to an embodiment of the present disclosure;
[0104] Figure 31 This is a server structure diagram illustrating the implementation of various methods according to an embodiment of the present disclosure. Detailed Implementation
[0105] This disclosure provides a document synchronization method, apparatus, storage medium, and electronic device, which can improve the efficiency of document synchronization.
[0106] 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.
[0107] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification, claims, and accompanying drawings of this disclosure 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 “corresponding to,” and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises 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 apparatus.
[0108] The term “exemplary” as used herein means “serving as an example, embodiment, or illustration.” Any embodiment illustrated herein as “exemplary” is not necessarily to be construed as superior to or better than other embodiments.
[0109] In this disclosure, 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.
[0110] Furthermore, to better illustrate this disclosure, numerous specific details are set forth in the following detailed description. Those skilled in the art will understand that this disclosure can be practiced without certain specific details. In some instances, methods, means, components, and circuits well known to those skilled in the art have not been described in detail in order to highlight the main points of this disclosure.
[0111] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure belongs. The terminology used herein is for the purpose of describing embodiments of this disclosure only and is not intended to be limiting of this disclosure.
[0112] The following explains some of the terms used in the embodiments of this disclosure.
[0113] Atomic collaboration: In collaborative office scenarios, data transmission is required between clients and servers to achieve collaboration. The data transmitted between clients and servers corresponds to atomic operations during file processing. For example, a client sends atomic operations during file editing to the server instead of sending the entire file to the server. The server then sends the atomic operations performed by one client on file editing to other clients, thus achieving atomic collaboration.
[0114] Atomic operation: An action unit that is a specific editing operation performed on the file being edited.
[0115] OOXML (Office Open XML): A document format standard. It is an open document format based on XML. OOXML contains a series of XML files used to describe the content, format, structure, and metadata of a document. OOXML files have extensions such as .docx, .xlsx, and .pptx, corresponding to the document formats of Microsoft Office software such as Word, Excel, and PowerPoint, respectively. Compared to earlier binary file formats, OOXML offers better readability, scalability, and portability, while also supporting more features and functionalities.
[0116] Extensible Markup Language (XML): A subset of Standard Generalized Markup Language (SGML), it can be used to mark up data and define data types. It is a source language that allows users to define their own markup language.
[0117] doc: A file type, usually a text document, such as text documents in versions of Word prior to 2003.
[0118] Sheet: A file type, the sheet is the most important part of Excel for storing and processing data. It contains cells arranged in rows and columns. It is part of a workbook, also known as a spreadsheet. Sheets are used to organize and analyze data. Data can be entered and edited on multiple sheets simultaneously, and summary calculations can be performed on data from different worksheets.
[0119] Slide: A file type, in this disclosure referring to electronic slides, also known as presentations or briefings, which is a playable file made up of text, images, etc., with added special effects and dynamic display effects.
[0120] Operation Transformation (OT): A method in collaborative technologies used to maintain consistency among different data replicas. On different terminals, operations are adjusted according to their sequence to maintain data consistency.
[0121] Conflict handling: By using the Operation Transformation (OT) algorithm, operations on multiple objects are processed to simultaneously preserve modifications made to the same online document by multiple objects. This collaborative conflict handling can also be called conflict resolution. Here, OT algorithm refers to a class of techniques rather than a specific algorithm. The idea is to transform atomic operations. The transformation function is the core of the OT algorithm, and its core lies in how to break down the editing of multiple objects. The specific operations to be broken down and the transformation algorithm can be customized. Therefore, the OT algorithm can flexibly support various collaborative editing applications, such as non-text editing (e.g., image editing, table editing, etc.).
[0122] Transform function: When there is a conflict between two atomic operations, the OT algorithm is required, and the implementation of the OT algorithm requires a transformation function.
[0123] The process of uploading and storing data (such as files, photos, and documents) from a local device to a cloud server is called data synchronization. This is done to enable data backup, sharing, and cross-device access. If a local document or a document stored in the cloud is modified, it needs to be manually re-uploaded or downloaded to achieve data synchronization. For an example, please refer to [link to example]. Figure 1 The diagram illustrates the synchronization between local and cloud documents. The terminal and server can communicate, allowing local documents on the terminal to be synchronized to the server, effectively creating cloud documents. The initial synchronization of a local document to cloud storage involves a full data transfer of the entire local document. When the content of the local document is edited and needs updating in the cloud document, a second full data transfer replaces the edited content of the local document. This method is inefficient and cannot meet the requirements for high-efficiency and fast synchronization.
[0124] When a cloud document is first synchronized to the terminal to generate a local document, the entire cloud document is transmitted to the terminal through a full synchronization. When the content of the cloud document is edited and the local document needs to be updated, the edited cloud document is transmitted to the terminal again through a full synchronization, that is, the content of the local document is replaced with the content of the edited cloud document.
[0125] This disclosure provides a document synchronization method. The method involves obtaining the first document content of a target local document to be synchronized, and obtaining the document content version of a target cloud document corresponding to the target local document in current cloud storage. Based on the document content version, a second document content is determined, and a first document change operation set is determined based on the differences between the first and second document content. A first document synchronization instruction is generated based on the first document change operation set. The first document synchronization instruction is sent to a target server, causing the target server to update the content of the target cloud document based on the document synchronization instruction. This method determines change operations based on the cloud document version and then sends the change operations to the target server, transmitting only the changed data. This significantly reduces redundant data and meaningless time consumption generated by full synchronization. Furthermore, since the change operations are re-determined based on the second document content indicated by the cloud document version, data loss or overwriting errors in the cloud document can be avoided, improving data consistency and integrity during the data synchronization process.
[0126] System architecture and scenario description of the embodiments disclosed herein
[0127] Figure 2 This is a system architecture diagram of a document synchronization method applied according to an embodiment of the present disclosure. It includes a terminal 140, an Internet 130, a gateway 120, a server 110, etc.
[0128] Terminal 140 includes various forms of devices with display screens, such as 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 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.
[0129] Server 110 refers to a computer system that can provide 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).
[0130] 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.
[0131] In the document synchronization method provided in this embodiment, terminal 140 obtains the first document content of the target local document to be synchronized, and obtains the document content version of the target cloud document corresponding to the target local document in the current cloud storage from server 110; terminal 140 determines the second document content based on the document content version, and determines the first document change operation set according to the difference between the first document content and the second document content; terminal 140 generates a first document synchronization instruction according to the first document change operation set; terminal 140 sends the first document synchronization instruction to server 110, and server 110 updates the content of the target cloud document based on the document synchronization instruction.
[0132] This disclosure can be applied to various scenarios. For example, taking a Word document as an example, the Word document can be synchronized from local storage to cloud storage, and a corresponding cloud document exists in the cloud storage. Both the Word document and the cloud document are editable. Using the document synchronization method of this disclosure, the set of change operations relative to the cloud document can be re-determined based on the relationship between the version of the document content in the cloud document and the version of the Word document that was last synchronized from local storage to the cloud, thereby improving the efficiency of data synchronization.
[0133] The above examples do not limit the scope of protection in this case.
[0134] General Description of Embodiments in this Disclosure
[0135] According to one embodiment of this disclosure, a document synchronization method is provided. For example... Figure 3 The diagram shown is a flowchart illustrating a document synchronization method provided in this disclosure. This method can be applied to a data synchronization device, which can be integrated into an electronic device, specifically a terminal or a server. The document synchronization method may include:
[0136] Step 301. Obtain the first document content of the target local document to be synchronized, and obtain the document content version of the target cloud document corresponding to the target local document in the current cloud storage.
[0137] The target local document can be a document stored locally. The first document content is the content of the target local document. The target local document can be a Word document, an Excel document, or a PPT document. When the document needs to be synchronized to cloud storage, the first document content of the target local document can be obtained. This can be done by using an object to directly instruct the synchronization to cloud storage, or by automatically triggering the operation of obtaining the first document content when the target local document is opened.
[0138] The target cloud document in the current cloud storage can be a synchronized object of the target local document. Based on synchronization from other devices or direct editing of the target cloud document, different versions of the target cloud document's content will be generated. This version can be called the document content version, which indicates how many times the document content of the target cloud document has been updated. For example, assuming the document content version before editing the target local document is 1.1, the current document content version of the target cloud document can be 1.1, or it can be a version that has been updated multiple times, such as 1.2, 1.3, 1.4, etc.
[0139] In one implementation, before acquiring the first document content of the target local document to be synchronized, the method further includes:
[0140] Displays the first document page of the target local document;
[0141] In response to the document synchronization trigger operation received on the first document page, a document synchronization request is generated.
[0142] In this embodiment, the first document page can be a page that displays the content of the first document. For example, the content of the first document can be displayed on the page of the display interface based on the instruction to open the target local document.
[0143] Document synchronization triggering operations can be any operations that can generate synchronization instructions. Here, the synchronization instruction is an instruction to synchronize the content of the first document. The user can trigger the synchronization instruction in any way, or it can be automatically triggered by the terminal device. For example, the terminal device can determine the synchronization instruction when it detects that the content of the first document is displayed on the first document page.
[0144] A document synchronization request can be a request to synchronize a target local document to cloud storage, that is, a request to update the target cloud document based on the content of the first document in this embodiment. When a synchronization instruction is triggered based on a document synchronization operation, a corresponding document synchronization request for the target local document can be generated.
[0145] For example, a schematic diagram of the first document page can be referred to Figure 4As shown, the display interface includes a page bar, which can distinguish different pages for display. That is, the page bar can contain multiple pages, and the corresponding document is displayed based on the selected page. For example... Figure 4 In this context, the initial page 401 can be the initial interface for selecting a document and jumping to another page for display, where the page can also be generated directly by opening the document. Figure 4 Select the first document page (402) as the display page. Figure 4 The current page is indicated by a thick outline, and the first document page 402 corresponds to the content of the target local document. Correspondingly, the page can also display the name 403 of the target local document; here, "Document 1" is used as the document name. The first document page 402 includes a text area 404, which can display the document's main text, such as... Figure 4 The content of the first document corresponding to the target local document is displayed.
[0146] The display interface in this embodiment can simultaneously display local documents and online documents. When the online document is a cloud document synchronized from the local document, a marker can be added to the page displaying the local document to distinguish between the local and online documents. For example, please refer to [link to example]. Figure 5 Another illustration of the first document page shown, in Figure 4 Based on this, a 501 tag can be added to the document name (403) on the first document page, such as... Figure 5 In this example, a local file is added after the document name as a marker, and this local file marker is indicated by bold font.
[0147] In one implementation, in response to a document synchronization trigger operation received on a first document page, a document synchronization request is generated, including:
[0148] Display the document synchronization area on the first document page;
[0149] In response to a document synchronization instruction received in the document synchronization area, a document synchronization request is generated.
[0150] In this implementation, the document synchronization area can be a specific area where the synchronization function can be viewed and operated. Each page can display the document synchronization area to provide a synchronization method for the documents on that page.
[0151] A document synchronization instruction can be a synchronization instruction containing document information (such as document ID, version number, editor identifier, etc.). This document synchronization instruction can be generated based on the user's operations in the document synchronization area. That is, a document synchronization instruction can be generated in response to operations in the document synchronization area, and the user's document synchronization request can be determined in response to this document synchronization instruction.
[0152] For example, a schematic diagram of the document synchronization area can be referred to Figure 6 As shown, in Figure 5 Based on this, a document synchronization area can be configured anywhere on the page. Figure 6 Taking the position at the same horizontal line as the document name as an example, that is, the document synchronization area 601 on document 1, the user can trigger a document synchronization instruction in the document synchronization area 601. The document synchronization instruction then instructs to synchronize document 1 with the corresponding cloud document, that is, to generate a request to synchronize document 1 to cloud storage.
[0153] In one implementation, in response to a document synchronization instruction received in the document synchronization area, a document synchronization request is generated, including:
[0154] Display the first document synchronization control in the document synchronization area;
[0155] In response to a trigger operation on the first document synchronization control, a document synchronization request is generated.
[0156] In this embodiment, the first document synchronization control can be a control used to instruct the synchronization of local documents to cloud storage. The first document synchronization control can be displayed on the page in various forms, such as a button (triggered by clicking the synchronization button) or a slider (triggered by sliding the control to a specified position). Accordingly, upon receiving a click or slider operation on the first document synchronization control, a document synchronization request to synchronize the documents on the current page to cloud storage can be determined.
[0157] For example, a schematic diagram of the first document synchronization control can be referred to Figure 7 As shown, in Figure 6 Based on the document synchronization area on document 1, a synchronization control 701 (first document synchronization control) is displayed in the document synchronization area 601. Users can trigger the synchronization control 701 to cause the document synchronization area to trigger a document synchronization command and generate a synchronization request to synchronize document 1 to cloud storage.
[0158] In one implementation, in response to a document synchronization instruction received in the document synchronization area, a document synchronization request is generated, including:
[0159] The first document page displays the document tags corresponding to the target local document;
[0160] In response to a drag operation where a document tag is dragged into the document synchronization area, a document synchronization request is generated.
[0161] In this implementation, a document tag can refer to a tag entity of a local document. This tag entity can be a structure that can be displayed on the page. The document tag can carry an identifier of the local document. When an object drags a document tag to the document synchronization area, the document synchronization area can recognize the identifier in the document tag to determine the local document to be synchronized to cloud storage. Here, it can generate a document synchronization request instructing the target local document to be synchronized to cloud storage. Alternatively, when the document synchronization area recognizes a document tag, it can also determine the local document to be synchronized to cloud storage based on the current page.
[0162] For example, document tags can be displayed directly on the page, or they can be hidden and only displayed when the page is dragged to move the page. For an example of document tags being displayed directly on the page, please refer to [link to example]. Figure 8 The document tags shown are an illustration. Figure 6 Based on this, document tag 801 of document 1 can be represented by tag 1. The method for performing a drag operation on the first document page 402 where document 1 is located is to drag tag 1 displayed on the first document page 402 to the document synchronization area 601. When tag 1 is received in the document synchronization area, it can be determined that the content of document 1 will be synchronized to cloud storage. The position of tag 1 can be any position. Figure 8 In the example of a page with a page bar, dragging is represented by a dashed line.
[0163] In one implementation, in response to a document synchronization trigger operation received on a first document page, a document synchronization request is generated, including:
[0164] Display the file menu control on the first document page;
[0165] In response to a trigger action on the file menu control, a file menu list is displayed, which contains a second document synchronization control;
[0166] In response to a trigger operation on the second document synchronization control, a document synchronization request is generated.
[0167] In this embodiment, the file menu control can be pre-set in the first document page of the document processing system. This file menu control can be presented as a graphical user interface (GUI) element, such as a button, icon, or drop-down menu item. When a user triggers the file menu control via a mouse, touch, or other input device, the system responsively displays a file menu list. This list can be presented as a pop-up window, drop-down menu, or sidebar, and contains multiple options or controls related to document processing. In this embodiment, the list can include a second document synchronization control. This second document synchronization control is used to trigger the synchronization operation of the document on the current page, and may appear as a button, link, or icon, and may be labeled with identifiers such as "Synchronize" or "Upload to Cloud" for user identification.
[0168] For example, please refer to Figure 9 The diagram shown illustrates document synchronization based on the file menu. Figure 5 Based on this, a menu control 901 is displayed on the first document page 402. Users can click on this menu control to display a corresponding drop-down menu item 902 on the first document page. This drop-down menu item may contain a synchronization control 903. Users can click on this synchronization control to trigger a synchronization request for document 1.
[0169] In one implementation, a document synchronization request is generated in response to a document synchronization trigger operation received on the first document page:
[0170] Retrieve keyboard input commands received from the first document page;
[0171] When a keyboard input command matches a preset input command for document synchronization, a document synchronization request is generated.
[0172] In this embodiment, keyboard operation instructions are operation instructions typed by the user on a keyboard. These instructions may include, but are not limited to, key combinations, shortcut keys, and function keys. When displaying the first document page, the operation instructions entered by the user via the keyboard can be captured in real time and matched with pre-stored operation instructions.
[0173] The preset operation instructions are pre-stored operation instructions related to document synchronization. These instructions are recognizable specific keyboard operation combinations used to trigger the document synchronization function. If the captured keyboard operation instruction matches the preset operation instruction exactly, a document synchronization request for the first document page is generated accordingly.
[0174] For example, the preset operation commands could be "Ctrl+Win+S", "Ctrl+S" (save and sync), "Alt+Shift+U" (upload and sync), etc. Figure 10 Taking "Ctrl+Win+S" as an example, the method determines the synchronization request for the current page based on the user simultaneously typing Ctrl+Win+S on the keyboard.
[0175] Step 302. Determine the content of the second document based on the document content version, and determine the set of change operations for the first document based on the differences between the content of the first document and the content of the second document.
[0176] The second document content can be the content of the target cloud document before editing, based on the content of the target local document before editing, after synchronization with other devices or directly based on the target cloud document. It can be understood that the target cloud document may also not have received synchronization from other devices or be directly based on the editing of the target cloud document. That is, the target cloud document may still be based on the version of the target local document before editing. In this case, the determined second document content can be the version of the target local document before editing.
[0177] The first set of document change operations can be a set of change operations that need to be updated in the target cloud document. Each change operation can be an operation to be performed on the changed data that needs to be synchronized to the target cloud document. The change operations can be in the form of atomic operations, that is, the changed data is divided into action units. Then, based on the difference between the content of the second document and the content of the first document, the data that needs to be synchronized to the cloud storage can be re-determined, the data can be divided into change operations, and the first set of change operations can be formed.
[0178] Atomic operations can be defined by target document attributes, which can be at least some of the document attributes corresponding to the OOXML format standard. Target document attributes can include various attributes used to describe the document, such as "font," "font size," "font color," "table," "range," and "graphic type." For different document types, each type has corresponding document attributes. For example, doc and docx format documents include document attributes such as "font," "font size," and "font color." Sheet format documents include document attributes such as "table size" and "table range." Slide format documents include document attributes such as "animation type" and "image type." Atomic operations can be...
[0179] The changed data is processed using a data structure model based on the OOXML format standard to generate behavioral data related to document attributes. This means that the corresponding data structure model can be determined based on the document type of the target local document. The changed data is then input into the corresponding data structure model to generate the behavioral data. Atomic operations can be determined by atomically processing the behavioral data at the functional granularity based on document type. Atomic processing can be a method of decomposing data into the smallest, independently operable data fragments.
[0180] In one implementation, determining the content of the second document based on the document content version includes:
[0181] Obtain multiple version information of the target local document stored locally, and determine the target version with the latest update time based on the update time corresponding to the multiple version information;
[0182] The content of the second document is determined based on the document content version and the target version.
[0183] In this embodiment, the version information may include a unique version identifier and an update timestamp. The version identifier is used to uniquely identify the version of the target local document, and the update timestamp is used to indicate the time of each update of the target local document. This embodiment of the disclosure can scan the storage path of the target local document, identify and collect all version files associated with the target local document under that path, and each version file contains the version information.
[0184] The target version can be the latest version determined by sorting versions according to their update timestamps. The version of each file can be determined by the target server; that is, each time a local document is synchronized to cloud storage, the target server indicates the version of the document content to be synchronized. Correspondingly, each time the target server initiates synchronization to the local document, it will also indicate the version to be synchronized. Alternatively, the version of each file can be determined by the device used to edit the document, based on the edited result or the update time, and then notified to the server during synchronization.
[0185] Comparing the document content version with the target version can confirm whether the target local document has been edited by other sources. After the target cloud document has been synchronized or edited by other sources, its content version will change. If the current document content version is updated relative to the target version, the determined second document content needs to retain the corresponding updated content. This ensures the accuracy and timeliness of the document content, improving the efficiency and reliability of document processing.
[0186] In one implementation, determining the second document content based on the document content version and the target version includes:
[0187] When the document content version is the same as the target version, the document content corresponding to the target version is determined as the second document content;
[0188] When the document content version differs from the target version, obtain the difference data between the document content version and the target version, and determine the second document content based on the difference data and the document content of the target version.
[0189] In this implementation, the document content version can be compared with the target version to determine whether they are the same. The comparison method can be to use an algorithm to check key information such as the document content version identifier, version number, and timestamp, and compare them one by one with the information corresponding to the target version to determine whether they are completely consistent.
[0190] When the document content version is the same as the target version, the document content of the target version can be directly used as the second document content. In this case, no modifications or adjustments are required, and the first document content is also edited based on the target cloud document with the same document content version.
[0191] Difference data can be data showing changes in the content of the target cloud document between the document version and the target version. This difference data includes, but is not limited to, differences in text, images, tables, formatting, etc., between the target cloud document and the target version, as well as possible additions, deletions, or modifications.
[0192] When the document content version differs from the target version, the difference data can be identified and obtained. This difference data can then be parsed to determine the specific content and location of each difference, allowing for corresponding modifications or adjustments to the target version of the document to reflect these differences. Finally, the modified or adjusted target version of the document is designated as the second document content. By determining the incremental data to be synchronized to the cloud document based on the differences between the cloud document version and the last locally synchronized version, the integrity and consistency of the document content can be maintained.
[0193] In one implementation, acquiring difference data between the document content version and the target version of the document content, and determining the second document content based on the difference data and the document content of the target version, includes:
[0194] Send a document update request to the target server;
[0195] Receive the difference data returned by the target server based on the document update request;
[0196] The content of the second document is determined based on the difference data and the content of the target version of the document.
[0197] In this implementation, the document update request may include a target version, which is an indication to the target server that the document content version of the target cloud document differs from the version of the target local document in the last synchronization. The target server can determine the target version based on the document update request, use the changed data between the document content version and the target version as difference data, and then process the document content of the target version based on the difference data to determine second document content that is identical to the target cloud document content. The second document content can also be a separate set of difference data.
[0198] For example, the target local document records a target version, currently 100, and the first document's content has been edited based on version 100 to version 101. When sync is clicked, the target server notifies the target cloud document that the latest version number (document content version) is 105. The local document then pulls the gap data between versions 101 and 105 from the target server as difference data, processes the first document's content based on this difference data, updating it from version 101 to 106, and finally determines the incremental data to be synchronized to the target server based on the document content of version 106. By accurately obtaining the document's difference data, fast and efficient synchronization of document content is achieved, greatly improving the flexibility and efficiency of document management.
[0199] In one implementation, determining a set of first document change operations based on the differences between the content of the first document and the content of the second document includes:
[0200] When there is a conflict between the difference data and the content of the first document, the conflict is handled and the content of the third document is generated.
[0201] The set of change operations for the first document is determined based on the differences between the content of the third document and the content of the second document;
[0202] When there is no conflict between the difference data and the content of the first document, the set of change operations for the first document is determined based on the differences between the content of the first document and the content of the second document.
[0203] In this implementation, the conflict between the difference data and the content of the first document may be that, based on the content of the target version of the document, there are simultaneous modifications, deletions, and additions of content at the same location.
[0204] Conflict handling may include, but is not limited to: automatic merging algorithms (such as merging strategies based on timestamps, priorities, or user-selected strategies), prompting manual conflict resolution, or logging conflicts and retaining the original version for later processing.
[0205] The third document content can be generated based on the conflict resolution results, covering the discrepancy data and the non-conflicting data from the first document content, as well as the data after conflict resolution.
[0206] The difference between the content of the third document and the content of the second document can be the data after conflict resolution between the changed data between the content of the first document and the content of the target version of the document.
[0207] The absence of conflict between the discrepancy data and the first document content can be defined as follows: Based on the target version of the document content, if the first document content and the target cloud document do not have the same editing operations in the same locations, the discrepancy data can be added to the first document content. In this case, the difference between the first document content and the second document content represents the change data between the first document content without added discrepancy data and the target version of the document content. By introducing a conflict detection and handling mechanism, the need for manual conflict resolution is reduced, and the automation level of document updates is improved.
[0208] In one implementation, when there is a conflict between the difference data and the content of the first document, conflict resolution is performed on the difference data and the content of the first document to generate the content of the third document, including:
[0209] When the discrepancy data conflicts with the content of the first document, a conflict display interface is shown.
[0210] Retrieve selection operations received from the conflict content display interface, and generate third-party document content based on the selection operations.
[0211] In this implementation, the conflict content display interface can present the conflict content in an intuitive and easy-to-understand manner, including but not limited to: marking the specific location of the conflict, displaying detailed information about both parties involved in the conflict (such as the original text and the differences in data), and suggesting possible solutions. Furthermore, the interface design also includes interactive elements to enable users to easily handle the conflict.
[0212] Based on the conflict content display interface, which presents optional solutions, users can select a suitable solution from the interface. The document content generated based on the selected solution can be called the third document content. This system promptly displays conflicting information when discrepancies arise between the discrepancy data and the first document content. Furthermore, it intelligently generates third document content based on the user's selection, improving both the efficiency and accuracy of document processing and enhancing the user experience.
[0213] Among them, conflict permissions can be configured for users who edit documents. That is, for users with conflict permissions, the first document page of the user can display the conflict content display interface, which displays the conflict content and the optional solutions for the user to choose from.
[0214] For users without conflict permissions, the conflict content display interface may not be displayed on the first document page; instead, it can be directly processed into a third document based on the conflict algorithm. Alternatively, the conflict content display interface can be displayed on the first document page. This interface only shows the specific location of the conflict, detailed information about both conflicting parties, and the conflict resolution method used, allowing users to view the conflict results.
[0215] For example, the conflict content display interface can take the form of a sidebar on the first document page or a pop-up at the bottom of the first document page. For an example of a sidebar, please refer to [link / reference]. Figure 11 The diagram shown illustrates the conflict content display interface, based on... Figure 4 Based on this, the sidebar of the first document page 402 displays a conflict content display interface 1101 for document 1. This interface 1101 can display conflict content 1, corresponding solutions 1 and 2, conflict content 2, and corresponding solutions 3 and 4. Users can choose one solution from solutions 1 and 2 to handle conflict content 1, and one solution from solutions 3 and 4 to handle conflict content 2, according to their needs.
[0216] Step 303. Generate the first document synchronization instruction based on the first document change operation set.
[0217] The first document synchronization instruction can be a set of instructions to ensure consistency between two or more document versions; in this case, it instructs the target cloud document to be consistent with the target local document. The instruction set can be generated based on the first document change operation set, that is, each change operation in the first document change operation set is converted into a change instruction.
[0218] Step 304. Send the first document synchronization instruction to the target server so that the target server updates the content of the target cloud document based on the document synchronization instruction.
[0219] The target server can be a server that synchronizes the target local document to cloud storage, responsible for maintaining the synchronization between the target local document and the target cloud document. After the terminal device determines the first document synchronization instruction, it can send the first document synchronization instruction to the target server. The target server can parse the first document synchronization instruction, obtain the instruction content, and perform corresponding update operations on the document content of the target cloud document according to the instruction content, thereby ensuring that the content of the cloud document is consistent with the instruction requirements. In one example, the target local document can also be configured with a privacy lock, meaning that content within a preset area of the target local document is not included in the content of the first document; that is, data within this preset area will not be synchronized to the target cloud document.
[0220] In one implementation, the first document page, based on the target document application display, sends a first document synchronization instruction to the target server, so that the target server updates the content of the target cloud document based on the first document synchronization instruction. The method further includes:
[0221] Obtain the document link of the target cloud document;
[0222] The cloud document editing interface is displayed based on the document link, and the content of the first document is displayed in the cloud document editing interface.
[0223] In this implementation, the document link can be a Uniform Resource Locator (URL) address that directly accesses the cloud document, or it can be an encrypted string containing document access permissions and location information. The document link can be obtained by being saved in the user's account and obtained based on the user's click, or it can be sent directly by another user, or it can be sent locally after the target server updates the content of the target cloud document based on the first document synchronization instruction, with the updated target cloud document link being sent directly to the local machine.
[0224] The cloud document editing interface can be an online document display page that shows the target cloud document. This online document display page is editable, meaning users can directly edit the target cloud document through this interface. After the content of the target cloud document is updated based on the target server, the cloud document editing interface can display the same updated content as the target cloud document. This allows for instant viewing of the target cloud document's update results, improving the efficiency and security of document access.
[0225] For example, when syncing a local document to cloud storage, a UI prompt can be displayed first to indicate that the local document content is being imported, informing the user that the local document synchronization operation is in progress. See [link to relevant documentation]. Figure 12 The synchronization diagram shown is in Figure 5 Based on the synchronization command for document 1, while the local machine is performing the synchronization process for document 1, a pop-up window (1201) appears on the document 1 page indicating that synchronization is in progress. Figure 12 The message displayed is "Synchronizing, please wait".
[0226] For example, please refer to Figure 13 The diagram shown illustrates the cloud document editing interface. Figure 5 Based on this, open a new page based on a document link, such as Figure 13 Document 2 is located on page 1301. Document 2 and Figure 5 The difference in the display of document 1 is that document 1 is marked as a local document, while document 2, with document name 403, can be marked as an online document or left unmarked. Figure 13 For example, there is no marker in the Chinese version.
[0227] In one implementation, after displaying the cloud document editing interface according to the link and displaying the content of the first document in the cloud document editing interface, the method further includes:
[0228] Display the sharing control in the cloud document editing interface;
[0229] In response to a trigger action on the sharing control in the cloud document editing interface, the sharing interface is displayed.
[0230] In this implementation, the sharing control can be a control used to share the current page, which can be an icon, button or other easily recognizable graphic element, and its location can be the top of the interface, sidebar or toolbar, etc.
[0231] The sharing interface provides users with options for sharing target cloud documents. This interface can display various sharing methods, including but not limited to direct link sharing, email sharing, social media sharing, and collaborative sharing based on the cloud platform. The cloud document editing interface embeds sharing controls and features a responsive sharing interface, providing users with an efficient and flexible cloud document sharing experience.
[0232] For example, please refer to Figure 14 The diagram shown illustrates the sharing method. Figure 13 Based on this, a sharing control 1401 is configured on the page containing document 2. In response to the user's click operation on the sharing control, the page containing document 2 can display a drop-down list of sharing methods 1402, or a pop-up window can be used to display the list of sharing methods 1402. Figure 14 Taking the pop-up displaying a list of sharing methods as an example, this list includes social media sharing, email sharing, and generating a link. Users can select a sharing method by clicking, checking boxes, or performing other simple operations. Social media sharing allows users to send a link to selected friends via social media, enabling them to view the cloud document. Email sharing allows users to send a link to the cloud document via their email address. Generating a link allows users to choose how to share the document with other users based on the generated link.
[0233] In one implementation, the method further includes:
[0234] Receive the second document synchronization command sent by the target server;
[0235] Update the content of the first document based on the changes set of the second document.
[0236] In this embodiment, the second document synchronization instruction can be an instruction to synchronize documents locally. It may include a second document change set, which includes all changes to the target cloud document on the target server since the last update of the local document. These changes may include, but are not limited to, added content, deleted content, location identifiers of modified content, and specific content. The local machine can parse the second document synchronization instruction to obtain the second document change set and extract the change operations from the second document change set to modify the corresponding document positions in the first document content. Specifically, for the second document synchronization instruction issued by the target server, the local machine can display the changed content, and the user can choose whether or not to accept the update. For example, when the local machine generates third document content based on the conflict between the difference data and the first document content, the user can also choose not to accept the third document content. That is, even if the last updated version of the target local document is still the target version, when the target server detects a difference between the local version and the target cloud document version, it issues a synchronization instruction to the local machine, and the user can continue to refuse the update indicated by this synchronization instruction.
[0237] In one implementation, sending a first document synchronization instruction to the target server includes:
[0238] The first document synchronization command is serialized to obtain the first encoded data;
[0239] Send the first encoded data to the target server.
[0240] In this implementation, serialization refers to converting data into a storable or transmissible format, such as converting data attributes or information into a byte stream or other forms of data. The result of serialization can be called encoded data, and the serialization result of the first document synchronization instruction can be called the first encoded data. The serialization algorithm can be Protocol Buffers (PB). Protocol Buffers use binary encoding and can serialize data into a binary format byte stream for transmission, resulting in a smaller data volume.
[0241] Replacing the transmission of the first document synchronization instruction with the transmission of the first encoded data to the target server, serialization reduces data redundancy, improves transmission speed, and reduces network burden.
[0242] In one implementation, the first document synchronization instruction is serialized to obtain first encoded data, including:
[0243] The first document synchronization command is converted into first structure data with a preset data structure;
[0244] Compile the first structure data into code data;
[0245] The code data is serialized to obtain the first encoded data.
[0246] In this implementation, the preset data structure can be a standardized data structure used to uniformly represent different types of synchronization instructions, ensuring data consistency and readability.
[0247] The first structure data can be defined by using this preset data structure to define the various operation instructions in the first document synchronization instruction.
[0248] Code data can be generated by compiling the first structure data through preset code compilation rules or algorithms, converting the first structure data into a code format suitable for transmission and processing.
[0249] The compiled code data is serialized and converted into first-encoded data in a storable or transmissible format. Through predefined data structures and code compilation rules, compatibility and interoperability of document synchronization instructions across different systems are achieved.
[0250] Therefore, the document synchronization method provided in this application obtains the first document content of the target local document to be synchronized, and obtains the document content version of the target cloud document corresponding to the target local document in the current cloud storage; determines the second document content based on the document content version, and determines the first document change operation set according to the difference between the first document content and the second document content; generates a first document synchronization instruction according to the first document change operation set; and sends the first document synchronization instruction to the target server so that the target server updates the content of the target cloud document based on the first document synchronization instruction.
[0251] This method determines the change operation based on the cloud document version and then sends the change operation to the target server, transmitting only the changed data. This greatly reduces redundant data and meaningless time consumption generated by full synchronization. At the same time, the change operation is re-determined based on the content of the second document indicated by the cloud document version, which can avoid data loss or overwriting errors in the cloud document and improve data consistency and integrity during the data synchronization process.
[0252] This disclosure provides a detailed description of embodiments in conjunction with specific application scenarios.
[0253] like Figure 15 The diagram shown is another flowchart illustrating the document synchronization method provided in this disclosure. This method specifically includes the following steps:
[0254] Step 1501. Obtain the synchronization command.
[0255] A synchronization instruction can be an instruction to synchronize the document on the current page to cloud storage. This synchronization instruction can be manually triggered by the user or generated when the terminal recognizes that synchronization is needed, such as when the document is opened and synchronization is determined.
[0256] Step 1502. Obtain the local document content of the local document, and obtain the cloud document version number of the corresponding cloud document in cloud storage.
[0257] A local document can be a document stored locally, and the content of a local document can be the content of a local document after it has been edited by the object. The content of a local document can be retrieved from a local document based on synchronization instructions.
[0258] The cloud document version number can be the version number of the document content of the cloud document corresponding to the local document in cloud storage. This version number can be the same as or different from the version number of the local document when it was last synchronized with cloud storage. For example, if the version number of the local document when it was last synchronized with cloud storage was 100, then the version number of the cloud document at that time was also 100. When the cloud document is synchronized with other devices or after the cloud document is received for online editing, the version number of the cloud document can be 101, or it can be updated to 102, 103, etc. after multiple updates.
[0259] Step 1503. When the cloud document version number is the same as the local version number, the document content corresponding to the local version number is determined as the cloud document content.
[0260] The local version number can be the version number of the local document when it was last synchronized with cloud storage, or it can be the latest version of the local document updated with cloud storage.
[0261] The content of a cloud document can be the current content of the cloud document. When the cloud document version number is the same as the local version number, it means that the cloud document is based on the local document's content before editing, and has not received synchronization from other devices or directly edited based on the target cloud document. In this case, the cloud document content is the same as the document content corresponding to the local version number.
[0262] Step 1504. When the cloud document version number is different from the local version number, obtain the difference data between the document content of the cloud document version number and the local version number.
[0263] If the cloud document version number differs from the local version number, it means that the cloud document, based on the local document's content before editing, has been synchronized from other devices or directly edited based on the target cloud document. In this case, the cloud document content differs from the content corresponding to the local version number. The difference data can be any changes made to the cloud document between the cloud and local version numbers. This difference data includes, but is not limited to, differences in text, images, tables, formatting, etc., as well as possible additions, deletions, or modifications.
[0264] Step 1505. When there is a conflict between the difference data and the local document content, perform conflict resolution on the difference data and the local document content, and generate merged document content.
[0265] Conflicts can occur when two editing operations, such as modifying, deleting, and adding content in the same location, coexist and cannot be directly merged. Conflicts between discrepancy data and local document content can also occur when editing the object within the local document content and editing the discrepancy data in the same location occur. For identified conflicts, a conflict resolution algorithm can be used to handle them, merging the conflict-resolved discrepancy data with the local document content into a single document. The content of this merged document can be referred to as the new local document content.
[0266] Step 1506. Determine the changed data based on the differences between the local document content and the cloud document content.
[0267] Change data can be understood as the edit data between the local document content and the local version number document content after conflict resolution when there is a conflict between the difference data and the local document content.
[0268] It can also be used to edit data between the local document content edited by an object and the document content with the local version number when the cloud document version number is the same.
[0269] Step 1507. When there is no conflict between the difference data and the local document content, determine the change data based on the difference between the local document content and the cloud document content.
[0270] If there is no conflict between the difference data and the local document content, it means that, based on the local version of the document content, there are no editing operations in the same position between the local document content and the difference data. The difference data can be added to the local document content. In this case, the difference between the local document content and the cloud document content is the editing data between the first document content without the added difference data and the local version of the document content.
[0271] Step 1508. Convert the changed data into operational behavior data according to the target data structure standard, and determine the atomic operations based on the operational behavior data.
[0272] The target data structure standard can be a document format standard that describes the content, format, structure, and metadata of a document, such as the OOXML format standard, and can include target document information attributes. Target document attributes can be at least some of the document attributes corresponding to the OOXML format standard. These target document attributes can include various attributes used to describe the document, such as "font," "font size," "font color," "table," "range," and "graphics type." For different document types, each type has corresponding document attributes. For example, doc and docx format documents include document attributes such as "font," "font size," and "font color." Sheet format documents include document attributes such as "table size" and "table range." Slide format documents include document attributes such as "animation type" and "image type."
[0273] Operational behavior data can be generated from changed data using a data structure model based on the OOXML format standard. That is, the corresponding data structure model is determined based on the document type of the local document, and the changed data is processed by calling the corresponding data structure model to generate operational behavior data that reflects the document attributes.
[0274] Atomic operations can be based on the type of a local document, and are obtained by atomically processing the operation data with the functionality of that document type as the smallest granularity. Atomization can be understood as the smallest meaningful, independently operable data segment in the document. Fine-grained atomic operations allow each change to be processed and recorded independently, and any errors can be quickly located and corrected, reducing the error rate during the editing process.
[0275] The data structure model is based on the OOXML format standard, which can record detailed operations such as text modification, image insertion, graph drawing, and animation settings. It can record and share various operations such as text editing, formatting adjustment, and chart insertion of objects in a timely manner to ensure the consistency and integrity of document content.
[0276] For example, converting change data into operational behavior data can be done as follows: Figure 16 As shown, users collect change data through various interactive devices such as keyboards, mice, cameras, and microphones. This change data, after analysis and processing, can be converted into specific operational behaviors, such as single clicks, double clicks, left mouse clicks, right mouse clicks, long presses, and short touches. These operational behaviors, combined with specific business scenarios, such as adding, deleting, and modifying text, can accurately reflect the user's intent and operation path. Based on these analysis results, the system uses a generator to generate targeted operational behavior data.
[0277] The generator, also known as the aforementioned data structure model, can be divided into three types based on document type: Figure 17 The data structure model diagram shown includes doc, sheet, and slide models. The document attributes of the doc model include those of Word, such as document, attribute tree, text pool, and other attributes. The document attributes of the sheet model include those of Excel, such as workbook, cell data, row and column information, and other attributes. The document attributes of the slide model include those of PowerPoint, such as presentation, graphic data, animation, and other attributes.
[0278] The generated action data can also be atomically processed at the smallest granularity, using the functions of an Office document, ensuring highly accurate and flexible operations during collaborative editing and data analysis. For example, please refer to... Figure 18 The document function diagrams shown illustrate this. Word boasts over 3,000 different functions, including but not limited to text editing, formatting, image insertion, table creation, and style application; Excel offers over 4,500 functions, covering data entry, formula calculation, chart generation, pivot tables, and macro programming; and PowerPoint has over 4,400 functions, encompassing slide design, animation effects, media insertion, and template application. By performing fine-grained atomic processing on these functions, every tiny edit and operation can be independently identified, recorded, and managed.
[0279] In this disclosed embodiment, the concept of "Mutation" can be used to record the atomic operations that create and evolve a document. There are 6 atomic operations describing data changes in the doc scenario, 45 in the sheet scenario, and 46 in the slide scenario. All operations related to a category can be found within the permutations and combinations of these mutations, representing the advanced data changes we need. In other words, all the characteristics of a document can be determined by the following formula:
[0280] All document features:
[0281] All features of the table:
[0282] All features of the slides:
[0283] An exemplary diagram illustrating the description of a document using atomic operations can be found in [reference needed]. Figure 19 As shown, a blank document is edited starting from 0. Each edit can be converted into various attributes based on the target data structure standard. Combining multiple attributes constitutes an atomic operation. Each atomic operation is the smallest unit of editing and cannot be idempotent with other atomic operations. Multiple atomic operations can be combined into a revision record, which is the smallest unit of data transfer. The document is revised based on these revision records to form the final displayed document. Unlike traditional document collaboration, where an equivalent file is required to restore the document content after revisions are transferred, this document is not affected by the need for a separate file. The document is composed of atomic operations, each of which can be rolled back or reverted.
[0284] Step 1509. Convert atomic operations into structured data of a preset data structure.
[0285] A pre-defined data structure can be a standardized data structure used to uniformly represent different types of synchronization instructions, ensuring data consistency and readability.
[0286] The structured data can be defined by defining the various operation instructions in the atomic operation using this preset data structure.
[0287] For example, you can use a PowerBuilder .proto file to define the data structure for atomic operations and revision records of a document. For instance, you can define the type of each atomic operation, its parameters, and the timestamp of the revision record.
[0288] Step 1510. Compile the structured data into code data.
[0289] Code data can be generated by compiling structured data through preset code compilation rules or algorithms, converting structured data into a code format suitable for transmission and processing.
[0290] For example, structured data defined using PB's .proto files can be used by the compiler to generate corresponding code, which can be called code data, so that these data structures can be used in applications.
[0291] Step 1511. Serialize the code data into encoded data.
[0292] Encoded data can be a storable or transmissible format, obtained by serializing compiled code data. For example, in an application, generated code is used to serialize data and convert it into encoded data in a transmissible format.
[0293] A flowchart illustrating the encoding of atomic operations can be found here. Figure 20As shown, atomic operations can be in the form of XSD (XML Schema Definition) files, which are standards used to define and describe the structure and content of XML documents, reflecting the elements, attributes, data types, and relationships between them in an XML document. XSD files can be manually maintained based on the location tools / xsd_schemas / origin / *xsd, and these XSD files contain the original data structure definitions. XSD files can also be modified systematically in batches using XSD batch processing tools, based on the path tools / xsd_schemas / normalized / *xsd, to modify the XSD files to meet the required data standards. Then, tools for generating XSD code can be used to convert the XSD files into proto files conforming to the current standard and generate corresponding import and export code. The generated import code (x2pb.h / cc) and export code (pb2x.h / cc) are used for data conversion between XML and PB formats. During the import process, XML data is parsed and "deserialized" into PB objects; during the export process, PB objects are "serialized" into XML format data. The PB compatibility processing tool is used to convert raw proto files into proto files compatible with both new and old standards. This step ensures that the generated proto file is compatible with existing PB formats. Throughout the process, a changelog file is generated, recording the history of all changes, including the time, reason, and impact of each change. This helps technical personnel trace and understand the reasons and effects of each change.
[0294] Step 1512. Send the encoded data to the server.
[0295] Local documents can be synchronized to cloud storage via a server, which is responsible for maintaining the synchronization between local and cloud documents. Terminal devices can send encoded data to this server, which can deserialize the encoded data, parse out the corresponding atomic operations, and then perform corresponding update operations on the cloud document content based on these atomic operations, thereby ensuring that the content of the cloud document remains consistent with the requirements of the encoded data.
[0296] For example, a diagram illustrating server updates based on incremental data from the terminal can be referred to Figure 21As shown, the client sends operation requests to the server, such as adding, deleting, modifying, and querying data. These operation requests are encapsulated into specific operation instructions and sent to the server over the network. After receiving the operation instructions from the client, the server places them in an operation queue for processing and checks if there are any conflicting instructions in the current system. If there are conflicts, they are resolved. In the diagram, the thin solid lines represent the path from which the client sends the operation, and the thick solid lines represent the server path—the path along which the server receives and processes the operation. The dashed lines represent acknowledgments received by the client, meaning that after processing the client's operation, the server sends an acknowledgment message back to the client.
[0297] The document update process diagram of this disclosure can be referred to... Figure 22 As shown, the client synchronizes documents with the server. The client can include a storage database (IndexedDB), a persistent manager, and a changepoint manager.
[0298] Storage databases are used to store and retrieve data.
[0299] The persistence manager is used for initialization (init) and data retrieval.
[0300] Changepoint Manager is used to handle data changes and breakpoints.
[0301] The server can provide data services and respond to client requests.
[0302] A version manager is likely responsible for managing version control of data.
[0303] Specifically, step 2201. The persistence manager can perform initialization. Step 2202. After initialization, it can retrieve data from the storage database (get data), such as the content of a local document. Step 2203. The storage database returns data to the persistence manager. Step 2204. The persistence manager calls the `get_all` method to retrieve all data from the local document and sends it to the changepoint manager. Step 2205. The changepoint manager sends a data retrieval request to the server (request:fetch data), such as requesting the current version number of the cloud document, and requesting difference data between different version numbers if the current version number differs from the last synchronized version number locally. Step 2206. The server processes the request and returns a response to the changepoint manager, i.e., providing the current version number and possible difference data. Step 2207. After processing the response, the changepoint manager performs a distinct operation to differentiate the data. Step 2208. Perform a merge operation to merge the differentiated data to obtain merged data. This involves distinguishing the difference data from the edit data of the local document used by the user, and then merging them based on conflict resolution. Step 2209. The Changepoint Manager sends the merged data to the Version Manager via a push data operation. The Version Manager can perform the same functions as the Changepoint Manager, aligning version numbers based on the merged data and then handling conflict resolution. Step 2210. The Version Manager can then send the processed data to the server.
[0304] The schematic diagram illustrating the synchronization of local and cloud documents in this embodiment can be seen in... Figure 23 As shown, local documents synchronize changed data to cloud documents via atomic collaborative incremental synchronization. That is, when a user edits a local document, these changes are recorded, the changed data is converted into atomic operations, packaged into an incremental update package, and sent to the cloud, whereby the cloud executes the update to the cloud document. Similarly, cloud documents synchronize changed data to local documents via atomic collaborative incremental synchronization. When a cloud document changes (potentially due to other users or devices, or directly edited on the cloud document), these changes are also recorded, the changed data is converted into atomic operations, packaged into an incremental update package, and sent to the terminal, whereby the terminal executes the update to the local document.
[0305] Step 1513. Obtain the cloud document link.
[0306] A cloud document link can be a Uniform Resource Locator (URL) that directly accesses the cloud document, or it can be sent by the server to the terminal after the cloud document has been updated based on the encoded data, so that the user can view the update result. Alternatively, the cloud document link can be saved in the user's account and obtained based on the user's click, or it can be sent directly by another user.
[0307] Step 1514. Display the cloud document corresponding to the cloud document link.
[0308] The terminal can access cloud documents in cloud storage via cloud document links and display the cloud document on the display interface. The cloud document is editable, and incremental data edited from the cloud document can also be sent to the terminal, which can update the local document based on the incremental data.
[0309] For example, in a cloud document, a user can see all the content from a local document; the two documents are completely identical. The user can directly modify the local document or the cloud document. The modifications are also processed by the data capture and parsing module, undergoing atomic operations and lossless data transmission. Finally, they are transmitted incrementally between the terminal and the server, again maintaining complete consistency between the local and cloud-stored documents. Figure 24 The document synchronization diagram shown illustrates that the user can edit document 1 on page 402. Document 1 is a local document, and the text edited on the page containing document 1 is labeled "Text 1". The cloud document is document 2, which can also be edited. The edited text, such as "Text 2", can be incrementally transferred to document 1 for updates, meaning "Text 2" will also be displayed on the page containing document 1. Similarly, as... Figure 25 Another illustration of document synchronization is shown below. Figure 24 Based on this, the current page is document 2, and the page containing document 2 also displays text 1 and text 2 in the same positions as document 1.
[0310] Another schematic diagram of the document synchronization process in this disclosure can be referred to. Figure 26 As shown, the terminal side includes a local storage database, a shared worker, and an application. The local storage database stores local documents, the application is used to open local documents, the shared worker is used to synchronize local documents to the server, the server updates the content of the local document to the cloud document, and the cloud storage database is used to store the cloud document.
[0311] Specifically, Step 1. When deciding to transfer a local document to a cloud document, the local storage database generates a Keyframe without resources. This Keyframe can be a lightweight document structure or framework, and generates Resource Mutation and UserChange based on modifications to the objects used. Step 2. The local storage database sends the Keyframe, UserChange, and Resource Mutation to a sharing worker, a web worker that shares a single JavaScript execution environment across multiple browsing contexts. Step 3. The sharing worker uses the server's CreateDoc API to create a new cloud document link on the server based on the received Keyframe and UserChange. Step 4. The server returns the created cloud document link to the sharing worker. Step 5. The sharing worker sends the cloud document link to the local storage database. Step 6. The local storage database updates the Keyframe and UserChange in the database and binds the updated data to a new version (Revision). Revision is a version number or identifier used to distinguish different versions of the document. Step 7. The local storage database redirects to the cloud document based on the cloud document link. Step 8. The sharing worker requests the mapped local resource from the application, which is the software program that opens the local document. Step 9. The application returns a file converted into a blob object, which is a resource easily processed and transferred in a browser. Step 10. The sharing worker uploads the file to the server; this file can be an image, audio / video file, font, attachment, etc. Step 11. The server returns a locator to the sharing worker, such as the URL of an image or the object key (unique identifier) of an audio / video file. Step 12. When further modifications are made to the cloud document using the object, these modifications are submitted to the server as Mutations by the sharing worker. Step 13. The server processes these Mutations, updates the status of the cloud document, and sends an ACK response to the sharing worker. Step 14. The sharing worker determines the successful submission event based on the response and notifies the local storage database of the successful submission. Step 15. The local storage database sends an ACK response to the sharing worker. Step 16. The sharing worker notifies the cloud storage database of the successful submission. Step 17. The cloud storage database sends an ACK response to the sharing worker. Step 18. The cloud storage database updates the data in persistent storage to reflect the latest changes. When processing requests, it checks for duplicate requests based on the Taskid (task identifier). If a duplicate request is found, it is processed only once to avoid redundant operations. Step 19. If the cloud storage database discovers data gaps (i.e., data inconsistency or missing data) during synchronization, it will pull the gapped data from the server to repair it.Step 20. The server synchronizes changes to the local document to the cloud document in the cloud storage database, i.e., it pulls the latest version of the document to ensure data consistency between the two. Step 21. In a multi-person collaboration scenario, the local storage database can send the changed document resources to the sharing workers. Step 22. The sharing workers convert the document resources into web page resources and send them to the local storage database. Step 23. The local storage database submits the changes to the server; these changes are in the form of web page resources. Step 24. The server can also send changes to the local storage database; these changes are also in the form of web page resources. Step 25. The local storage database sends the web page resources to the sharing workers. Step 26. The sharing workers convert the web page resources into document resources and return them to the local storage database. Step 27. The local storage database analyzes the change operations in the document resources and handles conflicts with editing operations on objects in the local document. Step 28. Data in the cloud storage database can be transferred to the server at any time, i.e., sent to the server via uplink data transmission and downloaded from the server via downlink data transmission (Step 29). The order of steps 21 to 23, steps 24 to 27, and steps 28 to 29 is not fixed.
[0312] Another schematic diagram of the document synchronization process in this disclosure can be referred to. Figure 27 As shown, when the terminal side determines whether to transfer a local document to a cloud document, it can serialize the local document. If serialization fails, it will display "Cloud upload failed," indicating a synchronization failure. If serialization succeeds, the serialized data can be obtained. The serialized data can be decomposed to obtain keyframes without resources, as well as to identify resource changes and user changes. Without resources, the keyframes and user changes can be quickly created into a cloud document using a shared array buffer or structured clone. Resource changes are uploaded asynchronously after document creation. Next, a SharedWorker object can be initialized. SharedWorker can share a single JavaScript execution environment across multiple browsing contexts, enabling cross-thread communication and data processing. SharedWorker performs asynchronous uploads of cloud document creation and resource changes. The execution results of SharedWorker include cloud document creation failure, cloud document creation success, resource change upload failure, and resource change upload success. When cloud document creation fails, a callback is executed, displaying "Cloud upload failed." When cloud document creation succeeds, a callback is executed, redirecting the user to open the cloud document. When a resource upload fails, the reason for the failure can be determined, such as capacity issues, network problems, or missing documents. If it is a capacity issue, you can be prompted to become a member to increase the resource capacity. If it is a network issue, refresh the page.
[0313] When using an object to edit a local document, you can refer to the following diagram for the interface display. Figure 28 As shown, if a user wants to synchronize a local document to cloud storage in an atomic collaborative editing manner, this function can be triggered through several entry points: selecting "Synchronize Document" via the File menu; selecting "Synchronize Document" via the top shortcut toolbar; or triggering "Synchronize Document" via a keyboard shortcut event. When performing the atomic synchronization of a local document, a UI interaction prompt will first appear indicating that the local document content is being imported, informing the user that the synchronization process is in progress. This process uses atomic operations to convert the data into atomic operations that can be reconstructed and recognized by the cloud storage. Successful and failed synchronizations will both provide subsequent prompts to the user. Upon successful synchronization, the user will be redirected to the cloud document, which displays the updated content for viewing and continued editing.
[0314] Therefore, the document synchronization method provided in this application obtains the first document content of the target local document to be synchronized, and obtains the document content version of the target cloud document corresponding to the target local document in the current cloud storage; determines the second document content based on the document content version, and determines the first document change operation set according to the difference between the first document content and the second document content; generates a first document synchronization instruction according to the first document change operation set; and sends the first document synchronization instruction to the target server so that the target server updates the content of the target cloud document based on the first document synchronization instruction.
[0315] This method determines the change operation based on the cloud document version and then sends the change operation to the target server, transmitting only the changed data. This greatly reduces redundant data and meaningless time consumption caused by full synchronization. At the same time, the change operation is re-determined based on the content of the second document indicated by the cloud document version, which can avoid data loss or overwriting errors in the cloud document and improve data consistency and integrity during the data synchronization process.
[0316] Description of apparatus and devices according to embodiments of this disclosure
[0317] 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.
[0318] 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.
[0319] Figure 29 A schematic diagram of the structure of the document synchronization device 290 provided in this embodiment of the disclosure. The device includes:
[0320] The acquisition unit 2901 is used to acquire the first document content of the target local document to be synchronized, and to acquire the document content version of the target cloud document corresponding to the target local document in the current cloud storage;
[0321] The determining unit 2902 is used to determine the content of the second document based on the document content version, and to determine the set of first document change operations based on the differences between the content of the first document and the content of the second document;
[0322] Generation unit 2903 is used to generate a first document synchronization instruction based on the first document change operation set;
[0323] The sending unit 2904 is used to send a first document synchronization instruction to the target server, so that the target server updates the content of the target cloud document based on the first document synchronization instruction.
[0324] Optionally, the acquisition unit 2901 includes:
[0325] The first display subunit is used to display the first document page of the target local document;
[0326] The first generation subunit is used to generate a document synchronization request in response to a document synchronization trigger operation received on the first document page. The document synchronization request indicates that the target local document be synchronized to cloud storage.
[0327] Optionally, generating sub-units includes:
[0328] The first display module is used to display the document synchronization area on the first document page;
[0329] The first generation module is used to generate a document synchronization request in response to a document synchronization instruction received in the document synchronization area.
[0330] Optionally, the first generation module includes:
[0331] The first display submodule is used to display the first document synchronization control in the document synchronization area;
[0332] The first generation submodule is used to generate a document synchronization request in response to the trigger operation of the first document synchronization control.
[0333] Optionally, the first generation module includes:
[0334] The second display submodule is used to display the document tags corresponding to the target local document on the first document page;
[0335] The second generation submodule is used to generate a document synchronization request in response to a drag operation where a document tag is dragged into the document synchronization area.
[0336] Optionally, the first generating subunit includes:
[0337] The second display module is used to display a file menu control on the first document page; in response to a trigger operation on the file menu control, a file menu list is displayed, which contains a second document synchronization control;
[0338] The second generation module is used to generate a document synchronization request in response to the triggering operation of the second document synchronization control.
[0339] Optionally, the first generating subunit includes:
[0340] The first acquisition module is used to acquire keyboard operation commands received from the first document page;
[0341] The third generation module is used to generate a document synchronization request when the keyboard operation command matches the preset operation command corresponding to document synchronization.
[0342] Optionally, the determining unit 2902 includes:
[0343] The first acquisition subunit is used to acquire multiple version information of the target local document stored locally, and determine the target version with the latest update time based on the update time corresponding to the multiple version information.
[0344] The first determining subunit is used to determine the content of the second document based on the document content version and the target version.
[0345] Optionally, the first determined subunit includes:
[0346] The first determining module is used to determine the document content corresponding to the target version as the second document content when the document content version is the same as the target version.
[0347] The second determining module is used to obtain the difference data between the document content version and the target version when the document content version is different from the target version, and to determine the second document content based on the difference data and the document content of the target version.
[0348] Optionally, the second determining module includes:
[0349] The sending submodule is used to send document update requests to the target server. The document update request includes the target version.
[0350] The receiving submodule is used to receive the difference data returned by the target server based on the document update request;
[0351] The determination submodule is used to determine the content of the second document based on the difference data and the document content of the target version.
[0352] Optionally, the determining unit 2902 includes:
[0353] The second generation subunit is used to handle the conflict between the difference data and the content of the first document when there is a conflict between the difference data and the content of the first document, and generate the content of the third document.
[0354] The second determining subunit is used to determine the set of first document change operations based on the differences between the content of the third document and the content of the second document;
[0355] The third determining subunit is used to determine the set of first document change operations based on the differences between the content of the first document and the content of the second document when there is no conflict between the difference data and the content of the first document.
[0356] Optionally, the second generating subunit includes:
[0357] The third display module is used to display the conflict content when there is a conflict between the difference data and the content of the first document;
[0358] The second acquisition module is used to acquire the selection operation received from the conflict content display interface and generate the third document content based on the selection operation.
[0359] Optionally, the acquisition unit 2901 includes:
[0360] The second acquisition subunit is used to obtain the document link of the target cloud document;
[0361] The second display subunit is used to display the cloud document editing interface based on the document link, and to display the content of the first document in the cloud document editing interface.
[0362] Optionally, the second display subunit includes:
[0363] The fourth display module is used to display the sharing control in the cloud document editing interface;
[0364] The fifth display module is used to respond to the triggering operation of the sharing control in the cloud document editing interface and display the sharing interface, which is used to select the sharing method for the target cloud document.
[0365] Optionally, the acquisition unit 2901 includes:
[0366] The receiving subunit is used to receive a second document synchronization instruction sent by the target server. The second document synchronization instruction includes a second document change set.
[0367] The update sub-unit is used to update the content of the first document based on the second document change set.
[0368] Optionally, the transmitting unit 2904 includes:
[0369] The encoding subunit is used to serialize the first document synchronization instruction to obtain the first encoded data;
[0370] The sending subunit is used to send the first encoded data to the target server.
[0371] Optionally, the coding subunit includes:
[0372] The conversion module is used to convert the first document synchronization instruction into first structure data with a preset data structure.
[0373] The compilation module is used to compile the first structure data into code data;
[0374] The encoding module is used to serialize the code data to obtain the first encoded data.
[0375] In this disclosure, 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.
[0376] Reference Figure 30 , Figure 30To illustrate the structural block diagram of a portion of the terminal 140 implementing the document synchronization method of this embodiment, the terminal 140 includes: a radio frequency (RF) circuit 3010, a memory 3015, an input unit 3030, a display unit 3040, a sensor 3050, an audio circuit 3060, a wireless fidelity (WiFi) module 3070, a processor 3080, and a power supply 3090, among other components. Those skilled in the art will understand that... Figure 30 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.
[0377] The RF circuit 3010 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 3080; in addition, it transmits uplink data to the base station.
[0378] The memory 3015 can be used to store software programs and modules. The processor 3080 executes various terminal functions and document editing by running the software programs and modules stored in the memory 3015.
[0379] The input unit 3030 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 3030 may include a touch panel 3031 and other input devices 3032.
[0380] The display unit 3040 can be used to display input or provided information, as well as various menus of the terminal. The display unit 3040 may include a display panel 3041.
[0381] Audio circuit 3060, speaker 3061, and microphone 3062 provide an audio interface.
[0382] In this embodiment, the processor 3080 included in the terminal 140 can execute the document synchronization method of the previous embodiment.
[0383] 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.
[0384] Figure 31This is a partial structural block diagram of a server 110 implementing the document synchronization method of this disclosure. The server 110 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 3122 (e.g., one or more processors) and storage devices 3132, and one or more storage media 3130 (e.g., one or more mass storage devices) storing application programs 3142 or data 3144. The storage devices 3132 and storage media 3130 can be temporary or persistent storage. The program stored in the storage media 3130 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server 110. Furthermore, the CPU 3122 may be configured to communicate with the storage media 3130 and execute the series of instruction operations in the storage media 3130 on the server 110.
[0385] Server 110 may also include one or more power supplies 3126, one or more wired or wireless network interfaces 3150, one or more input / output interfaces 3158, and / or one or more operating systems 3141, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0386] The central processing unit 3122 in server 110 can be used to execute the document synchronization method of the present disclosure embodiments.
[0387] This disclosure also provides a storage medium for storing program code for executing the document synchronization methods of the foregoing embodiments.
[0388] This disclosure also provides a computer program product comprising a computer program. A processor of an electronic device reads and executes the computer program, causing the electronic device to perform the document synchronization method described above.
[0389] 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.
[0390] 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.
[0391] 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.
[0392] 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.
[0393] 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.
[0394] 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.
[0395] 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 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.
[0396] It should also be understood that the various implementation methods provided in this disclosure can be combined arbitrarily to achieve different technical effects.
[0397] 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 synchronization method, characterized in that, include: Obtain the first document content of the target local document to be synchronized, and obtain the document content version of the target cloud document corresponding to the target local document in the current cloud storage; The second document content is determined based on the document content version, and the first document change operation set is determined based on the difference between the first document content and the second document content; Generate a first document synchronization instruction based on the first document change operation set; Send the first document synchronization instruction to the target server so that the target server updates the content of the target cloud document based on the first document synchronization instruction.
2. The method according to claim 1, characterized in that, Before obtaining the first document content of the target local document to be synchronized, the method further includes: Displays the first document page of the target local document; In response to the document synchronization trigger operation received on the first document page, a document synchronization request is generated, which instructs the target local document to be synchronized to cloud storage.
3. The method according to claim 2, characterized in that, The step of generating a document synchronization request in response to a document synchronization trigger operation received on the first document page includes: Display the document synchronization area on the first document page; In response to a document synchronization instruction received in the document synchronization area, a document synchronization request is generated.
4. The method according to claim 3, characterized in that, The step of generating a document synchronization request in response to a document synchronization instruction received in the document synchronization area includes: Display a first document synchronization control in the document synchronization area; In response to the triggering operation of the first document synchronization control, a document synchronization request is generated.
5. The method according to claim 3, characterized in that, The step of generating a document synchronization request in response to a document synchronization instruction received in the document synchronization area includes: The document tags corresponding to the target local document are displayed on the first document page; In response to a drag operation that moves the document tag to the document synchronization area, a document synchronization request is generated.
6. The method according to claim 2, characterized in that, The step of generating a document synchronization request in response to a document synchronization trigger operation received on the first document page includes: Display a file menu control on the first document page; In response to a trigger operation on the file menu control, a file menu list is displayed, the file menu list containing a second document synchronization control; In response to the triggering operation of the second document synchronization control, a document synchronization request is generated.
7. The method according to claim 2, characterized in that, In response to the document synchronization trigger operation received on the first document page, a document synchronization request is generated: Obtain keyboard operation commands received from the first document page; When the keyboard operation command matches the preset operation command corresponding to document synchronization, a document synchronization request is generated.
8. The method according to any one of claims 1 to 7, characterized in that, The step of determining the content of the second document based on the document content version includes: Obtain multiple version information of the target local document stored locally, and determine the target version with the latest update time based on the update time corresponding to the multiple version information; The content of the second document is determined based on the document content version and the target version.
9. The method according to claim 8, characterized in that, The step of determining the content of the second document based on the document content version and the target version includes: When the document content version is the same as the target version, the document content corresponding to the target version is determined as the second document content; When the document content version is different from the target version, obtain the difference data between the document content version and the target version, and determine the second document content based on the difference data and the document content of the target version.
10. The method according to claim 9, characterized in that, The step of obtaining the difference data between the document content version and the target version, and determining the second document content based on the difference data and the document content of the target version, includes: Send a document update request to the target server, the document update request including the target version; Receive the difference data returned by the target server based on the document update request; The content of the second document is determined based on the difference data and the content of the target version of the document.
11. The method according to any one of claims 9 or 10, characterized in that, The step of determining the first document change operation set based on the differences between the content of the first document and the content of the second document includes: When the difference data conflicts with the content of the first document, conflict resolution is performed on the difference data and the content of the first document to generate the content of the third document. The first document change operation set is determined based on the differences between the content of the third document and the content of the second document; When the difference data does not conflict with the content of the first document, the first document change operation set is determined based on the difference between the content of the first document and the content of the second document.
12. The method according to claim 11, characterized in that, When the difference data conflicts with the content of the first document, conflict resolution is performed on the difference data and the content of the first document to generate third document content, including: When the difference data conflicts with the content of the first document, a conflict content display interface is shown. Obtain the selection operation received from the conflict content display interface, and generate third document content based on the selection operation.
13. The method according to claim 1, characterized in that, The first document page is displayed based on the target document application. After sending the first document synchronization instruction to the target server so that the target server updates the content of the target cloud document based on the first document synchronization instruction, the method further includes: Obtain the document link of the target cloud document; The cloud document editing interface is displayed according to the document link, and the content of the first document is displayed in the cloud document editing interface.
14. The method according to claim 13, characterized in that, After displaying the cloud document editing interface according to the link and displaying the content of the first document in the cloud document editing interface, the method further includes: A sharing control is displayed in the cloud document editing interface; In response to a triggering operation of the sharing control in the cloud document editing interface, a sharing interface is displayed, which is used to select the sharing method for the target cloud document.
15. The method according to claim 1, characterized in that, The method further includes: Receive a second document synchronization instruction sent by the target server, the second document synchronization instruction including a second document change set; The content of the first document is updated based on the second document change set.
16. The method according to claim 1, characterized in that, Sending the first document synchronization instruction to the target server includes: The first document synchronization instruction is serialized to obtain the first encoded data; Send the first encoded data to the target server.
17. The method according to claim 16, characterized in that, The step of serializing the first document synchronization instruction to obtain the first encoded data includes: The first document synchronization instruction is converted into first structure data with a preset data structure; Compile the first structure data into code data; The code data is serialized to obtain the first encoded data.
18. A document synchronization device, characterized in that, include: The acquisition unit is used to acquire the first document content of the target local document to be synchronized, and to acquire the document content version of the target cloud document corresponding to the target local document in the current cloud storage; The determining unit is configured to determine the second document content based on the document content version, and to determine the first document change operation set based on the difference between the first document content and the second document content; The generation unit is used to generate a first document synchronization instruction based on the first document change operation set; The sending unit is used to send the first document synchronization instruction to the target server, so that the target server updates the content of the target cloud document based on the first document synchronization instruction.
19. A storage medium storing a computer program, characterized in that, When the computer program is executed by a processor, it implements the document synchronization method according to any one of claims 1 to 17.
20. An electronic 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 synchronization method according to any one of claims 1 to 17.