Document switching method and device, equipment, medium and program product
By restarting the document editor on the client and reusing other parts, combined with the server prefetching document data, the problem of long wait time for users to switch documents is solved, and a fast, efficient and user-friendly document switching experience is achieved.
Patent Information
- Application Number
- CN202411772502.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art requires reloading the entire web page when a user switches documents, resulting in increased server burden and extended user waiting time, reducing usage efficiency.
By prefetching the configuration data and document data of the document to be switched from the server, restarting the document editor on the client, reusing the part other than the document editor, and loading the document data of the target document, to achieve rapid document switching.
It significantly reduces the waiting time for users when switching documents, improves the response speed and user experience of document switching, and saves system resources.
Smart Images

Figure CN119692316A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of document processing technology, and in particular to a document switching method, device, equipment, storage medium and program product. Background Art
[0002] With the rapid development of Internet technology, online document editing and processing has become an indispensable tool for users to create texts and manage information. As the number of user documents increases, users are more and more inclined to edit multiple documents in a unified interface. If the entire web page is reloaded every time a user switches documents, this practice will not only greatly increase the burden on the server, but also significantly prolong the user's waiting time and reduce usage efficiency. Summary of the invention
[0003] In view of this, embodiments of the present application at least provide a document switching method, apparatus, device, storage medium, and program product.
[0004] The technical solution of the embodiment of the present application is implemented as follows:
[0005] On the one hand, an embodiment of the present application provides a document switching method, which is applied to a client; the method includes: pre-fetching configuration data and document data of a document to be switched from a server; in response to a switching event to switch to a target document, restarting a document editor running in the target document instance based on a target document instance and the configuration data of the target document; a portion of the target document instance other than the document editor is reused by the document to be switched, wherein the target document is one of the documents to be switched; and loading the document data of the target document based on the target document instance of the restarted document editor.
[0006] On the other hand, an embodiment of the present application provides another document switching method, which is applied to a server, and the method includes: pre-fetching configuration data and document data of a document to be switched; sending the configuration data and document data of the document to be switched to a client; the client is used to respond to a switching event of switching to a target document, and based on a target document instance and the configuration data of the target document, restart the document editor running in the target document instance; based on the target document instance of the restarted document editor, load the document data of the target document; wherein, a portion of the target document instance other than the document editor is reused by the document to be switched, and the target document is one of the documents to be switched.
[0007] On the other hand, an embodiment of the present application provides a document switching device, which includes: a first pre-fetching module, used to pre-fetch configuration data and document data of a document to be switched from a server; a configuration loading module, used to restart a document editor running in the target document instance based on a target document instance and the configuration data of the target document in response to a switching event to switch to a target document; a portion of the target document instance other than the document editor is reused by the document to be switched, wherein the target document is one of the documents to be switched; and a document loading module, used to load the document data of the target document based on the target document instance of the restarted document editor.
[0008] On the other hand, an embodiment of the present application provides a document switching device, which includes: a second pre-fetching module, used to pre-fetch configuration data and document data of a document to be switched; a sending module, used to send the configuration data and document data of the document to be switched to a client; the client is used to respond to a switching event of switching to a target document, and based on a target document instance and the configuration data of the target document, restart a document editor running in the target document instance; based on the target document instance of the restarted document editor, load the document data of the target document; wherein a portion of the target document instance other than the document editor is reused by the document to be switched, and the target document is one of the documents to be switched.
[0009] On the other hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0010] On the other hand, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements part or all of the steps in the above method when executed by a processor.
[0011] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the above method.
[0012] In the embodiment of the present application, by pre-fetching the configuration data and document data of the document to be switched from the server, the waiting time of the user when switching documents can be significantly reduced, because the required data has been downloaded and stored in advance on the client, thereby improving the response speed of document switching and the user experience; at the same time, by responding to the switching event of switching to the target document, the document editor running in the target document instance is restarted based on the target document instance and the configuration data of the target document, so that the document editor can correctly parse and render the content of the target document without creating a new instance for each document, thereby saving system resources and meeting the document switching requirements; finally, by loading the document data of the target document based on the restarted document editor, the content of the target document can be immediately displayed on the user interface, so that the user can continue editing work seamlessly. The document switching method provided in the embodiment of the present application realizes a fast, efficient and user-friendly document switching experience by pre-fetching data, reusing document instances and restarting the document editor based on configuration data.
[0013] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.
[0015] Figure 1 A schematic diagram of the implementation process of a document switching method provided in an embodiment of the present application Figure 1 ;
[0016] Figure 2 A schematic diagram of the implementation process of a document switching method provided in an embodiment of the present application Figure 2 ;
[0017] Figure 3 A schematic diagram of the implementation process of a document switching method provided in an embodiment of the present application Figure 3 ;
[0018] Figure 4 Schematic diagram of another implementation process of a document switching method provided in an embodiment of the present application Figure 1 ;
[0019] Figure 5 Schematic diagram of another implementation process of a document switching method provided in an embodiment of the present application Figure 2 ;
[0020] Figure 6 Schematic diagram of another implementation process of a document switching method provided in an embodiment of the present application Figure 3 ;
[0021] Figure 7 Schematic diagram of another implementation process of a document switching method provided in an embodiment of the present application Figure 4 ;
[0022] Figure 8 A system diagram of a document switching scenario provided in an embodiment of the present application;
[0023] Fig. 9A A schematic diagram of a scenario of a client and a server in a document switching scenario provided in an embodiment of the present application;
[0024] Fig. 9B A schematic diagram of a scenario of a parent document and a child document provided in an embodiment of the present application;
[0025] Fig.10 A schematic diagram of the structure of a document switching device provided in an embodiment of the present application;
[0026] Fig.11 A schematic diagram of the structure of another document switching device provided in an embodiment of the present application;
[0027] Fig.12 A hardware entity diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0029] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" involved are merely used to distinguish similar objects and do not represent a specific order for the objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing this application and are not intended to limit this application.
[0031] With the continuous advancement of Internet technology, online document editing and processing has become an important means for users to create text and manage information. As the number of user documents continues to increase, users tend to achieve efficient management of multiple documents on the same page. In order to meet this demand and provide users with a smoother and more seamless user experience, this application aims to design and implement an innovative document reloading method that can switch and update documents without refreshing the web page.
[0032] In some embodiments, iframe can be used as a carrier to achieve the management of multiple documents on a single web page. When the user chooses to switch documents, these products generally reload the new web page through the iframe to complete the switching process. However, this method has certain limitations in terms of user experience and efficiency.
[0033] In this embodiment, in the document product, authenticating the user's identity is a key step in ensuring data security. In addition, in order to correctly load and render the document, it is also necessary to obtain the document's data and configuration information. This series of steps constitutes the main process of loading a new document, which specifically includes:
[0034] Server process:
[0035] (1) When a client requests to access a document to be switched, the client sends a request to obtain the document to be switched to the server. The server responds to the request to perform authentication based on the user information logged in by the client and the document information of the document to be switched;
[0036] The server performs permission verification based on user information and document information to ensure that the user has the authority to access and edit the document.
[0037] (2) If the authentication is successful, that is, if it is determined that the user has the authority to access the document to be switched, the server obtains the document configuration information;
[0038] The configuration information of the requested document is retrieved and extracted from the database, and the document configuration information is used in the subsequent front-end rendering process.
[0039] (3) The server downloads the document data;
[0040] Wherein, according to the configuration information, the document data corresponding to the requested document is downloaded from the storage system.
[0041] (4) The server assembles the information and sends HTML to the client.
[0042] The JS script in the HTML includes a document configuration reading code and a document data reading code.
[0043] Client process:
[0044] (1) Parse HTML and execute JS scripts.
[0045] The client receives and parses the HTML page, and executes the JavaScript script therein to initialize the page functions and components, and obtains the document configuration reading code and the document data reading code therein.
[0046] (2) Read configuration and load components and plug-ins.
[0047] Among them, the client reads the code according to the document configuration, reads and loads the corresponding document components and plug-ins, and prepares for document rendering and editing.
[0048] (3) Read document data, render pages, and display different operation interfaces based on user permission information.
[0049] Among them, the client reads data according to the document data reading code, renders the page content according to the user permission information, and displays the corresponding operation interface.
[0050] It can be seen that in the above-mentioned embodiment, the basic needs of users for multi-document management are met to a certain extent, but the following problems still exist: (1) Each time a document is switched, the entire web page needs to be reloaded, which not only increases the burden on the server, but also prolongs the user's waiting time. (2) Reloading a web page means that various components and plug-ins need to be reloaded and initialized, which not only wastes system resources, but also leads to a slow document switching speed and a poor user experience. (3) When switching documents, the user will be blocked by the authentication process of the server, resulting in an unsmooth document switching and a freeze problem.
[0051] Therefore, in order to improve the user experience, a new document switching mechanism needs to be proposed. The embodiment of the present application provides a document switching method, which can realize fast switching between different documents without reloading the web page.
[0052] The embodiment of the present application provides a document switching method, which can be executed by a server and a client. The server can be deployed on a high-performance server to manage and store document data and respond to requests from the client; the client can be a browser or a dedicated online document editing application that can be operated by the user, which is set on various smart devices of the user, including but not limited to laptops, tablet computers, desktop computers, smart phones, etc. The client can send a request to the server to perform operations such as document switching.
[0053] Figure 1 A schematic diagram of the implementation process of a document switching method provided in an embodiment of the present application Figure 1 ,like Figure 1 As shown, the method includes the following steps S101 to S103:
[0054] Step S101: pre-fetch configuration data and document data of the document to be switched from the server.
[0055] In the embodiment of the present application, the client communicates with the server to realize an online document editing scenario, in which users can be supported to perform online document editing, storage, sharing, etc. The server is used to store, manage, and version documents and provide an API interface for the client to call; the client can be a browser or a dedicated online document editing application that can be operated by the user.
[0056] In some embodiments, the client is used to provide an interactive interface, allowing users to edit, preview, save, and other operations on documents; the client can also send requests to the server based on the user's operations, such as uploading documents, obtaining document data, editing document data, saving editing results, etc. Correspondingly, the client can also receive a response returned by the server and update the user interface or perform other operations based on the response.
[0057] The document to be switched is a document that the client predicts may be opened by the user based on the current scenario. The document to be switched may be one or more.
[0058] In some embodiments, the document to be switched may be determined based on the currently opened document and the document association relationship. Exemplarily, the document association relationship may include an association relationship between a main document and an attachment document of the main document.
[0059] Among them, the attachment documents of the main document can be stored in the main document in the form of pages. After opening the main document, the display interface of the main document may include a selection bar for the attachment documents. In response to a selection operation on an attachment document in the selection bar, the relevant content of the attachment document will be displayed in the display interface of the main document.
[0060] In some embodiments, the document to be switched is a document that has an associated relationship with the document loaded in the document editor currently running in the target document instance. In the case where the associated relationship is a master-attached document relationship, the document loaded in the document editor currently running in the target document instance is any attachment document in the master document, and the document to be switched is another attachment document in the master document.
[0061] In some embodiments, the documents to be switched may be stored in the client in the form of a pre-fetch list. Before pre-fetching the configuration data and document data of all the documents to be switched in the pre-fetch list from the server, all the documents to be switched are authenticated in advance.
[0062] In some embodiments, the document to be switched can be determined based on the user's historical records and / or behavior patterns. The historical records here refer to the historical records formed based on the documents that the user has accessed and edited in the past period of time. Then, the client can find out the documents that the user has frequently accessed or edited recently, as well as the documents that the user has opened before but has not yet completed, as the documents to be switched based on the user's historical records. The behavior patterns here may include: the user often edits multiple documents at the same time, switches documents within a specific time period, etc. Accordingly. The client can build a user portrait based on the user's behavior pattern, and predict the document that the user may access next based on the portrait as the document to be switched.
[0063] In other embodiments, the document to be switched may be determined based on the storage path of the currently opened document. For example, other documents pointed to by the storage path of the currently opened document may be used as the document to be switched, for example, documents in the same folder may be used as the document to be switched.
[0064] It should be noted that the above-mentioned document to be switched refers to a document that is not opened at the current moment. At the same time, at the current moment, the client may have an open document or may not have an open document. This application does not limit this.
[0065] In some embodiments, the client loads a document editor through the target document instance, and loads the document data of the document through the document editor; the document editor includes multiple functional components, and the configuration data of the document to be switched is the configuration parameters of each functional component in the document to be switched, and the configuration parameters are used to determine the functional attributes of the functional components. Exemplarily, taking the functional components including the font component and the page rendering component as an example, the configuration parameters of the font component can control the attributes of the font in the page, and the configuration parameters of the page rendering component can control the page attributes such as the page margin. The document data is the actual content of the document to be switched, and the document data may include: text, pictures, tables, videos, audios and other types of content, as well as the structure and format information of these contents. In the client, before the document needs to be switched, the client will first pre-fetch the configuration data and document data of the document to be switched. The configuration data is used to update the editor component configuration in the target document instance so as to correctly display and edit the document to be switched. The document data is used to fill the content area of the target document instance and display it to the user for viewing and editing.
[0066] In some embodiments, the document editor is an editor that matches the target document, that is, the type of the document editor is the same as the document type of the target document. Exemplarily, if the target document is a table file, the document editor is a table editor; if the target document is a text file, the document editor is a text editor; if the target document is a picture, the document editor is a picture editor; if the target document is a web link, the document editor is a browser.
[0067] In some embodiments, the client may send a request to the server for obtaining configuration data and document data of the document to be switched, and receive pre-fetch feedback sent by the server (server) carrying the configuration data and document data of the document to be switched.
[0068] Step S102: In response to a switching event to switch to a target document, restart the document editor running in the target document instance based on the target document instance and the configuration data of the target document; the portion of the target document instance other than the document editor is reused by the document to be switched.
[0069] In some embodiments, the switching event may be a signal or instruction triggered by a user through an interface operation, which indicates that the user wishes to switch to the target document. The switching process may be understood as switching from an open current document to an open target document, or may be understood as switching from no open documents to an open target document.
[0070] Among them, the target document instance is a running program, the document editor is a part of the target document instance, and the target document instance may also include a set of other functional components in addition to the document editor. The set of functional components of the target document instance also includes at least a set of functional components that can be used to create, run, restart, and close the document editor. The document editor is a set of functional components running in the target document instance, which is used to display, edit and save document content in the target document instance. Considering that the configuration parameters of the functional components used in different documents are different, therefore, in the process of reusing the target document instance, it is necessary to restart the document editor running in the target document instance based on the configuration data of the target document, that is, restart the set of functional components in the target document instance based on the configuration data of the target document. In this way, the document instance can be reused efficiently when switching documents, while ensuring that the configuration of the document editor matches the target document.
[0071] Among them, the part of the target document instance except the document editor is reused by the document to be switched. When the above-mentioned switching event represents the switch from the open current document to the open target document, the part of the target document instance except the document editor is actually reused by the current document and the document to be switched. It can be understood that when it is necessary to switch from the current document to another document, the system will not create a brand new document instance to load the new document, but will restart or reinitialize the document editor in the existing target document instance based on the configuration data of the new document. In this way, different documents can be seamlessly switched in the same document editing environment without going through the tedious process of creating a new instance.
[0072] Step S103: based on the target document instance of the restarted document editor, load the document data of the target document.
[0073] In some embodiments, after the document editor running in the target document instance is restarted in step S102, the document data of the target document is read from the local cache and loaded into the document editor instance. During the loading process, the document editor parses and renders the document data according to the configuration data to present it to the user through the interactive interface.
[0074] In the embodiment of the present application, by pre-fetching the configuration data and document data of the document to be switched from the server, the waiting time of the user when switching documents can be significantly reduced, because the required data has been downloaded and stored in advance on the client, thereby improving the response speed of document switching and the user experience; at the same time, by responding to the switching event of switching to the target document, the document editor running in the target document instance is restarted based on the target document instance and the configuration data of the target document, so that the document editor can correctly parse and render the content of the target document without creating a new instance for each document, thereby saving system resources and meeting the document switching requirements; finally, by loading the document data of the target document based on the restarted document editor, the content of the target document can be immediately displayed on the user interface, so that the user can continue the editing work seamlessly. The document switching method provided in the embodiment of the present application realizes a fast, efficient and user-friendly document switching experience by pre-fetching data, reusing parts of the document instance except the document editor, and restarting the document editor based on the configuration data.
[0075] In some embodiments, the target document instance in the client is connected to the server via a target communication channel; the target communication channel is multiplexed by the document to be switched.
[0076] In one example, the client needs to establish a persistent connection channel for each document and implement an online editing function for the document through the persistent connection channel.
[0077] In an embodiment of the present application, after creating a target document instance in the client, the client will establish a target communication channel with the server. The target communication channel uses a long connection technology to ensure that the client and the server can continue to maintain a communication state. Among them, the target communication channel is used to update data, document data, configuration data, etc. At the same time, the communication channel is multiplexed by multiple documents to be switched, that is, when the user switches documents, there is no need to re-establish a connection, but continue to transmit data through the existing target communication channel.
[0078] Exemplarily, taking online document editing software as an example, in the above example, an independent long connection channel needs to be established for each opened document. However, in an embodiment of the present application, when the user opens the first document, the client will establish a target communication channel with the server, and implement the online editing function of the document based on the target communication channel. When the user switches to the second document, the client will not re-establish the long connection channel, but reuse the previously established channel, and implement the online editing function of the second document based on the target communication channel. By analogy, after switching to any document, the same target communication channel is reused.
[0079] In an embodiment of the present application, by connecting the target document instance in the client to the server through a target communication channel, efficient data transmission between the client and the server can be achieved; at the same time, since the target communication channel adopts long connection technology, when a new network address needs to be accessed, there is no need to refresh the browser page, avoiding the need to reload the target document instance, thereby improving the efficiency of document switching and user experience.
[0080] Figure 2 This is a schematic diagram of the implementation process of a document switching method provided in an embodiment of the present application. Figure 2 , the method can be executed by a processor of a computer device. Figure 1 The method further includes steps S201 to S202, combining Figure 2 The steps shown are explained.
[0081] Step S201: receiving a cache update notification for the document to be switched sent by a server; the cache update notification carries update data of the document to be switched.
[0082] In this scenario, the cache update notification of the document to be switched may be transmitted through the target communication channel.
[0083] The cache update notification is generated by the server and is used to notify the client that the data on the server has changed and carries the updated data so that the client can update its local cache. In the embodiment of the present application, when the server detects an update of the document to be switched, it generates a cache update notification and sends it to the client through the target communication channel so that the client can update the document data in its local cache in a timely manner.
[0084] In some embodiments, the server first detects the update of the document to be switched, and then generates a cache update notification. Exemplarily, the cache update notification may include the identifier of the document to be switched and the update data of the document to be switched. Then, the server sends the cache update notification to the client through the target communication channel. After receiving the cache update notification, the client parses out the identifier of the document to be switched and the update data of the document to be switched, so as to facilitate the cache update process of the document to be switched.
[0085] It should be noted that, at the current moment, the client will not transmit the updated data of the document to be switched to the server through the target communication channel. Considering that the current document (open document) and multiple documents to be switched reuse the target communication channel, the client can only actively send the updated data of the current document to the server through the target communication channel at the same time. During the process of the current document using the target communication channel (that is, the target communication channel supports the online editing function of the current document at the current moment), the client can passively receive the cache update notification sent by the server to update the local cache file of the document to be switched.
[0086] Step S202: updating the local cache file of the document to be switched based on the update data of the document to be switched.
[0087] In some embodiments, the client parses the update data in the cache update notification received in step S201. The update data may include incremental update content of the document (such as modified partial paragraphs or pictures), or may include data of the entire document. The client updates the corresponding content in the local cache file based on this data. If the update data is incremental update content, the client merges the content into the corresponding position of the local cache file; if the update data is the latest version of the entire document, the client directly replaces the content in the local cache file.
[0088] For example, suppose that the user is editing a document named "Project Report", and another document named "Market Research" is one of the documents to be switched. The server detects that the content of the "Market Research" document is automatically updated by other users or the system, so it generates a cache update notification and sends it to the client through the target communication channel. After receiving the cache update notification of the "Market Research" document, the client will parse out the updated data. Assume that this data is the incremental update content of the document, including a newly added market analysis data. The client will merge this data into the corresponding position of the local cache file of the "Market Research" document to ensure that the data in the local cache is consistent with the data on the server.
[0089] In some embodiments, the update data includes at least one of the following: new configuration data, new document data, and new permission data.
[0090] Among them, the new document data refers to the document content change data that occurs in the actual editing process of the document to be switched. These document content change data need to be synchronized to each client in a timely manner to ensure that users can see the latest document content. For example, when other users modify the document on the server side through their respective clients (such as adding new paragraphs, modifying pictures or tables, etc.), the server side needs to generate new document data containing these modifications and send it to the client through the target communication channel. After receiving the new document data, the client will update the document content in the local cache file based on the new document data, so that the user can see the latest version when switching to the document. The new configuration data is the new configuration parameters of the functional components in the document to be switched. The new configuration parameters can be set by the owner or administrator of the document to be switched and other users with permission management authority.
[0091] In some embodiments, the update data includes new permission data, and accordingly, the cache update notification includes a permission update notification of the new permission data; the updating of the local cache file of the document to be switched based on the update data of the document to be switched includes: updating the client's permission to the document to be switched based on the new permission data of the document to be switched. In the case where the new permission data indicates that the client has restricted access to the document to be switched, it also includes processing of the document data pre-downloaded for the document to be switched, such as deleting the document data if the client does not have permission to read the document to be switched, or changing from decrypted document data to encrypted document data, and not allowing the client to switch to the document to be switched.
[0092] In the above embodiment, the permissions of the current client for the document to be switched are determined by the owner or administrator of the document to be switched, or other users with permission management permissions. After the user with permission management permissions initiates a change in the access permissions of the document to be switched, the server will send a permission update notification to the relevant client based on the new permission data of the document to be switched. It can be understood that the new permission data is related to the client (it can also be understood as being related to the user who logs into the client), that is, for the same document to be switched, different clients (users who log into the client) also have different access permissions for the document to be switched. Accordingly, the above-mentioned change in the access permissions of the document to be switched can be for one client, for some clients, or for all clients. In the case where the above-mentioned change in the access permissions of the document to be switched is for the current client, the current client will receive the new permission data of the document to be switched, and update the client's (its own) permissions to the document to be switched based on the new permission data. The server will send a permission update notification to the relevant client based on the new permission data of the document to be switched. On the one hand, it is an advance authentication of permissions, avoiding the need to go through the authentication process separately every time to obtain document data and configuration data, which may cause the client to switch to the target document. The situation is blocked, thereby making the process of the client switching to the target document smoother and more responsive. On the other hand, sending permission update notifications in time to obtain the latest permission data also avoids the data leakage of the target file due to the client switching to the target document that no longer has permissions based on the old permission data.
[0093] In some embodiments, when the new permission data represents that the client changes from having access rights to the document to be switched to not having access rights to the document to be switched, not only will the client's permissions to the document to be switched be updated, but the document data of the document to be switched will also be first processed so that the client loses the ability to access the document data of the document to be switched; the first processing includes but is not limited to deletion, encryption, etc.
[0094] In some embodiments, when the new permission data indicates that the client has never had access rights to the document to be switched, but now has access rights to the document to be switched, not only will the client's rights to the document to be switched be updated, but the document data of the document to be switched will also be subjected to a second processing so that the client can obtain access to the document data of the document to be switched; the second processing includes but is not limited to pre-fetching and decryption from the server.
[0095] For example, a user may have been authorized to edit a document before, but later had their editing privileges revoked for some reason, leaving only the read privilege. This change in privileges needs to be synchronized to the client in a timely manner to prevent unauthorized users from attempting to perform editing operations. After detecting the privilege change, the server generates new privileges and sends them to the client through the target communication channel. After receiving these updated data, the client updates the document privilege information in the local cache file, thereby ensuring that the user follows the correct privilege settings when trying to access or edit the document.
[0096] In an embodiment of the present application, by receiving a cache update notification for the document to be switched sent by the server through the target communication channel, the updated data of the document to be switched can be obtained in real time to ensure that the local cached data is consistent with the server; at the same time, the local cache file is directly updated based on the updated data of the document to be switched, and the data synchronization work can be completed before the user actually switches to the document to be switched, thereby reducing the time the user needs to wait for data loading when switching, and improving the efficiency of document switching and user experience.
[0097] In some embodiments, before pre-fetching the configuration data and document data of the document to be switched from the server, the method includes: receiving permission data sent by the server; the permission data is obtained after the server authenticates the document to be switched; in response to the permission data indicating that the client has the permission to the document to be switched, pre-fetching the configuration data and document data of the document to be switched from the server.
[0098] In the above embodiment, the server can obtain the identifier of the document to be switched and the identity information of the client (i.e., the user who logs in to the client), and then authenticate the identity information of the client according to the stored permission information of the document to be switched. If the authentication is successful, the server will pre-fetch the configuration data and document data of the document to be switched.
[0099] Exemplarily, assuming there is a document to be switched, the server first obtains the identifier of the document to be switched (such as the document ID) and the user's identity information, queries the database to confirm that the user has the authority to access the document to be switched, and then pre-fetches the configuration information and content data of the document to be switched.
[0100] In another embodiment, when the related documents of the document to be switched are accessed by the client, the server may authenticate the document to be switched in advance. For example, the related documents of the document to be switched are the main documents of the document to be switched; for another example, the related documents of the document to be switched are documents in the same folder as the document to be switched.
[0101] In a specific embodiment, in a scenario where there is an attachment document in a main document, when the main document is accessed by a client, the server can authenticate the main document and the attachment document in the main document in advance without the client sending an authentication request. In which, when any attachment file of the main document is accessed by the client, it can be determined that the main document is accessed by the client.
[0102] In the embodiment of the present application, the configuration data and document data of the document to be switched are pre-fetched only when the client has legal authority. This can not only protect the security of the document and prevent unauthorized access, but also improve the accuracy and effectiveness of the pre-fetched data.
[0103] Figure 3 This is a schematic diagram of the implementation process of a document switching method provided in an embodiment of the present application. Figure 3 , the method can be executed by a processor of a computer device. Figure 2 , Figure 1 Step S101 in can be updated to step S301 to step S302, combining Figure 3 The steps shown are explained.
[0104] Step S301: receiving document data of the document to be switched sent by a server; the document data is pre-fetched by the server.
[0105] The document data of the document to be switched refers to the actual content of the document that the user is about to access or switch to, which may include various types of data such as text, pictures, videos, etc. The database is a system used by the server to store and manage document data, which can be a relational database or a non-relational database.
[0106] In some embodiments, the client receives the document data of the document to be switched sent by the server through the target communication channel.
[0107] In some embodiments, the server can retrieve the document data corresponding to the document to be switched from the database based on the identifier of the document to be switched, and then encapsulate the retrieved document data into a response message, which can include the identifier of the document to be switched and the document data of the document to be switched, and send it to the client through the target communication channel. The client receives and parses the response message to obtain the document data of the document to be switched.
[0108] For example, suppose that a user is using an online document editing software, and there is a document to be switched called "market research". In the embodiment of the present application, the server can retrieve the document data of the "market research" document from the database and send it to the client through the target communication channel. When the user actually switches to the "market research" document, the page can be rendered immediately based on the document data of the "market research" document without waiting for data loading.
[0109] Step S302: Receive configuration data of the document to be switched sent by the server.
[0110] In some embodiments, the configuration data of the document to be switched sent by the server through a preset configuration acquisition interface is received through the configuration acquisition interface.
[0111] The preset configuration acquisition interface is an application programming interface (API) provided by the server, and is used by the client to obtain configuration data of the document.
[0112] In some embodiments, the server can retrieve the corresponding configuration data from the database based only on the identifier of the document to be switched. The server encapsulates the retrieved configuration data into a response message and sends it to the client through the configuration acquisition interface. The client receives and parses the response message, obtains the configuration data of the document to be switched, and updates the configuration of the document editor.
[0113] In an embodiment of the present application, by receiving the document data of the document to be switched pre-fetched and sent by the server from the database, the data loading time of the user when switching documents is significantly reduced, and the response speed and user experience are improved; at the same time, the configuration data of the document to be switched sent by the server is received through a preset configuration acquisition interface, so that the document can be displayed and edited on the client according to the correct configuration, thereby making the entire document switching process smoother and more efficient. The technical effect of the overall solution is to significantly improve the efficiency of document switching and user experience.
[0114] In some embodiments, the above-mentioned receiving the document data and configuration data of the document to be switched sent by the server can be implemented in the following manner: receiving the document data and configuration data of the document to be switched sent by the server in an idle scenario.
[0115] Among them, the idle time scenario is a state where the user's interaction with the document is reduced or the target communication channel is idle, which can provide the client with the best time to pre-fetch data.
[0116] In some implementation scenarios, the idle time scenario may occur when the user completes an editing task, finishes reading a piece of content, or temporarily leaves the work area. At this time, the user's operation frequency decreases, such as the editing speed slows down, the scrolling frequency decreases, and the click events are sparse. These changes in behavior data provide a basis for judging whether the user has entered the idle time scenario.
[0117] In some embodiments, the idle scene can be determined by the following scheme: during the opening process of the current document, the operation status for the current document is obtained, and whether it is in the idle scene is determined based on the operation status.
[0118] The opening process of the current document refers to the entire process in which the current document is fully loaded and can be edited or viewed on the client. The operation state is used to characterize the user's operation activity on the current document, and can be determined based on the behavior data generated by the user in the process of interacting with the current document. The behavior data includes but is not limited to: editing speed, dwell time, scrolling frequency, click events, etc. In some embodiments, the server or client can process and analyze the above behavior data in real time to obtain the user's operation activity on the current document, thereby determining whether the user is in an idle scenario.
[0119] For example, during the editing process, the document editor can capture the user's editing speed, dwell time, scrolling frequency, click events and other behavioral data in real time, and immediately process and analyze these data to generate the user's operation status on the current document. When the user stops editing and stays on a certain page for a long time, the document editor will determine that the user's operation activity is reduced and may be in an idle scene. At this time, the server will send the configuration data of the document to be switched to the client through the target communication channel.
[0120] In the embodiment of the present application, since the process of pre-fetching data is performed in an idle scenario, no additional burden is imposed on the user's normal operations and network resources.
[0121] In some embodiments, the method further includes: if a plug-in exists in the target document instance, sending an update notification to the plug-in by way of a global notification, so that the plug-in is updated based on the plug-in configuration data corresponding to the target document.
[0122] The plug-in is an extension component for the document editor in the target document instance. The plug-in can increase or modify the functions of the document editor and provide users with additional editing tools or data processing capabilities. It is understandable that the plug-in and the editor are two independent sets of code, so a specific communication mechanism is required for interaction. Among them, the global notification method allows different components (such as document editors and plug-ins) to communicate.
[0123] In some embodiments, since different documents may require different functions or tools for processing, the functions of the plug-in need to be associated with the target document. When switching to the target document, the plug-in needs to provide or display corresponding functions according to the type or content of the current target document. Through the global notification method, the client can send an update notification to the plug-in when the document is switched, notifying the plug-in to provide or switch to the corresponding function according to the target document.
[0124] For example, take the plug-in for inserting contacts in document editing software as an example. This plug-in allows users to select and insert contact information from a preset contact library into a document. Importantly, based on the same plug-in for inserting contacts, different documents may be associated with different contact libraries when used. The contact library is the configuration data of the plug-in specific to each document. The following is the update process of the plug-in configuration data: in the process of the user opening document A, the configuration data of the plug-in for inserting contacts is "contact library A", that is, the user tries to insert a contact into document A, the plug-in displays the contacts in contact library A for the user to select, and after the user selects and inserts the contact, the plug-in inserts the selected contact information into document A; document B is associated with contact library B, the document editor detects the switching operation of document B, and sends an update notification to the insert contact plug-in through the global notification mechanism. After receiving the global notification, the insert contact plug-in updates its internally maintained contact list to contact library B. After that, in the process of the user opening document B, the contact information from contact library B can be inserted into document B.
[0125] In an embodiment of the present application, when a plug-in exists in the target document instance and the switch is made to the target document, an update notification is sent to the plug-in via a global notification. This not only enables the plug-in to obtain the latest status of the target document instance in real time and dynamically, but also allows hot reloading based on new configuration data or document environment, thereby ensuring that the functionality of the plug-in remains consistent with the current document, thereby improving the flexibility of the system and user experience.
[0126] Figure 4 This is a schematic diagram of the implementation process of another document switching method provided in an embodiment of the present application. Figure 1 ,like Figure 1 As shown, the method includes the following steps S401 to S402, combining Figure 4 The steps shown are explained.
[0127] Step S401: pre-fetch configuration data and document data of the document to be switched.
[0128] In the embodiment of the present application, the server communicates with the client to realize an online document editing scenario, in which users can be supported to perform online document editing, storage, sharing, etc. The server is used to store, manage, and version documents and provide an API interface for the client to call; the client can be a browser or a dedicated online document editing application that can be operated by the user.
[0129] In some embodiments, the server is used to store documents uploaded by users, including the document's original data, editing history, version information, etc.; the server is also used to provide management functions such as document creation, deletion, renaming, and moving to ensure orderly storage and access to documents; the server is also used to provide an API interface for the client to call to implement document upload, download, editing, sharing, and other operations.
[0130] The document to be switched is a document that the client predicts may be opened by the user based on the current scenario. In some embodiments, the client may determine the document to be switched based on the currently opened document and the document association relationship. In other embodiments, the client may determine the document to be switched based on the user's historical records and / or behavior patterns. The document to be switched may be one or more.
[0131] In some embodiments, the server may receive a request for obtaining configuration data and document data of the document to be switched sent by the client, and pre-fetch the configuration data and document data of the document to be switched in response to the request.
[0132] Step S402: sending the configuration data and document data of the document to be switched to the client; the client is used to respond to a switching event of switching to the target document, restart the document editor running in the target document instance based on the target document instance and the configuration data of the target document; based on the target document instance of the restarted document editor, load the document data of the target document; wherein, the portion of the target document instance other than the document editor is reused by the document to be switched, and the target document is one of the documents to be switched.
[0133] In some embodiments, after pre-fetching the configuration data and document data of the document to be switched, the server sends the configuration data and document data to the client. The client receives this information and uses it to update the document editor configuration in the target document instance and load the document data of the target document when switching documents is required.
[0134] Among them, the part of the target document instance except the document editor is reused by the document to be switched. When the above switching event represents the switch from the open current document to the open target document, the target document instance is actually reused by the current document and the document to be switched. It can be understood that when it is necessary to switch from the current document to another document, the system will not create a brand new document instance to load the new document, but will restart or reinitialize the document editor in the existing target document instance based on the configuration data of the new document. In this way, different documents can be seamlessly switched in the same document editing environment without going through the tedious process of creating a new instance.
[0135] In an embodiment of the present application, the configuration data of the target document sent by the server can be used to restart the document editor running in the target document instance, so that the document editor can correctly parse and render the content of the target document without creating a new instance for each document, thereby saving system resources and meeting the document switching requirements; at the same time, the document data of the target document sent by the server can be loaded through the document editor based on the restart, and then the content of the target document can be immediately displayed on the user interface, so that the user can continue the editing work seamlessly. The document switching method provided in the embodiment of the present application can support the client to achieve fast and efficient document switching by pre-fetching the configuration data and document data of the document to be switched and sending them to the client.
[0136] In some embodiments, the server is connected to the target document instance in the client via a target communication channel; the target communication channel is multiplexed by the document to be switched.
[0137] In some examples, the server needs to process multiple independent long connection channels from the client, each channel corresponds to a document, to implement the online editing function of each document.
[0138] In an embodiment of the present application, after the client creates a target document instance, the client will establish a target communication channel with the server. The target communication channel uses a long connection technology to ensure continuous and stable communication between the server and the client. Once the communication channel is successfully established, the server can receive document editing requests from the client through the target communication channel and send document data to the client. It is worth noting that the target communication channel not only serves one document, but is reused by multiple documents to be switched. In other words, when the user switches documents, there is no need for the server and the client to re-establish a connection for the new document, but to continue to transmit data with the client through the existing target communication channel.
[0139] Exemplarily, taking online document editing software as an example, in one of the examples above, every time a user opens a new document, an independent long connection channel needs to be established between the server and the client for the document. However, in an embodiment of the present application, when the user opens the first document, the server will establish a target communication channel with the client and process the online editing request for the document based on the channel. When the user switches to the second document, the server will not re-establish a connection for the second document, but will continue to process the editing request for the second document through the previously established channel. By analogy, no matter which document the user switches to, the server reuses the same target communication channel.
[0140] In the embodiment of the present application, the server can efficiently process the data transmission request from the client, while significantly reducing the occupation of communication resources. Because multiple documents share the same communication channel, the communication cost is reduced and the communication efficiency is improved. In addition, this method of multiplexing the communication channel also helps to simplify the communication management of the server, because the server does not need to establish and maintain a communication channel for each document separately.
[0141] Figure 5 This is a schematic diagram of the implementation process of another document switching method provided in an embodiment of the present application. Figure 2 , the method can be executed by a processor of a computer device. Figure 4 The method further comprises steps S501 and S502, combining Figure 5 The steps shown are explained.
[0142] Step S501: When the document to be switched is edited by other clients, update data of the document to be switched is obtained.
[0143] In some embodiments, when multiple clients share the same document, if one of the clients edits the document, the other clients need to obtain the updated data in a timely manner to ensure that the document data in the local cache is consistent with the actual data. Based on this, the server detects whether the document to be switched is edited by other clients. In response to detecting the change of the document to be switched, the server can read the latest document data of the document to be switched as the updated data of the document to be switched.
[0144] Step S502: Send a cache update notification to the client; the cache update notification carries the update data of the document to be switched; the cache update instruction is used to instruct the client to update the local cache file of the document to be switched based on the update data of the document to be switched.
[0145] In this scenario, the cache update notification of the document to be switched may be transmitted through the target communication channel.
[0146] In some embodiments, the update data may include incremental update content of the document to be switched (such as modified partial paragraphs or pictures), or may include data of the entire document to be switched. The client will update the corresponding content in the local cache file based on this data. If the update data is incremental update content, the client will merge this content into the corresponding position of the local cache file; if the update data is the latest version of the entire document, the client will directly replace the content in the local cache file.
[0147] In some embodiments, the update data includes at least one of the following: new configuration data, new document data, and new permission data.
[0148] Among them, the new document data refers to the document content change data that occurs in the actual editing process of the document to be switched. These document content change data need to be synchronized to each client in a timely manner to ensure that users can see the latest document content. For example, when other users modify the document on the server side through their respective clients (such as adding new paragraphs, modifying pictures or tables, etc.), the server side needs to generate new document data containing these modifications and send it to the client through the target communication channel. After receiving the new document data, the client will update the document content in the local cache file based on the new document data, so that the user can see the latest version when switching to the document. The new configuration data is the new configuration parameters of the functional components in the document to be switched. The new configuration parameters can be set by the owner or administrator of the document to be switched and other users with permission management authority.
[0149] In some embodiments, the updated data includes new permission data of the document to be switched for the target user; the method further includes: obtaining a target client related to the target user; sending a permission update notification carrying the new permission data to the target client; the permission update notification is used to instruct the target client to update the permission to the document to be switched based on the new permission data.
[0150] In the above embodiment, the permissions of a client for the document to be switched are determined by the owner or administrator of the document to be switched, or other users with permission management permissions. After the user with permission management permissions initiates a change in the access permissions of the document to be switched, the server will send a permission update notification to the relevant client based on the new permission data of the document to be switched. It can be understood that the new permission data is related to the client, that is, related to the user who logs in to the client. In other words, for the same document to be switched, the users who log in to the client are different, and the access permissions for the document to be switched are also different. Accordingly, the above-mentioned change in the access permissions for the document to be switched can be for one user (client), or for some users (clients), or for all users (clients). The above-mentioned target user is the user involved in the new permission data, that is, the user whose access permissions for the document to be switched have been changed.
[0151] In some embodiments, obtaining the target client associated with the target user is actually obtaining the client that has logged in the target account. The target client may include the current client or may not include the current client, depending on the actual implementation scenario.
[0152] In some embodiments, when the number of target users is at least two, the new permission data for the target users includes the new permission data for each target user; the new permission data for different target users may be the same or different. For example, for user 1 and user 2 who need to access document A, the administrator may simultaneously change the permissions of user 1 and user 2 on document A to allow access, or may change the permission of user 1 on document A to allow access, while changing the permission of user 2 on document A to inaccessible.
[0153] In some embodiments, when the new permission data represents that the target client changes from having access rights to the document to be switched to not having access rights to the document to be switched, not only will the target client's rights to the document to be switched be updated, but the document data of the document to be switched will also be first processed so that the target client loses the ability to access the document data of the document to be switched; the first processing includes but is not limited to deletion, encryption, etc.
[0154] In some embodiments, when the new permission data indicates that the target client has never had access rights to the document to be switched, but now has access rights to the document to be switched, not only will the target client's rights to the document to be switched be updated, but the document data of the document to be switched will also be subjected to a second processing so that the target client can obtain access to the document data of the document to be switched; the second processing includes but is not limited to pre-fetching and decryption from the server.
[0155] In the embodiment of the present application, by obtaining the update data of the document to be switched when it is edited by other clients, it can be ensured that the client can grasp the latest status of the document; at the same time, a cache update notification carrying the update data is sent to the client, so that the client can receive the change information of the document in time; the cache update instruction can guide the client to update the local cache file of the document to be switched according to the update data, thereby maintaining the consistency of the local cache with the server-side document. Based on the embodiment provided by the present application, the efficiency of collaborative editing of documents can be effectively improved, and the conflict problems caused by version asynchrony can be reduced.
[0156] Figure 6 This is a schematic diagram of the implementation process of another document switching method provided in an embodiment of the present application. Figure 3 , the method can be executed by a processor of a computer device. Figure 4 , step S401 can be updated to step S601 and step S602, combining Figure 6 The steps shown are explained.
[0157] Step S601: pre-fetch the document data of the document to be switched, and send the document data of the document to be switched to the client.
[0158] In some embodiments, the document data of the document to be switched is pre-fetched in a database, and the document data of the document to be switched is sent to the client through the target communication channel.
[0159] The document data of the document to be switched refers to the actual content of the document that the user is about to access or switch to, covering multiple data types such as text, pictures, and videos. The database is a system used by the server to store and manage document data, which can be a relational database or a non-relational database.
[0160] In some embodiments, the server first obtains the identifier of the document to be switched (e.g., the document ID), and retrieves the document data of the corresponding document to be switched in the database according to the identifier. Subsequently, the server encapsulates the retrieved document data into a response message, which includes the identifier of the document to be switched and its document data, and transmits it back to the client. The client is used to receive and parse the response message to obtain the required document data to be switched.
[0161] For example, in a scenario where a user is operating an online document editing software, if there is a document to be switched named "Market Research". According to an embodiment of the present application, the server can first obtain the identifier of "Market Research", and use it to locate and retrieve the document data of the "Market Research" document in the database, and then send it to the client through the target communication channel. In this way, when the user actually switches to the "Market Research" document, the client can immediately render the page based on the document data of the "Market Research" document without waiting for data loading.
[0162] Step S602: Acquire the configuration data of the document to be switched, and send the configuration data of the document to be switched to the client.
[0163] In some embodiments, the configuration data of the document to be switched may be acquired, and the configuration data of the document to be switched may be sent to the client through the configuration acquisition interface.
[0164] The preset configuration acquisition interface is an application programming interface (API) designed and opened by the server, and is intended for the client to call to obtain the configuration data of the document.
[0165] In some embodiments, the server will search and retrieve the corresponding configuration data in the database based on the identifier of the document to be switched. Subsequently, the server will encapsulate the configuration data into a response message and send it back to the client through a preset configuration acquisition interface. After receiving and parsing the response message, the client will obtain the configuration data of the document to be switched and update the configuration of the document editor accordingly.
[0166] In the embodiment of the present application, the server can pre-fetch and send the document data of the document to be switched, thereby greatly reducing the data loading time when the user switches documents, improving the response speed and user experience. At the same time, the server can pre-fetch and send the configuration data of the document to be switched, so that the document to be switched can be displayed and edited according to the correct configuration on the client, thereby making the entire document switching process smoother and more efficient. The technical effect of the overall solution is to significantly improve the efficiency of document switching and user experience.
[0167] In some embodiments, before pre-fetching the configuration data and document data of the document to be switched, the method includes: authenticating the document to be switched and sending permission data to the client; and pre-fetching the configuration data and document data of the document to be switched when the permission data indicates that the client has permission for the document to be switched.
[0168] In some embodiments, the server authenticates the identity information provided by the client based on the stored permission information of the document to be switched to confirm whether the user belongs to a specific user group that can access the document, or whether the user has specific permissions to access the document. If the authentication is successful, that is, it is confirmed that the client has the permission to access the document to be switched, the server will send permission data containing the permission information to the client. After that, the server will pre-fetch and prepare the configuration data and document data of the document to be switched.
[0169] In the embodiment of the present application, the server not only protects the security of the document and prevents unauthorized access by pre-fetching after authentication, but also improves the accuracy and effectiveness of pre-fetched data. At the same time, because pre-fetching and sending data is performed only after confirming the authority, unnecessary network transmission and data processing can be avoided, thereby improving the overall performance of the system and user experience.
[0170] Figure 7 This is a schematic diagram of the implementation process of another document switching method provided in an embodiment of the present application. Figure 4 , the method can be executed by a processor of a computer device. Figure 4 The method further comprises step S701, combining Figure 7 The steps shown are explained.
[0171] Step S701: pre-activate the communication core corresponding to the document to be switched; the communication core is used to respond to the editing operation on the document to be switched.
[0172] In some embodiments, the communication kernel is a component in the server for processing edit operation requests related to the document. Each document has a communication kernel associated with it on the server, which is responsible for receiving, parsing and processing edit operation requests from the client, and then returning the processing results to the client. It can be understood that the activation state of the communication kernel determines whether it can respond to the edit operation request immediately.
[0173] In one example, the communication kernel is usually activated when the document is opened for editing. In the present application, in order to improve the editing experience of the user when switching documents, the communication kernel corresponding to the document to be switched can be activated in advance. For example, the communication kernels corresponding to all documents to be switched can be activated in advance, or part of the documents to be switched can be determined to be activated in advance based on the access frequency of the documents to be switched. This ensures that after the document switching is completed, the user's editing operation can be responded to immediately without waiting for the activation process of the communication kernel.
[0174] For example, assuming that there are multiple documents on the server, each document corresponds to a communication kernel. When the documents to be switched include "Document 1" and "Document 2", the communication kernels of the two documents to be switched are activated; then, when the user successfully switches to "Document 2", the editing operation can be started immediately without waiting for the activation of the communication kernel.
[0175] In some embodiments, the method further includes step S702.
[0176] Step S702: After the client switches to the target document, the communication core of the target document that has been activated responds to the editing operation on the target document to be switched.
[0177] Among them, after the client successfully switches to the target document, the server can receive the corresponding switching notification and can connect the target communication channel with the communication kernel of the target document. Afterwards, when the client receives the user's editing operations on the target document, these editing operations will be sent to the communication kernel of the activated target document through the target communication channel, and then, the communication kernel of the target document will respond to the above editing operations.
[0178] In an embodiment of the present application, by activating the communication kernel corresponding to the document to be switched, when the client switches to the target document, the communication kernel is already in a ready state and can immediately respond to editing operation requests from the client, thereby reducing the waiting time after switching documents and improving the user experience; at the same time, after the client switches to the target document, by utilizing the activated communication kernel that is closely associated with the target document to respond to and process editing operations on the target document, the initialization delay after the switch can be significantly reduced, so that the editing operation can be immediately executed and reflected in the document.
[0179] The following describes the application of the document switching method provided in the embodiment of the present application in actual scenarios.
[0180] In order to meet the needs of users to quickly switch between different documents on a single page, an effective solution is to identify and optimize the time-consuming steps in loading documents. After in-depth analysis, it can be seen that there is a significant time consumption in each execution link of loading documents. Based on the strategy of reducing repeated execution steps and early execution, the embodiment of the present application proposes a document switching mechanism based on data hot reload. This mechanism aims to reduce the waiting time of users when switching documents by identifying and optimizing the key time-consuming steps in the loading process. The core idea of the data hot reload mechanism is that when switching documents, avoid reloading the entire document, but based on the loaded document instances and data, quickly switch documents by updating related data. This mechanism not only reduces the time consumption of repeated execution, but also improves the efficiency of document switching and user experience.
[0181] In an embodiment of the present application, the document switching mechanism based on data hot reload includes the following steps:
[0182] Editor instance reuse design: When the user switches between different documents, the system does not reload the entire web page, but restarts the document editor based on the existing web page document instance by introducing new document data. This method enables smooth switching to different documents based on reusing the same web page instance.
[0183] Global data refresh mechanism: This mechanism is responsible for comprehensively updating global data, which includes the basic information of the document, main content, editor details and version information.
[0184] Document plug-in hot reload mechanism: For rich text editor products with plug-in functions, after the document is loaded, its instance will contain multiple plug-ins. This mechanism triggers data updates of all plug-ins through global notification, thereby realizing the hot reload function of plug-ins.
[0185] Persistent session reuse technology: This mechanism enables a single persistent session to support switching to communication channels of different documents. Users can smoothly switch to the communication channel of a new document without having to reestablish a connection, improving system efficiency and user experience.
[0186] The implementation process of this application scheme will be described in detail below.
[0187] 1. Decoupling of document communication network layer capabilities.
[0188] Client:
[0189] (1) A single document container that implements network layer decoupling and supports communication with different document communication channels.
[0190] Among them, one document communication channel can support the switching of multiple documents, that is, multiple documents use the same established document communication channel (long connection channel).
[0191] (2) When opening a document, pre-fetch the data and permissions of the files to be switched in the file list during idle time.
[0192] Here, the file list is a list of documents that the user may need to open in the current scenario. In the implementation scenario of the present application, the user often needs to switch between multiple documents during the task processing. After the user opens any one of the multiple documents, the other documents in the multiple documents can form the file list.
[0193] The data that needs to be pre-fetched includes the document ID, author, file name and content data; the permission information is used to determine the current user's operation permissions on the document, including but not limited to editing permissions and commenting permissions.
[0194] (3) When file content and permissions are updated, the communication channel notification is received and the local cache file data and permissions are updated.
[0195] In document processing scenarios, the content of a file may be updated due to editing by a collaborator, and the file permissions may change due to the settings of the author or system administrator, such as changing from editable to read-only. Therefore, there may be changes in the content of a file in the file list or the access permissions of the file.
[0196] In some embodiments, when the file content or permissions change, the server needs to notify the current client through a communication channel. The content of the notification may include the file ID that has changed, the type of change (content update or permission change), and the specific content or permission status after the change. After the current client receives the notification, the local cache of the current client needs to be updated to reflect the latest status of the file content or permissions. For file content, the latest version of the file data can be pulled from the server again and the old cached data can be replaced. For permissions, the locally stored permission information can be updated to ensure that subsequent operations on the file comply with the latest permission settings.
[0197] Server:
[0198] (1) A single long connection channel supports switching the communication cores corresponding to different documents.
[0199] The long connection channel establishes a persistent network connection between the client and the server.
[0200] In the embodiment of the present application, each document has a communication core associated with it on the server side, and the communication core is responsible for processing all editing operation requests related to the document.
[0201] In some embodiments, in a single long connection channel, the client can request to switch to a communication kernel of a different document. That is, the user can seamlessly switch to any document to be switched in the same editor window without establishing a new connection for each document. Exemplarily, the client can send a switching request to the server, and the server switches to the corresponding communication kernel according to the request.
[0202] See also Figure 8 A system schematic diagram of a document switching scenario is provided, wherein a client 810 and a server 820 are connected via a communication channel 830 .
[0203] In the embodiment of the present application, the client 810 includes a document container 811. From the perspective of the client 810, when the user switches between different documents, the document container 811 communicates with the server through the communication channel 830, thereby implementing the document operation process for different documents. It can be understood that Figure 8 exemplarily shows n documents, among which “Document 1” is the document being opened, and “Document 2” to “Document n” are documents to be switched.
[0204] In the embodiment of the present application, the server 820 includes multiple communication cores, such as Figure 8 In the "communication kernel 1" to "communication kernel n", each communication kernel corresponds to a document; illustratively, "document 1" can correspond to "communication kernel 1", "document 2" can correspond to "communication kernel 2", ..., "document n" can correspond to "communication kernel n". When "document 1" is the document being opened, the communication channel 830 switches to "communication kernel 1", and when "document 2" is the document being opened, the communication channel 830 switches to "communication kernel 2", and so on. In other words, when the client 810 opens different documents, the server 820 uses the same communication channel 830, and what changes is the communication kernel currently using the communication channel 830; it can be understood that in the above examples, "communication kernel 1" to "communication kernel n" are all in an activated state.
[0205] (2) The server pre-fetches the document data of all the documents to be switched in the list from the database in advance.
[0206] In an embodiment of the present application, compared with the solution in some examples where document data is retrieved from a database only after a document is opened for editing, the present application can pre-retrieve document data of the document to be switched from a database before the document to be switched is opened.
[0207] (3) The server authenticates all the documents to be switched in the list from the database in advance. When the permission of a single document to be switched changes, the permission information of the document to be switched in the cache is updated.
[0208] (4) When a file is edited and updated by others, broadcast and push the new cached file data to other editors.
[0209] based on Figure 8 In the example, during the process of "Document 1" being edited by "Client 810" and other clients, if "Document 1" is updated by the editing operation of "Client 810", then the server 820 will push the new cache file to other clients. Here, "Document 1" in other clients can be in an open state or in a to-be-switched state.
[0210] (5) Develop a strategy to open and activate several document communication cores in advance.
[0211] In some examples, when a document is not edited, its communication kernel is in an inactive state, and the document data is stored in a database. When a document is opened for editing, the server retrieves the document data from the database and activates the corresponding communication kernel to prepare it for processing the editing operation. In this application, the communication kernels corresponding to all documents to be switched are activated.
[0212] 2. Document Editor Capability Decoupling
[0213] (1) Add plugin uninstallation and hot reload mechanisms to implement hot reload of document plugins.
[0214] (2) Hot reload of document editing components.
[0215] (3) Document configuration data supports hot reload.
[0216] See also Fig. 9A , which shows a schematic diagram of a scenario of a client and a server in a document switching scenario. Fig. 9A As shown, after opening the parent document, the client 910 will send a notification to the server 920; after receiving the notification, the server 920 will perform relevant pre-fetching actions, including at least one of the following: pre-fetching sub-document data, and pre-authenticating the document. It can be understood that the parent document here is used to point to at least two sub-documents, and the at least two sub-documents here include the document to be switched in the above embodiment.
[0217] See also Fig. 9B , which shows a schematic diagram of a scenario of a parent document and a child document. In response to an opening event for a parent document, the following may be displayed: Fig. 9BThe display interface 90 includes a document structure display area 91 and a document content display area 92, wherein the document structure display area 91 is used to display the parent document and the sub-documents associated with the parent document, and the figure exemplarily shows "sub-document 1", "sub-document 2", "sub-document 2.1", and "sub-document 2.2". The document content display area 92 is used to display the document content of the target document, wherein, by default, the document content display area 92 is used to display the document content of the parent document, and in response to a selection event for any sub-document in the document structure display area 91, the document content of the selected sub-document can be displayed in the document content display area 92. It can be understood that, when the above-mentioned parent document is opened, the "sub-document 1", "sub-document 2", "sub-document 2.1", and "sub-document 2.2" can be the documents to be switched; of course, when the "sub-document 1" is opened, the "parent document", "sub-document 2", "sub-document 2.1", and "sub-document 2.2" can be the documents to be switched.
[0218] Between the server 920 and the client 910, multiple documents can be reused through a single long connection channel, and then the pre-fetched data can be pushed to the client 910 through the long connection channel, and the client 910 caches the pre-fetched data locally to achieve data hot reload during document switching. In the process of opening the parent document, the client 910 can also send a notification to the server 920 through a preset API interface, and receive the plug-in configuration data and component configuration data fed back by the server 920 through the API interface, thereby achieving component hot reload and plug-in hot reload.
[0219] Based on the above embodiment, a design scheme for refreshing document switching based on data hot reload is provided, which can help users switch documents quickly, greatly improve user experience, and has certain practical value.
[0220] Based on the foregoing embodiments, the embodiments of the present application provide a document switching device, which includes the units included and the modules included in the units, which can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0221] Fig.10A schematic diagram of the structure of a document switching device provided in an embodiment of the present application is shown in FIG. Fig.10 As shown, the document switching device 1000 is applied to the client, and the document switching device 1000 includes: a first pre-fetching module 1010, a configuration loading module 1020, and a document loading module 1030, wherein:
[0222] The first pre-fetching module 1010 is used to pre-fetch the configuration data and document data of the document to be switched from the server;
[0223] A configuration loading module 1020, configured to, in response to a switching event to switch to a target document, restart a document editor running in the target document instance based on the target document instance and configuration data of the target document; a portion of the target document instance other than the document editor is reused by the document to be switched, wherein the target document is one of the documents to be switched;
[0224] The document loading module 1030 is used to load the document data of the target document based on the target document instance of the restarted document editor.
[0225] In some embodiments, the target document instance in the client is connected to the server via a target communication channel; the target communication channel is multiplexed by the document to be switched.
[0226] In some embodiments, the document switching device 1000 further includes an update module. The update module is configured to receive a cache update notification for the document to be switched sent by the server; the cache update notification carries the update data of the document to be switched; and update the local cache file of the document to be switched based on the update data of the document to be switched.
[0227] In some embodiments, the cache update notification includes a permission update notification of the new permission data; the update module is further used to update the client's permission to the document to be switched based on the new permission data of the document to be switched.
[0228] In some embodiments, before pre-fetching the configuration data and document data of the document to be switched from the server, the first pre-fetching module 1010 is also used to receive permission data sent by the server; the permission data is obtained after the server authenticates the document to be switched; in response to the permission data indicating that the client has the permission to the document to be switched, the configuration data and document data of the document to be switched are pre-fetched from the server.
[0229] In some embodiments, the first pre-fetching module 1010 is further used to receive document data of the document to be switched sent by the server; the document data is pre-fetched by the server; and receive configuration data of the document to be switched sent by the server.
[0230] In some embodiments, the first pre-fetching module 1010 is further used to receive document data and configuration data of the document to be switched sent by the server in an idle scenario.
[0231] In some embodiments, the update module is further used to send an update notification to the plug-in through a global notification when a plug-in exists in the target document instance, so that the plug-in is updated based on the plug-in configuration data corresponding to the target document.
[0232] Fig.11 A schematic diagram of the structure of another document switching device provided in an embodiment of the present application is shown in FIG. Fig.11 As shown, the document switching device 1100 is applied to the server, and the document switching device 1100 includes: a second pre-fetching module 1110 and a sending module 1120, wherein:
[0233] The second pre-fetching module 1110 is used to pre-fetch the configuration data and document data of the document to be switched;
[0234] A sending module 1120 is used to send the configuration data and document data of the document to be switched to the client; the client is used to restart the document editor running in the target document instance in response to a switching event of switching to the target document, based on the target document instance and the configuration data of the target document; based on the target document instance of the restarted document editor, load the document data of the target document; wherein the portion of the target document instance other than the document editor is reused by the document to be switched, and the target document is one of the documents to be switched.
[0235] In some embodiments, the sending module 1120 is also used to obtain the updated data of the document to be switched when the document to be switched is edited by other clients; send a cache update notification to the client; the cache update notification carries the updated data of the document to be switched; and the cache update instruction is used to instruct the client to update the local cache file of the document to be switched based on the updated data of the document to be switched.
[0236] In some embodiments, the updated data includes new permission data of the document to be switched for the target user; the sending module 1120 is also used to obtain a target client related to the target user; and send a permission update notification carrying the new permission data to the target client; the permission update notification is used to instruct the target client to update permissions to the document to be switched based on the new permission data.
[0237] In some embodiments, before pre-fetching the configuration data and document data of the document to be switched, the sending module 1120 is also used to authenticate the document to be switched and send permission data to the client; when the permission data indicates that the client has the permission for the document to be switched, the configuration data and document data of the document to be switched are pre-fetched.
[0238] In some embodiments, the document switching device 1100 further includes an activation module. The activation module is used to pre-activate the communication core corresponding to the document to be switched; the communication core is used to respond to the editing operation on the document to be switched.
[0239] The description of the above device embodiment is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. In some embodiments, the functions or modules included in the device provided in the embodiment of the present application can be used to execute the method described in the above method embodiment. For technical details not disclosed in the device embodiment of the present application, please refer to the description of the method embodiment of the present application for understanding.
[0240] It should be noted that in the embodiment of the present application, if the above-mentioned document switching method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the embodiment of the present application is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific hardware, software or firmware, or any combination of hardware, software, and firmware.
[0241] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0242] The embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, some or all of the steps in the above method are implemented. The computer-readable storage medium can be transient or non-transient.
[0243] An embodiment of the present application provides a computer program, including a computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0244] The embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, some or all of the steps in the above method are implemented. The computer program product can be implemented specifically by hardware, software or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium, and in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK) and the like.
[0245] It should be noted here that the description of the various embodiments above tends to emphasize the differences between the various embodiments, and the same or similar aspects can be referenced to each other. The description of the above device, storage medium, computer program and computer program product embodiments is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment. For technical details not disclosed in the embodiments of the device, storage medium, computer program and computer program product of this application, please refer to the description of the method embodiment of this application for understanding.
[0246] Fig.12 A hardware entity diagram of a computer device provided in an embodiment of the present application is shown in FIG. Fig.12 As shown, the hardware entity of the computer device 1200 includes: a processor 1201 and a memory 1202, wherein the memory 1202 stores a computer program that can be run on the processor 1201, and the processor 1201 implements the steps in the method of any of the above embodiments when executing the program.
[0247] The memory 1202 stores computer programs that can be run on the processor. The memory 1202 is configured to store instructions and applications executable by the processor 1201. It can also cache data to be processed or processed by the processor 1201 and various modules in the computer device 1200 (for example, image data, audio data, voice communication data, and video communication data). This can be achieved through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0248] When the processor 1201 executes the program, the steps of any of the above document switching methods are implemented. The processor 1201 generally controls the overall operation of the computer device 1200.
[0249] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the document switching method in any of the above embodiments.
[0250] It should be noted here that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments, and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0251] The processor may be at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Central Processing Unit (CPU), a controller, a microcontroller, and a microprocessor. It is understandable that the electronic device that implements the functions of the processor may also be other, and the embodiments of the present application are not specifically limited.
[0252] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disk, or a compact disc read-only memory (CD-ROM) and the like; it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0253] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the size of the serial number of each step / process mentioned above does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present application. The serial numbers of the embodiments of the present application mentioned above are for description only and do not represent the advantages and disadvantages of the embodiments.
[0254] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0255] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the devices or units can be electrical, mechanical or other forms.
[0256] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; 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 present embodiment.
[0257] In addition, all functional units in the embodiments of the present application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units. A person of ordinary skill in the art can understand that all or part of the steps of the above method embodiments can be completed by hardware related to program instructions, and the above program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above method embodiments are executed; and the above storage medium includes: mobile storage devices, read-only memory (ROM), disks or optical disks, etc. Various media that can store program codes.
[0258] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can essentially or in other words, the part that contributes to the relevant technology can be embodied in the form of a software product, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0259] The above is only an implementation method of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A document switching method, characterized in that: Applied to a client; the method comprises: Pre-fetch configuration data and document data of the document to be switched from the server; In response to a switching event to switch to a target document, restarting a document editor running in the target document instance based on the target document instance and configuration data of the target document; a portion of the target document instance other than the document editor is reused by the document to be switched, wherein the target document is one of the documents to be switched; Based on the target document instance of the restarted document editor, the document data of the target document is loaded.
2. The method according to claim 1, characterized in that The target document instance in the client is connected to the server via a target communication channel; the target communication channel is multiplexed by the document to be switched.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: Receiving a cache update notification for the document to be switched sent by the server; the cache update notification carries update data of the document to be switched; The local cache file of the document to be switched is updated based on the updated data of the document to be switched.
4. The method according to claim 3, characterized in that The cache update notification includes a permission update notification of the new permission data; The updating of the local cache file of the document to be switched based on the update data of the document to be switched includes: Based on the new permission data of the document to be switched, the permission of the client to the document to be switched is updated.
5. The method according to any one of claims 1 to 4, characterized in that: Before pre-fetching the configuration data and document data of the document to be switched from the server, the method includes: Receiving permission data sent by the server; the permission data is obtained after the server authenticates the document to be switched; In response to the permission data indicating that the client has the permission for the document to be switched, configuration data and document data of the document to be switched are pre-fetched from the server.
6. The method according to any one of claims 1 to 5, characterized in that: The pre-fetching of the configuration data and document data of the document to be switched from the server includes: Receiving document data of the document to be switched sent by the server; the document data is pre-fetched by the server; Receive the configuration data of the document to be switched sent by the server.
7. The method according to claim 6, characterized in that The pre-fetching of the configuration data and document data of the document to be switched from the server includes: Receive document data and configuration data of the document to be switched sent by the server in the idle scenario.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: In the case where a plug-in exists in the target document instance, an update notification is sent to the plug-in in a global notification manner, so that the plug-in is updated based on the plug-in configuration data corresponding to the target document.
9. A document switching method, characterized in that: Applied to the server, the method includes: Pre-fetching configuration data and document data of the document to be switched; The configuration data and document data of the document to be switched are sent to the client; the client is used to restart the document editor running in the target document instance in response to a switching event of switching to the target document based on the target document instance and the configuration data of the target document; based on the target document instance of the restarted document editor, the document data of the target document is loaded; wherein the portion of the target document instance other than the document editor is reused by the document to be switched, and the target document is one of the documents to be switched.
10. The method according to claim 9, characterized in that The method further comprises: When the document to be switched is edited by other clients, acquiring update data of the document to be switched; A cache update notification is sent to the client; the cache update notification carries the update data of the document to be switched; and the cache update instruction is used to instruct the client to update the local cache file of the document to be switched based on the update data of the document to be switched.
11. The method according to claim 10, characterized in that The update data includes new permission data of the document to be switched for the target user; the method further includes: Acquire a target client related to the target user; A permission update notification carrying the new permission data is sent to the target client; the permission update notification is used to instruct the target client to update the permission to the document to be switched based on the new permission data.
12. The method according to claim 10, characterized in that Before pre-fetching the configuration data and document data of the document to be switched, the method includes: The document to be switched is authenticated, and permission data is sent to the client; when the permission data indicates that the client has the permission for the document to be switched, configuration data and document data of the document to be switched are pre-fetched.
13. The method according to any one of claims 9 to 12, characterized in that: The method further comprises: The communication core corresponding to the document to be switched is activated in advance; the communication core is used to respond to the editing operation on the document to be switched.
14. A document switching device, characterized in that: Applied to a client; the device comprises: A first pre-fetching module, used for pre-fetching configuration data and document data of the document to be switched from the server; A configuration loading module, configured to, in response to a switching event to switch to a target document, restart the document editor running in the target document instance based on the target document instance and the configuration data of the target document; a portion of the target document instance other than the document editor is reused by the document to be switched, wherein the target document is one of the documents to be switched; The document loading module is used to load the document data of the target document based on the target document instance of the restarted document editor.
15. A document switching device, characterized in that: Applied to the server; the device comprises: A second pre-fetching module, used for pre-fetching configuration data and document data of the document to be switched; A sending module, used for sending the configuration data and document data of the document to be switched to the client; the client is used for, in response to a switching event of switching to a target document, restarting the document editor running in the target document instance based on the target document instance and the configuration data of the target document; loading the document data of the target document based on the target document instance of the restarted document editor; wherein the portion of the target document instance other than the document editor is reused by the document to be switched, and the target document is one of the documents to be switched.
16. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps of the method according to any one of claims 1 to 8 are implemented, or the steps of the method according to any one of claims 9 to 13 are implemented.
17. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented, or the steps of the method according to any one of claims 9 to 13 are implemented.
18. A computer program product comprising a computer program or instructions, characterized in that When the computer program or instruction is executed by a processor, the steps of the method described in any one of claims 1 to 8 are implemented, or the steps of the method described in any one of claims 9 to 13 are implemented.