Online document data collaboration method and device, equipment, storage medium and product
By receiving and judging data update instructions for online documents, only valid instructions are sent to clients that need to be updated, and using two-way linked lists and long connections to optimize data synchronization, the problem of invalid instructions and resource waste in online document collaborative editing is solved, and the problem of invalid instructions and resources is improved The rendering performance and collaborative editing efficiency of the client.
Patent Information
- Application Number
- CN202411020402.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-29
- Publication Date
- 2024-11-12
AI Technical Summary
During the online document collaborative editing process, the display area of the user editing page is affected by factors such as browser window settings and screen size, resulting in invalid command information being unable to be in the display area, resulting in waste of resources and increased network load, which in turn causes client stuttering Phenomenon.
By receiving data update instructions, obtaining the target location, and determining whether it is located in the data display area of the client, only valid instructions are sent to the client that needs to be updated, using the bidirectional linked list data structure to listen and update the data display area in real time, establishing a long connection To improve communication efficiency and delete data display area information when the client disconnects.
It reduces the occurrence of invalid instructions, improves client resource utilization, reduces network overhead, improves rendering performance, avoids client lag, and improves the efficiency of collaborative editing.
Smart Images

Figure CN118940729A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an online document data collaboration method, device, equipment, storage medium and product. Background Art
[0002] With the development of Internet technology, the applications carried by the Internet are becoming increasingly rich, and online documents are an important form of Internet applications. Online documents are a common multi-person collaborative office application. When using online documents, multiple users can collaboratively view and edit the same online document. Since the collaborative solution of online documents is based on a single editing page for data collaboration, any user on the same editing page will receive instruction information from all other participants.
[0003] In actual applications, the display area of the user editing page is often affected by multiple factors such as browser window settings, screen size, resolution, etc., and cannot display all the data content of the entire editing page, resulting in the instruction information that currently needs to be rendered often not being in the current user's display area. These instruction information outside the display area are collectively referred to as invalid instructions. The reception, parsing and rendering of invalid instructions will waste client resources, greatly reduce the client's resource utilization, and even cause client freezes. When there are too many people collaborating, a lot of network load will be wasted to send and receive invalid instructions. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide an online document data collaboration method, device, equipment, storage medium and product, which reduces the occurrence of invalid instructions, improves client resource utilization while also reducing network overhead, improves client rendering performance, and avoids the occurrence of freezes.
[0005] To achieve the above object, an embodiment of the present invention provides an online document data collaboration method, comprising:
[0006] Receiving a data update instruction; wherein the data update instruction is sent by any client when there is an editing operation on the online document;
[0007] Obtaining the target location carried in the data update instruction;
[0008] Determine whether the target location is located in a data display area of an online document of any client;
[0009] When the target location is located in the data display area of the first client, the data update instruction is sent to the first client, so that the first client updates the online document according to the data update instruction.
[0010] As an improvement of the above solution, the method further includes:
[0011] When a new client is detected to participate in the collaboration of the online document, a coordinate object of the online document of the new client is initialized; wherein the coordinate object is a bidirectional linked list data composed of a plurality of nodes;
[0012] Receive the data display area of the online document sent by the new client;
[0013] The online document of the new client is updated according to the data display area.
[0014] As an improvement of the above solution, the step of determining whether the target location is located in a data display area of an online document of any client includes:
[0015] Traverse the coordinate objects of the data display areas of all clients;
[0016] When the target position falls within the data display area of any client, determining that the current client is the first client;
[0017] When the target position does not fall within the data display area of any client, it is determined that the current client is the second client.
[0018] As an improvement of the above solution, after determining whether the target location is located in a data display area of an online document of any client, the method further includes:
[0019] When it is detected that the data display area of the second client is updated, comparing the updated target data display area with the latest data of the online document;
[0020] When it is detected that there is data to be updated in the target data display area, a data update instruction corresponding to the data to be updated is sent to the second client, so that the second client updates the online document according to the data update instruction.
[0021] As an improvement of the above solution, before receiving the data update instruction, the method further includes:
[0022] Establishing a persistent connection with a client that enters an editing page of the online document;
[0023] Obtain the latest data of the online document;
[0024] The latest data is rendered into an online document of the client.
[0025] As an improvement of the above solution, after establishing a persistent connection with the client that enters the editing page of the online document, the method further includes:
[0026] After the long connection with the client is disconnected, the data display area information of the client is deleted.
[0027] To achieve the above object, an embodiment of the present invention further provides an online document data collaboration device, comprising:
[0028] A data update instruction receiving module, used to receive a data update instruction; wherein the data update instruction is sent by any client when there is an editing operation on the online document;
[0029] A target position acquisition module, used to acquire the target position carried in the data update instruction;
[0030] A determination module, used to determine whether the target location is located in a data display area of an online document of any client;
[0031] The data update instruction sending module is used to send the data update instruction to the first client when the target position is located in the data display area of the first client, so that the first client updates the online document according to the data update instruction.
[0032] To achieve the above objectives, an embodiment of the present invention further provides an online document data collaboration device, comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the online document data collaboration method as described in any of the above embodiments is implemented.
[0033] To achieve the above objectives, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the online document data collaboration method as described in any of the above embodiments.
[0034] To achieve the above objectives, an embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the online document data collaboration method as described in any of the above embodiments.
[0035] Compared with the prior art, the online document data collaboration method, device, equipment, storage medium and product disclosed in the present invention, when a user performs an editing operation on an online document, the client will send the data update instruction of the online document to the server. After receiving the data update instruction, the server will parse and obtain the target position of the data updated by the client, and then determine whether the target position is in the data display area of any client. If it is, it means that the updated data needs to be displayed in the data display area of the client. The server will then send the data update instruction to these clients so that these clients update the online document according to the data update instruction. Since the data display area of the client's online document is monitored in real time, and only the online document of the client with updated data in the data display area is updated, the occurrence of invalid instructions is reduced, and the server does not need to send the data update instruction to all clients, so as not to waste client resources. On the basis of improving the utilization rate of client resources, the network overhead is also reduced, the rendering performance of the client is improved, and the occurrence of freezes is avoided. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] Figure 1 is a flow chart of an online document data collaboration method provided by an embodiment of the present invention;
[0037] Figure 2 This is a first schematic diagram of a data display area of an online document provided by an embodiment of the present invention;
[0038] Figure 3 This is a second schematic diagram of the data display area of the online document provided by the embodiment of the present invention;
[0039] Figure 4 This is a third schematic diagram of the data display area of the online document provided by the embodiment of the present invention;
[0040] Figure 5 This is a flow chart of a new client participating in online document collaboration provided by an embodiment of the present invention;
[0041] Figure 6 is a flow chart of online document data rendering provided by an embodiment of the present invention;
[0042] Figure 7 is a schematic diagram of information interaction between a client and a server provided in an embodiment of the present invention;
[0043] Figure 8 is another flow chart of the online document data collaboration method provided by an embodiment of the present invention;
[0044] Fig. 9 Schematic diagram of data display area of client C and client D provided by an embodiment of the present invention;
[0045] Fig.10 It is a structural block diagram of an online document data collaboration device provided by an embodiment of the present invention;
[0046] Fig.11 It is a structural block diagram of an online document data collaboration device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0048] See also Figure 1 , Figure 1 : is a flowchart of an online document data collaboration method provided by an embodiment of the present invention. The online document data collaboration method is implemented by a server and includes:
[0049] S11, receiving a data update instruction; wherein the data update instruction is sent by any client when there is an editing operation on the online document;
[0050] S12, obtaining the target position carried in the data update instruction;
[0051] S13, determining whether the target location is located in a data display area of an online document of any client;
[0052] S14: When the target location is located in the data display area of the first client, the data update instruction is sent to the first client, so that the first client updates the online document according to the data update instruction.
[0053] Exemplarily, before receiving the data update instruction, the server needs to receive the data display area of the online document sent by any client. It is understandable that the display area of the online document is often affected by multiple factors such as browser window settings, screen size, resolution, etc., and it is impossible to display all the data content of the entire editing page. Therefore, the client needs to detect the data display area of the online document in real time. Once it detects that the data display area has changed, it sends the updated data display area to the server. When the user edits the online document, the client will send the data update instruction of the online document to the server. After receiving the data update instruction, the server parses and obtains the target position of the data updated by the client, and then determines whether the target position is in the data display area of any client. If so, it means that these clients are affected clients, recorded as the first client, and the updated data needs to be displayed in the data display area of the first client. At this time, the server sends the data update instruction to the first client, and the first client updates the online document according to the data update instruction.
[0054] In the embodiment of the present invention, since the data display area of the client's online document is monitored in real time and only the online document of the client with data update in the data display area is updated, the occurrence of invalid instructions is reduced, the server does not need to send data update instructions to all clients, and client resources are not wasted. On the basis of improving the utilization rate of client resources, the network overhead is also reduced, the rendering performance of the client is improved, and the occurrence of freezes is avoided.
[0055] Specifically, the online document includes any document that can realize multi-user collaborative operation, such as the online document includes online tables, online blank documents, online graphic editing documents, etc. When the online document itself has a data positioning function, the data positioning function can be directly used to determine the location information of all data in the online document; when the online document itself does not have a data positioning function, a coordinate system can be generated at a certain position of the online document (such as the upper right corner, upper left corner, lower right corner, lower left corner, center position), and the coordinate system can be a two-dimensional or three-dimensional coordinate system (the three-dimensional coordinate system is suitable for online documents with a three-dimensional drawing function), and then the coordinate system is used to obtain the location information of all data in the online document.
[0056] For example, in order to facilitate the description of the data display area of the online document of this solution, three types of online documents are provided in the embodiment of the present invention, namely, online tables, online blank documents, and online graphic editing documents. The three types of online documents are described as follows:
[0057] 1. The first type of online document is an online form, see Figure 2 , Figure 2is a first schematic diagram of a data display area of an online document provided by an embodiment of the present invention. The online table includes a plurality of cells. The online table has a first horizontal positioning mark and a second vertical positioning mark. The first positioning mark is represented by letters, and the second positioning mark is represented by numbers. The position information of each cell in the online table can be obtained by locating the first positioning mark and the second positioning mark together, such as Figure 2 The four top corner cells of the data display area of the online table are D5, N5, D21, and N21 respectively. The client will report this data display area (carrying information: D5, N5, D21, and N21 cells) to the server. The server stores this data display area and binds the data display area to the corresponding client, such as binding the data display area to the client ID. When the data display area of the client is updated, the client ID is unbound and then re-bound to the updated data display area. When the user needs to fill in data in the online table, the client sends a data update instruction to the server. The information carried by the data update instruction includes the data generated according to the editing operation and the target location of the data. For example, when the user fills in the data "11" in cell L15, the content carried by the data update instruction includes: data body-11 (including font color, size, type and format information), target location-L15.
[0058] Furthermore, the data update instruction may also carry the ID of the client, so that the server can know which client sent the data update instruction. In addition, if the user does not fill in data in the online form, but changes the format of the cell (such as row height, width, background color), for example, the client changes the row height of cell L15 to xx, the content carried by the data update instruction includes: data body-row height xx, target position-L15.
[0059] 2. The second type of online document is an online blank document, see Figure 3 , Figure 3 is a second schematic diagram of the data display area of the online document provided by the embodiment of the present invention. Assuming that the online blank document itself does not have a positioning function, when the client generates the online blank document for the first time, it also generates a coordinate system at a certain position (such as the upper right corner, the upper left corner, the lower right corner, the lower left corner, or the center position) of the online blank document, such as Figure 3 As shown, a two-dimensional coordinate system is generated at the upper left corner of the online blank document, and the scales of the horizontal axis and the vertical axis in the generated two-dimensional coordinate system can be set as needed, and no specific limitation is made here. Figure 3The coordinates of the upper left, upper right, lower left and lower right corners of the data display area of the online blank document are D1, D2, D3 and D4 respectively. The client will report this data display area (carrying information: coordinate information of D1, D2, D3 and D4) to the server, and the server will store this data display area and bind the data display area to the corresponding client. When the user needs to fill in data in the online blank document, the client sends a data update instruction to the server. The information carried by the data update instruction includes the data generated according to the editing operation and the target location of the data. For example, when the user fills in the data "aaaaaaaaaaaaaa" in the online blank document, the client will also obtain the display range occupied by this data, such as d1, d2, d3 and d4 in the figure. The content carried by the data update instruction includes: data body-aaaaaaaaaaaaa (including font color, size, type and format, etc.), target location-coordinate information of d1, d2, d3 and d4.
[0060] 3. The third type of online document is online graphic editing document, see Figure 4 , Figure 4 is a third schematic diagram of a data display area of an online document provided by an embodiment of the present invention, wherein the online graphic editing document includes a plurality of spacers, the online graphic editing document has a first horizontal scale line and a second vertical scale line, the first scale line and the second scale line have the same unit length, and the position information of each spacer in the online graphic editing document can be obtained by the common positioning of the first scale line and the second scale line, such as Figure 4 The four top left, top right, bottom left and bottom right spacers of the data display area of the online graphic editing document are E1, E3, E2 and E4 respectively. Taking spacer E1 as an example, the position information of spacer E1 is expressed as: L79, H109, where "L" represents the scale of the first horizontal scale line and "H" represents the scale of the second vertical scale line. The client will report this data display area (carrying information: spacer position information of E1, E3, E2, E4) to the server. The server stores this data display area and binds the data display area to the corresponding client. When the user needs to fill in data in the online graphic editing, the client sends a data update instruction to the server. The information carried by the data update instruction includes the data generated according to the editing operation and the target location of the data, such as in Figure 4In the example, if the data is "circle", the data update instruction carries the following contents: data body - circle (including color and shape), target position - the position information of the spacers of e1, e2, e3, and e4. It is understandable that some users usually hide the spacers and / or tick marks when using online graphic editing documents, which does not affect the online graphic editing documents recording the position information of these hidden spacers.
[0061] It is worth mentioning that Figures 2 to 4 The types of online documents listed are only examples. In actual applications, the types of online documents are not limited to these, and the specific presentation methods of the editing pages of online tables, online blank documents, and online graphic editing documents are not limited to these. For example, online blank documents may also have a positioning function.
[0062] See also Figure 5 , Figure 5 This is a flow chart of a new client participating in online document collaboration provided by an embodiment of the present invention. The online document data collaboration method further includes:
[0063] S21, when detecting that a new client participates in the collaboration of the online document, initializing the coordinate object of the online document of the new client; wherein the coordinate object is a bidirectional linked list data composed of a plurality of nodes;
[0064] S22, receiving the data display area of the online document sent by the new client;
[0065] S23: Update the online document of the new client according to the data display area.
[0066] Exemplarily, when the server monitors that a new client is participating in the collaboration of an online document, it initializes a coordinate object of an online document. The coordinate object is a two-way linked list data composed of four nodes, and one node corresponds to an online document coordinate object. A two-way linked list is also called a double linked list, which is a kind of linked list. Each of its data nodes has two pointers, pointing to the direct successor and the direct predecessor respectively. Therefore, starting from any node in the two-way linked list, it is very convenient to access its predecessor node and successor node, that is, the two-way linked list can be searched forward or backward. Through the query mechanism of the two-way linked list, the online documents in all clients can be associated. The server then collects the coordinate data of the data display area uploaded by the new client in real time, and updates the coordinate object of the online document according to this coordinate data. The coordinate object is used to calculate the collaborative clients affected by the data change in the online document in real time.
[0067] Specifically, in step S13, the step of determining whether the target location is located in a data display area of an online document of any client includes:
[0068] S131, traversing the coordinate objects of the data display areas of all clients;
[0069] S132: when the target position falls within the data display area of any client, determining that the current client is the first client;
[0070] S133: When the target position does not fall within the data display area of any client, determine that the current client is the second client.
[0071] Exemplarily, after receiving the data instruction, the server parses to obtain the target location, then traverses the coordinate objects of the data display areas of all clients, compares them with the coordinate data corresponding to the target location, and selects the affected collaborative clients as the first clients, while the remaining unaffected collaborative clients are the second clients.
[0072] See also Figure 6 , Figure 6 is a flowchart of online document data rendering provided by an embodiment of the present invention. Before receiving the data update instruction, the method further includes:
[0073] S101, establishing a persistent connection with a client that enters an editing page of the online document;
[0074] S102, obtaining the latest data of the online document;
[0075] S103: Render the latest data into the online document of the client.
[0076] For example, see Figure 7 , Figure 7 This is a schematic diagram of information interaction between the client and the server provided by an embodiment of the present invention. Assume that there are 6 clients (clients A to F) entering the editing page of the online document at this time. When a user clicks on the online document link displayed in the client, it means that the user participates in collaborative editing. Clients A to F will establish a long connection with the server for sending and receiving instructions. The method for establishing a long connection can refer to the prior art and will not be repeated here. After the long connection is successfully established, the server will pull the latest online table data and render the latest data into the online document of the client. For example, the online document of the client is rendered through canvas (canvas is a new interface introduced by the H5 standard, which provides front-end developers with a platform that can freely draw static graphics, dynamic graphics, audio and video operations). At the same time, the client reports the location information of the data display area to the server based on the actual data display area.
[0077] For example, suppose that at this time, both client A and client B have users editing online documents, client A sends data update instruction a to the server, and client B sends data update instruction b to the server. For data update instruction a, the server needs to determine whether the online documents of clients B to F need to perform synchronous data updates. If it is detected that the target position of the data update instruction a only falls within the data display area of client F, the server sends the data update instruction a to client F, and client F updates the online document according to the data update instruction a. For data update instruction b, the server needs to determine whether the online documents of clients A and C to F need to perform synchronous data updates. If it is detected that the target position of the data update instruction b only falls within the data display area of clients C to E, the server sends the data update instruction b to clients C to E, and clients C to E update the online document according to the data update instruction b.
[0078] In the embodiment of the present invention, by establishing a long connection between the client and the server, the connection between the two parties can be maintained for a long time, thereby improving the communication speed, ensuring real-time performance, and avoiding the waste of channel resources and network resources caused by repeated connections in a short period of time.
[0079] Specifically, after executing step S101, the method further includes:
[0080] S104: After the long connection with the client is disconnected, the data display area information of the client is deleted.
[0081] Exemplarily, after the collaborative user exits the online document editing, the client disconnects the persistent connection with the server, and upon receiving the collaborative exit request from the client, the server deletes the data display area information of the collaborative user in the bidirectional linked list in real time.
[0082] In the embodiment of the present invention, when it is detected that the user exits the online document editing, the long connection with the client is disconnected in time to avoid occupying channel resources and network resources and to avoid wasting channel resources and network resources.
[0083] Further, see Figure 8 , Figure 8 is another flow chart of the online document data collaboration method provided by an embodiment of the present invention. After executing step S13, the method further includes:
[0084] S15: When the target location is not in the data display area of the online document of the second client, suspend sending the data update instruction to the second client.
[0085] For example, see Fig. 9 , Fig. 91 is a schematic diagram of the data display area of client C and client D provided by an embodiment of the present invention. Assuming that the online documents of client C and client D are both online tables, the data display area of the online table in client C is D5, N5, D21, and N21, and the data display area of the online table in client D is A1, R1, A12, and R12. Assuming that the user of client A modifies the data of cell C4 at this time, client A sends a data update instruction to the server. After receiving the data update instruction, the server parses the target position of the modified data (cell C4) according to the data update instruction, finds the collaborative user affected by the current modification, which is recorded as the first client, and finds the collaborative user not affected by the current modification, which is recorded as the second client. Since cell C4 is not in the data display area of the online table of client C, client C is recorded as the second client, and since cell C4 is in the data display area of the online table of client D, client D is recorded as the first client. At this time, the server will not send a data update instruction to the second client.
[0086] In an embodiment of the present invention, the server will not temporarily send data update instructions to clients that are not affected by the editing operation, thereby avoiding large-scale data broadcasting to all users, achieving the purpose of regional data collaboration, and reducing the occurrence of invalid instructions. The server does not need to send data update instructions to all clients, thereby improving client resource utilization.
[0087] Further, see Figure 8 After executing step S15, the method further includes:
[0088] S16, when it is detected that the data display area of the second client is updated, comparing the updated target data display area with the latest data of the online document;
[0089] S17: When it is detected that there is data to be updated in the target data display area, a data update instruction corresponding to the data to be updated is sent to the second client, so that the second client updates the online document according to the data update instruction.
[0090] Exemplarily, since the second client has not received the data update instruction, the data of the online document of the second client has not been synchronously updated at this time. If the second client user moves the online document at this time, resulting in data to be updated in the data display area of the online document of the second client, the server will send the data update instruction corresponding to the data to be updated to the second client, so that the second client updates the online document data according to the data update instruction. Taking client C as an example, the user moves the data display area of the online document of client C, and client C sends the updated data display area to the server. The server compares the latest data of the online document and finds that there is data in cell C4 in the latest data, but there is no data in cell C4 of the online document of client C. At this time, the server uses the data of cell C4 as the data to be updated, and synchronizes the data of cell C4 to client C for updating, and client C updates the data of cell C4 in the online document.
[0091] In an embodiment of the present invention, for a second client that has not received a data update instruction in real time, when a user changes the data display area of an online document, the server can also learn about the data that has not been updated synchronously by the second client by comparing the online document data, and synchronize the data in a timely manner to avoid missing the display of the online document data.
[0092] Furthermore, when the user operates the online document, there may be a situation where the online document needs to be stored locally / in the cloud. In this case, the method further includes:
[0093] S18, when a document storage instruction sent by the client is detected, current data of the online document of the client is compared with the latest data;
[0094] S19: When it is detected that there is data to be synchronized, a data update instruction corresponding to the data to be synchronized is sent to the client, so that the client updates the online document according to the data update instruction.
[0095] Exemplarily, when a user clicks the "Save / Save As" button of an online document, the client sends a document storage instruction to the server. At this time, the server counts the online document contents filled in by all clients, obtains the latest data of the online document, and then compares this latest data with the data of the online document of the client that sent the document storage instruction. It can be learned that the online document of the client needs to synchronize data to be synchronized. The server sends the data update instruction corresponding to the data to be synchronized to the client, and the client updates and stores the online document according to the data update instruction.
[0096] In the embodiment of the present invention, for a client that needs to store online documents, the server can also learn the data that has not been updated synchronously by the client by comparing the online document data, and synchronize the data in time to avoid missing the display of the online document data.
[0097] Compared with the prior art, the online document data collaboration method disclosed in the present invention collects the data display area information of the online document, and then calculates the collaborative clients affected by the online document editing in real time based on the search algorithm of the bidirectional linked list, and then pushes the data update instructions to the affected collaborative clients through a long connection. This operation avoids the occurrence of data instruction broadcasting, reduces the number of collaborative users of the data to a minimum, and effectively saves network overhead. At the same time, the client will only receive valid instructions from the data display area and render the data, which is imperceptible to the user. Overall, the rendering performance of the client is improved, the occurrence of lag is reduced, and resource utilization is improved.
[0098] See also Fig.10 , Fig.10 1 is a structural block diagram of an online document data collaboration device 100 provided in an embodiment of the present invention. The online document data collaboration device 100 includes:
[0099] The data update instruction receiving module 11 is used to receive a data update instruction; wherein the data update instruction is sent by any client when there is an editing operation on the online document;
[0100] A target position acquisition module 12, used to acquire the target position carried in the data update instruction;
[0101] A determination module 13, used to determine whether the target location is located in a data display area of an online document of any client;
[0102] The data update instruction sending module 14 is used to send the data update instruction to the first client when the target position is located in the data display area of the online document of the first client, so that the first client updates the online document according to the data update instruction.
[0103] Specifically, the online document data collaboration device 100 further includes:
[0104] An online document initialization module, used to initialize the coordinate object of the online document of the new client when detecting that the new client participates in the collaboration of the online document; wherein the coordinate object is a bidirectional linked list data composed of a plurality of nodes;
[0105] A data display area receiving module, used for receiving the data display area of the online document sent by the new client;
[0106] The online document updating module is used to update the online document of the new client according to the data display area.
[0107] Specifically, the judgment module 13 is used to: traverse the coordinate objects of the data display areas of all clients; when the target position falls within the data display area of any client, determine that the current client is the first client; when the target position does not fall within the data display area of any client, determine that the current client is the second client.
[0108] Specifically, the data update instruction sending module 14 is further used for: when the target location is not in the data display area of the online document of the second client, suspending sending the data update instruction to the second client.
[0109] Specifically, the online document data collaboration device 100 further includes:
[0110] A data comparison module, configured to compare the updated target data display area with the latest data of the online document when detecting that the data display area of the second client is updated;
[0111] Then, the data update instruction sending module 14 is further used for: when detecting that there is data to be updated in the target data display area, sending a data update instruction corresponding to the data to be updated to the second client, so that the second client updates the online document according to the data update instruction.
[0112] Specifically, the online document data collaboration device 100 further includes:
[0113] A persistent connection establishing module, used to establish a persistent connection with a client entering the editing page of the online document;
[0114] The data rendering module is used to obtain the latest data of the online document and render the latest data into the online document of the client.
[0115] Specifically, the long connection establishing module is further used to: delete the data display area information of the client after disconnecting the long connection with the client.
[0116] Specifically, the data comparison module is further used to: compare the current data of the online document of the client with the latest data when detecting the document storage instruction sent by the client;
[0117] Then, the data update instruction sending module 14 is further used for: when detecting that there is data to be synchronized, sending a data update instruction corresponding to the data to be synchronized to the client, so that the client updates the online document according to the data update instruction.
[0118] It is worth noting that the working process of each module in the online document data collaboration device 100 described in the embodiment of the present invention can refer to the working process of the online document data collaboration method described in the above embodiment, and will not be repeated here.
[0119] Compared with the prior art, the online document data collaboration device 100 disclosed in the present invention collects the data display area information of the online document, and then calculates the collaborative clients affected by the online document editing in real time based on the search algorithm of the bidirectional linked list, and then pushes the data update instructions to the affected collaborative clients through a long connection. This operation avoids the occurrence of data instruction broadcasting, reduces the number of collaborative users of the data to a minimum, and effectively saves network overhead. At the same time, the client will only receive valid instructions from the data display area and render the data, which is imperceptible to the user. Overall, the client's rendering performance is improved, the occurrence of freezes is reduced, and resource utilization is improved.
[0120] See also Fig.11 , Fig.11 2 is a structural block diagram of an online document data collaboration device 200 provided in an embodiment of the present invention, and the online document data collaboration device 200 includes a processor 21, a memory 22, and a computer program stored in the memory 22 and executable on the processor 21. When the processor 21 executes the computer program, the steps in the above-mentioned online document data collaboration method embodiments are implemented, such as steps S11 to S14.
[0121] Exemplarily, the computer program may be divided into one or more modules / units, which are stored in the memory 22 and executed by the processor 21 to implement the present invention. The one or more modules / units may be a series of computer program instruction segments capable of implementing specific functions, which are used to describe the execution process of the computer program in the online document data collaborative device 200.
[0122] The online document data collaboration device 200 may include, but is not limited to, a processor 21 and a memory 22. Those skilled in the art will appreciate that the schematic diagram is merely an example of the online document data collaboration device 200 and does not constitute a limitation on the online document data collaboration device 200. The online document data collaboration device 200 may include more or fewer components than shown in the diagram, or may combine certain components, or different components. For example, the online document data collaboration device 200 may also include input and output devices, network access devices, buses, and the like.
[0123] The processor 21 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor 21 is the control center of the online document data collaborative device 200, and uses various interfaces and lines to connect various parts of the entire online document data collaborative device 200.
[0124] The memory 22 can be used to store the computer program and / or module. The processor 21 implements various functions of the online document data collaboration device 200 by running or executing the computer program and / or module stored in the memory 22 and calling the data stored in the memory 22. The memory 22 can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory 22 can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Med ia Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0125] Wherein, if the modules / units integrated in the online document data collaboration device 200 are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and when the computer program is executed by the processor 21, the steps of the above-mentioned method embodiments can be implemented. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM, Read-On lyMemory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0126] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.
Claims
1. An online document data collaboration method, characterized in that: include: Receiving a data update instruction; wherein the data update instruction is sent by any client when there is an editing operation on the online document; Obtaining the target location carried in the data update instruction; Determine whether the target location is located in a data display area of an online document of any client; When the target location is located in the data display area of the first client, the data update instruction is sent to the first client, so that the first client updates the online document according to the data update instruction.
2. The online document data collaboration method according to claim 1, characterized in that: The method further comprises: When a new client is detected to participate in the collaboration of the online document, a coordinate object of the online document of the new client is initialized; wherein the coordinate object is a bidirectional linked list data composed of a plurality of nodes; Receive the data display area of the online document sent by the new client; The online document of the new client is updated according to the data display area.
3. The online document data collaboration method according to claim 2, characterized in that: The determining whether the target location is located in a data display area of an online document of any client includes: Traverse the coordinate objects of the data display areas of all clients; When the target position falls within the data display area of any client, determining that the current client is the first client; When the target position does not fall within the data display area of any client, it is determined that the current client is the second client.
4. The online document data collaboration method according to claim 1, characterized in that: After determining whether the target location is located in the data display area of the online document of any client, the method further includes: When it is detected that the data display area of the second client is updated, comparing the updated target data display area with the latest data of the online document; When it is detected that there is data to be updated in the target data display area, a data update instruction corresponding to the data to be updated is sent to the second client, so that the second client updates the online document according to the data update instruction.
5. The online document data collaboration method according to claim 1, characterized in that: Before receiving the data update instruction, the method further includes: Establishing a persistent connection with a client that enters an editing page of the online document; Obtain the latest data of the online document; The latest data is rendered into an online document of the client.
6. The online document data collaboration method according to claim 5, characterized in that: After establishing a persistent connection with the client that enters the editing page of the online document, the method further includes: After the long connection with the client is disconnected, the data display area information of the client is deleted.
7. An online document data collaboration device, characterized in that: include: A data update instruction receiving module, used to receive a data update instruction; wherein the data update instruction is sent by any client when there is an editing operation on the online document; A target position acquisition module, used to acquire the target position carried in the data update instruction; A determination module, used to determine whether the target location is located in a data display area of an online document of any client; The data update instruction sending module is used to send the data update instruction to the first client when the target position is located in the data display area of the first client, so that the first client updates the online document according to the data update instruction.
8. An online document data collaboration device, characterized in that: The method comprises a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the online document data collaboration method as claimed in any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the online document data collaboration method according to any one of claims 1 to 6.
10. A computer program product, characterized in that It comprises computer instructions, which, when executed by a processor, implement the online document data collaboration method as described in any one of claims 1 to 6.
