Document editing method and device and computing equipment

By caching the edit operation generated on the terminal device and synchronizing it when necessary, and using short connections or timed synchronization, the power consumption and traffic consumption problems caused by long connections are solved, and the efficiency of devices and networks is improved.

CN121728155APending Publication Date: 2026-03-24HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Long-term connections between terminal devices and servers lead to excessive power consumption and network traffic consumption, affecting device performance and network efficiency.

Method used

By caching the edit operation locally after it is generated on the terminal device, and then synchronizing it to the server when other terminal devices edit it, short connections or synchronization according to a set time period are used to reduce the frequent establishment and maintenance of long connections.

Benefits of technology

It reduces the power consumption and network traffic consumption of terminal devices, reduces the power consumption and network resource occupation of devices, and improves the efficiency of device use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121728155A_ABST
    Figure CN121728155A_ABST
Patent Text Reader

Abstract

The invention provides a document editing method. The document editing method comprises the steps that first terminal equipment obtains a stored target document from a server; the first terminal device generates a first editing operation on the target document and caches the first editing operation locally; under the condition that the server determines that other terminal devices edit the target document stored in the server, the server sends a first notification message to the first terminal device; the first terminal device receives the first notification message and synchronizes a locally cached first editing operation to the server according to the first notification message; and the server receives the first editing operation and updates the target document stored on the server according to the first editing operation. The scheme can reduce the power consumption of the terminal equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing, and more specifically, to a method, apparatus, and computing device for document editing. Background Technology

[0002] With the rapid development of computer application software, online documents such as web pages provide the ability for multiple users to edit simultaneously. Users can access online documents stored on a server through their respective terminal devices and perform corresponding editing operations. The server will synchronously update the online document based on the editing operations performed by users on each terminal device to support multiple users editing the online document simultaneously.

[0003] In related technical solutions, multiple users establish long-lived connections with a server through their respective terminal devices, and send their document operations to the server via these connections. The server then forwards these document operations to the terminal devices of other users through the same long-lived connections, thereby achieving real-time synchronization of documents between the various terminal devices and the server. However, this technology relies on long-lived connections between the terminal devices and the server, resulting in relatively high power consumption for the terminal devices.

[0004] Therefore, how to reduce the power consumption of terminal devices has become an urgent technical problem to be solved. Summary of the Invention

[0005] This application provides a document editing method that can reduce the power consumption of terminal devices.

[0006] In a first aspect, a method for editing a document is provided, the method comprising: a first terminal device obtaining a target document stored in a server from a server; the first terminal device generating a first editing operation on the target document and caching the first editing operation locally; the server, upon determining that another terminal device has edited the target document stored in the server, sending a first notification message to the first terminal device; the first terminal device receiving the first notification message and synchronizing the locally cached first editing operation to the server according to the first notification message; and the server receiving the first editing operation and updating the target document stored on the server according to the first editing operation.

[0007] In the above technical solution, after the first terminal device generates the first editing operation on the target document, it can be cached locally without requiring real-time collaboration between the terminal device and the cloud server. Only when other terminal devices edit the target document stored on the server are the locally cached first editing operation synchronized to the server. This eliminates the need for a long-term connection between the terminal device and the cloud server, thereby reducing the power consumption of the terminal device and the network traffic consumption between the terminal device and the server.

[0008] In conjunction with the first aspect, in some implementations of the first aspect, the first terminal device establishes a short connection with the server; the first terminal device obtains the target document stored in the server through the short connection.

[0009] In the above technical solution, the first terminal device obtains the target document stored in the server from the server through a short connection, which can reduce the power consumption of the terminal device.

[0010] In conjunction with the first aspect, in some implementations of the first aspect, the first terminal device obtains the target document stored in the server through a long connection. Before the first terminal device generates a first editing operation on the target document, the method further includes: if the server determines that no other terminal device has edited the target document stored in the server, it sends a second notification message to the first terminal device; the first terminal device receives the second notification message and disconnects the long connection with the server according to the second notification message.

[0011] In the above technical solution, if the first terminal device obtains the target document stored on the server from the server through a long connection, and no other terminal device edits the target document stored on the server, the first terminal device can disconnect the long connection to reduce the power consumption of the terminal device and the amount of network traffic consumed between the terminal device and the server.

[0012] In conjunction with the first aspect, in some implementations of the first aspect, the first terminal device synchronizes the first editing operation to the server via a short connection; the server receives the first editing operation via the short connection.

[0013] In the above technical solution, the first terminal device sends the locally cached first editing operation on the target document to the server through a short connection, thereby reducing the power consumption of the terminal device.

[0014] In conjunction with the first aspect, in some implementations of the first aspect, the first terminal device sends the locally cached first editing operation to the server via the short connection according to a set time period.

[0015] In the above technical solution, the first editing operation on the target document can be stored locally, and then the cached first editing operation can be synchronized to the server via a short connection at certain time intervals. This reduces the number of network requests from the terminal device to the server, eliminating the need to send a request to the server after each editing operation on the target document, thus reducing server load. It also allows for periodic updates of the content of the target document stored on the server, preventing the content from becoming outdated.

[0016] In conjunction with the first aspect, in some implementations of the first aspect, the method further includes: if the first terminal device exits editing the target document, and if the first terminal device has a second editing operation on the target document locally cached, the first terminal device establishes a short connection and sends the second editing operation to the server through the short connection; the server receives the second editing operation and updates the target document stored on the server according to the second editing operation.

[0017] In conjunction with the first aspect, in some implementations of the first aspect, the first terminal device obtains the target document stored in the server through the target application, and the notification message is a pass-through message.

[0018] In conjunction with the first aspect, in some implementations of the first aspect, the server is located in at least one data center that provides cloud services.

[0019] Secondly, a method for editing a document is provided, the method comprising: a first terminal device obtaining a target document stored in the server from a server via a short connection; the first terminal device generating a first editing operation on the target document and caching the first editing operation locally; the first terminal device sending the locally cached first editing operation to the server via the short connection according to a set first time period; the server receiving the first editing operation and updating the target document stored on the server according to the first editing operation.

[0020] In the above technical solution, the first terminal device retrieves the target document stored on the server via a short connection, stores the first editing operation on the target document locally, and then synchronizes the cached first editing operation to the server via a short connection at regular intervals. This reduces the number of network requests the terminal device makes to the server, eliminating the need to send a request to the server after each editing operation on the target document, thus reducing server load. It also allows for periodic updates to the content of the target document stored on the server, preventing the content from becoming outdated.

[0021] In conjunction with the second aspect, in some implementations of the second aspect, the method includes: a second terminal device obtaining a target document stored on a server via a short connection; the second terminal device generating a third editing operation on the target document and caching the third editing operation locally; the second terminal device sending the locally cached third editing operation to the server via the short connection according to a set second time period; the server receiving the third editing operation and updating the target document stored on the server according to the third editing operation.

[0022] In conjunction with the second aspect, in some implementations of the second aspect, the method further includes: if the first terminal device exits editing the target document, and if the first terminal device has a second editing operation on the target document locally cached, the first terminal device establishes a short connection and sends the second editing operation to the server through the short connection; the server receives the second editing operation and updates the target document stored on the server according to the second editing operation.

[0023] In conjunction with the second aspect, in some implementations of the second aspect, before the first terminal device retrieves the target document stored in the server via a short connection, the method further includes: the first terminal device setting the time period.

