Document collaborative editing method and device, server and storage medium
By detecting the client connection status in the document collaborative editing system, comparing the differences between offline and online documents, and determining the final version of the document based on user feedback, the problem of content conflicts during document synchronization in multi-person collaboration is solved and the accuracy of document editing is improved. and integrity.
Patent Information
- Application Number
- CN202410694808.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-24
AI Technical Summary
In the process of multi-person collaborative document editing, when users synchronize the document after modifying it offline, the document may lose important modifications.
By detecting when the client connection is disconnected and reconnected, offline documents are saved, the latest version of the document is obtained, offline and online differences are compared, conflicting parts are marked, and the final version of the document is determined based on user feedback to avoid content conflicts.
It improves the accuracy of document collaborative editing, avoids the loss of modified content, and ensures document integrity when multiple people collaborate.
Smart Images

Figure CN118690727A
Abstract
Description
Technical Field
[0001] The present application relates to the field of document processing technology, and in particular to a method, device, server and storage medium for collaborative document editing. Background Art
[0002] Modern enterprises are all operated based on the team collaboration mode. In the process of team collaboration, document sharing and modification are very important. The use of documents runs through all aspects of the enterprise. In this process, document modification is inevitable, and sometimes even multiple people modify the same document at the same time.
[0003] When multiple people modify the same document, if communication is not timely or the operation is not careful, users can easily change the content modified by their colleagues, resulting in the loss of important changes in the document. In addition, when using the document, users may make offline changes in places without network, and then summarize them at the end. However, in this process, the content modified by different users may conflict, causing problems in document synchronization, and may also cause the document to lose important changes.
[0004] Therefore, how to solve the problem that after users modify documents offline, important changes may be lost during synchronization. Summary of the invention
[0005] The embodiments of the present application provide a method, device, server and storage medium for collaborative document editing, which are used to solve the problem of conflicts between documents uploaded by a user client after going offline and documents edited online, and improve the accuracy of collaborative document editing.
[0006] In a first aspect, the present application provides a method for collaboratively editing a document, applied to a server, the method comprising:
[0007] When detecting that the first client is disconnected, saving the first document at the time when the first client is disconnected;
[0008] When it is detected that the first client has established a connection, receiving a second document sent by the first client, and acquiring a third document of the latest current version;
[0009] Acquire offline difference content between the second document and the first document, and online difference content between the first document and the third document;
[0010] Identify whether the offline difference content and the online difference content are modified in the same minimum unit, where the minimum unit in a table is a cell and the minimum unit in a text content is a paragraph;
[0011] If the offline difference content and the online difference content are modified in the same minimum unit, then on the basis of the third document, the offline difference content and the online difference content in the same minimum unit are marked with different colors respectively, and the first user identifier corresponding to the offline difference content and the second user identifier corresponding to the online difference content in the same minimum unit are marked, to obtain a fourth document;
[0012] Sending the fourth document to the first client and a second client corresponding to the second user identifier;
[0013] The final version of the document is determined according to the modification results fed back by the first client and / or the second client, where the modification results are used to indicate acceptance of the content modified by the first user identifier or acceptance of the content modified by the second user identifier.
[0014] Optionally, determining the final version of the document according to the modified content fed back by the first client and / or the second client includes:
[0015] If only the first modification result fed back by the first client is received within a preset time period after sending the fourth document, determining the final version of the document according to the first modification result;
[0016] If only the second modification result fed back by the second client is received within a preset time period after sending the fourth document, determining the final version of the document according to the second modification result;
[0017] If a first modification result fed back by the first client and a second modification result fed back by the second client are received within a preset time period after sending the fourth document, determining whether the first modification result and the second modification result are the same;
[0018] If the first modification result and the second modification result are the same, determining the final version of the document according to the first modification result;
[0019] If the first modification result is different from the second modification result, an online modification service is provided to the first client and the second client based on the fourth document to determine the final version of the document.
[0020] Optionally, the method further includes:
[0021] When determining the final version of the document, determining whether the third document is updated;
[0022] If the third document is updated, an updated final version document is generated according to the updated third document and the final version document.
[0023] Optionally, the method further includes:
[0024] Upon receiving a save operation instruction for the current document from any user, the current document is backed up and saved. The backup save name of the current document is determined based on the hash value of the original document, the save date, and the user identifier of the user who saves the current document. The hash value of the original document is generated by a hash algorithm based on the content and creation time of the original document.
[0025] Optionally, the method further includes:
[0026] Receiving a permission modification instruction sent by a client of an administrator, the permission modification instruction includes a minimum unit identifier and a usage permission corresponding to the minimum unit identifier, the usage permission includes at least one of the following permissions: read-only permission, read-write permission, open time permission, and device permission;
[0027] The usage permission of the minimum unit corresponding to the minimum unit identifier is set according to the permission modification instruction.
[0028] Optionally, if the usage permission corresponding to the minimum unit identifier in the permission modification instruction includes an opening time permission, the method further includes:
[0029] Get the current time;
[0030] If the current time exceeds the opening time of the minimum unit, the minimum unit that exceeds the opening time will be hidden, and the hiding process is used to prevent the user from viewing the hidden minimum unit.
[0031] Optionally, the method further includes:
[0032] The user ID that writes the smallest unit of content is associated at a preset location in any document.
[0033] In a second aspect, the present application further provides a device for collaboratively editing a document, the device comprising:
[0034] An offline saving module, configured to save the first document of the first client when the first client is disconnected, when detecting that the first client is disconnected;
[0035] A receiving module, configured to receive a second document sent by the first client and obtain a third document of the latest version when it is detected that the first client has established a connection;
[0036] An acquisition module, configured to acquire offline difference content between the second document and the first document, and acquire online difference content between the first document and the third document;
[0037] A judgment module, used for judging whether the offline difference content and the online difference content are modified in the same minimum unit, wherein the minimum unit in a table is a cell as the minimum unit, and the minimum unit in a text content is a paragraph as the minimum unit;
[0038] an identification generating module, configured to mark the offline difference content and the online difference content in the same minimum unit with different colors respectively, and mark the first user identification of the offline difference content and the second user identification corresponding to the online difference content in the same minimum unit, based on the third document, if the offline difference content and the online difference content are modified in the same minimum unit, to obtain a fourth document;
[0039] A file transmission module, used for sending the fourth document to the first client and the second client corresponding to the second user identifier;
[0040] A determination module is used to determine a final version of the document according to the modification results fed back by the first client and / or the second client, wherein the modification results are used to indicate acceptance of the content modified by the first user identifier or acceptance of the content modified by the second user identifier.
[0041] In a third aspect, the present application further provides a server, including: a memory, a processor;
[0042] The memory stores computer-executable instructions;
[0043] The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method as described in any one of the first aspects.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and when the computer-executable instructions are executed by a processor, they are used to implement the method as described in any one of the first aspects.
[0045] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the method described in any one of the first aspects above.
[0046] The method, device, server and storage medium for collaborative document editing provided by the embodiment of the present application include: when detecting that the first client is disconnected, saving the first document when the first client is disconnected; when detecting that the first client is connected, receiving the second document sent by the first client, and obtaining the latest version of the third document; obtaining the offline difference content of the second document and the first document, and the online difference content of the first document and the third document; identifying whether the offline difference content and the online difference content are modified in the same minimum unit; if the offline difference content and the online difference content are modified in the same minimum unit, then based on the third document, the offline difference content and the online difference content in the same minimum unit are marked with different colors respectively, and the first user identifier corresponding to the offline difference content and the second user identifier corresponding to the online difference content in the same minimum unit are marked to obtain a fourth document; sending the fourth document to the first client and the second client; determining the final version of the document according to the modification results fed back by the first client and / or the second client. Through this method, the problem of loss of modified content caused by the conflict between the modified content and the online modified content when the user client modifies the document offline can be avoided, and the accuracy of collaborative document editing can be improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0048] Figure 1 A schematic diagram of a scenario of a method for collaborative document editing provided in this application;
[0049] Figure 2 Schematic diagram of the process of collaborative editing of documents provided in this application Figure 1 ;
[0050] Figure 3 Schematic diagram of the process of collaborative editing of documents provided in this application Figure 2 ;
[0051] Figure 4 Schematic diagram of the structure of the document collaborative editing device provided by this application Figure 1 ;
[0052] Figure 5 A schematic diagram of the structure of the electronic device provided in this application.
[0053] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0054] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0055] First, the terms involved in this application are explained:
[0056] Shared documents: Modern enterprises all operate based on team collaboration mode. During the team collaboration process, the same document modified by multiple people is called a shared document.
[0057] The sharing and modification of documents is very important. Documents are used throughout all aspects of an enterprise, such as plan making and review. In this process, document modification is inevitable, and sometimes multiple people modify the same document at the same time.
[0058] Figure 1 A schematic diagram of a scenario of a method for collaborative document editing provided by this application, such as Figure 1 As shown, in the specific application scenario of the present application, multiple users edit shared documents through the client in the terminal device, the cloud server provides services for each client, the server establishes a connection with each client, receives the documents updated by each client, and updates the shared documents in real time.
[0059] In the above Figure 1 In the scenario of , when a user is editing a shared document, he may not be connected to the Internet and cannot update it online, but other colleagues may update the shared document online. In this way, when the user goes online from offline, the uploaded document content may conflict with the document content edited by other users. In the prior art, the latest document content is usually sent based on the time sequence, and the previous content is overwritten. This may cause the document to lose important modified content during synchronization.
[0060] In view of this, the present application provides a method for collaborative document editing, which saves the current document when the user client is offline. When the user client is online again, the shared document is not updated directly, but the user's modification content is first determined. Then the modification content of the shared document by other users is determined. When the modification content of the two users does not conflict, the final document is directly generated. When the content of the two users conflicts, a notification message is sent to the user client of the conflicting content, and the final document is determined according to the modification results fed back by the user.
[0061] It should be noted that the method, device, server and storage medium for collaborative document editing of the present application can be used in the document processing field, and can also be used in any field other than the document processing field. The application field of the method, device, server and storage medium for collaborative document editing of the present application is not limited.
[0062] The following takes the execution subject as a cloud server as an example, and describes in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0063] Figure 2 Schematic diagram of the process of collaborative editing of documents provided in this application Figure 1 ,like Figure 2 As shown, the method includes:
[0064] S101. When it is detected that a first client is disconnected, a first document at the time when the first client is disconnected is saved.
[0065] In this step, when the server detects that any client (ie, the first client) is disconnected from it, the server records the current time as the disconnection time and suspends communication with the client. At the same time, the server saves the current status and version information of the shared document, ie, the first document.
[0066] S102: When it is detected that the first client has established a connection, a second document sent by the first client is received, and the latest version of a third document is obtained.
[0067] In this step, after the first client is disconnected, other users' clients may operate on the shared document and modify the content in the shared document. Therefore, once the first client reconnects to the server, the server will immediately respond and receive the connection request from the first client. The server will first check whether other users have modified the shared document during the disconnection period. If so, the server will obtain the latest document version, that is, the third document.
[0068] S103: Obtain offline difference content between the second document and the first document, and online difference content between the first document and the third document.
[0069] In this step, the second document is compared with the first document to find the differences between the two documents. In one implementation, this is achieved by using a string comparison algorithm (e.g., a line-based or sentence-based comparison algorithm). The algorithm will identify the newly added, deleted or modified parts and record the corresponding locations and contents.
[0070] Compare the first document with the third document to identify the differences between the two documents. Since this is an online comparison, a more efficient incremental comparison algorithm (such as a differential algorithm or a tree-based algorithm) can be used. Similarly, the algorithm will identify the newly added, deleted or modified parts and record the corresponding location and content.
[0071] S104: Identify whether the offline difference content and the online difference content are modified in the same minimum unit, where a cell is used as the minimum unit in a table and a paragraph is used as the minimum unit in text content.
[0072] In this step, the shared document can be in Word, Excel, TXT and other formats. When the shared document is a table (such as an Excel document), the cell is defined as the smallest unit. When the shared document is text content, the paragraph is defined as the smallest unit. Determine whether there are modifications in the same smallest unit by comparing the location and content of the differences. When comparing differences, if it is found that the offline difference content and the online difference content have modifications in the same smallest unit, it will be marked as a conflict.
[0073] For example, in an Excel document, for a cell summarizing the amount of consumption, the first client fills in the cell content when offline, and the user in the online client also fills in the cell. Therefore, both the offline difference content and the online difference content are modified in the cell summarizing the amount of consumption, and at this time, the shared document is unclear which content to take as the standard.
[0074] Optionally, if the offline difference content and the online difference content are the same in the same minimum unit, the current document is modified with either content. Exemplarily, if both the offline difference content and the online difference content are modified in a cell of the consumption amount summary and are the same, the cell is modified with either content.
[0075] S105. If the offline difference content and the online difference content are modified in the same minimum unit, then on the basis of the third document, the offline difference content and the online difference content in the same minimum unit are marked with different colors respectively, and the first user identifier corresponding to the offline difference content and the second user identifier corresponding to the online difference content in the same minimum unit are marked to obtain a fourth document.
[0076] In this step, if the offline difference content and the online difference content are modified in the same minimum unit, the content in the minimum unit is defined as conflicting content, and the two difference contents are displayed in the minimum unit of the third document and marked with different colors. The differences between the two can be modified separately through the revision mode. The parts where there is no conflict between the offline difference content and the online difference content are updated in the corresponding minimum unit of the third document to obtain the fourth document.
[0077] The user ID who wrote the content is marked at each difference content. In one implementation, each difference content is annotated, and the user ID is displayed in the annotation. In another implementation, the user ID is added to the text after each difference content. The user ID can be in brackets or in a different font from the difference content to distinguish the difference content.
[0078] It should be noted that the content written by users in a shared document has an associated user ID in a preset position in any document, that is, the author of each content is marked. The preset position can be the right side of the document, for example, in the form of an annotation. In a table, the preset position can be the upper right corner of the table, marking the user ID.
[0079] S106: Send the fourth document to the first client and the second client corresponding to the second user identifier.
[0080] In this step, the IP address of the first client is determined according to the first user identifier of the offline difference content, and the fourth document is sent to the first client. The IP address of the second client is determined according to the second user identifier of the online difference content, and the fourth document is sent to the second client.
[0081] S107: Determine a final version of the document according to the modification result fed back by the first client and / or the second client, where the modification result is used to indicate acceptance of the content modified by the first user identifier or acceptance of the content modified by the second user identifier.
[0082] In this solution, the first client and the second client receive the fourth document sent by the server, display the fourth document, and the user can view the conflicting content. The users of the first client and the second client can determine which modification method to adopt through offline negotiation, or choose which modification to accept according to their own wishes, and can operate in a way of receiving revisions. The first client and / or the second client sends the received revised fourth document (i.e., the modification result) to the server.
[0083] The server receives the modification results fed back by the first client and / or the second client, and determines a final version of the document according to the modification results.
[0084] There are several situations that may occur in this step:
[0085] In the first case, within the preset time period of sending the fourth document, only the modification result fed back by the first client is received, and the document based on the modification result fed back by the first client is used as the final version of the document. The modification result fed back by the first client is the document formed after the first user receives the revision based on the fourth document. The preset time period can be set as required, and can be set to 1 hour, half an hour, or ten minutes, and there is no restriction here.
[0086] In the second case, within the preset time period of sending the fourth document, only the modification result fed back by the second client is received, and the document based on the modification result fed back by the second client is used as the final version of the document. The modification result fed back by the second client is the document formed after the second user receives the revision based on the fourth document. The preset time period can be set as required, and can be set to 1 hour, half an hour, or ten minutes, without limitation.
[0087] In the third case, within the preset time period of sending the fourth document, the modification results fed back by the first client and the modification results fed back by the second client are received. It is necessary to determine whether the modification results fed back by the first client and the modification results fed back by the second client are the same. If the results fed back by the two are the same (i.e., the same revision is received), the document with any modification results fed back by the two is used as the final version of the document. If the results fed back by the two are not the same, an online modification service is provided to the first client and the second client based on the fourth document. In the online modification service, the users of the first client and the second client can see the content modified by the other party, and the same document that is no longer modified by both parties and clicked to be saved is used as the final version of the document.
[0088] This embodiment provides a method for collaborative document editing, the method comprising: when it is detected that the first client is disconnected, saving the first document at the time when the first client is disconnected; when it is detected that the first client is connected, receiving the second document sent by the first client, and obtaining the latest version of the third document; obtaining the offline difference content between the second document and the first document, and the online difference content between the first document and the third document; identifying whether the offline difference content and the online difference content are modified in the same minimum unit; if the offline difference content and the online difference content are modified in the same minimum unit, then based on the third document, marking the offline difference content and the online difference content in the same minimum unit with different colors, and marking the first user identifier corresponding to the offline difference content and the second user identifier corresponding to the online difference content in the same minimum unit, to obtain a fourth document; sending the fourth document to the first client and the second client; determining the final version of the document according to the modification results fed back by the first client and / or the second client. Through this method, the problem of loss of modified content caused by the conflict between the modified content and the online modified content when the user client modifies the document offline can be avoided, and the accuracy of collaborative document editing can be improved.
[0089] It should be noted that the above embodiment only introduces a method when the content modified by the user offline only conflicts with the content of the second user. Similarly, when there is a conflict with the content modified by multiple user identifiers, the above fourth document is sent to the clients corresponding to the multiple user identifiers, and the final version of the document is determined based on the modification results fed back by the clients corresponding to the multiple user identifiers.
[0090] Based on the above embodiment 1, the server sends the fourth document to the first client and the second client, and receives the modification result within a preset time period. During this time period, the shared document may be modified or written by other users based on the third document. Therefore, the following steps are required:
[0091] S108: When determining the final version of the document, determine whether the third document is updated.
[0092] In this step, according to the above method for determining the final version of the document, the final version of the document is saved, and the latest document is obtained to determine whether it is the same as the third document. If it is the same, it means that there is no update, and the final version of the document is used as the latest version of the shared document. If the latest document is different from the third document, it means that a user has updated it during the time of determining the final version of the document, and S109 is executed.
[0093] S109: If the third document is updated, generate an updated final version document according to the updated third document and the final version document.
[0094] In this step, the difference between the updated third document and the third document is obtained. According to the specific situation of the difference, it is merged and updated into the final version document to obtain the updated final version document, and the updated final version document is used as the latest version of the shared document.
[0095] By using this method, when determining the conflicting content of offline modifications, the loss of modifications to existing documents can be avoided.
[0096] In this solution, each document in the server has a unique identifier, and users can use the identifier to obtain documents saved by others or documents saved by themselves. When the user who created the document saves the document, the initial name of the document is a string of characters generated by a hash algorithm based on the original content and creation time of the document as the name of the original document. The document unique identifier is also used to share files across devices. The terminal can obtain the same file located on other terminals through the document unique identifier. The document identifier can only be seen by the administrator, and other readable users can obtain the entire document through the identifier. Different terminals also pull documents from the server through the identifier; if the document is modified and different versions exist, the version flag of the document will be assigned different dates or notes to distinguish different versions.
[0097] Specifically, during the modification process of a shared document, the user can save it at any time. In response to the user's save operation, the client sends a save instruction to the server. Therefore, when the server receives a save operation instruction from any user for the current document, it backs up and saves the current document. The backup save name of the current document is determined based on the hash value of the original document, the save date, and the user ID who saves the current document. The hash value of the original document is generated by a hash algorithm based on the content and creation time of the original document.
[0098] Since the document may be viewed and modified by multiple people, there may be multiple modifications. The system will record the time and person who modified each modification, and reflect it in the document name. In one possible implementation, user modification records are saved in the smallest unit, that is, each modification unit is saved after the modification is completed. Users can also customize backup rules, such as specifying the save time interval and the maximum save time, or manually save without specifying a time. When the user logs in to the system, he can see all the modified versions, modification time and modification author in the history record function. Users can restore historical versions as needed. The modification records of different terminals are saved on the server side, and each terminal can also view the historical modification versions of all terminals.
[0099] Each document has a unique identifier, which can be used to easily retrieve the document, whether it is shared on the same device or across devices. This makes document access and sharing easier and more efficient. By assigning different dates or notes to the version flag of the document, different versions of the document can be easily distinguished. In this way, users can easily find and restore to a specific previous version, avoiding the impact of accidental modifications or misoperations on the document.
[0100] Figure 3 Schematic diagram of the process of collaborative editing of documents provided in this application Figure 2 ,like Figure 3 As shown, the method includes:
[0101] S201. Receive a permission modification instruction sent by an administrator's client, where the permission modification instruction includes a minimum unit identifier and usage permissions corresponding to the minimum unit identifier, where the usage permissions include at least one of the following permissions: read-only permission, read-write permission, open time permission, and device permission.
[0102] In this step, for the original document, when the document is created, the administrator sets the usage permissions of each minimum unit. The administrator can also modify the usage permissions of the minimum unit during the use of the shared document.
[0103] The server needs to listen to the permission modification instructions from the administrator client, which include the name of the document to be modified, the smallest unit identifier in the document, and the usage permission corresponding to the smallest identifier. Parse and verify the instructions sent by the client to ensure that the format is correct and the permissions are valid, and extract the smallest unit identifier and the corresponding usage permission from the received instructions.
[0104] Read-only permissions allow users to view the smallest unit content but not edit or modify it. This is suitable for scenarios where data integrity or security needs to be protected, such as confidential documents and financial statements. Read-only permissions can prevent users from making mistakes or accidentally modifying data, and can also prevent malicious software from causing damage.
[0105] Through read and write permissions: users are allowed to edit or modify the smallest unit. This permission is suitable for users who need to modify, update, supplement, and other operations on the smallest unit while keeping the data relatively stable. For example, in an open document library, some documents may only be allowed to be edited, but not deleted or added.
[0106] Open time permissions: You can control whether the smallest unit is visible or editable during a specified time period. This permission is suitable for publishing or restricting access to certain documents or information during a specific time. For example, a company's annual report may only be made public around the end of the year, and will be hidden or presented in read-only mode at other times.
[0107] Device permissions: You can control which devices can access the smallest unit. This permission is suitable for scenarios where you need to restrict access to specific devices or networks. For example, the company's internal network database is only accessible in the company's internal network environment, and is not allowed to be accessed on public networks or unauthorized devices. You can also set it to only allow computer clients to log in, but not mobile clients to log in.
[0108] S202: Set the usage permission of the minimum unit corresponding to the minimum unit identifier according to the permission modification instruction.
[0109] In this step, the corresponding minimum unit (paragraph, cell, etc.) is found in the document according to the minimum unit identifier, the use permission of the minimum unit is set to the permission specified by the administrator, and the permission information of the minimum unit in the system is updated.
[0110] If the minimum unit usage permission is set with an opening time permission, steps S203 - S204 also need to be performed.
[0111] S203: Get the current time.
[0112] Get the current date and time information in the system.
[0113] S204: If the current time exceeds the opening time of the minimum unit, the minimum unit that exceeds the opening time is hidden, and the hiding process is used to prevent the user from viewing the hidden minimum unit.
[0114] Compare the current time with the opening time of the minimum unit to determine whether the opening time has been exceeded. The minimum unit that has exceeded the opening time can be hidden so that users cannot view or access the hidden minimum unit. The hiding process can be achieved by modifying the properties, permissions or status of the minimum unit. The specific implementation method depends on the system architecture and design.
[0115] If the smallest unit is a cell, you can hide the cell by the following operations: select the cell you want to hide, right-click the cell, and then select "Format Cells", switch to the "Number" or "Alignment" tab in the pop-up dialog box, check "Hide Value" in the "Custom" category, and then click "OK" to hide the value in the cell. If it is a column or a row, select the row or column you want to hide, right-click the row number or column number, and then select "Hide".
[0116] If the smallest unit is a paragraph, you can hide a paragraph by doing the following: Select the paragraph text you want to hide. In the Font group on the Home tab, click the Font dialog box launcher (located in the lower right corner), and switch to the Font tab in the dialog box that opens. In the Effects section, check the Hide checkbox, and then click OK to hide the selected paragraph text.
[0117] The above hiding operation is performed by the server, and the administrator only needs to send the minimum unit identifier to be hidden. Of course, the administrator's client can also process the shared document locally, modify the permissions and send the document to the server.
[0118] If the usage permission of the smallest unit is set with device permission and is set to be accessible only through the company's intranet, a specific embodiment is described below.
[0119] The company has a server running a web application that provides an online table editing service. The company hopes that only employees in the company's internal network environment can access and edit specific cells. In this case, the server can detect whether the client meets the permission requirements in the following ways:
[0120] The server is configured with firewall rules to only allow requests from the company's intranet IP address range. When an employee accesses the online form on the company's intranet, their request will be allowed through the firewall. The firewall setting can only satisfy the permission control of the entire document to prevent devices on the external network from being inaccessible.
[0121] The server requires employees who access the online form to authenticate themselves. Employees need to provide the company's unified authentication credentials, such as username and password. Only employees who pass the authentication can access and edit the form. Authentication and authorization are required for employees who need to access protected cells. Accounts and passwords can be created for these employees and authenticated when they log in. At the same time, the server will authorize employees to access and edit which protected cells based on their permission settings. This prevents unauthorized people from accessing and modifying protected cells. This allows different parts of the document to be authorized separately.
[0122] Based on the above measures, when a client initiates an access request, the server can combine IP address filtering, identity authentication and other means to detect whether the client meets the permission requirements. Only clients that meet the permission requirements can successfully access and edit specific cells, thereby ensuring the security and confidentiality of data.
[0123] In addition, users can link their computer accounts with mobile accounts to achieve wireless automatic transmission between different terminals. You can view the content modified on another terminal on the terminal without manual transmission, which avoids the inconvenience caused by leaving the device behind and enables multiple device terminals to automatically align document content without manual operation. Users can customize the document font, bold, highlight and other formats. The modified content will be marked with the author next to it for other users to read.
[0124] Figure 4 Schematic diagram of the structure of the document collaborative editing device provided by this application Figure 1 ,like Figure 3 , the document collaborative editing device 400 includes:
[0125] The offline saving module 411 is used to save the first document of the first client when the first client is disconnected when it is detected that the first client is disconnected;
[0126] The receiving module 412 is configured to receive the second document sent by the first client and obtain the latest version of the third document when it is detected that the first client has established a connection.
[0127] An acquisition module 413 is used to acquire offline difference content between the second document and the first document, and acquire online difference content between the first document and the third document;
[0128] A determination module 414 is used to determine whether the offline difference content and the online difference content are modified in the same minimum unit, where the minimum unit in a table is a cell and the minimum unit in a text content is a paragraph;
[0129] The identification generating module 415 is used for marking the contents of the offline difference content and the online difference content in the same minimum unit with different colors respectively based on the third document if the offline difference content and the online difference content are modified in the same minimum unit, and marking the first user identification of the offline difference content and the second user identification corresponding to the online difference content in the same minimum unit, so as to obtain a fourth document;
[0130] A file transmission module 416, configured to send the fourth document to the first client and a second client corresponding to the second user identifier;
[0131] The determination module 417 is used to determine the final version of the document according to the modification result fed back by the first client and / or the second client, wherein the modification result is used to indicate acceptance of the content modified by the first user identifier or acceptance of the content modified by the second user identifier.
[0132] Optionally, the determining module 417 is specifically configured to:
[0133] If only the first modification result fed back by the first client is received within a preset time period after sending the fourth document, determining the final version of the document according to the first modification result;
[0134] If only the second modification result fed back by the second client is received within a preset time period after sending the fourth document, determining the final version of the document according to the second modification result;
[0135] If a first modification result fed back by the first client and a second modification result fed back by the second client are received within a preset time period after sending the fourth document, determining whether the first modification result and the second modification result are the same;
[0136] If the first modification result and the second modification result are the same, determining the final version of the document according to the first modification result;
[0137] If the first modification result is different from the second modification result, an online modification service is provided to the first client and the second client based on the fourth document to determine the final version of the document.
[0138] Optionally, the determining module 417 is further configured to:
[0139] When determining the final version of the document, determining whether the third document is updated;
[0140] If the third document is updated, an updated final version document is generated according to the updated third document and the final version document.
[0141] Optionally, the device further includes a backup module 418;
[0142] The backup module 418 is used to receive a save operation instruction for the current document from any user, back up and save the current document, and the backup save name of the current document is determined based on the hash value of the original document, the save date, and the user identifier of the user who saves the current document. The hash value of the original document is generated by a hash algorithm based on the content and creation time of the original document.
[0143] Optionally, the device further includes a permission division module 419:
[0144] The permission division module 419 is used to receive a permission modification instruction sent by the administrator's client, wherein the permission modification instruction includes a minimum unit identifier and a usage permission corresponding to the minimum unit identifier, wherein the usage permission includes at least one of the following permissions: read-only permission, read-write permission, open time permission, and device permission;
[0145] The usage permission of the minimum unit corresponding to the minimum unit identifier is set according to the permission modification instruction.
[0146] Optionally, the authority division module 419 is further used to:
[0147] Get the current time;
[0148] If the current time exceeds the opening time of the minimum unit, the minimum unit that exceeds the opening time will be hidden, and the hiding process is used to prevent the user from viewing the hidden minimum unit.
[0149] Optionally, the identification generating module 315 is further used for:
[0150] The user ID that writes the smallest unit of content is associated at a preset location in any document.
[0151] The document collaborative editing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effects are similar, and are not described in detail in this embodiment.
[0152] Figure 5 This is a schematic diagram of the structure of the electronic device provided in this application. The electronic device may be a server. Figure 5 As shown, the electronic device 50 provided in this embodiment includes: at least one processor 501 and a memory 502. Optionally, the device 50 also includes a communication component 503. The processor 501, the memory 502 and the communication component 503 are connected via a bus 504.
[0153] In a specific implementation process, at least one processor 501 executes the computer-executable instructions stored in the memory 502, so that at least one processor 501 executes the above method.
[0154] The specific implementation process of the processor 501 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.
[0155] In the above embodiments, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.
[0156] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (Non-volatile Memory, NVM), such as at least one disk memory.
[0157] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.
[0158] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.
[0159] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.
[0160] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0161] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.
[0162] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.
[0163] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0164] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0165] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0166] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.
[0167] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.
Claims
1. A method for collaborative document editing, characterized in that: Applied to a server, the method comprises: When detecting that the first client is disconnected, saving the first document at the time when the first client is disconnected; When it is detected that the first client has established a connection, receiving a second document sent by the first client, and acquiring a third document of the latest current version; Acquire offline difference content between the second document and the first document, and online difference content between the first document and the third document; Identify whether the offline difference content and the online difference content are modified in the same minimum unit, where the minimum unit in a table is a cell and the minimum unit in a text content is a paragraph; If the offline difference content and the online difference content are modified in the same minimum unit, then on the basis of the third document, the offline difference content and the online difference content in the same minimum unit are marked with different colors respectively, and the first user identifier corresponding to the offline difference content and the second user identifier corresponding to the online difference content in the same minimum unit are marked, to obtain a fourth document; Sending the fourth document to the first client and a second client corresponding to the second user identifier; The final version of the document is determined according to the modification results fed back by the first client and / or the second client, where the modification results are used to indicate acceptance of the content modified by the first user identifier or acceptance of the content modified by the second user identifier.
2. The method according to claim 1, characterized in that Determining the final version of the document according to the modified content fed back by the first client and / or the second client includes: If only the first modification result fed back by the first client is received within a preset time period after sending the fourth document, determining the final version of the document according to the first modification result; If only the second modification result fed back by the second client is received within a preset time period after sending the fourth document, determining the final version of the document according to the second modification result; If a first modification result fed back by the first client and a second modification result fed back by the second client are received within a preset time period after sending the fourth document, determining whether the first modification result and the second modification result are the same; If the first modification result and the second modification result are the same, determining the final version of the document according to the first modification result; If the first modification result is different from the second modification result, an online modification service is provided to the first client and the second client based on the fourth document to determine the final version of the document.
3. The method according to claim 2, characterized in that The method further comprises: When determining the final version of the document, determining whether the third document is updated; If the third document is updated, an updated final version document is generated according to the updated third document and the final version document.
4. The method according to claim 1 or 2, characterized in that: The method further comprises: Upon receiving a save operation instruction for the current document from any user, the current document is backed up and saved. The backup save name of the current document is determined based on the hash value of the original document, the save date, and the user identifier of the user who saves the current document. The hash value of the original document is generated by a hash algorithm based on the content and creation time of the original document.
5. The method according to claim 1 or 2, characterized in that: The method further comprises: Receiving a permission modification instruction sent by a client of an administrator, the permission modification instruction includes a minimum unit identifier and a usage permission corresponding to the minimum unit identifier, the usage permission includes at least one of the following permissions: read-only permission, read-write permission, open time permission, and device permission; The usage permission of the minimum unit corresponding to the minimum unit identifier is set according to the permission modification instruction.
6. The method according to claim 5, characterized in that If the usage permission corresponding to the minimum unit identifier in the permission modification instruction includes an opening time permission, the method further includes: Get the current time; If the current time exceeds the opening time of the minimum unit, the minimum unit that exceeds the opening time will be hidden, and the hiding process is used to prevent the user from viewing the hidden minimum unit.
7. The method according to claim 1 or 2, characterized in that: The method further comprises: The user ID that writes the smallest unit of content is associated at a preset location in any document.
8. A device for collaborative document editing, characterized in that: The device comprises: An offline saving module, configured to save the first document of the first client when the first client is disconnected, when detecting that the first client is disconnected; A receiving module, configured to receive a second document sent by the first client and obtain a third document of the latest version when it is detected that the first client has established a connection; An acquisition module, configured to acquire offline difference content between the second document and the first document, and acquire online difference content between the first document and the third document; A judgment module, used for judging whether the offline difference content and the online difference content are modified in the same minimum unit, wherein the minimum unit in a table is a cell as the minimum unit, and the minimum unit in a text content is a paragraph as the minimum unit; an identification generating module, configured to mark the offline difference content and the online difference content in the same minimum unit with different colors respectively, and mark the first user identification of the offline difference content and the second user identification corresponding to the online difference content in the same minimum unit, based on the third document, if the offline difference content and the online difference content are modified in the same minimum unit, to obtain a fourth document; A file transmission module, used for sending the fourth document to the first client and the second client corresponding to the second user identifier; A determination module is used to determine a final version of the document according to the modification results fed back by the first client and / or the second client, wherein the modification results are used to indicate acceptance of the content modified by the first user identifier or acceptance of the content modified by the second user identifier.
9. A server, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.
Citation Information
Cited By
Online PPT content synchronization method, electronic equipment, medium and product
CN120353420A
GMP electronic document management system EDMS and implementation method
CN121051287A
