Document editing method and apparatus, and computing device
By caching editing operations locally on the terminal device and using short connections for synchronization, the problems of high power consumption and network traffic consumption on the terminal device are solved, resulting in a more efficient document editing experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2026-04-02
AI Technical Summary
Long-term connections between terminal devices and servers lead to excessive power consumption and network traffic consumption, affecting device performance and network efficiency.
By caching the edit operations generated on the terminal device locally and then synchronizing them to the server only when other terminal devices edit the server document, short connections are used for data transmission, reducing the frequent establishment and maintenance of long connections.
It reduces power consumption and network traffic consumption of terminal devices, improves device performance and network efficiency, and reduces server load.
Smart Images

Figure CN2025118232_02042026_PF_FP_ABST
Abstract
Description
Method, device and computing device for document editing
[0001] This application claims priority to the Chinese patent application No. 202411336371.7, filed on September 24, 2024, with the State Intellectual Property Office of China, and entitled “Method, device and computing device for document editing”, the entire content of which is incorporated herein by reference. TECHNICAL FIELD
[0002] The present application relates to the field of cloud computing, and more particularly, to a method, device and computing device for document editing. BACKGROUND
[0003] With the rapid development of computer application software, online documents such as web documents provide the function of simultaneous online editing for multiple users. Users can access the online document stored on the server through their respective terminal devices and perform corresponding editing operations on the online document. The server will update the online document in synchronization according to the editing operations performed by the users on the respective terminal devices to support multiple users to simultaneously edit the online document online.
[0004] In the related technical solution, multiple users establish a long connection between the terminal devices used by each user and the server, and send their respective operations on the document to the server through the long connection. The server then forwards the operations on the document to the terminal devices used by other users through the long connection, thereby realizing real-time synchronization of the document between the terminal devices and the server. In the related technology, a long connection is established between the terminal device and the server, and the power consumption of the terminal device is relatively large.
[0005] Therefore, how to reduce the power consumption of the terminal device has become a technical problem to be solved. SUMMARY
[0006] The present application provides a method for document editing, which can reduce the power consumption of the terminal device.
[0007] In a first aspect, a method for document editing is provided, which includes: a first terminal device obtaining a target document stored in a server from the server; the first terminal device generating a first editing operation on the target document and caching the first editing operation locally; the server determining that there is another terminal device editing the target document stored in the server, and sending a first notification message to the first terminal device; the first terminal device receiving the first notification message and synchronizing the first editing operation cached locally 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.
[0008] In the technical solution, the first terminal device generates the first editing operation on the target document, and the first editing operation is buffered locally without real-time collaboration between the terminal device and the server. When another terminal device edits the target document stored in the server, the first editing operation buffered locally is synchronized to the server. In this way, a long connection between the terminal device and the server is not required, thereby reducing power consumption of the terminal device and network traffic between the terminal device and the server.
[0009] With reference to the first aspect, in some implementations of the first aspect, the first terminal device establishes a short connection with the server, and the first terminal device acquires the target document stored in the server through the short connection.
[0010] In the technical solution, the first terminal device acquires the target document stored in the server through the short connection, thereby reducing power consumption of the terminal device.
[0011] With reference to the first aspect, in some implementations of the first aspect, the first terminal device acquires 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 method further includes: the server determines that no other terminal device edits the target document stored in the server, and sends a second notification message to the first terminal device; and the first terminal device receives the second notification message, and disconnects the long connection with the server according to the second notification message.
[0012] In the technical solution, if the first terminal device acquires the target document stored in the server through the long connection, and no other terminal device edits the target document stored in the server, the first terminal device can disconnect the long connection, thereby reducing power consumption of the terminal device and network traffic between the terminal device and the server.
[0013] With reference to the first aspect, in some implementations of the first aspect, the first terminal device synchronizes the first editing operation to the server through the short connection, and the server receives the first editing operation through the short connection.
[0014] In the technical solution, the first terminal device sends the first editing operation on the target document buffered locally to the server through the short connection, thereby reducing power consumption of the terminal device.
[0015] With reference to the first aspect, in some implementations of the first aspect, the first terminal device sends the first editing operation buffered locally to the server through the short connection according to a set time period.
[0016] In the technical solution, the first editing operation on the target document is stored locally first, and then the cached first editing operation is synchronized to the server through a short connection according to a certain time period. In this way, the number of network requests of the terminal device to the server can be reduced, and the server pressure can be reduced without sending a request to the server after each editing operation on the target document. The content of the target document stored in the server can be updated regularly, and the content of the target document stored in the server can be prevented from being too old.
[0017] With reference to the first aspect, in some implementations of the first aspect, the method further includes: if the first terminal device has a second editing operation on the target document stored locally, the first terminal device establishes a short connection and sends the second editing operation to the server through the short connection in the case that the first terminal device exits editing the target document; and the server receives the second editing operation and updates the target document stored in the server according to the second editing operation.
[0018] With reference to the first aspect, in some implementations of the first aspect, the first terminal device acquires the target document stored in the server through a target application, and the notification message is a transparent message.
[0019] With reference to the first aspect, in some implementations of the first aspect, the server is arranged in at least one data center providing cloud services.
[0020] The second aspect provides a document editing method, which includes: a first terminal device acquires a target document stored in a server through 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 first editing operation cached locally to the server through the short connection according to a set first time period; and the server receives the first editing operation and updates the target document stored in the server according to the first editing operation.
[0021] In the technical solution, the first terminal device acquires the target document stored in the server through a short connection, and stores the first editing operation on the target document locally, and then synchronizes the cached first editing operation to the server through the short connection according to a certain time period. In this way, the number of network requests of the terminal device to the server can be reduced, and the server pressure can be reduced without sending a request to the server after each editing operation on the target document. The content of the target document stored in the server can be updated regularly, and the content of the target document stored in the server can be prevented from being too old.
[0022] With reference to the second aspect, in some implementations of the second aspect, the method further comprises: in a case where the first terminal device exits editing the target document, if the second editing operation of the first terminal device on the target document is locally cached, the first terminal device establishes a short connection and sends the second editing operation to the server through the short connection; and the server receives the second editing operation and updates the target document stored on the server according to the second editing operation.
[0023] With reference to the second aspect, in some implementations of the second aspect, the method further comprises: in a case where the first terminal device exits editing the target document, if the second editing operation of the first terminal device on the target document is locally cached, the first terminal device establishes a short connection and sends the second editing operation to the server through the short connection; and the server receives the second editing operation and updates the target document stored on the server according to the second editing operation.
[0024] With reference to the second aspect, in some implementations of the second aspect, before the first terminal device acquires the target document stored in the server through the short connection, the method further comprises: the first terminal device setting the time period.
[0025] With reference to the second aspect, in some implementations of the second aspect, the time period is determined according to a number of other terminal devices currently acquiring the target document stored in the server.
[0026] With reference to the second aspect, in some implementations of the second aspect, the more the number of other terminal devices currently acquiring the target document stored in the server, the shorter the time period.
[0027] With reference to the second aspect, in some implementations of the second aspect, the less the number of other terminal devices currently acquiring the target document stored in the server, the longer the time period.
[0028] The third aspect provides a system for document editing, comprising a first terminal device and a server, wherein: the first terminal device is configured to acquire a target document stored in 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 in a case where other terminal devices edit the target document stored in the server; the first terminal device is further configured to receive the first notification message and synchronize the first editing operation cached locally to the server according to the first notification message; and 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.
[0029] In some implementations of the third aspect, the first terminal device is specifically configured to: acquire the target document stored in the server through the short connection.
[0030] In some implementations of the third aspect, the first terminal device acquires the target document stored in the server through a long connection, and the server is further configured to: determine that no other terminal device edits the target document stored in the server, and send a second notification message to the first terminal device; and 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.
[0031] In some implementations of the third aspect, the first terminal device is specifically configured to: synchronize the first editing operation to the server through a short connection; and the server is specifically configured to: receive the first editing operation through the short connection.
[0032] In some implementations of the third aspect, the first terminal device is specifically configured to: send the locally cached first editing operation to the server through the short connection according to a set time period.
[0033] In some implementations of the third aspect, the first terminal device is further configured to: if the first terminal device locally caches a second editing operation on the target document when the first terminal device exits editing the target document, establish a short connection, and send the second editing operation to the server through the short connection; and 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.
[0034] In some implementations of the third aspect, the first terminal device is specifically configured to: acquire the target document stored in the server through the short connection.
[0035] In some implementations of the fourth aspect, the system further includes: a second terminal device configured to obtain the target document stored in the server via the 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 third editing operation cached locally to the server via the short connection according to a second time period; and the server is further configured to receive the third editing operation and update the target document stored in the server according to the third editing operation.
[0036] In some implementations of the fourth aspect, the first terminal device is further configured to, if the second editing operation on the target document is cached locally when the first terminal device exits the editing of the target document, establish a short connection and send the second editing operation to the server via the short connection; and the server is further configured to receive the second editing operation and update the target document stored in the server according to the second editing operation.
[0037] In the fifth aspect, a computing device is provided, which includes a processor and a memory, and optionally, an input / output interface. The processor is configured to control the input / output interface to receive and send information, and the memory is configured to store a computer program. The processor is configured to call and run the computer program from the memory, so as to execute the method in the first aspect or any possible implementation manner of the first aspect, or execute the method in the second aspect or any possible implementation manner of the second aspect.
[0038] Optionally, the processor can be a general-purpose processor, which can be implemented by hardware or software. When implemented by hardware, the processor can be a logic circuit or an integrated circuit. When implemented by software, the processor can be a general-purpose processor, which reads software codes stored in the memory to implement the processor. The memory can be integrated in the processor or exist independently outside the processor.
[0039] In the sixth aspect, a computing device cluster is provided, which includes at least one computing device, and each computing device includes 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, so as to make the computing device cluster execute the method in the first aspect or any possible implementation manner of the first aspect, or execute the method in the second aspect or any possible implementation manner of the second aspect.
[0040] In a seventh aspect, a chip is provided, which obtains instructions and executes the instructions to implement the method in the first aspect and any one of the implementation manners of the first aspect, or to implement the method in the second aspect or any one of the possible implementation manners of the second aspect.
[0041] Optionally, as an implementation manner, the chip comprises a processor and a data interface, the processor reads the instructions stored on the memory through the data interface, and executes the method in the first aspect and any one of the implementation manners of the first aspect, or executes the method in the second aspect or any one of the possible implementation manners of the second aspect.
[0042] Optionally, as an implementation manner, the chip can further comprise a memory, the memory stores the instructions, and the processor is configured to execute the instructions stored on the memory, and when the instructions are executed, the processor is configured to execute the method in the first aspect and any one of the implementation manners of the first aspect, or execute the method in the second aspect or any one of the possible implementation manners of the second aspect.
[0043] In an eighth aspect, a computer program product comprising instructions which, when executed by a computing device, cause the computing device to perform the method in the first aspect and any one of the implementation manners of the first aspect, or perform the method in the second aspect or any one of the possible implementation manners of the second aspect is provided.
[0044] In a ninth aspect, a computer program product comprising instructions which, when executed by a computing device cluster, cause the computing device cluster to perform the method in the first aspect and any one of the implementation manners of the first aspect, or perform the method in the second aspect or any one of the possible implementation manners of the second aspect is provided.
[0045] In a tenth aspect, a computer-readable storage medium comprising computer program instructions which, when executed by a computing device, cause the computing device to perform the method in the first aspect and any one of the implementation manners of the first aspect, or perform the method in the second aspect or any one of the possible implementation manners of the second aspect is provided.
[0046] As an example, the computer-readable storage includes, but is 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.
[0047] Optionally, as an implementation manner, the storage medium can be a non-volatile storage medium.
[0048] In a eleventh aspect, a computer readable storage medium is provided, including computer program instructions, when the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method in the first aspect and any implementation manner of the first aspect, or executes the method in the second aspect or any implementation manner of the second aspect.
[0049] By way of example, such computer readable storage media include one or more of the following: a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), a Flash memory, an electrically EPROM (EEPROM), and a hard drive.
[0050] Optionally, as an implementation manner, the storage medium can be a non-volatile storage medium. BRIEF DESCRIPTION OF DRAWINGS
[0051] FIG. 1 is a schematic block diagram of an application scenario suitable for embodiments of the present application.
[0052] FIG. 2 is a schematic block diagram of a cloud scenario suitable for embodiments of the present application.
[0053] FIG. 3 is a schematic flowchart of a method for document editing according to an embodiment of the present application.
[0054] FIG. 4 is a schematic flowchart of another method for document editing according to an embodiment of the present application.
[0055] FIG. 5 is a schematic flowchart of another method for document editing according to an embodiment of the present application.
[0056] FIG. 6 is a schematic flowchart of another method for document editing according to an embodiment of the present application.
[0057] FIG. 7 is a schematic block diagram of a system 700 for document editing according to an embodiment of the present application.
[0058] FIG. 8 is a schematic diagram of an architecture of a computing device 1500 according to an embodiment of the present application.
[0059] FIG. 9 is a schematic diagram of an architecture of a computing device cluster according to an embodiment of the present application.
[0060] FIG. 10 is a schematic diagram of the connection between the computing devices 1500A and 1500B through a network according to an embodiment of the present application. DETAILED DESCRIPTION
[0061] The technical solutions in the present application will be described below with reference to the drawings.
[0062] The present application will present various aspects, embodiments or features around a system including a plurality of devices, components, modules, etc. It should be understood and appreciated that each system can include additional devices, components, modules, etc., and / or can not include all of the devices, components, modules, etc. discussed in connection with the figures. Furthermore, a combination of these aspects can also be used.
[0063] In addition, in the embodiments of the present application, the words "example", "for example", etc. are used to mean serving as an example, instance, or illustration. Any embodiment or design presented as an "example" in the present application should not be interpreted as being more preferred or advantageous than other embodiments or design solutions. Rather, the word "example" is used to represent a concept in a specific manner.
[0064] In the embodiments of the present application, "corresponding" and "relevant" can be used interchangeably at times. It should be noted that when the distinction is not emphasized, the meanings expressed are consistent.
[0065] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that as the network architecture evolves and new business scenarios appear, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0066] In the present specification, the reference to "one embodiment" or "some embodiments" etc. means that a particular feature, structure or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other embodiments", "in additional embodiments" etc. appearing in various places in the specification are not necessarily all referring to one and the same embodiment, but can mean "one or more but not all embodiments", unless they are specifically stated otherwise. The terms "comprise", "include", "have" and their conjugates mean "including but not limited to", unless they are specifically stated otherwise.
[0067] 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.
[0068] For ease of description, the concepts involved in the embodiments of this application will be explained below.
[0069] 1. Short connection
[0070] 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.
[0071] As an example, short connections are primarily implemented using protocols such as the Hypertext Transfer Protocol (HTTP), and the connection is closed after each request-response cycle.
[0072] 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.
[0073] 2. Long connection
[0074] 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.
[0075] As an example, long connections are mainly implemented through protocols such as transmission control protocol (TCP) or WebSocket. In the TCP protocol, a long connection can be implemented by keeping a connection state after connection establishment, while in the WebSocket protocol, a more advanced real-time communication capability is provided.
[0076] The above long connection is mainly applicable to real-time application scenarios that require frequent communication, for example, real-time chat applications, real-time games, etc. In these scenarios, the client and the server need to maintain long-time and persistent communication in order to transmit data and state information in real time. Using a long connection can reduce the overhead of establishing a new connection, improve communication efficiency and stability. However, a long connection occupies certain resources due to a persistent connection maintained between the client and the server.
[0077] 3. Push service
[0078] The push service is a message push platform provided by a mobile phone manufacturer or a third-party supplier, which establishes a message push channel from the cloud to the terminal, and generally supports notification bar messages and transparent messages. The transparent message is a message processed by an application on the terminal device, and the terminal device does not directly display the transparent message pushed by the cloud, but transmits the data to the corresponding application on the terminal device, which analyzes the content and triggers relevant actions.
[0079] With the rapid development of computer application software, online documents such as web documents provide simultaneous online editing functions for multiple users. Users can access online documents stored on a server through their respective terminal devices and perform corresponding editing operations on the online documents. The server will update the online documents in synchronization according to the editing operations performed by the users on the respective terminal devices to support multiple users to simultaneously edit the online documents online.
[0080] In related technical solutions, multiple users establish long connections between their respective terminal devices and the server, and send their respective operations on the document to the server through the long connection, thereby realizing real-time synchronization of the document between the respective terminal devices and the server. In the related technology, since a long connection is established between the terminal device and the server, a persistent connection is maintained between the terminal device and the server due to the long connection. On the one hand, the power consumption of the terminal device is large, and on the other hand, the terminal device and the server will frequently receive and send through the long connection, resulting in a large consumption of network traffic.
[0081] Therefore, the embodiment of the present application provides a document editing method, which can not only reduce the power consumption of the terminal device, but also reduce the consumption of network traffic between the terminal device and the server.
[0082] For ease of description, the application scenario applicable to the present application is described in detail below in combination with FIG. 1-FIG. 2.
[0083] As an example, FIG. 1 is a schematic block diagram of an application scenario applicable to the embodiment of the present application. As shown in FIG. 1, the scenario can include at least one terminal device 110, a server 120. The at least one terminal device 110 is connected with the server 120 through a network.
[0084] The server 120 stores a document. When a certain user accesses the document stored in the server 120 through the terminal device 110 used by the user, other users can also access the document stored in the server 120 through the terminal devices 110 used by the users. When multiple users access the document through the terminal devices 110 used by the users, the document can be edited simultaneously. The server 120 can edit and update the document according to the content edited by each terminal device 110, and synchronize the updated document to each terminal device 110, so that each user can see the latest edited document through the terminal device 110 used by the user.
[0085] As an example, the at least one terminal device 110 is installed with a browser or an application (APP). A certain user accesses the document from the server 120 through the browser or the APP in the terminal device 110 used by the user, performs an editing operation on the document, and synchronizes the change of the content of the document between the server 120. Meanwhile, the server 120 can also synchronize the operation of the certain user on the document to other terminal devices 110 using the document.
[0086] As an example, the server 120 provides a collaboration service and a data service. A certain user accesses the collaboration service through the browser or the APP in the terminal device 110 used by the user to obtain the document from the server 120. The server 120 can also synchronize the operation of the certain user on the document to other terminal devices 110 using the document through the collaboration service.
[0087] As an example, the server 120 also provides a data service. The collaboration service in the server 120 can also persist the full change process data of the operation of the at least one terminal device 110 on the document to the data service.
[0088] The type of the terminal device 110 is not limited in the embodiments of this application. For example, the terminal device 110 can include, but is not limited to, at least one of the following: a personal computer, a notebook computer, a smart phone, and a tablet computer.
[0089] The type of the server 120 is not limited in the embodiments of this application. For example, the server 120 can be a single server in a cloud data center, or can also be a server cluster composed of multiple servers in a cloud data center.
[0090] FIG. 2 is a schematic block diagram of a cloud scenario suitable for the embodiments of this application. As shown in FIG. 2, the cloud scenario can include a cloud management platform 210, an Internet 220, and a client 230.
[0091] As shown in FIG. 2, the cloud management platform 210 is configured to manage an infrastructure that provides multiple cloud services. The infrastructure includes multiple cloud data centers, each of which includes multiple servers, and each of the servers includes cloud service resources and provides corresponding cloud services for users.
[0092] The cloud management platform 210 can be located in a cloud data center, which can provide an access interface (such as an interface or an application program interface (API)). The user can remotely access the access interface to register a cloud account and a password in the cloud management platform 210 by operating the client 230, and log in to the cloud management platform 210. After the cloud management platform 210 authenticates the cloud account and the password successfully, the user can further select and purchase a virtual machine with a specific specification (processor, memory, and disk) by paying a fee in the cloud management platform 210. After the payment and purchase are successful, the cloud management platform 210 provides a remote login account and password of the purchased virtual machine, and the client 230 can remotely log in to the virtual machine to install and run the user's application in the virtual machine. Therefore, the user can create, manage, log in to, and operate the virtual machine in the cloud data center through the cloud management platform 210. The virtual machine can also be referred to as a cloud server (elastic compute service, ECS) or an elastic instance (different cloud service providers have different names).
[0093] It should be understood that the user of the cloud service can be an individual, an enterprise, a school, a hospital, an administrative organ, etc.
[0094] The functions of the cloud management platform 210 include, but are not limited to, a user console, a computing management service, a network management service, a storage management service, an authentication service, and an image management service. The user console provides an interface or an API for user interaction, the computing management service is used to manage servers running virtual machines and containers and bare metal servers, the network management service is used to manage network services (such as gateways, firewalls, etc.), the storage management service is used to manage storage services (such as data bucket services), the authentication service is used to manage user account passwords, and the image management service is used to manage virtual machine images. The user uses the client 230 to log in to the cloud management platform 210 through the Internet 220 to manage the rented cloud services.
[0095] FIG. 3 is a schematic flowchart of a method for document editing according to an embodiment of the present application. As shown in FIG. 3, the method can include steps 310-350, which are described in detail as follows.
[0096] Step 310: The first terminal device acquires a target document stored in a server.
[0097] In the embodiment of the present application, the user can acquire the target document stored in the server through the first terminal device.
[0098] The user can acquire the target document stored in the server through a browser on the first terminal device, or can acquire the target document stored in the server through an application (APP) on the first terminal device, which is not limited in the present application.
[0099] There are various implementation manners for the first terminal device to acquire the target document stored in the server, which are not limited in the embodiment of the present application, and several possible implementation manners are listed as follows.
[0100] In one possible implementation manner, the first terminal device establishes a short connection with the server, and acquires the target document stored in the server through the short connection.
[0101] In another possible implementation manner, the first terminal device establishes a long connection with the server, and acquires the target document stored in the server through the long connection.
[0102] Step 320: The first terminal device generates a first editing operation on the target document, and caches the first editing operation locally.
[0103] In the embodiment of the present application, the first terminal device generates the 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, the first editing operation is not synchronized to the server in real time, but is cached locally.
[0104] As an example, the first editing operation includes a position where an object editing the target document is located and content of editing the object.
[0105] As an example, the object editing the target document can include, but is not limited to, a picture in the target document, a text in the target document, etc. The content of editing can include, but is not limited to, dragging a picture in the target document, changing a size of a picture in the target document, modifying a font of a text in the target document, modifying a color of a text in the target document, modifying a size of a text in the target document, etc.
[0106] Step 330: The server sends a first notification message to the first terminal device if there is another terminal device editing the target document stored in the server.
[0107] In the embodiment, the server can determine whether there is another terminal device editing the target document stored in the server after the first terminal device obtains the stored target document from the server.
[0108] In Example 1, if the server determines that there is another terminal device editing the target document stored in the server, the server sends a first notification message to the first terminal device, and the first notification message is used to notify the first terminal device that there is another terminal device editing the target document stored in the server.
[0109] In Example 2, if the server determines that there is another terminal device editing the target document stored in the server, the server sends a second notification message to the first terminal device, and the second notification message is used to notify the first terminal device that there is no other terminal device editing the target document stored in the server.
[0110] In the above Example 2, 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 of the target document, the first terminal device disconnects the long connection with the server according to the second notification message received by the first terminal device, so as to save the power consumption of the first terminal device.
[0111] Step 340: 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.
[0112] In the embodiment, if the first terminal device receives the first notification message sent by the server, the first terminal device can determine that there is another terminal device editing the target document stored in the server according to the first notification message, and the first terminal device sends the locally cached first editing operation to the server according to the first notification message.
[0113] In a 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 the long connection.
[0114] 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 the short connection. For example, the short connection with the server can be established according to a set time period.
[0115] For example, the time period can be set according to the number of other terminal devices currently obtaining the stored target document from the server. For example, the more the number of other terminal devices currently obtaining the stored target document from the server, the shorter the time period. For another example, the less the number of other terminal devices currently obtaining the stored target document from the server, the longer the time period.
[0116] Step 350: The server receives the first editing operation, and updates the target document stored on the server according to the first editing operation.
[0117] In the embodiment of the application, after the server receives 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.
[0118] In a possible implementation, the server combines all editing operations on the terminal device side to update the target document stored on the server, thereby obtaining the updated target document.
[0119] For example, the first editing operation includes the position of the object edited in the target document and the content of the editing of the object. After the cloud server receives the first editing operation, the cloud server can edit the target document stored on the cloud server according to the edited position and the edited content included in the first editing operation, thereby realizing the synchronization of the target document between the first terminal device and the cloud server.
[0120] Optionally, in the case that the first terminal device exits the editing of the target document, if the second editing operation of the target document by the first terminal device is locally cached, the first terminal device establishes a short connection with the server, and sends the second editing operation to the server through the short connection. After the server receives the second editing operation, the server updates the target document stored on the server according to the second editing operation.
[0121] In the technical solution, the first terminal device generates the first editing operation on the target document, and the first editing operation is buffered locally without real-time collaboration between the terminal device and the cloud server. In the case that another terminal device edits the target document stored in the server, the first editing operation buffered locally is synchronized to the server. In this way, long-term long connection is not required between the terminal device and the cloud server, thereby reducing power consumption of the terminal device and consumption of network traffic between the terminal device and the server.
[0122] The different implementation processes of the method for editing a document shown in FIG. 3 will be described in detail below with reference to FIGS. 4-5. It should be understood that the examples of FIGS. 4-5 are only used to help those skilled in the art understand the embodiments of the present application, and the embodiments of the present application are not limited to the specific values or specific scenarios shown in the examples of FIGS. 4-5. Those skilled in the art can obviously make various equivalent modifications or changes according to the examples given below in FIGS. 4-5, and such modifications and changes also fall within the scope of the embodiments of the present application.
[0123] FIG. 4 is a schematic flowchart of another method for editing a document according to an embodiment of the present application. As shown in FIG. 4, the method can include steps 410-470, which will be described in detail below.
[0124] In step 410, the user 1 sends a request message for attempting to establish a long connection to the cloud server through the APP 1 on the terminal device 1.
[0125] In the embodiments of the present application, the user 1 can send a request message for attempting to establish a long connection to the cloud server through the APP 1 on the terminal device 1, so as to obtain the target document stored on the cloud server through the long connection between the APP 1 and the cloud server.
[0126] As an example, the cloud server is provided with a collaboration service, and the request message sent by the user 1 to the cloud server through the APP 1 is used to request to attempt to establish a long connection with the collaboration service on the cloud server.
[0127] The request message can include identification information of the APP.
[0128] In step 415, the cloud server sends a response message that does not require the establishment of a long connection to the APP 1 on the terminal device 1.
[0129] In the embodiment, after receiving the request message for attempting to establish a long connection sent by APP1 on the terminal device 1, the cloud server can send a response message for notifying APP1 that it is not necessary to establish a long connection with APP1 to APP1 according to the following information: 1, judging that the request message is sent by APP according to the identification information of APP in the request message; 2, no other user accesses the target document currently except user 1.
[0130] Step 420: APP1 and the cloud server establish a short connection, and the target document is acquired.
[0131] In the embodiment, after receiving the response message for not establishing a long connection sent by the cloud server, APP1 can establish a short connection with the cloud server, and acquire the target document stored on the cloud server through the short connection.
[0132] As an example, APP1 can send a request message for acquiring the target document to the cloud server through the short connection established above, the cloud server can send the target document stored by it to APP1 after receiving the request message, and user 1 can view the target document displayed on APP1 through the display interface of the terminal device 1.
[0133] Step 425: User 1 performs an editing operation on the target document through APP1, and stores the edited target document locally.
[0134] In the embodiment, after acquiring the target document, user 1 can perform an editing operation on the target document through APP1, and store the edited target document locally.
[0135] Step 430: User 2 establishes a long connection with the cloud server, and acquires the target document from the cloud server through the long connection.
[0136] In the embodiment, if user 2 wants to acquire the target document from the cloud server, the user 2 can send a request message for establishing a long connection to the cloud server through APP or browser 1 on the terminal device 2. After the cloud server establishes a long connection with the APP or browser of user 2, user 2 acquires the target document from the cloud server through the APP or browser.
[0137] In order to facilitate description, the following takes an example of user 2 establishing a long connection with the cloud server through browser 1.
[0138] Step 435: User 2 realizes synchronization of the target document through the long connection between browser 1 and the cloud server.
[0139] As an example, after the user 2 obtains the target document from the cloud server through the browser 1, the user 2 can edit the target document locally and send the edited result to the cloud server, so as to synchronize the target document between the browser 1 and the cloud server.
[0140] For example, the user 2 sends the editing operation information to the cloud server through the browser 1, the editing operation information including the position of the object edited in the target document and the content of the editing. After the cloud server receives the editing operation information, the cloud server can edit the target document stored thereon according to the editing position and the editing content included in the editing operation information, so as to synchronize the target document between the APP 2 and the cloud server.
[0141] As an example, the object edited in the target document can include but is not limited to a picture in the target document, a text in the target document, etc. The editing content can include but is not limited to dragging a picture in the target document, changing the size of a picture in the target document, modifying the font of a text in the target document, modifying the color of a text in the target document, modifying the size of a text in the target document, etc.
[0142] Step 440: The cloud server sends a PUSH transparent message to the APP 1.
[0143] As an example, after the cloud server establishes a long connection with the browser 1 used by the user 2, the cloud server sends a PUSH transparent message to the APP 1 used by the user 1, the PUSH transparent message being used to indicate that the APP 1 has other users online to access the target document in addition to the user 1.
[0144] Step 445: The APP 1 actively establishes a long connection with the cloud server according to the PUSH transparent message.
[0145] In the embodiment of the application, the APP 1 receives the 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.
[0146] Step 450: The user 1 synchronizes the target document through the long connection between the APP 1 and the cloud server.
[0147] As an example, the user 1 can obtain the target document from the cloud server through the long connection established between the APP 1 and the cloud server. After the user 1 obtains the target document through the APP 1, the user 1 can edit the target document locally and send the edited result to the cloud server, so as to synchronize the target document between the APP 1 and the cloud server.
[0148] For example, user 1 sends an editing operation information to the cloud server through APP 1, the editing operation information including an editing position and editing content of the target document. After receiving the editing operation information, the cloud server can edit the target document stored thereon according to the editing position and editing content included in the editing operation information, thereby realizing synchronization of the target document between APP 1 and the cloud server.
[0149] In the embodiment of the present application, the cloud server can also send the editing operation (including the editing position and editing content) of the target document by user 1 through APP 1 to browser 1, so as to synchronize the target document edited by user 1 between browser 1 and the cloud server.
[0150] Thereafter, the editing operation of the target document by user 1 through APP 1 and the editing operation of the target document by user 2 through browser 1 are all sent to the cloud server through the respective long connections, and forwarded by the cloud server to other users including user 1 and user 2, thereby realizing synchronization of the target document between the cloud server and each user accessing the target document.
[0151] Step 455: When user 2 exits the editing of the target document, user 2 closes the long connection between browser 1 and the cloud server.
[0152] In the embodiment of the present application, when user 2 exits the editing of the target document, user 2 can close the long connection between browser 1 and the cloud server.
[0153] Step 460: The cloud server closes the long connection between itself and APP 1.
[0154] In the embodiment of the present application, when the cloud server judges that there is only one connection APP 1 after browser 1 closes the long connection with the cloud server, the cloud server can close the long connection between itself and APP 1, and keep the online state of user 1. At this time, the cloud server and APP 1 have been disconnected, and the subsequent modification of the target document by user 1 can be saved only locally.
[0155] Step 465: When user 1 exits the editing of the target document, user 1 sends a request message for clearing user state to the cloud server through APP 1.
[0156] In the embodiment of the present application, when user 1 exits the editing of the target document, user 1 can send a request message for clearing user state to the cloud server through APP 1, so as to mark the state of user 1 as offline by the cloud server.
[0157] Optionally, if user 1 still edits the target document during the disconnection of APP1 and the cloud server, APP1 can also save the edited target document locally. And APP1 can also establish a short connection with the cloud server, and send the result of this editing to the cloud server through the short connection.
[0158] Step 470: The cloud server marks user 1 as offline.
[0159] In the embodiment of the application, after receiving the request message for clearing the user state sent by APP1, the cloud server marks the state of user 1 as offline.
[0160] In the above technical solution, since most of the scenarios are single-user editing of the target document, there is no need to perform real-time collaboration between the terminal device and the cloud server for the edited document, and thus there is no need to maintain a long-term long connection between the terminal device and the cloud server, thereby reducing the power consumption of the terminal device and the consumption of network traffic between the terminal device and the server.
[0161] FIG. 5 is a schematic flowchart of another method for document editing provided by an embodiment of the application. As shown in FIG. 5, the method can include steps 510-580, which are described in detail as follows.
[0162] Step 510: User 1 establishes a long connection between APP1 on terminal device 1.
[0163] In the embodiment of the application, user 1 can send a request message for establishing 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 for establishing a long connection sent by APP1, the cloud server establishes a long connection with APP1.
[0164] Step 515: User 1 obtains the target document from the cloud server through the long connection between APP1 and the cloud server.
[0165] In the embodiment of the application, after the cloud server establishes a long connection with APP1 of user 1, user 1 can obtain the target document from the cloud server through APP1.
[0166] It should be understood that the specific process of how APP1 obtains the target document from the cloud server is described in step 420, which will not be described here.
[0167] Step 520: The cloud server sends a notification message to APP1.
[0168] In the embodiments of the present application, the cloud server can send a notification message to APP1, and the message contains a list of all online users.
[0169] Step 525: User 1 sends a notification message to the cloud server through APP1, which indicates that the long connection is disconnected.
[0170] In the embodiments of the present application, after APP1 receives the notification message sent by the cloud server, it is determined that no other user accesses the target document according to the user list, and user 1 can send a notification message to the cloud server through APP1, which indicates that it is temporarily offline and the long connection between it and the cloud server is disconnected.
[0171] Step 530: The cloud server disconnects the long connection between it and APP1, and records that user 1 is online.
[0172] In the embodiments of the present application, after the cloud server receives the notification message sent by user 1 through APP1, which indicates that it is temporarily offline and the long connection between it and the cloud server is disconnected, it disconnects the long connection between it and APP1 and records that user 1 is online.
[0173] Step 535: User 1 edits the target document through APP1 and stores the edited target document locally.
[0174] In the embodiments of the present application, after the long connection between APP1 and the cloud server is disconnected, user 1 can edit the target document obtained by it through APP1 and store the edited target document locally.
[0175] Step 540: User 2 connects a long connection between the cloud server and the browser 1 on the terminal device 2, and obtains the target document from the cloud server through the long connection.
[0176] Step 545: User 2 realizes synchronization of the target document through the long connection between the cloud server and the browser 1 on the terminal device 2.
[0177] Step 550: The cloud server sends a PUSH transparent message to APP1.
[0178] Step 555: APP1 actively establishes a long connection with the cloud server according to the PUSH transparent message.
[0179] Step 560: User 1 realizes synchronization of the target document through the long connection between APP1 and the cloud server.
[0180] Step 565: When user 2 exits the editing of the target document, user 2 closes the long connection between the cloud server and the browser 1.
[0181] Step 570: The cloud server closes the long connection between it and APP1.
[0182] Step 575: When the user 1 exits the editing of the target document, the user 1 sends a request message for clearing the user state to the cloud server through the APP 1.
[0183] Optionally, when the user 1 has further editing on the target document before exiting the editing of the target document, a short connection is established between the APP 1 and the cloud server, and the result of the current editing is sent to the cloud server through the short connection.
[0184] Step 580: The cloud server marks that the user 1 is offline.
[0185] It should be noted that steps 540-580 are similar to steps 430-470, and details are referred to the description in steps 430-470, which will not be repeated here.
[0186] In the above technical solution, in the case of the long connection between the terminal device and the cloud server, the power consumption of the terminal device and the consumption of the network traffic between the terminal device and the server can be reduced.
[0187] Optionally, in some embodiments, the first terminal device can also realize the synchronization of the document with the server through the short connection, which will be described in detail below in combination with FIG. 6.
[0188] FIG. 6 is a schematic flowchart of another method for editing a document according to an embodiment of the present application. As shown in FIG. 6, the method can include steps 610-640, which will be described in detail below.
[0189] Step 610: The first terminal device acquires the target document stored in the server through a short connection.
[0190] As an example, the first terminal device can establish a short connection with the server, and acquire the target document stored in the server through the short connection.
[0191] For example, the user can establish a short connection with the server through the APP on the first terminal device, send a request message for acquiring the target document to the server through the short connection, and the server can send the target document stored by the server to the APP on the first terminal device after receiving the request message. The user can view the target document displayed on the APP through the display interface of the first terminal device.
[0192] Step 620: The first terminal device generates a first editing operation on the target document, and caches the first editing operation locally.
[0193] In the embodiment of the present application, before step 620, the first terminal device can set a time period for synchronizing the first editing operation to the server, for example, a first time period.
[0194] For example, the user can set the time period for synchronizing the document through the APP on the first terminal device. The time period for synchronizing the document refers to the period in which the APP on the first terminal device synchronizes the locally cached first editing operation on the target document to the server. That is, when the user edits the target document through the APP on the first terminal device, the user can perform multiple first editing operations on the target document through the APP on the first terminal device within the time period specified by the timing mechanism, and cache the multiple first editing operations locally, and then synchronize the locally cached first editing operation on the target document to the server according to the set time period.
[0195] For example, the time period can be that the locally cached first editing operation on the target document is synchronized to the cloud server once every n minutes. For example, the server is synchronized once every 30 minutes or 60 minutes.
[0196] In the above technical solution, the first editing operation on the target document can be stored locally first, and then the cached first editing operation is synchronized to the server according to a certain time period. In this way, the number of network requests of the terminal device to the server can be reduced, and the server does not need to send a request every time the target document is edited, thereby reducing the pressure on the server. In addition, the content of the target document stored in the server can be updated regularly, so that the content of the target document stored in the server is not too old.
[0197] In the embodiment of the present application, after the first terminal device obtains the target document, a timer of a first time period can be started. 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.
[0198] Step 630: 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.
[0199] In a possible implementation, when the timing time of the first time period arrives, the first terminal device establishes a short connection with the server, and sends the locally cached first editing operation to the server through the short connection.
[0200] Step 640: The server receives the first editing operation, and updates the target document stored in the server according to the first editing operation.
[0201] In the embodiment of the present application, after the server receives the first editing operation sent by the first terminal device, the server updates the target document stored in the server according to the first editing operation.
[0202] Optionally, it is assumed that there are other terminal devices that need to obtain the stored target document from the server and edit the target document. For example, a second terminal device obtains the target document stored in the server from the server through a short connection, the second terminal device generates a third editing operation on the target document, and caches the third editing operation locally. According to a set second time period, the second terminal device sends the third editing operation cached locally to the server through the short connection, and after the server receives the third editing operation, the server updates the target document stored in the server according to the third editing operation.
[0203] Optionally, in the embodiment of the present application, when the user needs to exit the editing of the target document, if there is a second editing operation on the target document cached locally before the user exits the editing of the target document, the user can establish a short connection between the first terminal device and the server, and synchronize the second editing operation on the target document cached locally before the user exits the editing of the target document to the cloud server through the short connection, so as to realize the synchronization of the document between the first terminal device and the server.
[0204] In the above technical solution, the edited document does not need to be synchronized in real time between the terminal device and the server, and the synchronization of the target document between the terminal device and the server can be realized through a short connection according to a set time period, so as to further reduce the power consumption of the terminal device and the consumption of network traffic between the terminal device and the server.
[0205] The above describes the document editing method provided by the embodiment of the present application in combination with FIG. 1 to FIG. 6, and the following will describe the embodiment of the device of the present application in combination with FIG. 7 to FIG. 10. It should be understood that the description of the method embodiment and the description of the device embodiment correspond to each other, and therefore, the parts not described in detail can be referred to the foregoing method embodiment.
[0206] FIG. 7 is a schematic block diagram of a system 700 for document editing according to an embodiment of the present application. The system 700 includes a first terminal device 710 and a server 720.
[0207] In one example, the first terminal device 710 is configured to acquire a target document stored in the server 720 from the 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 determine a case where another terminal device edits the target document stored in the server 720, and send a first notification message to the first terminal device 710; the first terminal device 710 is further configured to receive the first notification message and synchronize the first editing operation cached locally to the server 720 according to the first notification message; and the server 720 is further configured to receive the first editing operation and update the target document stored in the server 720 according to the first editing operation.
[0208] Optionally, the first terminal device 710 is specifically configured to acquire the target document stored in the server 720 through the short connection.
[0209] Optionally, the first terminal device 710 acquires the target document stored in the server 720 through a long connection, and the server 720 is further configured to determine a case where no other terminal device edits the target document stored in the server 720, and send a second notification message to the first terminal device 710; the first terminal device 710 is further configured to receive the second notification message and disconnect the long connection between the first terminal device 710 and the server 720 according to the second notification message.
[0210] Optionally, the first terminal device 710 is specifically configured to synchronize the first editing operation to the server 720 through the short connection; and the server 720 is specifically configured to receive the first editing operation through the short connection.
[0211] Optionally, the first terminal device 710 is specifically configured to send the first editing operation cached locally to the server 720 through the short connection according to a set time period.
[0212] Optionally, the first terminal device 710 is further configured to, in a case where the first terminal device 710 exits editing the target document, if a second editing operation of the first terminal device 710 on the target document is cached locally, establish a short connection and send the second editing operation to the server 720 through the short connection; and the server 720 is further configured to receive the second editing operation and update the target document stored in the server 720 according to the second editing operation.
[0213] In another example, the first terminal device 710 is configured to acquire a target document stored in the server 720 through a short connection; 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 first terminal device 710 is further configured to send the locally cached first editing operation to the server 720 through the short connection according to a set first time period; and the server 720 is configured to receive the first editing operation and update the target document stored in the server 720 according to the first editing operation.
[0214] Optionally, the system further comprises a second terminal device configured to acquire a target document stored in the server 720 through 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 720 through the short connection according to a set second time period; and the server 720 is further configured to receive the third editing operation and update the target document stored in the server 720 according to the third editing operation.
[0215] Optionally, the first terminal device 710 is further configured to, in a case where the first terminal device 710 exits editing the target document, if a second editing operation of the first terminal device 710 on the target document is cached locally, establish a short connection and send the second editing operation to the server 720 through the short connection; and the server 720 is further configured to receive the second editing operation and update the target document stored in the server 720 according to the second editing operation.
[0216] The method provided by the embodiments of the present application can be executed by a computing device, which can also be referred to as a computer system. The computer system includes a hardware layer, an operating system layer running on the hardware layer, and an application layer running on the operating system layer. The hardware layer includes hardware such as a processing unit, a memory, and a memory control unit, and the functions and structures of the hardware are described in detail later. The operating system is any one or more computer operating systems that implement business processing through processes, such as a Linux operating system, a Unix operating system, an Android operating system, an iOS operating system, or a windows operating system. The application layer includes application programs such as a browser, an address book, a word processing software, and an instant messaging software. Optionally, the computer system is a handheld device such as a smartphone or a terminal device such as a personal computer, and the present application is not particularly limited as long as the method provided by the embodiments of the present application can be executed. The execution subject of the method provided by the embodiments of the present application can be a computing device or a functional module in the computing device that can invoke and execute a program.
[0217] The following describes in detail a computing device provided by an embodiment of the present application in combination with FIG. 8.
[0218] FIG. 8 is an architecture diagram of a computing device 1500 provided by an embodiment of the present application. The computing device 1500 can be a server or a computer or other device with computing capability. The computing device 1500 shown in FIG. 8 includes at least one processor 1510 and a memory 1520.
[0219] It should be understood that the present application does not limit the number of processors and memories in the computing device 1500.
[0220] The processor 1510 executes instructions in the memory 1520, so that the computing device 1500 implements the method provided by the present application. Alternatively, the processor 1510 executes instructions in the memory 1520, so that the computing device 1500 implements the various functional modules provided by the present application, thereby implementing the method provided by the present application.
[0221] Optionally, the computing device 1500 further includes a communication interface 1530. The communication interface 1530 uses a transceiving module such as but not limited to a network interface card, a transceiver, to implement communication between the computing device 1500 and other devices or communication networks.
[0222] Optionally, the computing device 1500 further includes a system bus 1540, wherein the processor 1510, the memory 1520 and the communication interface 1530 are respectively connected with the system bus 1540. The processor 1510 can access the memory 1520 through the system bus 1540, for example, the processor 1510 can read and write data or execute code 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, only one thick line is shown in FIG. 8, but it does not mean that there is only one bus or one type of bus.
[0223] In one possible implementation, the function of the processor 1510 is mainly to interpret instructions (or code) of a computer program and process data in computer software. The instructions of the computer program and the data in the computer software can be saved in the memory 1520 or the cache 1516.
[0224] Optionally, the processor 1510 is a chip that has a processing capability of signals. As an example but not limitation, the processor 1510 is a general processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Among them, the general processor is a microprocessor and the like. For example, the processor 1510 is a central processing unit (CPU).
[0225] Optionally, each processor 1510 includes at least one processing unit 1512 and a memory control unit 1514.
[0226] Optionally, the processing unit 1512 is also called core or kernel, which is the most important component of the processor. The processing unit 1512 is manufactured by single crystal silicon with a certain production process, and all the calculations, command receiving, command storage and data processing of the processor are executed by the core. The processing units respectively independently run program instructions, and use the parallel computing capability to speed up the program running. Various processing units have fixed logic structures, for example, the processing unit includes logic units such as a first level cache, a second level cache, an execution unit, an instruction level unit and a bus interface.
[0227] In one implementation, the memory control unit 1514 is used to control the data interaction between the memory 1520 and the processing unit 1512. Specifically, the memory control unit 1514 receives a memory access request from the processing unit 1512, and controls the access to the memory based on the memory access request. As an example but not limitation, the memory control unit is a memory management unit (MMU) and the like.
[0228] In one implementation, each memory control unit 1514 addresses the memory 1520 through a system bus. And an arbiter (not shown in FIG. 8) is configured in the system bus, which is responsible for processing and coordinating the competitive access of multiple processing units 1512.
[0229] In one implementation, the processing unit 1512 and the memory control unit 1514 are communicatively connected through the internal connection line of the chip, such as the address line, so as to realize the communication between the processing unit 1512 and the memory control unit 1514.
[0230] Optionally, each processor 1510 also includes a cache 1516, which provides temporary storage of often-used data and instructions. Recent use patterns of the data can be tracked by the cache control 1518 in order to maximize the effectiveness of the cache 1516. The cache 1516 is typically more expensive per byte of storage than the main memory 1520, but is faster. Therefore, the cache 1516 acts as a bridge between the main memory 1520 and the processor 1510, allowing the processor 1510 to run faster while the more expensive cache 1516 does the work of fetching data and instructions and storing the results of access intensive workloads.
[0231] The memory 1520 can provide a space for processes in the computing device 1500 to run, for example, the memory 1520 stores computer programs (in particular, the codes of the programs) for generating the processes. After the computer programs are run by the processor to generate the processes, the processor allocates corresponding storage spaces in the memory 1520 for the processes. Further, the storage spaces further include a text segment, an initialized data segment, a bit initialized data segment, a stack segment, a heap segment, and the like. The memory 1520 stores data generated during the running of the processes, for example, intermediate data, or process data, and the like, in the storage spaces corresponding to the processes.
[0232] Optionally, the memory is also referred to as the internal memory, which is used to temporarily store the data for operation in the processor 1510, and exchange the data with the external memory such as the hard disk. As long as the computer is running, the processor 1510 will call the data needed for operation to the internal memory for operation, and the processing unit 1512 will transmit the results after the operation is completed.
[0233] By way of example, and not limitation, memory 1520 is volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. By way of example, and not limitation, nonvolatile memory can be read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), electrically EPROM (EEPROM), or flash memory. Volatile memory is random access memory (RAM), which acts as external cache. By way of example, and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double-data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), Synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). The system and method described herein can be stored on or transmitted across one or more of these forms of RAM, or nonvolatile memory.
[0234] The structure of the computing device 1500 listed above is only exemplary, and the present application is not limited thereto. The computing device 1500 of the embodiments of the present application includes various hardware in the prior art computer system, for example, the computing device 1500 also includes other memories in addition to the memory 1520, such as disk memories and the like. Those skilled in the art should understand that the computing device 1500 can also include other devices necessary for normal operation. Meanwhile, according to specific needs, those skilled in the art should understand that the above-mentioned computing device 1500 can also include hardware devices for realizing other additional functions. In addition, those skilled in the art should understand that the above-mentioned computing device 1500 can also only include devices necessary for realizing the embodiments of the present application, and does not necessarily include all the devices shown in FIG. 8.
[0235] The embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server. In some embodiments, the computing device can also be a desktop computer, a notebook computer, or a terminal device such as a smart phone.
[0236] As shown in FIG. 9, the computing device cluster includes at least one computing device 1500. The memory 1520 in one or more computing devices 1500 in the computing device cluster can have the same instructions for performing the above method.
[0237] In some possible implementation, the memory 1520 in one or more computing devices 1500 in the computing device cluster can also respectively have partial instructions for performing the above method. In other words, the combination of one or more computing devices 1500 can collectively perform the instructions of the above method.
[0238] It should be noted that the memory 1520 in different computing devices 1500 in the computing device cluster can store different instructions, respectively used for performing part of the functions of the above apparatus. That is, the instructions stored in the memory 1520 in different computing devices 1500 can implement the functions of one or more modules in the above apparatus.
[0239] In some possible implementation, one or more computing devices in the computing device cluster can be connected through a network. The network can be a wide area network, a local area network, or the like. FIG. 10 shows one possible implementation. As shown in FIG. 10, two computing devices 1500A and 1500B are connected through a network. Specifically, the computing devices are connected to the network through the communication interfaces in the computing devices.
[0240] It should be understood that the functions of the computing device 1500A shown in FIG. 10 can also be completed by multiple computing devices 1500. Similarly, the functions of the computing device 1500B can also be completed by multiple computing devices 1500.
[0241] In this embodiment, a computer program product including instructions is also provided. The computer program product can be software or a program product including instructions, which can be run on a computing device or stored in any available medium. When it is run on a computing device, it causes the computing device to perform the above-provided method, or causes the computing device to implement the functions of the above-provided apparatus.
[0242] In this embodiment, a computer readable storage medium is also provided. The 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 including one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk), or the like. The computer readable storage medium includes instructions, which, when executed on a computing device, cause the computing device to perform the above-provided method.
[0243] It should be understood that the size of the sequence number of the above processes does not mean the order of execution in various embodiments of the present application, and the execution order of the processes should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0244] Those skilled in the art can appreciate that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0245] Those skilled in the art can clearly understand that, for the convenience and brevity of the description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the foregoing method embodiments, which will not be repeated here.
[0246] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the above-described device embodiments are only schematic, for example, the division of the units is only a logical function division, and actual implementation can have another division manner, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.
[0247] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or can be distributed on a plurality of network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0248] In addition, each functional unit in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0249] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the parts that contribute to the prior art or parts of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.
[0250] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.
Claims
1. A method of document editing, characterized by, The method comprises: The first terminal device acquires a target document stored in a server from the server; The first terminal device generates a first editing operation on the target document and caches the first editing operation locally; The server determines that other terminal devices edit the target document stored in the server, and sends a first notification message to the first terminal device; The first terminal device receives the first notification message and synchronizes the first editing operation cached locally 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 of claim 1, wherein, The first terminal device acquires a target document stored in a server from the server, comprising: The first terminal device establishes a short connection with the server; The first terminal device acquires the target document stored in the server through the short connection.
3. The method of claim 1, wherein, The first terminal device acquires the target document stored in the server through a long connection, and before the first terminal device generates a first editing operation on the target document, the method further comprises: The server determines that no other terminal device edits the target document stored in the server, and sends a second notification message to the first terminal device; The first terminal device receives the second notification message and disconnects the long connection between the first terminal device and the server according to the second notification message.
4. The method of any one of claims 1 to 3, wherein The first terminal device synchronizes the first editing operation to the server, comprising: The first terminal device synchronizes the first editing operation to the server through a short connection; The server receives the first editing operation, comprising: The server receives the first editing operation through the short connection.
5. The method of claim 4, wherein The first terminal device synchronizes the first editing operation to the server through a short connection, comprising: The first terminal device sends the first editing operation cached locally to the server through 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 comprises: If there is a second editing operation of the first terminal device on the target document cached locally when the first terminal device exits editing the target document, 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 of document editing, characterized by, The method comprises: The first terminal device acquires a target document stored in a server from the server through 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 a 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 of claim 7, wherein, The method comprises: The second terminal device acquires the target document stored in the server through 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 through the short connection according to a 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 comprises: In the case that the first terminal device exits editing the target document, 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 system for document editing, characterized by The system comprises a first terminal device and a server, wherein: The first terminal device is configured to acquire the target document stored in 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, in the case that there is another terminal device editing the target document stored in the server, send a first notification message to the first terminal device; 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.
11. The system of claim 10, wherein, The first terminal device is specifically configured to: Acquire the target document stored in the server through the short connection.
12. The system of claim 10, wherein, The first terminal device acquires the target document stored in the server through a long connection, The server is further configured to, in the case that there is no other terminal device editing the target document stored in the server, send a second notification message to the first terminal device; 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, wherein: The first terminal device is specifically configured to: Synchronize the first editing operation to the server through a short connection; The server is specifically configured to: Receive the first editing operation through the short connection.
14. The system of claim 13, wherein, The first terminal device is specifically configured to: The first editing operation locally cached is sent to the server through the short connection according to a set time period.
15. The system of any of claims 10 to 14, wherein, The first terminal device is further configured to, if a second editing operation on the target document performed by the first terminal device is locally cached when the first terminal device exits editing the target document, establish a short connection 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.
16. A system for document editing, characterized by The system comprises a first terminal device and a server, wherein: The first terminal device is configured to acquire the target document stored in the server from the server through 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 first editing operation locally cached to the server through 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 of claim 16, wherein, The system further comprises: The second terminal device is configured to acquire the target document stored in the server from the server through 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 third editing operation locally cached to the server through 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.
18. The system of claim 16 or 17, wherein, The first terminal device is further configured to, if a second editing operation on the target document performed by the first terminal device is locally cached when the first terminal device exits editing the target document, establish a short connection 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.
19. A cluster of computing devices, characterized in that, at least one computing device, each computing device comprising 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 to cause the cluster of computing devices to perform the method of any of claims 1 to 9.
20. A computer program product comprising instructions, characterized in that, The instructions, when executed by the cluster of computing devices, cause the cluster of computing devices to perform the method of any of claims 1 to 9.
21. A computer-readable storage medium, characterized in that, computer program instructions, which, when executed by a cluster of computing devices, cause the cluster of computing devices to perform the method of any of claims 1 to 9.
Citation Information
Patent Citations
File online editing method, apparatus and system
CN105357307A
Online document editing method and device, computer equipment and storage medium
CN109918601A
File synchronization method, device, system and equipment and storage medium
CN116401222A
Server apparatus and client apparatus
US20240020469A1