[0024] In conjunction with the second aspect, in some implementations of the second aspect, the time period is determined based on the number of other terminal devices currently retrieving the stored target document from the server.

[0025] In conjunction with the second aspect, in some implementations of the second aspect, the more other terminal devices currently retrieving the stored target document from the server, the shorter the time period.

[0026] In conjunction with the second aspect, in some implementations of the second aspect, the fewer the number of other terminal devices currently retrieving the stored target document from the server, the longer the time period.

[0027] Thirdly, a document editing system is provided, comprising a first terminal device and a server, wherein: the first terminal device is configured to retrieve a target document stored on the server from the server; the first terminal device is further configured to generate a first editing operation on the target document and cache the first editing operation locally; the server is configured to send a first notification message to the first terminal device when it determines that another terminal device is editing the target document stored on the server; the first terminal device is further configured to receive the first notification message and synchronize the locally cached first editing operation to the server according to the first notification message; the server is further configured to receive the first editing operation and update the target document stored on the server according to the first editing operation.

[0028] In conjunction with the third aspect, in some implementations of the third aspect, the first terminal device is specifically used to: obtain the target document stored in the server through the short connection.

[0029] In conjunction with the third aspect, in some implementations of the third aspect, the first terminal device obtains the target document stored in the server through a long connection. The server is further configured to send a second notification message to the first terminal device if it determines that no other terminal device has edited the target document stored in the server. The first terminal device is further configured to receive the second notification message and disconnect the long connection with the server according to the second notification message.

[0030] In conjunction with the third aspect, in some implementations of the third aspect, the first terminal device is specifically used to: synchronize the first editing operation to the server via a short connection; the server is specifically used to: receive the first editing operation via the short connection.

[0031] In conjunction with the third aspect, in some implementations of the third aspect, the first terminal device is specifically used to: send the locally cached first editing operation to the server via the short connection according to a set time period.

[0032] In conjunction with the third aspect, in some implementations of the third aspect, the first terminal device is further configured to, when the first terminal device exits editing the target document, establish a short connection if the first terminal device has a second editing operation on the target document locally cached, and send the second editing operation to the server through the short connection; the server is further configured to receive the second editing operation and update the target document stored on the server according to the second editing operation.

[0033] Fourthly, a document editing system is provided, comprising a first terminal device and a server, wherein: the first terminal device is configured to retrieve a target document stored on the server via a short connection; the first terminal device is further configured to generate a first editing operation on the target document and cache the first editing operation locally; the first terminal device is further configured to send the locally cached first editing operation to the server via the short connection according to a set first time period; the server is configured to receive the first editing operation and update the target document stored on the server according to the first editing operation.

[0034] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the system further includes: a second terminal device, configured to retrieve a target document stored on the server via a short connection; the second terminal device is further configured to generate a third editing operation on the target document and cache the third editing operation locally; the second terminal device is further configured to send the locally cached third editing operation to the server via the short connection according to a set second time period; the server is further configured to receive the third editing operation and update the target document stored on the server according to the third editing operation.

[0035] In conjunction with the fourth aspect, in some implementations of the fourth aspect, the first terminal device is further configured to, when the first terminal device exits editing the target document, establish a short connection if the first terminal device has a second editing operation on the target document locally cached, and send the second editing operation to the server through the short connection; the server is further configured to receive the second editing operation and update the target document stored on the server according to the second editing operation.

[0036] Fifthly, a computing device is provided, including a processor and a memory, and optionally, an input / output interface. The processor controls the input / output interface to send and receive information, the memory stores a computer program, and the processor retrieves and runs the computer program from the memory, causing it to execute the method of the first aspect or any possible implementation thereof, or to execute the method of the second aspect or any possible implementation thereof.

[0037] Optionally, the processor can be a general-purpose processor, which can be implemented in hardware or software. When implemented in hardware, the processor can be a logic circuit, integrated circuit, etc.; when implemented in software, the processor can be a general-purpose processor that reads software code stored in memory. This memory can be integrated into the processor or located outside the processor and exist independently.

[0038] In a sixth aspect, a computing device cluster is provided, including at least one computing device, each computing device including a processor and a memory; the processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device, such that the computing device cluster performs a method in the first aspect or any possible implementation thereof, or performs a method in the second aspect or any possible implementation thereof.

[0039] In a seventh aspect, a chip is provided that acquires and executes instructions to implement the methods in the first aspect and any implementation thereof, or to implement the methods in the second aspect or any possible implementation thereof.

[0040] Optionally, as one implementation, the chip includes a processor and a data interface, through which the processor reads instructions stored in the memory and executes the methods in the first aspect and any implementation thereof, or executes the methods in the second aspect or any possible implementation thereof.

[0041] Optionally, as one implementation, the chip may further include a memory storing instructions, and the processor is used to execute the instructions stored in the memory. When the instructions are executed, the processor is used to execute the method in the first aspect and any implementation thereof, or to execute the method in the second aspect or any possible implementation thereof.

[0042] Eighthly, a computer program product comprising instructions is provided, which, when executed by a computing device, causes the computing device to perform the method as described in the first aspect and any implementation thereof, or to perform the method as described in the second aspect or any possible implementation thereof.

[0043] In a ninth aspect, a computer program product containing instructions is provided, which, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the methods described in the first aspect and any implementation thereof, or to perform the methods described in the second aspect or any possible implementation thereof.

[0044] In a tenth aspect, a computer-readable storage medium is provided, including computer program instructions that, when executed by a computing device, perform a method as described in the first aspect and any implementation thereof, or perform a method as described in the second aspect or any possible implementation thereof.

[0045] As examples, these computer-readable storage devices include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), flash memory, electrically EPROM (EEPROM), and hard drive.

[0046] Alternatively, as one implementation method, the aforementioned storage medium can specifically be a non-volatile storage medium.

[0047] Eleventhly, a computer-readable storage medium is provided, including computer program instructions that, when executed by a cluster of computing devices, perform the method as described in the first aspect and any implementation thereof, or perform the method as described in the second aspect or any possible implementation thereof.

[0048] As examples, these computer-readable storage devices include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), flash memory, electrically EPROM (EEPROM), and hard drive.

[0049] Alternatively, as one implementation method, the aforementioned storage medium can specifically be a non-volatile storage medium. Attached Figure Description

[0050] Figure 1 This is a schematic block diagram illustrating an application scenario applicable to the embodiments of this application.

[0051] Figure 2 This is a schematic block diagram of a cloud scenario applicable to embodiments of this application.

[0052] Figure 3 This is a schematic flowchart illustrating a document editing method provided in an embodiment of this application.

[0053] Figure 4 This is a schematic flowchart illustrating another document editing method provided in an embodiment of this application.

[0054] Figure 5 This is a schematic flowchart illustrating another document editing method provided in an embodiment of this application.

[0055] Figure 6 This is a schematic flowchart illustrating another document editing method provided in an embodiment of this application.

[0056] Figure 7 This is a schematic block diagram of a document editing system 700 provided in an embodiment of this application.

[0057] Figure 8 This is a schematic diagram of the architecture of a computing device 1500 provided in an embodiment of this application.

[0058] Figure 9 This is a schematic diagram of the architecture of a computing device cluster provided in an embodiment of this application.

[0059] Figure 10 This is a schematic diagram showing the connection between computing devices 1500A and 1500B via a network, as provided in the embodiments of this application. Detailed Implementation

[0060] The technical solutions in this application will now be described with reference to the accompanying drawings.

