Document collaborative editing method and device, storage medium and electronic equipment
By using the proxy process in the document service to manage the document operation process, the problem of resource competition caused by a single process is solved, the stability and efficiency of document collaborative editing are improved, and a collaborative editing experience of multi-client secure editing is realized.
Patent Information
- Application Number
- CN202410815422.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-24
- Publication Date
- 2024-09-10
AI Technical Summary
In the existing technology, a single process is used to provide the client with the document collaborative editing function, which can easily lead to resource competition between multiple clients, process crashes, and affect the stability of collaborative editing.
By using a proxy process in the document service, it is determined whether the target document operation process is occupied by other clients, and the process information is fed back when it is not occupied, so that the target client can access and edit documents based on the process information, avoiding resource competition and process crashes.
It improves the stability of document collaborative editing, prevents incorrect overwriting of document content caused by simultaneous editing by multiple clients, and achieves a more efficient collaborative editing experience.
Smart Images

Figure CN118627474A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document processing, and in particular to a method, device, storage medium and electronic device for collaboratively editing a document. Background Art
[0002] With the gradual advancement of enterprise information office construction, enterprise document editing has become more and more frequent, and management requirements have become higher and higher. First, the display of enterprise documents needs to be universal to avoid format deviation problems caused by different software. Secondly, enterprises require employees to participate in remote work more frequently, requiring enterprise document editing and collaboration functions to have higher geographical flexibility and responsiveness. Furthermore, efficient information office often requires multiple users to work on a document at the same time, view each other's editing content in real time, reduce version conflicts and communication costs, and accelerate the decision-making process and project progress. Therefore, the stability of document collaborative editing is very important.
[0003] Currently, in the related technology, a single process is usually used to provide the document collaborative editing function to the client and solve the resource competition among multiple clients, which makes the process prone to crash and affects the stability of collaborative editing.
[0004] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method, device, storage medium and electronic device for collaborative document editing, so as to at least solve the technical problems in the related art of providing document collaborative editing function to clients through a single process and solving resource competition among multiple clients, which makes the process easy to crash and affects the stability of collaborative editing.
[0006] According to one aspect of an embodiment of the present invention, a method for collaborative document editing is provided, comprising: receiving a first request sent by a target client, wherein the first request is used to request editing of a target document; determining, through a proxy process in a document service, a target document operation process corresponding to the target document requested in the first request, and judging whether the target document operation process is occupied by other clients, wherein the other clients refer to clients other than the target client; in a case where the target document operation process is not occupied by other clients, feeding back process information of the target document operation process to the target client through the proxy process, so that the target client accesses the target document operation process based on the process information, and collaboratively edits the target document through the target document operation process.
[0007] Furthermore, the method for collaborative document editing also includes: after determining whether the target document operation process is occupied by other clients, if the target document operation process is occupied by other clients, waiting through the proxy process for the target document operation process to be released by other clients; and if it is detected that the target document operation process is released by other clients, feeding back process information of the target document operation process to the target client through the proxy process.
[0008] Furthermore, the method for collaborative document editing also includes: before determining the target document operation process corresponding to the target document requested in the first request through the proxy process in the document service, determining whether there is a proxy process in the document service; if no proxy process exists, creating a target document operation process and a proxy process; obtaining the content of the target document from a third-party service through the target document operation process, wherein the third-party service is a service that stores the target document; and storing process information of the target document operation process through the proxy process.
[0009] Furthermore, the method for collaborative document editing also includes: extracting an access token from the first request, and generating a document acquisition request based on the access token and document information of the target document; sending the document acquisition request to a target proxy service, wherein the target proxy service determines whether the target document operation process has document acquisition permission based on the access token in the document acquisition request, and if the target document operation process has document acquisition permission, obtains the content of the target document from a third-party service, and sends the content of the target document to the target document operation process.
[0010] Furthermore, the method for collaborative document editing also includes: before receiving the first request sent by the target client, the target proxy service receives a document service session request sent by the target client, sends the client information in the document service session request to the third-party service, and generates an access token when receiving feedback from the third-party service that the target client has passed the authentication, and sends the access token and the uniform resource locator of the document service to the target client, wherein the third-party service authenticates the target client based on the client information.
[0011] Furthermore, the document collaborative editing method also includes: receiving a target request sent by a target client, wherein the target request is a first request or a second request, and the second request is used to request to view a target document; when the target request is a first request, determining that the first request sent by the target client is received.
[0012] Furthermore, the method for collaborative document editing also includes: after feeding back process information of the target document operation process to the target client through the proxy process, receiving a document editing request sent by the target client through the target document operation process; editing the content of the target document acquired by the target document operation process according to the document editing request through the target document operation process to obtain edited content; and when receiving a document save instruction sent by the target client, sending the edited content to a third-party service through the target document operation process.
[0013] According to another aspect of an embodiment of the present invention, a device for collaborative document editing is also provided, including: a receiving module, used to receive a first request sent by a target client, wherein the first request is used to request editing of a target document; a determining module, used to determine a target document operation process corresponding to the target document requested in the first request through a proxy process in a document service, and to determine whether the target document operation process is occupied by other clients, wherein other clients refer to clients other than the target client; a first processing module, used to feedback process information of the target document operation process to the target client through the proxy process when the target document operation process is not occupied by other clients, so that the target client can access the target document operation process based on the process information, and collaboratively edit the target document through the target document operation process.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned document collaborative editing method when running.
[0015] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes one or more processors; a memory for storing one or more programs, so that when the one or more programs are executed by the one or more processors, the one or more processors are implemented to run the programs, wherein the programs are configured to execute the above-mentioned document collaborative editing method when running.
[0016] In the embodiment of the present invention, in the collaborative editing process, different functions are provided through different processes. The first request sent by the target client is received, and then the target document operation process corresponding to the target document requested in the first request is determined through the proxy process in the document service, and it is determined whether the target document operation process is occupied by other clients. In this case, if the target document operation process is not occupied by other clients, the process information of the target document operation process is fed back to the target client through the proxy process, so that the target client can access the target document operation process based on the process information, and collaboratively edit the target document through the target document operation process. Among them, the first request is used to request editing of the target document, and other clients refer to clients other than the target client.
[0017] In the above process, the target document operation process corresponding to the target document requested in the first request is determined by the proxy process, and when the target document operation process is not occupied by other clients, the process information of the target document operation process is fed back to the target client, thereby resolving resource competition among multiple clients through the proxy process, avoiding the phenomenon that the document content may be erroneously overwritten due to multiple clients editing the document at the same time, setting the client to collaboratively edit the target document through the target document operation process, and providing the document collaborative editing function to the client through the target document operation process, thereby achieving the effect of providing different functions in collaborative editing through different processes and improving the stability of collaborative editing.
[0018] It can be seen that the solution provided by the present application achieves the purpose of providing different functions through different processes during the collaborative editing process, thereby realizing the technical effect of improving the stability of collaborative editing, and further solves the technical problems in the related technology of providing document collaborative editing functions to clients through a single process and solving resource competition among multiple clients, which makes the process prone to crash and affects the stability of collaborative editing. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0020] Figure 1 This is a flow chart of an optional method for collaborative document editing according to an embodiment of the present invention. Figure 1 ;
[0021] Figure 2 This is a flow chart of an optional method for collaborative document editing according to an embodiment of the present invention. Figure 2 ;
[0022] Figure 3This is a flow chart of an optional method for collaborative document editing according to an embodiment of the present invention. Figure 3 ;
[0023] Figure 4 It is an optional document collaborative editing device according to an embodiment of the present invention;
[0024] Figure 5 is a schematic diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings 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 should fall within the scope of protection of the present invention.
[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0027] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards in the relevant regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0028] Example 1
[0029] According to an embodiment of the present invention, an embodiment of a method for collaborative editing of a document is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0030] Figure 1 This is a flow chart of an optional method for collaborative document editing according to an embodiment of the present invention. Figure 1 ,like Figure 1 As shown, the method is applied to document service and includes the following steps:
[0031] Step S101: receiving a first request sent by a target client, wherein the first request is used to request editing of a target document.
[0032] In this embodiment, the document may be a Web (World Wide Web) document, the document service is used to support the operation of the Web document, and the target client sends a first request to the document service to request to open the Web document editing interface to edit the target document. The first request includes at least the document information of the target document and may also include an access token, wherein the access token is used to authenticate whether the identity of the target client is secure.
[0033] Optionally, the document service is a multi-process service, which may include a Web service main process (WSD), a document suite service process (ForKit), a proxy process (DocBroker), and a document operation process (Kit). The Web service main process is the main process of the document service, which is used to receive and manage client requests, create a proxy process, and request the document suite service process to create a document operation process. The document suite service process is used to load the LibreOffice suite library deployed locally on the server and provide various document functions of LibreOffice to the document operation process, so that each document operation process does not need to repeatedly load the LibreOffice library. In addition, the document suite service process can also manage the start and stop of the document operation process and create different document operation processes according to different documents. The document operation process corresponds to the document one-to-one. The document operation process can create a session process for editing and multi-user collaborative editing. The document operation process is connected to the client through the proxy process. The document operation process provides resource caching and editing updates in sandbox mode.
[0034] Optionally, the aforementioned first request may be received by a Web service main process in the document service.
[0035] Step S102, determining the target document operation process corresponding to the target document requested in the first request through the proxy process in the document service, and judging whether the target document operation process is occupied by other clients, wherein other clients refer to clients other than the target client.
[0036] Optionally, after the Web service main process receives the first request, the Web service main process forwards the first request to the proxy process. Documents correspond to document operation processes one by one, and the proxy process is preset with a correspondence between documents and document operation processes. The proxy process can determine the target document operation process corresponding to the target document based on the correspondence and the document information in the first request.
[0037] In order to avoid the situation where multiple users collaboratively edit the target document at the same time, which may cause the content in the target document to be erroneously overwritten, after determining the target document operation process, the proxy process can determine whether the target document operation process is occupied by other clients, so that the target document can only be edited by one user at the same time.
[0038] Step S103, when the target document operation process is not occupied by other clients, the process information of the target document operation process is fed back to the target client through the proxy process, so that the target client can access the target document operation process based on the process information and collaboratively edit the target document through the target document operation process.
[0039] Optionally, when the target document operation process is not occupied by other clients, it is determined that no other user is editing the target document at this moment. In this case, the proxy process can feed back the process information of the target document operation process to the target client. The process information can refer to the session ID of the target document operation process.
[0040] Afterwards, when the target client obtains the process information, the target client can continuously access the target document operation process corresponding to the process information through the proxy process to edit the target document through the target document operation process. For example, the target client sends a document editing request including process information to the proxy process, and the proxy process sends the document editing request to the target document operation process according to the process information in the document editing request for processing by the target document operation process. The target client can load a web document page through a web browser, and display the document content provided by the target document operation process on the web document page.
[0041] Based on the scheme defined in the above steps S101 to S103, it can be known that in the embodiment of the present invention, in the collaborative editing process, different functions are provided through different processes, by receiving the first request sent by the target client, and then determining the target document operation process corresponding to the target document requested in the first request through the proxy process in the document service, and judging whether the target document operation process is occupied by other clients, so that when the target document operation process is not occupied by other clients, the process information of the target document operation process is fed back to the target client through the proxy process, so that the target client can access the target document operation process based on the process information, and collaboratively edit the target document through the target document operation process. Among them, the first request is used to request to edit the target document, and other clients refer to clients other than the target client.
[0042] It is easy to notice that in the above process, the target document operation process corresponding to the target document requested in the first request is determined by the proxy process, and when the target document operation process is not occupied by other clients, the process information of the target document operation process is fed back to the target client, thereby solving the resource competition among multiple clients through the proxy process, avoiding the phenomenon that the document content may be erroneously overwritten due to multiple clients editing the document at the same time, setting the client to collaboratively edit the target document through the target document operation process, and providing the document collaborative editing function to the client through the target document operation process, thereby achieving the effect of providing different functions in collaborative editing through different processes and improving the stability of collaborative editing.
[0043] It can be seen that the solution provided by the present application achieves the purpose of providing different functions through different processes during the collaborative editing process, thereby realizing the technical effect of improving the stability of collaborative editing, and further solves the technical problems in the related technology of providing document collaborative editing functions to clients through a single process and solving resource competition among multiple clients, which makes the process prone to crash and affects the stability of collaborative editing.
[0044] In an optional embodiment, after determining whether the target document operation process is occupied by other clients, the document service may, if the target document operation process is occupied by other clients, wait through a proxy process for the target document operation process to be released by other clients, and, if it is detected that the target document operation process is released by other clients, feedback the process information of the target document operation process to the target client through the proxy process.
[0045] Optionally, when the target document operation process is occupied by other clients, it is determined that other users are editing the target document. In this case, the proxy process can wait for the target document operation process to be released by other clients, that is, wait for other users to complete editing the target document.
[0046] When detecting that the target document operation process is released by other clients, the proxy process can feedback the process information of the target document operation process to the target client, so that the target client can access the target document operation process based on the process information and collaboratively edit the target document through the target document operation process.
[0047] In some embodiments, when multiple clients are waiting to edit a target document, the proxy process may feedback the process information of the target document operation process to each client in turn. Optionally, the proxy process may sort the clients in the order in which the clients send the first request.
[0048] It should be noted that, through the above method, the target client can process the target document in time after the target document is occupied by other clients, thereby improving the efficiency of document collaborative editing.
[0049] In an optional embodiment, before determining the target document operation process corresponding to the target document requested in the first request through the proxy process in the document service, the document service can determine whether there is a proxy process in the document service, and then create a target document operation process and a proxy process if there is no proxy process, and then obtain the content of the target document from the third-party service through the target document operation process, and store the process information of the target document operation process through the proxy process. The third-party service is a service that stores the target document.
[0050] Optional, Figure 2 This is a flow chart of an optional method for collaborative document editing according to an embodiment of the present invention. Figure 2 ,like Figure 2 As shown in FIG. 1 , after obtaining the first request, the Web service main process can determine whether there is a proxy process in the document service. If there is a proxy process, the first request can be directly sent to the proxy process so that the proxy process can determine the target document operation process. If there is no proxy process, the Web service main process determines that not only no proxy process is created in the document service, but also no document operation process is created. In this case, Figure 2As shown, the Web service main process can request the document suite service process to create a document operation session for the target document. After receiving the request sent by the Web service main process, the document suite service process associates the Office function suite to create a corresponding target document operation process according to the document type. After the target document operation process is initialized, the target document operation process actively informs the Web service main process through the Socket connection. After receiving the initialization completion information sent by the target document operation process, the Web service main process creates a proxy process to coordinate multi-user collaborative editing through the proxy process.
[0051] Optional, such as Figure 2 As shown, after the proxy process is created, the Web service main process sends the first request to the proxy process, and the proxy process then sends the first request to the target document operation process to request the target document operation process to load the target document. After receiving the first request, the target document operation process can obtain the content of the target document from the third-party service through the target proxy service. The third-party service can be a cloud storage service or other services that support the storage of target documents.
[0052] After the target document operation process obtains the content of the target document from the third-party service, the target document operation process can cache the document content and feed back the process information of the target document operation process (e.g., session ID) and the document information of the target document (e.g., document ID) to the proxy process for storage by the proxy process, thereby facilitating the proxy process to determine the correspondence between the target document and the target document operation process.
[0053] In some embodiments, after determining that a proxy process exists in the document service, the proxy process can determine whether there is a target document operation process corresponding to the target document in the document service, and thus, if there is no target document operation process corresponding to the target document, request the Web service main process to create a target document operation process through the document suite service process.
[0054] It should be noted that, through the above method, the effective creation of the process to be used is achieved, thereby improving the stability of document collaborative editing.
[0055] In an optional embodiment, in the process of obtaining the content of the target document from a third-party service through the target document operation process, the document service can extract the access token from the first request, and generate a document acquisition request based on the access token and the document information of the target document, thereby sending the document acquisition request to the target proxy service, wherein the target proxy service determines whether the target document operation process has the document acquisition permission based on the access token in the document acquisition request, and if the target document operation process has the document acquisition permission, obtains the content of the target document from the third-party service, and sends the content of the target document to the target document operation process.
[0056] Optionally, the first request includes an access token, which may be pre-assigned to the target client. The access token is used to authenticate the client that has the access token.
[0057] After extracting the access token from the first request, the target document operation process generates a document acquisition request according to the access token and the document information of the target document, wherein the document information may refer to a document ID.
[0058] Afterwards, the target document operation process sends the document acquisition request to the target proxy service, and the target proxy service can determine whether the target document operation process has the document acquisition permission based on the access token in the document acquisition request. For example, the target proxy service is preset with multiple authorized access tokens. If the access token in the document acquisition request belongs to the multiple authorized access tokens, it is determined that the target document operation process has the document acquisition permission. Otherwise, it is determined that the target document operation process does not have the document acquisition permission.
[0059] After the target proxy service determines that the target document operation process has document acquisition permission, the target proxy service can extract the document information of the target document from the document acquisition request, and then send the document information to the third-party service to obtain the document content of the target document from the third-party service, and then send the content of the target document to the target document operation process.
[0060] Optionally, after the target document operation process obtains the document content of the target document, the target document operation process can create a sandbox environment Jail for the target document, and then run the document content of the target document in the sandbox environment as a resource cache and snapshot to achieve isolation of document resources that are not actually saved.
[0061] It should be noted that, by allowing the target document operation process to obtain the document content of the target document when the access token authentication is passed, the security of the target document is guaranteed.
[0062] In an optional embodiment, before receiving the first request sent by the target client, the target proxy service receives a document service session request sent by the target client, sends the client information in the document service session request to the third-party service, and generates an access token upon receiving feedback from the third-party service that the target client has passed authentication, and sends the access token and the uniform resource locator of the document service to the target client, wherein the third-party service authenticates the target client based on the client information.
[0063] Optionally, the target client communicates with the document service via a target proxy service, and the target proxy service may be a WOPI service. In this embodiment, the access token needs to be provided to the target client by the target proxy service.
[0064] Therefore, when the target client expects to send a first request to the document service, the target client needs to first send a document service session request to the target proxy service. The document service session request includes at least the client information of the target client, which may include the user identity or session identifier corresponding to the target client, and also includes the document information of the target document.
[0065] Afterwards, if the client information includes the user identity, the target proxy service can request the third-party service to obtain the metadata of the target document based on the document information and the user identity. The document metadata may include but is not limited to basic information such as document ID, file format, size, etc.
[0066] Optional, Figure 3 This is a flow chart of an optional method for collaborative document editing according to an embodiment of the present invention. Figure 3 ,like Figure 3 As shown, before the third-party service provides metadata to the target proxy service, the third-party service first authenticates the target client based on the user identity identifier. For example, the third-party service has preset client information of the authorized client, so the target client is authenticated based on the client information of the authorized client. If the authentication fails, information indicating that the authentication failed is returned to the target proxy service, and then the target proxy service handles the unauthorized request, for example, an HTTP Response with a status code of 401 can be returned. If the authentication passes, the authentication pass information and metadata are fed back to the target proxy service.
[0067] Optionally, after the target proxy service obtains the authentication information and document metadata, it can directly generate an access token, and then put the access token together with the metadata, user identity, etc. into the global cache, and feedback the access token and the uniform resource locator of the document service to the target client, so that the target client can generate a first request based on the access token and establish a session with the document service according to the uniform resource locator of the document service.
[0068] Optional, such as Figure 3 As shown, after the target proxy service obtains the authentication information and document metadata, it can also first initiate a query to the document service to query whether the document format of the target document supports opening and editing operations. For example, the document service is requested to provide a list of supported formats of Office. The information returned by the document service is encapsulated in the XML format, which is parsed and cached by the proxy service. The proxy service can determine whether the document format of the target document supports opening and editing operations based on the information returned by the document service. If opening and editing are not supported, the target proxy service will feedback information about the unsupported operation to the target client, for example, returning an HTTP Response with a status code of 400; if opening or editing is supported, an access token is generated, and then the access token, metadata, user identity, etc. are placed in the global cache, and the access token and the uniform resource locator of the document service are fed back to the target client.
[0069] Afterwards, if Figure 3 As shown, the target client can generate a first request based on the access token and the uniform resource locator of the document service, and initiate a first request to the document service to request to load the document content, thereby realizing collaborative editing, and save and close the document after the editing is completed.
[0070] It should be noted that by determining whether to provide an access token to a target client based on the authentication result of the client identity, the reliability of the access token distribution is guaranteed, thereby improving the security of the target document.
[0071] In an optional embodiment, in the process of receiving the first request sent by the target client, the document service may receive a target request sent by the target client, and when the target request is the first request, determine that the first request sent by the target client is received. The target request is the first request or the second request, and the second request is used to request to view the target document.
[0072] Optionally, depending on actual application requirements, the target client may only need to open the target document or may need to edit the target document. Therefore, the request sent by the target client to the document service may be divided into a first request and a second request.
[0073] In this case, after the Web service main process receives the target request, the Web service main process can determine whether the target request is the first request. If so, it is determined that the first request sent by the target client is received, and then the target document operation process corresponding to the target document requested in the first request is determined through the proxy process in the document service. If not, it is determined that the second request is received, and the target document operation process corresponding to the target document requested in the first request can be determined through the proxy process in the document service, and then the proxy process directly feeds back the process information of the target document operation process to the target client without having to determine whether the target document operation process is occupied by other clients.
[0074] It should be noted that, through the above method, it is achieved that the user only pays attention to the resource competition between multiple clients when he needs to edit the document, so that multiple clients can view the document at the same time, improving the flexibility of document processing.
[0075] In an optional embodiment, after the process information of the target document operation process is fed back to the target client through the proxy process, the document service can receive the document editing request sent by the target client through the target document operation process, and then edit the content of the target document acquired by the target document operation process according to the document editing request through the target document operation process to obtain the edited content, so that when the document save instruction sent by the target client is received, the edited content is sent to the third-party service through the target document operation process.
[0076] Optional, such as Figure 2 As shown, after the target client obtains the process information of the target document operation process, the target client can generate a document editing request based on the process information, and send the document editing request to the target document operation process through the proxy process. The document editing request includes the process information and the target client's editing instructions for the target document. Afterwards, the target document operation process can edit the content of the acquired target document according to the editing instructions in the document editing request to obtain the edited content. Therefore, when receiving the document saving instruction sent by the target client, the edited content is first saved in the document cache of the target document operation process, and then the edited content is submitted to the target proxy service, and then the target proxy service writes the edited content into the third-party service.
[0077] Optionally, when the target client closes the target document, only a client session may be stopped in the proxy process, and the corresponding target document operation process may not necessarily be closed. After all client sessions have been exited, the proxy process may request the document suite service process to close the target document operation process to release system resources.
[0078] It should be noted that, through the above method, the content edited by the target client is effectively saved, and the stability of document processing is further improved.
[0079] It can be seen that the solution provided by the present application achieves the purpose of providing different functions through different processes during the collaborative editing process, thereby realizing the technical effect of improving the stability of collaborative editing, and further solves the technical problems in the related technology of providing document collaborative editing functions to clients through a single process and solving resource competition among multiple clients, which makes the process prone to crash and affects the stability of collaborative editing.
[0080] Example 2
[0081] According to an embodiment of the present invention, an embodiment of a device for collaboratively editing a document is provided, wherein: Figure 4 is an optional document collaborative editing device according to an embodiment of the present invention, such as Figure 4 As shown, the device comprises:
[0082] The receiving module 401 is used to receive a first request sent by a target client, wherein the first request is used to request to edit a target document;
[0083] The determination module 402 is used to determine the target document operation process corresponding to the target document requested in the first request through the proxy process in the document service, and determine whether the target document operation process is occupied by other clients, wherein the other clients refer to clients other than the target client;
[0084] The first processing module 403 is used to feed back process information of the target document operation process to the target client through the proxy process when the target document operation process is not occupied by other clients, so that the target client can access the target document operation process based on the process information and collaboratively edit the target document through the target document operation process.
[0085] It should be noted that the above-mentioned receiving module 401, determining module 402 and first processing module 403 correspond to steps S101 to S103 in the above-mentioned embodiment. The examples and application scenarios implemented by the three modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above-mentioned embodiment 1.
[0086] Optionally, the document collaborative editing device also includes: a second processing module, which is used to wait through a proxy process for the target document operation process to be released by other clients when the target document operation process is occupied by other clients; and a third processing module, which is used to feedback process information of the target document operation process to the target client through a proxy process when it is detected that the target document operation process is released by other clients.
[0087] Optionally, the document collaborative editing device also includes: a judgment module, used to determine whether there is a proxy process in the document service; a creation module, used to create a target document operation process and a proxy process when the proxy process does not exist; an acquisition module, used to obtain the content of the target document from a third-party service through the target document operation process, wherein the third-party service is a service that stores the target document; and a storage module, used to store process information of the target document operation process through the proxy process.
[0088] Optionally, the acquisition module also includes: a generation submodule, used to extract the access token from the first request, and generate a document acquisition request based on the access token and the document information of the target document; a sending submodule, used to send the document acquisition request to the target proxy service, wherein the target proxy service determines whether the target document operation process has the document acquisition permission based on the access token in the document acquisition request, and if the target document operation process has the document acquisition permission, obtains the content of the target document from a third-party service and sends the content of the target document to the target document operation process.
[0089] Optionally, before receiving the first request sent by the target client, the target proxy service receives a document service session request sent by the target client, sends the client information in the document service session request to the third-party service, and generates an access token upon receiving feedback from the third-party service that the target client has passed authentication, and sends the access token and the uniform resource locator of the document service to the target client, wherein the third-party service authenticates the target client based on the client information.
[0090] Optionally, the receiving module also includes: a receiving sub-module, used to receive a target request sent by a target client, wherein the target request is a first request or a second request, and the second request is used to request to view a target document; and a determining sub-module, used to determine that a first request sent by the target client is received when the target request is a first request.
[0091] Optionally, the device for collaborative document editing also includes: a first sending module, used to receive a document editing request sent by a target client through a target document operation process; an editing module, used to edit the content of the target document acquired by the target document operation process according to the document editing request through the target document operation process to obtain edited content; and a second sending module, used to send the edited content to a third-party service through the target document operation process when a document save instruction sent by the target client is received.
[0092] Example 3
[0093] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned document collaborative editing method when running.
[0094] Example 4
[0095] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, wherein: Figure 5 is a schematic diagram of an optional electronic device according to an embodiment of the present invention, such as Figure 5 As shown, the electronic device includes one or more processors; a memory for storing one or more programs, which, when the one or more programs are executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the above-mentioned document collaborative editing method when running.
[0096] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0097] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0098] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of units can be a logical function division. There may be other division methods in actual implementation. For example, 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 through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0099] 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 over multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0100] 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. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0101] If the integrated unit 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, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a 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, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.
[0102] The above are only preferred embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for collaborative document editing, characterized in that: Applicable to document services, including: Receiving a first request sent by a target client, wherein the first request is used to request editing of a target document; Determine, through the proxy process in the document service, a target document operation process corresponding to the target document requested in the first request, and judge whether the target document operation process is occupied by other clients, wherein the other clients refer to clients other than the target client; When the target document operation process is not occupied by the other clients, the process information of the target document operation process is fed back to the target client through the proxy process, so that the target client can access the target document operation process based on the process information and collaboratively edit the target document through the target document operation process.
2. The method according to claim 1, characterized in that After determining whether the target document operation process is occupied by other clients, the method further includes: When the target document operation process is occupied by the other client, waiting by the proxy process for the target document operation process to be released by the other client; When it is detected that the target document operation process is released by the other client, the process information of the target document operation process is fed back to the target client through the proxy process.
3. The method according to claim 1, characterized in that Before determining, through the proxy process in the document service, the target document operation process corresponding to the target document requested in the first request, the method further includes: Determining whether the proxy process exists in the document service; In the case where the proxy process does not exist, creating the target document operation process and the proxy process; Acquiring the content of the target document from a third-party service through the target document operation process, wherein the third-party service is a service storing the target document; The process information of the target document operation process is stored through the proxy process.
4. The method according to claim 3, characterized in that Acquiring the content of the target document from a third-party service through the target document operation process includes: Extracting an access token from the first request, and generating a document acquisition request according to the access token and the document information of the target document; The document acquisition request is sent to a target proxy service, wherein the target proxy service determines whether the target document operation process has document acquisition permission based on the access token in the document acquisition request, and if the target document operation process has document acquisition permission, obtains the content of the target document from the third-party service, and sends the content of the target document to the target document operation process.
5. The method according to claim 4, characterized in that Before receiving the first request sent by the target client, the target proxy service receives the document service session request sent by the target client, sends the client information in the document service session request to the third-party service, generates the access token when receiving feedback from the third-party service that the target client has been authenticated, and sends the access token and the uniform resource locator of the document service to the target client, wherein the third-party service authenticates the target client according to the client information.
6. The method according to claim 1, characterized in that Receiving a first request sent by a target client, including: receiving a target request sent by the target client, wherein the target request is the first request or the second request, and the second request is used to request to view the target document; In a case where the target request is the first request, it is determined that the first request sent by the target client is received.
7. The method according to claim 3, characterized in that After feeding back the process information of the target document operation process to the target client through the proxy process, the method further includes: Receiving, through the target document operation process, a document editing request sent by the target client; Editing the content of the target document acquired by the target document operation process according to the document editing request through the target document operation process to obtain the edited content; When the document saving instruction sent by the target client is received, the edited content is sent to the third-party service through the target document operation process.
8. A device for collaborative document editing, characterized in that: include: A receiving module, configured to receive a first request sent by a target client, wherein the first request is used to request editing of a target document; a determination module, configured to determine, through a proxy process in a document service, a target document operation process corresponding to the target document requested in the first request, and to determine whether the target document operation process is occupied by other clients, wherein the other clients refer to clients other than the target client; The first processing module is used to feedback the process information of the target document operation process to the target client through the proxy process when the target document operation process is not occupied by the other clients, so that the target client can access the target document operation process based on the process information and collaboratively edit the target document through the target document operation process.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method for collaborative document editing as claimed in any one of claims 1 to 7 when run.
10. An electronic device, characterized in that: The electronic device includes one or more processors; A memory for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to run the programs, wherein the programs are configured to execute the method for collaborative document editing as described in any one of claims 1 to 7 when run.