[0061] This application will present various aspects, embodiments, or features relating to systems comprising multiple devices, components, modules, etc. It should be understood and appreciated that individual systems may include additional devices, components, modules, etc., and / or may not include all devices, components, modules, etc. discussed in conjunction with the accompanying drawings. Furthermore, combinations of these approaches are also possible.

[0062] Furthermore, in the embodiments of this application, the words "exemplary," "for example," etc., are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design scheme described as "exemplary" in this application should not be construed as being more preferred or advantageous than other embodiments or design schemes. Specifically, the use of the term "exemplary" is intended to present the concept in a concrete manner.

[0063] In the embodiments of this application, "corresponding" and "corresponding" can sometimes be used interchangeably. It should be noted that when the distinction is not emphasized, their intended meanings are consistent.

[0064] The business scenarios described in the embodiments of this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided in the embodiments of this application. As those skilled in the art will know, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of this application are also applicable to similar technical problems.

[0065] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0066] In this application, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: A alone, A and B simultaneously, and B alone, 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 mean: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.

[0067] For ease of description, the concepts involved in the embodiments of this application will be explained below.

[0068] 1. Short connection

[0069] A short connection refers to a brief connection established between a client and a server, which is closed immediately after a single communication session. In short connections, the client and server need to establish a connection, transmit data, and close the connection each time; there is no persistent connection.

[0070] As an example, short connections are primarily implemented using protocols such as the Hypertext Transfer Protocol (HTTP), and the connection is closed once each request-response cycle is complete.

[0071] The aforementioned short connections are primarily suitable for non-real-time communication scenarios, such as file transfers and request-response applications. In these scenarios, short connections have shorter connection times and lower communication frequencies, thus avoiding prolonged consumption of server resources. Each communication is independent, saving resources. However, frequent connection and disconnection of short connections can impact communication efficiency and increase system overhead.

[0072] 2. Long connection

[0073] A persistent connection refers to a long-lasting connection maintained between a client and a server. Once established, this connection allows for extended communication. With a persistent connection, the client and server can send and receive data at any time without needing to re-establish and close the connection each time.

[0074] As an example, persistent connections are primarily implemented through protocols such as Transmission Control Protocol (TCP) or WebSocket. In TCP, persistent connections are achieved by maintaining the connection state after it is established, while WebSocket provides more advanced real-time communication capabilities.

[0075] The aforementioned long-lived connections are primarily suitable for real-time applications requiring frequent communication, such as real-time chat applications and real-time games. In these scenarios, the client and server need to maintain long-term, persistent communication to transmit data and status information in real time. Using long-lived connections can reduce the overhead of establishing new connections and improve communication efficiency and stability. However, because long-lived connections maintain a persistent connection between the client and server, they consume certain resources.

[0076] 3. Push service

[0077] Push services are message push platforms provided by mobile phone manufacturers or third-party suppliers. They establish a message push channel from the cloud to the terminal and generally support notification bar messages and pass-through messages. Among them, pass-through messages are messages that are handled by the application on the terminal device. After receiving the pass-through message from the cloud, the terminal device does not display it directly, but instead passes the data to the corresponding application on the terminal device. The application then parses the content and triggers relevant actions.

[0078] With the rapid development of computer application software, online documents such as web pages provide the ability for multiple users to edit simultaneously. Users can access online documents stored on a server through their respective terminal devices and perform corresponding editing operations. The server will synchronously update the online document based on the editing operations performed by users on each terminal device to support multiple users editing the online document simultaneously.

[0079] In related technical solutions, multiple users establish persistent connections with a server through their respective terminal devices, and send their document operations to the server through these persistent connections, thereby achieving real-time synchronization of documents between the various terminal devices and the server. However, because this technology establishes persistent connections between the terminal devices and the server, the persistent connections maintain a high level of network traffic. This results in both high power consumption on the terminal devices and high network bandwidth consumption due to the frequent sending and receiving of data through these persistent connections.

[0080] In view of this, embodiments of this application provide a document editing method that can not only reduce the power consumption of terminal devices, but also reduce the network traffic consumption between terminal devices and servers.

[0081] For ease of description, the following will combine... Figures 1-2 The application scenarios applicable to this application will be described in detail.

[0082] As an example, Figure 1 This is a schematic block diagram illustrating an application scenario applicable to the embodiments of this application. For example... Figure 1 As shown, this scenario may include at least one terminal device 110 and a server 120. The at least one terminal device 110 is connected to the server 120 via a network.

[0083] The server 120 stores documents. When a user accesses a document stored on the server 120 through their terminal device 110, other users can also access the document simultaneously through their terminal devices 110. Multiple users can edit the document simultaneously while accessing it through their respective terminal devices 110. The server 120 updates the document based on the edits made by each terminal device 110 and synchronizes the updated document with each terminal device 110, allowing each user to see the latest edited document on their respective terminal device 110.

[0084] For example, at least one terminal device 110 described above has a browser or application (APP) installed. A user obtains a document from the server 120 through the browser or APP on their terminal device 110, edits the document, and synchronizes the changes in the document content with the server 120. At the same time, the server 120 can also synchronize the user's operations on the document to other terminal devices 110 that use the document.

[0085] For example, the aforementioned server 120 provides collaborative services and data services. Specifically, a user can access the collaborative service through a browser or app on their terminal device 110 to retrieve the aforementioned document from server 120. Server 120 can also use this collaborative service to synchronize a user's actions on the document with other terminal devices 110 that are using the document.

[0086] For example, the server 120 also provides data services. The collaboration service in the server 120 can also persist the full change process data of at least one terminal device 110 operating on a document to the data service.

[0087] This application does not specifically limit the type of the terminal device 110 described above. As an example, the terminal device 110 may include, but is not limited to, at least one of the following: personal computer, laptop computer, smartphone, tablet computer.

[0088] This application does not specifically limit the type of server 120 described above. As an example, server 120 can be a standalone server in a cloud data center, or it can be a server cluster composed of multiple servers in a cloud data center.

[0089] Figure 2 This is a schematic block diagram illustrating a cloud scenario applicable to embodiments of this application. For example... Figure 2 As shown, the cloud scenario may include: cloud management platform 210, Internet 220, and client 230.

[0090] like Figure 2 As shown, the cloud management platform 210 is used to manage the infrastructure that provides multiple cloud services. The infrastructure includes multiple cloud data centers, each cloud data center includes multiple servers, and each server includes cloud service resources to provide corresponding cloud services to users.

[0091] The cloud management platform 210 can be located in a cloud data center and can provide access interfaces (such as user interfaces or application program interfaces, APIs). Users can use client 230 to remotely access the access interface to register a cloud account and password on the cloud management platform 210 and log in. After successful authentication of the cloud account and password, the user can further select and purchase virtual machines of specific specifications (processor, memory, disk) on the cloud management platform 210. After successful purchase, the cloud management platform 210 provides the remote login account and password for the purchased virtual machine, and client 230 can remotely log in to the virtual machine to install and run the user's applications. Therefore, users can create, manage, log in to, and operate virtual machines in the cloud data center through the cloud management platform 210. Virtual machines can also be referred to as Elastic Compute Service (ECS) or Elastic Instances (different cloud service providers may use different names).

[0092] It should be understood that users of cloud services can be individuals, businesses, schools, hospitals, government agencies, etc.

[0093] The cloud management platform 210 includes, but is not limited to, a user console, compute management services, network management services, storage management services, authentication services, and image management services. The user console provides an interface or API for user interaction. The compute management services manage servers running virtual machines and containers, as well as bare metal servers. The network management services manage network services (such as gateways and firewalls). The storage management services manage storage services (such as data bucket services). The authentication services manage user accounts and passwords. The image management services manage virtual machine images. Users can log in to the cloud management platform 210 via client 230 and the internet 220 to manage rented cloud services.

[0094] Figure 3 This is a schematic flowchart illustrating a document editing method provided in an embodiment of this application. Figure 3 As shown, the method may include steps 310-350, which will be described in detail below.

[0095] Step 310: The first terminal device retrieves the stored target document from the server.

[0096] In this embodiment of the application, the user can obtain the target document stored on the server from the server through the first terminal device.

[0097] The aforementioned user can obtain the target document stored on the server from the server through a browser on the first terminal device, or through an application (APP) on the first terminal device. This application does not specifically limit this.

[0098] There are multiple ways for the first terminal device to obtain the stored target document from the server. This application embodiment does not specifically limit this, and several possible implementation methods are listed below.

[0099] In one possible implementation, the first terminal device establishes a short connection with the server and obtains the target document stored on the server through the short connection.

[0100] In another possible implementation, the first terminal device establishes a long connection with the server and obtains the target document stored on the server through the long connection.

[0101] Step 320: The first terminal device generates the first editing operation on the target document and caches the first editing operation locally.

[0102] In this embodiment, the first terminal device generates a first editing operation on the target document and caches the first editing operation locally. That is, after the first terminal device generates the first editing operation on the target document, it does not synchronize the first editing operation to the server in real time, but caches it locally.

[0103] As an example, the first editing operation described above includes the location of the object to be edited in the target document and the content to be edited on that object.

[0104] For example, the objects to be edited in the target document mentioned above may include, but are not limited to, an image or a paragraph of text within the target document. The content to be edited may include, but is not limited to, dragging an image in the target document, changing the size of an image in the target document, changing the font of a paragraph of text in the target document, changing the color of a paragraph of text in the target document, and changing the size of a paragraph of text in the target document.

[0105] Step 330: If the server determines that another terminal device is editing the target document stored on the server, it sends a first notification message to the first terminal device.

[0106] In this embodiment of the application, the server can determine whether, after the first terminal device obtains the stored target document from the server, other terminal devices will edit the target document stored in the server.

[0107] Example 1: If the server determines that another terminal device is editing the target document stored on the server, the server will send a first notification message to the first terminal device. This first notification message is used to notify the first terminal device that another terminal device is editing the target document stored on the server.

[0108] Example 2: If the server determines that another terminal device is editing the target document stored on the server, the server will send a second notification message to the first terminal device. This second notification message is used to notify the first terminal device that no other terminal device is editing the target document stored on the server.

[0109] In Example 2 above, if the first terminal device obtains the target document stored in the server through a long connection, before the first terminal device generates the first editing operation on the target document, the first terminal device will disconnect the long connection with the server according to the second notification message it receives, so as to save the power consumption of the first terminal device.

[0110] Step 340: The first terminal device receives the first notification message and synchronizes the first edit operation cached locally to the server according to the first notification message.

[0111] In this embodiment of the application, if the first terminal device receives a first notification message sent by the server, it can determine that another terminal device is editing the target document stored in the server based on the first notification message. The first terminal device will then send the locally cached first editing operation to the server based on the first notification message.

[0112] In one possible implementation, the first terminal device can re-establish a long connection with the server and synchronize the first editing operation to the server through this long connection.

[0113] In another possible implementation, the first terminal device can establish a short connection with the server and synchronize the first editing operation to the server through this short connection. For example, the short connection with the server can be established according to a set time period.

[0114] For example, the time period can be set based on the number of other terminal devices currently retrieving the target document from the server. For instance, the more other terminal devices currently retrieving the target document from the server, the shorter the time period. Conversely, the fewer other terminal devices currently retrieving the target document from the server, the longer the time period.

[0115] Step 350: The server receives the first editing operation and updates the target document stored on the server according to the first editing operation.

[0116] In this embodiment of the application, after receiving the first editing operation sent by the first terminal device, the server updates the target document stored on the server according to the first editing operation.

[0117] In one possible implementation, the server merges all editing operations on the terminal device side to update the target document stored on the server, thereby obtaining the updated target document.

[0118] As an example, let's consider the first editing operation described above, which includes the location of the object to be edited in the target document and the content to be edited on that object. After receiving the first editing operation, the cloud server can edit the target document stored on it according to the editing location and content included in the first editing operation, thereby achieving synchronization of the target document between the first terminal device and the cloud server.

[0119] Optionally, if the first terminal device exits editing the target document, and if the first terminal device has a second editing operation on the target document cached locally, the first terminal device establishes a short connection with the server and sends the second editing operation to the server through this short connection. After receiving the second editing operation, the server updates the target document stored on the server according to the second editing operation.

[0120] In the above technical solution, after the first terminal device generates the first editing operation on the target document, it can be cached locally without requiring real-time collaboration between the terminal device and the cloud server. Only when other terminal devices edit the target document stored on the server are the locally cached first editing operation synchronized to the server. This eliminates the need for a long-term connection between the terminal device and the cloud server, thereby reducing the power consumption of the terminal device and the network traffic consumption between the terminal device and the server.

[0121] Let's combine the following... Figures 4-5 ,right Figure 3 The document editing method shown is described in detail in different specific implementation processes. It should be understood that... Figures 4-5 The examples are merely to help those skilled in the art understand the embodiments of this application, and are not intended to limit the embodiments of the application to... Figures 4-5 The specific numerical values ​​or specific scenarios illustrated. Those skilled in the art will understand based on... Figures 4-5 The examples given below can obviously be modified or varied in various ways, and such modifications and variations also fall within the scope of the embodiments of this application.

[0122] Figure 4 This is a schematic flowchart illustrating another document editing method provided in an embodiment of this application. Figure 4 As shown, the method may include steps 410-470, which will be described in detail below.

[0123] Step 410: User 1 sends a request message to the cloud server to attempt to establish a long connection through APP1 on terminal device 1.

[0124] In this embodiment of the application, user 1 can send a request message to the cloud server to attempt to establish a long connection through APP1 on terminal device 1, so as to obtain the target document stored on the cloud server through the long connection between APP1 and the cloud server.

[0125] As an example, the cloud server mentioned above provides a collaborative service. The request message sent by user 1 to the cloud server through APP1 is used to request an attempt to establish a long connection with the collaborative service on the cloud server.

[0126] The above request message may include the APP's identification information.

[0127] Step 415: The cloud server sends a response message to APP1 on terminal device 1 that does not require establishing a long connection.

[0128] In this embodiment of the application, after the cloud server receives the request message sent by APP1 on terminal device 1 to attempt to establish a long connection, it can send a response message to APP1 to notify APP1 that there is no need to establish a long connection with it based on the following information: 1. It is determined that the request message was sent by APP based on the APP identification information in the request message; 2. Currently, no other user besides user 1 is accessing the target document.

[0129] Step 420: APP1 establishes a short connection with the cloud server and obtains the target document.

[0130] In this embodiment of the application, after receiving a response message from the cloud server indicating that no long connection needs to be established, APP1 can establish a short connection with the cloud server and obtain the target document stored on the cloud server through this connection.

[0131] As an example, APP1 can send a request message to the cloud server to obtain the target document through the short connection established above. After receiving the request message, the cloud server can send the target document it stores to APP1. User 1 can view the target document displayed on APP1 through the display interface of terminal device 1.

[0132] Step 425: User 1 edits the target document through APP1 and stores the edited target document locally.

[0133] In this embodiment of the application, after obtaining the target document, user 1 can edit the target document through APP1 and store the edited target document locally.

[0134] Step 430: User 2 establishes a long connection with the cloud server and retrieves the target document from the cloud server through this long connection.

[0135] In this embodiment, if user 2 wants to retrieve a target document from a cloud server, user 2 can send a request message to the cloud server to establish a long connection through an APP or browser 1 on terminal device 2. After the cloud server establishes a long connection with user 2's APP or browser, user 2 can retrieve the target document from the cloud server through the APP or browser.

[0136] For ease of description, the following example illustrates how user 2 establishes a long connection with the cloud server through browser 1.

[0137] Step 435: User 2 synchronizes the target document through a long connection between browser 1 and the cloud server.

[0138] As an example, after user 2 obtains the target document from the cloud server through browser 1, he / she can edit the target document locally and send the edited result to the cloud server so as to realize the synchronization of the target document between browser 1 and the cloud server.

[0139] For example, User 2 sends editing operation information to the cloud server through Browser 1. This editing operation information includes the location of the object to be edited in the target document and the content to be edited. After receiving the editing operation information, the cloud server can edit the target document stored on it according to the editing location and content included in the editing operation information, thereby realizing the synchronization of the target document between APP 2 and the cloud server.

[0140] For example, the objects to be edited in the target document mentioned above may include, but are not limited to, an image or a paragraph of text within the target document. The content to be edited may include, but is not limited to, dragging an image in the target document, changing the size of an image in the target document, changing the font of a paragraph of text in the target document, changing the color of a paragraph of text in the target document, and changing the size of a paragraph of text in the target document.

[0141] Step 440: The cloud server sends a PUSH pass-through message to APP1.

[0142] As an example, after the cloud server establishes a long connection with browser 1 used by user 2, it sends a PUSH message to APP 1 used by user 1. This PUSH message is used to indicate that there are other users online in addition to user 1 to access the target document.

[0143] Step 445: APP1 actively establishes a long connection with the cloud server based on the PUSH transparent message.

[0144] In this embodiment of the application, APP1 receives a PUSH transparent message sent by the cloud server and can actively establish a long connection with the cloud server based on the PUSH transparent message.

[0145] Step 450: User 1 synchronizes the target document through a long connection between APP 1 and the cloud server.

[0146] As an example, User 1 can retrieve a target document from the cloud server through a long-lived connection established between APP1 and the cloud server. After retrieving the target document through APP1, User 1 can also edit the target document locally and send the edited result to the cloud server to achieve synchronization of the target document between APP1 and the cloud server.

[0147] For example, User 1 sends editing operation information to the cloud server through App 1. This editing operation information includes the location and content to be edited in the target document. After receiving this editing operation information, the cloud server can edit the target document stored on it according to the editing location and content included in the editing operation information, thereby realizing the synchronization of the target document between App 1 and the cloud server.

[0148] In this embodiment of the application, the cloud server can also send the editing operations (including the editing location and the editing content) performed by user 1 on the target document through APP 1 to browser 1 so as to synchronize the target document edited by user 1 between browser 1 and cloud server.

[0149] Subsequently, the editing operations performed by User 1 on the target document through APP1 and the editing operations performed by User 2 on the target document through Browser 1 will be sent to the cloud server through their respective long connections, and then forwarded by the cloud server to other users, including User 1 and User 2, thereby realizing the synchronization of the target document on the cloud server and among the various users accessing the target document.

[0150] Step 455: When User 2 exits editing the target document, User 2 closes the long connection between Browser 1 and the cloud server.

[0151] In this embodiment of the application, when user 2 exits editing the target document, user 2 can close the long connection with the cloud server through browser 1.

[0152] Step 460: The cloud server closes its long connection with APP1.

[0153] In this embodiment, if the cloud server determines that only APP1 is currently connected after browser 1 closes its persistent connection with it, the cloud server can close its persistent connection with APP1 while maintaining user 1's online status. At this time, the connection between the cloud server and APP1 is broken, and subsequent modifications made by user 1 to the target document can be saved locally only.

[0154] Step 465: When User 1 exits editing the target document, User 1 sends a request message to the cloud server to clear the user status through APP1.

[0155] In this embodiment of the application, when user 1 exits editing the target document, user 1 can send a request message to the cloud server to clear the user status through APP1, so that the cloud server can mark user 1's status as offline.

[0156] Optionally, if User 1 continues to edit the target document while APP1 is disconnected from the cloud server, APP1 can save the edited target document locally and establish a short connection with the cloud server to send the edited result to the cloud server.

[0157] Step 470: The cloud server marks user 1 as offline.

[0158] In this embodiment of the application, after the cloud server receives the request message from APP1 to clear the user status, it marks the user 1's status as offline.

[0159] In the above technical solution, since most scenarios involve a single user editing the target document, there is no need for real-time collaboration between the edited document and the cloud server. Therefore, there is no need to maintain a long-term connection between the terminal device and the cloud server, thereby reducing the power consumption of the terminal device and the network traffic consumption between the terminal device and the server.

[0160] Figure 5 This is a schematic flowchart illustrating another document editing method provided in an embodiment of this application. Figure 5 As shown, the method may include steps 510-580, which will be described in detail below.

[0161] Step 510: User 1 establishes a long connection with APP1 on terminal device 1.

[0162] In this embodiment, user 1 can send a request message to establish a long connection to the cloud server through APP1 on terminal device 1, so as to obtain the target document stored on the cloud server through the long connection between APP1 and the cloud server. After receiving the request message to establish a long connection sent by APP1, the cloud server establishes a long connection with APP1.

[0163] Step 515: User 1 retrieves the target document from the cloud server through a long connection between APP1 and the cloud server.

[0164] In this embodiment of the application, after a long connection is established between the cloud server and the user 1's APP1, the user 1 can obtain the target document from the cloud server through the APP1.

[0165] It should be understood that the specific process of how APP1 obtains the target document from the cloud server is described in step 420, and will not be repeated here.

[0166] Step 520: The cloud server sends a notification message to APP1.

[0167] In this embodiment of the application, the cloud server can send a notification message to APP1, which contains a list of all online users.

[0168] Step 525: User 1 sends a notification message to the cloud server to disconnect the long connection via APP1.

[0169] In this embodiment of the application, after APP1 receives the notification message sent by the cloud server, it determines from the user list that no other user is currently accessing the target document. User 1 can send a notification message to the cloud server through APP1 to temporarily go offline and disconnect the long connection between itself and the cloud server.

[0170] Step 530: The cloud server disconnects its long connection with APP1 and records user 1 as online.

[0171] In this embodiment of the application, after receiving a notification message from user 1 via APP1 indicating temporary offline status and disconnection of the long connection between user 1 and the cloud server, the cloud server disconnects the long connection between user 1 and APP1 and records user 1's status as online.

[0172] Step 535: User 1 edits the target document through APP1 and stores the edited target document locally.

[0173] In this embodiment of the application, after the connection between APP1 and the cloud server is disconnected, user 1 can edit the target document obtained by APP1 and store the edited target document locally.

[0174] Step 540: User 2 establishes a long connection with the cloud server through browser 1 on terminal device 2, and retrieves the target document from the cloud server through the long connection.

[0175] Step 545: User 2 synchronizes the target document through a long connection between browser 1 on terminal device 2 and the cloud server.

[0176] Step 550: The cloud server sends a PUSH pass-through message to APP1.

[0177] Step 555: APP1 actively establishes a long connection with the cloud server based on the PUSH transparent message.

[0178] Step 560: User 1 synchronizes the target document through a long connection between APP 1 and the cloud server.

[0179] Step 565: When User 2 exits editing the target document, User 2 closes the long connection between Browser 1 and the cloud server.

[0180] Step 570: The cloud server closes its long connection with APP1.

[0181] Step 575: When User 1 exits editing the target document, User 1 sends a request message to the cloud server to clear the user status through APP1.

[0182] Optionally, if User 1 still has edits to the target document before exiting the editing process, APP1 establishes a short connection with the cloud server and sends the results of the current edit to the cloud server through this short connection.

[0183] Step 580: The cloud server marks user 1 as offline.

[0184] It should be noted that steps 540-580 are similar to steps 430-470. Please refer to the descriptions in steps 430-470 for details, which will not be repeated here.

[0185] In the above technical solution, when a long connection is established between the terminal device and the cloud server, the power consumption of the terminal device and the amount of network traffic consumed between the terminal device and the server can also be reduced.

[0186] Optionally, in some embodiments, the first terminal device can also achieve document synchronization with the server via a short connection, as described below. Figure 6 Provide a detailed description.

[0187] Figure 6 This is a schematic flowchart illustrating another document editing method provided in an embodiment of this application. Figure 6 As shown, the method may include steps 610-640, which will be described in detail below.

[0188] Step 610: The first terminal device retrieves the target document stored on the server from the server via a short connection.

[0189] As an example, the first terminal device can establish a short connection with the server and retrieve the target document stored on the server through the short connection.

[0190] For example, a user can establish a short connection with the server through an APP on the first terminal device and send a request message to the server to obtain the target document through the short connection. After receiving the request message, the server can send the target document it stores to the APP on the first terminal device. The user can view the target document displayed on the APP through the display interface of the first terminal device.

[0191] Step 620: The first terminal device generates a first editing operation on the target document and caches the first editing operation locally.

[0192] In this embodiment of the application, before step 620, the first terminal device may set a time period for synchronizing the first editing operation with the server, such as a first time period.

[0193] For example, a user can set the document synchronization time period through an app on the first terminal device. This document synchronization time period refers to the period during which the app on the first terminal device synchronizes the locally cached first editing operations on the target document to the server. That is, when a user edits the target document through the app on the first terminal device, a timed mechanism can be used. Within the time period specified by the timed mechanism, the user can perform multiple first editing operations on the target document through the app on the first terminal device, cache these multiple first editing operations locally, and then synchronize the locally cached first editing operations on the target document to the server according to the set time period.

[0194] As an example, the aforementioned time period could be, for instance, synchronizing the first edit operation on the target document from the local cache to the cloud server every n minutes. For example, synchronizing to the server every 30 minutes or 60 minutes.

[0195] In the above technical solution, the first editing operation on the target document can be stored locally, and then the cached first editing operation can be synchronized to the server at a certain time period. This reduces the number of network requests from the terminal device to the server, eliminating the need to send a request to the server after each editing operation on the target document, thus reducing server load. It also allows for periodic updates of the content of the target document stored on the server, preventing the content from becoming outdated.

[0196] In this embodiment, after acquiring the target document, the first terminal device can start a timer for a first time period. The user can edit the target document through the first terminal device, and the first editing operation on the target document can be stored locally before the first time period specified by the timer expires.

[0197] Step 630: The first terminal device sends the first edit operation of the local cache to the server through a short connection according to the set first time period.

[0198] In one possible implementation, when the timer for the first time period arrives, the first terminal device establishes a short connection with the server and sends the first edit operation cached locally to the server through the short connection.

[0199] Step 640: The server receives the first editing operation and updates the target document stored on the server according to the first editing operation.

[0200] In this embodiment of the application, after receiving the first editing operation sent by the first terminal device, the server updates the target document stored on the server according to the first editing operation.

[0201] Optionally, suppose other terminal devices need to retrieve the target document stored on the server and edit it. For example, a second terminal device retrieves the target document stored on the server via a short connection, generates a third editing operation on the target document, and caches the third editing operation locally. The second terminal device sends the locally cached third editing operation to the server via a short connection according to a set second time period. After receiving the third editing operation, the server updates the target document stored on the server based on the third editing operation.

[0202] Optionally, in this embodiment, when a user needs to exit editing the target document, if a second editing operation on the target document is locally cached before exiting, the user can establish a short connection between the first terminal device and the server. This short connection then synchronizes the locally cached second editing operation on the target document before the user exits to the cloud server, thereby achieving document synchronization between the first terminal device and the server.

[0203] In the above technical solution, there is no need for real-time collaboration between the terminal device and the server after editing the document. The target document can be synchronized between the terminal device and the server through a short connection according to a set time period, thereby further reducing the power consumption of the terminal device and the amount of network traffic consumed between the terminal device and the server.

[0204] The above text combined Figures 1 to 6 The document editing method provided in the embodiments of this application is described in detail below. Figures 7-10 The embodiments of the apparatus of this application are described in detail below. It should be understood that the descriptions of the method embodiments correspond to the descriptions of the apparatus embodiments; therefore, any parts not described in detail can be referred to the foregoing method embodiments.

[0205] Figure 7 This is a schematic block diagram of a document editing system 700 provided in an embodiment of this application. The system 700 includes a first terminal device 710 and a server 720.

[0206] In one example, a first terminal device 710 is configured to retrieve a target document stored in a server 720; the first terminal device 710 is further configured to generate a first editing operation on the target document and cache the first editing operation locally; the server 720 is configured to send a first notification message to the first terminal device 710 if it determines that another terminal device has edited the target document stored in the server 720; the first terminal device 710 is further configured to receive the first notification message and synchronize the locally cached first editing operation to the server 720 according to the first notification message; the server 720 is further configured to receive the first editing operation and update the target document stored on the server 720 according to the first editing operation.

[0207] Optionally, the first terminal device 710 is specifically used to: obtain the target document stored in the server 720 through the short connection.

[0208] Optionally, the first terminal device 710 obtains the target document stored in the server 720 through a long connection. The server 720 is further configured to send a second notification message to the first terminal device 710 if it determines that no other terminal device has edited the target document stored in the server 720. The first terminal device 710 is further configured to receive the second notification message and disconnect the long connection with the server 720 according to the second notification message.

[0209] Optionally, the first terminal device 710 is specifically used to: synchronize the first editing operation to the server 720 via a short connection; the server 720 is specifically used to: receive the first editing operation via the short connection.

[0210] Optionally, the first terminal device 710 is specifically used to: send the locally cached first editing operation to the server 720 via the short connection according to a set time period.

[0211] Optionally, the first terminal device 710 is further configured to, if the first terminal device 710 exits editing the target document and there is a second editing operation of the first terminal device 710 on the target document in the local cache, establish a short connection and send the second editing operation to the server 720 through the short connection; the server 720 is further configured to receive the second editing operation and update the target document stored on the server 720 according to the second editing operation.

[0212] In another example, the first terminal device 710 is used to retrieve a target document stored in the server 720 via a short connection; the first terminal device 710 is also used to generate a first editing operation on the target document and cache the first editing operation locally; the first terminal device 710 is also used to send the locally cached first editing operation to the server 720 via the short connection according to a set first time period; the server 720 is used to receive the first editing operation and update the target document stored on the server 720 according to the first editing operation.

[0213] Optionally, the system further includes: a second terminal device, configured to retrieve a target document stored in server 720 via a short connection; the second terminal device is further configured to generate a third editing operation on the target document and cache the third editing operation locally; the second terminal device is further configured to send the locally cached third editing operation to server 720 via the short connection according to a set second time period; server 720 is further configured to receive the third editing operation and update the target document stored on server 720 according to the third editing operation.

[0214] Optionally, the first terminal device 710 is further configured to, when the first terminal device 710 exits editing the target document, if the first terminal device 710 has a second editing operation on the target document locally cached, establish a short connection and send the second editing operation to the server 720 through the short connection; the server 720 is further configured to receive the second editing operation and update the target document stored on the server 720 according to the second editing operation.

[0215] The method provided in this application can be executed by a computing device, which can also be referred to as a computer system. It includes a hardware layer, an operating system layer running on top of the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as processing units, memory, and memory control units; the functions and structure of this hardware will be described in detail later. The operating system can be any one or more computer operating systems that implement business processing through processes, such as Linux, Unix, Android, iOS, or Windows. The application layer includes applications such as browsers, address books, word processing software, and instant messaging software. Optionally, the computer system can be a handheld device such as a smartphone, or a terminal device such as a personal computer; this application does not particularly limit this, as long as the method provided in this application can be used. The executing entity of the method provided in this application can be a computing device, or a functional module within the computing device capable of calling and executing programs.

[0216] The following is combined Figure 8 This application provides a detailed description of a computing device provided in an embodiment.

[0217] Figure 8 This is a schematic diagram of the architecture of a computing device 1500 provided in an embodiment of this application. The computing device 1500 can be a server, a computer, or other device with computing capabilities. Figure 8 The computing device 1500 shown includes at least one processor 1510 and a memory 1520.

[0218] It should be understood that this application does not limit the number of processors and memories in the computing device 1500.

[0219] The processor 1510 executes instructions in the memory 1520, causing the computing device 1500 to implement the method provided in this application. Alternatively, the processor 1510 executes instructions in the memory 1520, causing the computing device 1500 to implement the various functional modules provided in this application, thereby implementing the method provided in this application.

[0220] Optionally, the computing device 1500 also includes a communication interface 1530. The communication interface 1530 uses a transceiver module, such as, but not limited to, a network interface card or a transceiver, to enable communication between the computing device 1500 and other devices or communication networks.

[0221] Optionally, the computing device 1500 further includes a system bus 1540, wherein the processor 1510, memory 1520, and communication interface 1530 are respectively connected to the system bus 1540. The processor 1510 can access the memory 1520 through the system bus 1540; for example, the processor 1510 can perform data read / write or code execution in the memory 1520 through the system bus 1540. The system bus 1540 is a peripheral component interconnect express (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The system bus 1540 is divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0222] In one possible implementation, the processor 1510 primarily functions to interpret the instructions (or code) of a computer program and process data within the computer software. The instructions of the computer program and the data within the computer software can be stored in memory 1520 or cache 1516.

[0223] Optionally, processor 1510 may be an integrated circuit chip with signal processing capabilities. By way of example and not limitation, processor 1510 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. A general-purpose processor may be a microprocessor, etc. For example, processor 1510 may be a central processing unit (CPU).

[0224] Optionally, each processor 1510 includes at least one processing unit 1512 and a memory control unit 1514.

[0225] Optionally, the processing unit 1512, also known as the core, is the most important component of the processor. The processing unit 1512 is manufactured from single-crystal silicon using a specific production process. All calculations, command reception, command storage, and data processing are performed by the core. Each processing unit independently executes program instructions, utilizing parallel computing capabilities to accelerate program execution. Various processing units have fixed logical structures; for example, a processing unit includes logical units such as a Level 1 cache, a Level 2 cache, an execution unit, an instruction-level unit, and a bus interface.

[0226] In one implementation example, the memory control unit 1514 controls the data interaction between the memory 1520 and the processing unit 1512. Specifically, the memory control unit 1514 receives memory access requests from the processing unit 1512 and controls access to memory based on the memory access requests. By way of example and not limitation, the memory control unit is a device such as a memory management unit (MMU).

[0227] In one implementation example, each memory control unit 1514 addresses the memory 1520 via the system bus. An arbitrator is configured in the system bus. Figure 8 (Not shown in the image), the arbitrator is responsible for handling and coordinating competing accesses of multiple processing units 1512.

[0228] In one implementation example, the processing unit 1512 and the memory control unit 1514 are connected via internal chip connection lines, such as address lines, thereby enabling communication between the processing unit 1512 and the memory control unit 1514.

[0229] Optionally, each processor 1510 also includes a cache 1516, which is a buffer for data exchange (called a cache). When the processing unit 1512 needs to read data, it first looks for the required data in the cache. If the data is found, it is executed directly; otherwise, it looks for the data in memory. Since the cache operates much faster than memory, its purpose is to help the processing unit 1512 run faster.

[0230] The memory 1520 provides runtime space for processes in the computing device 1500. For example, the memory 1520 stores the computer program (specifically, the program code) used to generate the process. After the computer program is run by the processor to generate a process, the processor allocates corresponding storage space for the process in the memory 1520. Furthermore, the aforementioned storage space further includes text segments, initialized data segments, bit initialized data segments, stack segments, heap segments, etc. The memory 1520 stores data generated during the process's execution, such as intermediate data or process data, in the storage space corresponding to the process.

[0231] Optionally, the memory, also known as RAM, is used to temporarily store the data processed by the processor 1510, as well as data exchanged with external storage devices such as hard disks. As long as the computer is running, the processor 1510 will load the data that needs to be processed into RAM for processing, and after the processing is completed, the processing unit 1512 will send the result out.

[0232] By way of example and not limitation, memory 1520 is volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Non-volatile memory is read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory is random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous linked dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM). It should be noted that the memory 1520 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0233] The above-described structure of the computing device 1500 is merely illustrative and is not intended to limit the application. The computing device 1500 in this application includes various hardware components found in existing computer systems. For example, the computing device 1500 may also include other memories besides the memory 1520, such as disk storage. Those skilled in the art should understand that the computing device 1500 may also include other devices necessary for normal operation. Furthermore, depending on specific needs, those skilled in the art should understand that the computing device 1500 may also include hardware devices for implementing other additional functions. Moreover, those skilled in the art should understand that the computing device 1500 may only include the devices necessary for implementing the embodiments of this application, and may not necessarily include... Figure 8 All the devices shown.

[0234] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a desktop computer, a laptop computer, or a smartphone, or other terminal device.

[0235] like Figure 9 As shown, the computing device cluster includes at least one computing device 1500. The memory 1520 of one or more computing devices 1500 in the computing device cluster may store the same instructions for performing the methods described above.

[0236] In some possible implementations, the memory 1520 of one or more computing devices 1500 in the computing device cluster may also each store a portion of the instructions for executing the above-described methods. In other words, a combination of one or more computing devices 1500 can jointly execute the instructions of the above-described methods.

[0237] It should be noted that the memory 1520 in different computing devices 1500 within the computing device cluster can store different instructions, each used to execute a portion of the functions of the aforementioned device. That is, the instructions stored in the memory 1520 of different computing devices 1500 can implement the functions of one or more modules within the aforementioned device.

[0238] In some possible implementations, one or more computing devices in a computing device cluster can be connected via a network. This network can be a wide area network (WAN) or a local area network (LAN), etc. Figure 10 One possible implementation is shown. For example... Figure 10 As shown, the two computing devices 1500A and 1500B are connected via a network. Specifically, they are connected to the network through the communication interfaces in each computing device.

[0239] It should be understood that Figure 10 The functions of computing device 1500A shown can also be performed by multiple computing devices 1500. Similarly, the functions of computing device 1500B can also be performed by multiple computing devices 1500.

[0240] In this embodiment, a computer program product containing instructions is also provided. The computer program product may be a software or program product containing instructions capable of running on a computing device or stored on any usable medium. When run on a computing device, it causes the computing device to perform the methods provided above, or causes the computing device to perform the functions of the apparatus provided above.

[0241] In this embodiment, a computer-readable storage medium is also provided. This computer-readable storage medium can be any available medium that a computing device can store, or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state drive). The computer-readable storage medium includes instructions that, when executed on a computing device, cause the computing device to perform the method described above.

[0242] It should be understood that in the various embodiments of this application, the order of the above-mentioned processes does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0243] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0244] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0245] In the several embodiments provided in this application, 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; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0246] 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.

[0247] In addition, the functional units in the various embodiments of this application 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.

[0248] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion 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 described in the various embodiments of this application. 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.

[0249] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A method for editing documents, characterized in that, The method includes: The first terminal device retrieves the target document stored on the server; The first terminal device generates a first editing operation on the target document and caches the first editing operation locally. If the server determines that another terminal device is editing the target document stored in the server, it sends a first notification message to the first terminal device. The first terminal device receives the first notification message and synchronizes the locally cached first editing operation to the server according to the first notification message; The server receives the first editing operation and updates the target document stored on the server according to the first editing operation.

2. The method according to claim 1, characterized in that, The first terminal device retrieves the target document stored in the server from the server, including: The first terminal device establishes a short connection with the server; The first terminal device obtains the target document stored in the server through the short connection.

3. The method according to claim 1, characterized in that, The first terminal device obtains the target document stored in the server via a long connection. Before the first terminal device generates a first editing operation on the target document, the method further includes: If the server determines that no other terminal device is editing the target document stored in the server, it sends a second notification message to the first terminal device. The first terminal device receives the second notification message and disconnects the long connection with the server according to the second notification message.

4. The method according to any one of claims 1 to 3, characterized in that, The first terminal device synchronizes the first editing operation to the server, including: The first terminal device synchronizes the first editing operation to the server via a short connection; The server receives the first editing operation, including: The server receives the first editing operation through the short connection.

5. The method according to claim 4, characterized in that, The first terminal device synchronizes the first editing operation to the server via a short connection, including: The first terminal device sends the first edit operation cached locally to the server via the short connection according to a set time period.

6. The method according to any one of claims 1 to 5, characterized in that, The method further includes: If the first terminal device exits editing the target document, and if the first terminal device has a second editing operation on the target document cached locally, the first terminal device establishes a short connection and sends the second editing operation to the server through the short connection. The server receives the second editing operation and updates the target document stored on the server according to the second editing operation.

7. A method for editing a document, characterized in that, The method includes: The first terminal device retrieves the target document stored in the server from the server via a short connection; The first terminal device generates a first editing operation on the target document and caches the first editing operation locally. The first terminal device sends the locally cached first editing operation to the server through the short connection according to the set first time period; The server receives the first editing operation and updates the target document stored on the server according to the first editing operation.

8. The method according to claim 7, characterized in that, The method includes: The second terminal device retrieves the target document stored in the server from the server via a short connection; The second terminal device generates a third editing operation on the target document and caches the third editing operation locally; The second terminal device sends the locally cached third editing operation to the server via the short connection according to the set second time period; The server receives the third editing operation and updates the target document stored on the server according to the third editing operation.

9. The method according to claim 7 or 8, characterized in that, The method further includes: If the first terminal device exits editing the target document, and if the first terminal device has a second editing operation on the target document cached locally, the first terminal device establishes a short connection and sends the second editing operation to the server through the short connection. The server receives the second editing operation and updates the target document stored on the server according to the second editing operation.

10. A document editing system, characterized in that, The system includes a first terminal device and a server, wherein: A first terminal device is used to retrieve a target document stored on the server from the server. The first terminal device is further configured to generate a first editing operation on the target document and cache the first editing operation locally; The server is configured to send a first notification message to the first terminal device when it determines that another terminal device is editing the target document stored in the server. The first terminal device is further configured to receive the first notification message and synchronize the locally cached first editing operation to the server according to the first notification message; The server is also configured to receive the first editing operation and update the target document stored on the server according to the first editing operation.

11. The system according to claim 10, characterized in that, The first terminal device is specifically used for: The target document stored on the server is obtained through the short connection.

12. The system according to claim 10, characterized in that, The first terminal device obtains the target document stored in the server via a long connection. The server is further configured to send a second notification message to the first terminal device if it determines that no other terminal device has edited the target document stored in the server; The first terminal device is further configured to receive the second notification message and disconnect the long connection with the server according to the second notification message.

13. The system according to any one of claims 10 to 12, characterized in that, The first terminal device is specifically used for: The first editing operation is synchronized to the server via a short connection; The server is specifically used for: The first editing operation is received through the short connection.

14. The system according to claim 13, characterized in that, The first terminal device is specifically used for: According to the set time period, the first edit operation cached locally is sent to the server through the short connection.

15. The system according to any one of claims 10 to 14, characterized in that, The first terminal device is further configured to, when the first terminal device exits editing the target document, if there is a second editing operation of the first terminal device on the target document locally cached, establish a short connection and send the second editing operation to the server through the short connection; The server is also configured to receive the second editing operation and update the target document stored on the server according to the second editing operation.

16. A document editing system, characterized in that, The system includes a first terminal device and a server, wherein: A first terminal device is used to retrieve a target document stored in the server from the server via a short connection; The first terminal device is further configured to generate a first editing operation on the target document and cache the first editing operation locally; The first terminal device is further configured to send the locally cached first editing operation to the server via the short connection according to a set first time period; The server is configured to receive the first editing operation and update the target document stored on the server according to the first editing operation.

17. The system according to claim 16, characterized in that, The system also includes: The second terminal device is used to retrieve the target document stored in the server from the server via a short connection; The second terminal device is further configured to generate a third editing operation on the target document and cache the third editing operation locally; The second terminal device is further configured to send the locally cached third editing operation to the server via the short connection according to a set second time period; The server is also configured to receive the third editing operation and update the target document stored on the server according to the third editing operation.

18. The system according to claim 18 or 19, characterized in that, The first terminal device is further configured to, when the first terminal device exits editing the target document, if there is a second editing operation of the first terminal device on the target document locally cached, establish a short connection and send the second editing operation to the server through the short connection; The server is also configured to receive the second editing operation and update the target document stored on the server according to the second editing operation.

19. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 9.

20. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster performs the method as described in any one of claims 1 to 9.

21. A computer-readable storage medium, characterized in that, It includes computer program instructions, which, when executed by a cluster of computing devices, perform the method as described in any one of claims 1 to 9.