Document co-processing method and device, storage medium and terminal

By establishing the binding of collaborative service call request and callback function between the terminal and the collaborative server, the problem that document viewers in the prior art cannot achieve real-time collaboration of high-fidelity digital documents is solved, and real-time collaboration between multiple users is realized. The document status is synchronized, improving team collaboration efficiency.

CN119129547AInactive Publication Date: 2024-12-13BEIJING QIHOOD TECHNOLOGY CO LTD

Patent Information

Application Number
CN202411617994.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-13
Publication Date
2024-12-13
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing document viewers cannot achieve real-time collaboration of high-fidelity digital documents, and cannot support multiple users to edit or annotate the same document at the same time, resulting in inefficient team collaboration.

Method used

By establishing a binding between the collaborative service call request and callback function between the terminal and the collaborative server, listening to document processing events and synchronizing the document status through network requests, real-time synchronization of high-fidelity digital documents is achieved.

Benefits of technology

Real-time collaboration between multiple users is realized, ensuring that all collaborators can see the latest document status, improving the efficiency of team collaboration and real-time document processing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119129547A_ABST
    Figure CN119129547A_ABST
Patent Text Reader

Abstract

The invention discloses a document co-processing method and device, a storage medium and a terminal. The method comprises the following steps: generating a collaborative service calling request based on user operation, sending the collaborative service calling request to a collaborative server, and receiving at least one callback function returned by the collaborative server; binding each callback function with a document processing event corresponding to each callback function in the terminal; and when a target document processing event for the document is monitored, triggering a target callback function corresponding to the target document processing event, constructing a corresponding network request through a processing flow defined in the target callback function, and sending the network request to the cooperative server, so that the cooperative server processes the target document processing event based on the target callback function. By binding the callback function of the server to the terminal event, when a user operates the document, the server can receive the operation information in real time and execute the callback function, so that the document state is updated and synchronized to all cooperative terminals, and highly cooperative document processing is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, storage medium and terminal for collaborative processing of documents. Background Art

[0002] With the rapid development of information technology, high-fidelity digital documents, such as Portable Document Format (PDF), have become widely used document formats in work, study, and life due to their cross-platform compatibility, high-fidelity document presentation, and security. Existing document viewers provide basic preview and reading functions for high-fidelity digital documents. Some viewers also allow users to perform simple editing of high-fidelity digital documents to correct and interpret the content of the document. However, in scenarios such as remote office and online education, users often need to be able to view, discuss, and modify the same document at the same time to achieve efficient real-time collaboration and communication. Therefore, it is necessary to develop a document viewer that can support efficient collaborative document processing to meet the increasingly diverse needs of users. Summary of the invention

[0003] The present application provides a document collaborative processing method, device, storage medium and terminal, which can solve the problem that existing document viewers cannot achieve real-time collaboration on the same high-fidelity digital document, and provides a document viewer that can support efficient collaborative processing, which can meet the user's document collaborative processing needs.

[0004] In a first aspect, an embodiment of the present application provides a method for collaboratively processing a document, which is applied to a terminal, and the method includes: Generate a collaboration service call request based on the user operation, send the collaboration service call request to the collaboration server and receive at least one callback function returned by the collaboration server; Bind each callback function to the document processing event corresponding to each callback function in the terminal; When a target document processing event for a document is monitored, the target callback function corresponding to the target document processing event is triggered, and the corresponding network request is constructed through the processing flow defined in the target callback function and sent to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function.

[0005] In a second aspect, an embodiment of the present application provides a method for collaboratively processing a document, which is applied to a collaborative server, and the method includes: In response to the collaborative service invocation request sent by the terminal, sending at least one callback function corresponding to the collaborative service invocation request to the terminal; When a network request constructed by the terminal through the processing flow defined in the target callback function is received, a target document processing event is processed based on the target callback function.

[0006] In a third aspect, an embodiment of the present application provides a document collaborative processing device, applied to a terminal, the device comprising: A function determination module, used to generate a collaboration service call request based on a user operation, send the collaboration service call request to a collaboration server, and receive at least one callback function returned by the collaboration server; A function binding module, used to bind each callback function to a document processing event corresponding to each callback function in the terminal; The function execution module is used to trigger the target callback function corresponding to the target document processing event when monitoring the target document processing event for the document, build the corresponding network request through the processing flow defined in the target callback function and send it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function.

[0007] In a fourth aspect, an embodiment of the present application provides a document collaborative processing device, which is applied to a collaborative server, and the device includes: A function sending module, used to respond to the collaborative service call request sent by the terminal, and send at least one callback function corresponding to the collaborative service call request to the terminal; The function execution module is used to process the target document processing event based on the target callback function when receiving a network request constructed by the terminal through the processing flow defined in the target callback function.

[0008] In a fifth aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium stores a plurality of instructions, wherein the instructions are suitable for being loaded by a processor and executing the steps of the above-mentioned method.

[0009] In a sixth aspect, an embodiment of the present application provides a terminal, characterized in that it comprises: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method of the first aspect above.

[0010] In the seventh aspect, an embodiment of the present application provides a collaborative server, characterized in that it includes: a processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the steps of the method of the second aspect above.

[0011] The beneficial effects brought about by the technical solutions provided by some embodiments of the present application include at least: The embodiment of the present application provides a collaborative processing method for a document, which generates a collaborative service call request based on a user operation, sends the collaborative service call request to a collaborative server and receives at least one callback function returned by the collaborative server; binds each callback function to a document processing event corresponding to each callback function in a terminal; when a target document processing event for a document is monitored, triggers a target callback function corresponding to the target document processing event, and constructs a corresponding network request through a processing flow defined in the target callback function and sends it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function. By binding the callback function in the collaborative server to the document processing event of the terminal, real-time synchronization of high-fidelity digital document processing is achieved. This means that when any collaborator operates a document on a terminal (such as loading, annotating, etc.), these operations will immediately trigger the corresponding callback function in the collaborative server, and send the operation information on the terminal to the collaborative server in real time. The collaborative server then updates the document status based on this information, and synchronizes the update to all terminals participating in the collaboration, thereby ensuring that all collaborators can see the latest document status and achieve true online collaboration. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0013] Figure 1 An exemplary system architecture diagram of a document collaborative processing method provided in an embodiment of the present application; Figure 2 A flowchart of a collaborative processing method for documents applied to a terminal provided in an embodiment of the present application; Figure 3 A schematic diagram of a process of initializing a collaborative server provided in an embodiment of the present application; Figure 4 A schematic diagram of a process flow of an event in a collaborative document processing method provided in an embodiment of the present application; Figure 5 A flowchart of a collaborative processing method for documents applied to a collaborative server provided in an embodiment of the present application; Figure 6 A structural block diagram of a collaborative processing device for documents applied to a terminal provided in an embodiment of the present application; Figure 7 A structural block diagram of a collaborative processing device for documents applied to a collaborative server provided in an embodiment of the present application; Figure 8 A schematic diagram of the structure of a terminal provided in an embodiment of the present application; Fig. 9 A schematic diagram of the structure of a collaboration server provided in an embodiment of the present application. DETAILED DESCRIPTION

[0014] In order to make the features and advantages of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.

[0015] When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Instead, they are only examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.

[0016] In recent years, remote work has gradually become the norm for many companies and teams, which requires team members to communicate and collaborate efficiently across geographical restrictions. The convenience and security of high-fidelity digital documents make them an important carrier for information transmission and sharing, and their processing efficiency is directly related to whether remote work can be carried out efficiently. Therefore, the demand for team collaboration to process high-fidelity digital documents has been further enhanced in the context of remote work. In addition to basic preview functions and simple editing, existing document viewers do not support multiple users editing or annotating the same high-fidelity digital document at the same time. The interactive collaboration between users is limited to file transfer and manual integration of their respective changes, which cannot meet the user's needs for deep interaction with documents. This document processing method is not only time-consuming but also prone to errors, which greatly limits the efficiency of team collaboration.

[0017] Therefore, an embodiment of the present application provides a collaborative processing method for documents, which generates a collaborative service call request based on user operations, sends the collaborative service call request to a collaborative server and receives at least one callback function returned by the collaborative server; binds each callback function to a document processing event corresponding to each callback function in a terminal; when a target document processing event for a document is monitored, triggers a target callback function corresponding to the target document processing event, builds a corresponding network request through the processing flow defined in the target callback function and sends it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function, so as to solve the problem of low efficiency in team collaborative document processing mentioned above.

[0018] See also Figure 1 , Figure 1 An exemplary system architecture diagram of a collaborative document processing method provided in an embodiment of the present application.

[0019] like Figure 1 As shown, the system architecture may include a terminal 101, a network 102, and a collaboration server 103. The network 102 is used to provide a medium for a communication link between the terminal 101 and the collaboration server 103. The network 102 may include various types of wired communication links or wireless communication links, for example, the wired communication link includes an optical fiber, a twisted pair, or a coaxial cable, and the wireless communication link includes a Bluetooth communication link, a Wireless-Fidelity (Wi-Fi) communication link, or a microwave communication link.

[0020] The terminal 101 can interact with the collaboration server 103 through the network 102 to receive messages from the collaboration server 103 or send messages to the collaboration server 103, or the terminal 101 can interact with the collaboration server 103 through the network 102 to receive messages or data sent by other users to the collaboration server 103. The terminal 101 can be hardware or software. When the terminal 101 is hardware, it can be various electronic devices, including but not limited to smart watches, smart phones, tablet computers, laptop portable computers and desktop computers. When the terminal 101 is software, it can be installed in the electronic devices listed above, which can be implemented as multiple software or software modules (for example: used to provide distributed services), or it can be implemented as a single software or software module, which is not specifically limited here.

[0021] In an embodiment of the present application, terminal 101 first generates a collaborative service call request based on a user operation, sends the collaborative service call request to collaborative server 103 and receives at least one callback function returned by collaborative server 103; then, terminal 101 binds each callback function to a document processing event corresponding to each callback function in the device; finally, when terminal 101 listens to a target document processing event for a document, it triggers a target callback function corresponding to the target document processing event, builds a corresponding network request through the processing flow defined in the target callback function and sends it to collaborative server 103, so that collaborative server 103 processes the target document processing event based on the target callback function.

[0022] The collaboration server 103 may be a business server that provides various services. It should be noted that the collaboration server 103 may be hardware or software. When the collaboration server 103 is hardware, it may be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When the collaboration server 103 is software, it may be implemented as multiple software or software modules (for example, for providing distributed services), or as a single software or software module, which is not specifically limited here.

[0023] Alternatively, the system architecture may not include the collaboration server 103. In other words, the collaboration server 103 may be an optional device in the embodiments of this specification. That is, the method provided in the embodiments of this specification may be applied to a system structure that only includes the terminal 101, and the embodiments of this application do not limit this.

[0024] It should be understood that Figure 1 The numbers of terminals, networks, and collaborative servers are only illustrative, and any number of terminals, networks, and collaborative servers may be used according to implementation requirements.

[0025] See also Figure 2 , Figure 2 A flowchart of a collaborative processing method for documents applied to a terminal provided in an embodiment of the present application. The execution subject of the embodiment of the present application can be a terminal that executes collaborative processing of documents, or a processor in a terminal that executes the collaborative processing method for documents, or a collaborative processing service for documents in a terminal that executes the collaborative processing method for documents. For the convenience of description, the specific execution process of the collaborative processing method for documents is introduced below by taking the execution subject being a processor in a terminal as an example.

[0026] like Figure 2 As shown, the collaborative processing method of the document, applied to the terminal, may at least include: S202: Generate a collaboration service call request based on the user operation, send the collaboration service call request to the collaboration server, and receive at least one callback function returned by the collaboration server.

[0027] Optionally, in the collaborative processing of documents, it is necessary to achieve timely response and synchronization to various data requests. If direct communication and data sharing are performed between terminals, each terminal first needs to establish a direct connection. After the connection is established, a data synchronization mechanism needs to be negotiated between the terminals. In this way, when editing a document, each terminal needs to transmit the editing information of the document to other terminals in real time, and receive the editing information from other terminals to update the local document. With the increase in the number of users and the number of documents, the communication and data synchronization between terminals may become very complicated and inefficient. Without the centralized processing of the server, the system may find it difficult to cope with large-scale concurrent requests and data transmission. At the same time, if the network connection of a terminal is interrupted or fails, it is also likely to affect the progress of the entire collaborative work. Based on this, considering that the server, as a central node, can centrally manage all data operations, all data operations related to document collaborative processing can be uniformly performed on the server without having to operate separately on each terminal. This reduces the load on the terminal. The terminal only needs to listen to the document processing request and send the request to the server without having to process complex business logic locally, simplifying the complexity of operation and management on each terminal, which can save the computing resources and storage space of the terminal and improve the user experience. At the same time, since the server usually has higher processing power and a more stable network environment, it can handle concurrent requests and real-time data exchange more efficiently. Therefore, a collaborative server can be used to communicate with the terminal in real time to perform collaborative processing operations on various documents and ensure a quick response to document processing events.

[0028] Optionally, in document collaborative processing, if all document collaborative data is processed in the collaborative server, although the load and computing amount on each terminal are greatly reduced, it may be necessary to send complete request and response data to the collaborative server each time the terminal triggers a collaborative processing request. Since many data may be repeated in multiple requests, the collaborative server needs to process a large number of repeated complete data requests, which easily causes the collaborative server to receive and process a large amount of redundant data, which increases the processing burden and storage burden of the collaborative server. In addition, due to the large amount of data, the transmission time will also increase, resulting in a longer delay felt by the user, which is also disadvantageous for document collaborative processing with high real-time requirements. Therefore, if the collaborative server re-parses and defines the function of each operation every time it processes a data operation, it will cause the collaborative server to bear a huge computing burden and communication pressure, and the response time and performance will be affected. Based on this, it can be considered to pre-define the callback functions corresponding to various data processing operations in the collaborative server, and execute the corresponding callback functions according to the specific data processing operations in the terminal after the terminal is connected to the collaborative server, so as to quickly and accurately process the data processing operations.

[0029] Optionally, in document collaborative processing, various data processing operations (such as editing, saving, and annotation) performed by users on documents can be regarded as document processing events. In the collaborative server, each callback function is pre-defined for a specific document processing event, and contains the processing logic for these events. They can accurately identify the corresponding events and automatically execute the corresponding processing flow when the event occurs. Based on the callback functions defined for various document processing events in the collaborative server, when a specific event is triggered (such as the user enters a user name to log in, clicks a document processing button, etc.), the collaborative server calls and executes the callback function corresponding to the event to realize the collaborative processing of the document, which greatly reduces the amount of data transmitted over the network and improves the efficiency and performance of the system. At the same time, by encapsulating complex logic in reusable callback functions, developers can build code blocks that are easier to understand and manage. These callback functions can also be passed as parameters to other functions, thereby realizing a high cohesion and low coupling code design and improving the reusability and maintainability of the code. In addition, the callback functions on the collaborative server can also be dynamically expanded according to actual needs. As new needs emerge, new callback functions can be added to handle new document processing events, providing extremely high flexibility and scalability.

[0030] Optionally, in actual applications, the collaborative server can provide collaborative services in the collaborative processing process based on callback functions pre-defined for various document processing events. Then, when the user has a demand for collaborative services, the terminal can generate a collaborative service call request for the collaborative server based on the user's operation, and then send the collaborative service call request to the collaborative server, so as to obtain various callback functions in the collaborative server through the response of the collaborative server to the request, so as to process the document processing event triggered by the user next through each callback function.

[0031] Optionally, in order to implement the call to the collaborative service, a communication instance needs to be established between the terminal and the collaborative server, so as to carry out subsequent communication based on the communication instance, thereby realizing the sending, receiving and processing of various data information during the communication process. This communication instance is the basis for ensuring that the document collaborative processing can proceed smoothly. It ensures that a stable and reliable communication channel is established between the terminal and the collaborative server, so that the collaborative server can receive various collaborative processing requests from the terminal and send various operation data to each terminal. After the communication instance is established, the terminal can verify the validity of the communication instance by sending a simple test request, which helps to timely discover and solve potential communication problems and ensure that subsequent service calls can proceed smoothly.

[0032] It should be noted that the high-fidelity digital document for collaborative processing can be a PDF document or a document of other types and formats; the platform for collaborative document processing in the terminal can be a PDF.JS Express viewer; and the online real-time database for implementing the collaborative processing function in the collaborative server can be a Firebase Realtime Database. The embodiments of the present application do not limit the specific types of document formats, document viewers, and online real-time databases.

[0033] S204: Bind each callback function to a document processing event corresponding to each callback function in the terminal.

[0034] Optionally, the callback function usually includes detailed processing logic for specific document processing events. In order to accurately call the corresponding callback function when various document processing events occur, the callback function in the collaborative server can be bound to the corresponding document processing event in the terminal. The binding between the callback function and the event is the key to realizing the automation of document collaborative processing, ensuring that when a specific document processing event occurs, the corresponding callback function can be automatically called to execute the preset processing logic.

[0035] Optionally, first, all possible document processing events need to be defined and identified within the terminal. The event definition may include information such as the event type (such as modification, saving, deletion, etc.), triggering conditions (such as user operations, etc.), and event data structures (such as document information and user information carried when the event occurs). At the same time, it is necessary to ensure that each callback function has a clear identification and description so that the terminal can identify the callback function obtained from the collaboration server and understand the specific document processing event corresponding to each function, so as to facilitate subsequent binding operations. After determining each document processing event and its corresponding callback function, each callback function needs to be bound to the corresponding document processing event in the terminal. After the binding is completed, the binding verification can be performed to test the execution of the callback function by simulating the event trigger to ensure that each callback function is correctly associated with the corresponding document processing event.

[0036] S206. When a target document processing event for a document is monitored, a target callback function corresponding to the target document processing event is triggered, and a corresponding network request is constructed through the processing flow defined in the target callback function and sent to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function.

[0037] Optionally, in the scenario of document collaborative processing, multiple users may edit, view or manage the same document at the same time. In order to ensure the correctness and real-time performance of these operations, it is necessary to be able to perceive the changes or events in the document in a timely manner and respond accordingly. Therefore, an event listener is set to monitor various processing events occurring in the document in real time. When a user triggers a specific document processing event on the terminal, the type of the event is immediately identified and the event is determined as the target document processing event. Since each event has been bound to a callback function, the target callback function matching the target document processing event in the collaborative server can be accurately found at this time. After finding the target callback function, the corresponding network request is constructed through the processing flow defined in the target callback function. The request contains the necessary information required to execute the target callback function, such as the callback function identifier, event data (such as the specific content of the edit, user information, etc.), the unique identifier of the document, etc. This information is encapsulated in the request to ensure the integrity and security of the data. The terminal sends the encapsulated request to the collaborative server through the established communication instance. After receiving the request, the collaborative server executes the specified callback function according to its internal logic. During this process, the collaborative server may interact with other services or resources such as databases to complete collaborative document processing tasks, such as updating document content, synchronizing version information, adjusting operation permissions, etc. After the collaborative server executes the callback function, it returns the processing result to the terminal, and the terminal performs corresponding processing based on the response result, such as updating the local document view and notifying the user of the processing result.

[0038] In an embodiment of the present application, a collaborative processing method for a document is provided, wherein a collaborative service call request is generated based on a user operation, the collaborative service call request is sent to a collaborative server and at least one callback function returned by the collaborative server is received; each callback function is bound to a document processing event corresponding to each callback function in a terminal; when a target document processing event for a document is monitored, a target callback function corresponding to the target document processing event is triggered, and a corresponding network request is constructed through a processing flow defined in the target callback function and sent to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function. By binding the callback function in the collaborative server to the document processing event of the terminal, real-time synchronization of high-fidelity digital document processing is achieved. This means that when any collaborator operates a document on a terminal (such as loading, annotating, etc.), these operations will immediately trigger the corresponding callback function in the collaborative server, and the operation information on the terminal will be sent to the collaborative server in real time. The collaborative server then updates the document status based on this information, and synchronizes the update to all terminals participating in the collaboration, thereby ensuring that all collaborators can see the latest document status and achieve true online collaboration.

[0039] In order to provide users with fast collaboration services in actual applications, the collaboration server needs to be initialized in advance. The initialization process includes initializing the database, defining data operations, defining user login methods, and defining data writing methods. Through these initialization processes, a collaboration server that can smoothly provide the above-mentioned collaboration services is obtained. For details, please refer to Figure 3 , Figure 3 A schematic diagram of a process of initializing a collaborative server provided in an embodiment of the present application.

[0040] like Figure 3 As shown, the steps of initializing the collaboration server may at least include: S302, enter the backend console and initialize the database.

[0041] Optionally, in a real-time collaborative system, multiple users may need to access and modify the same document at the same time, and these document data may be stored in a database on a collaborative server. This means that the collaborative server is not only a data processing center, it also provides a persistent and accessible data storage space, and the terminal can interact with the collaborative server through network requests to query, modify or delete the document data stored on the collaborative server. In this case, in order to ensure the consistency and real-time nature of the data, it is necessary to ensure that the collaborative server can receive the data operations of each terminal in real time, and when the data in the collaborative server changes, the terminals corresponding to all relevant users can be notified in time and respond accordingly. Based on this, in a feasible implementation, the collaborative server can act as an online database to implement an event bus, triggering events when data is created, modified or deleted. Specifically, using the collaborative server as an event bus for message transmission can allow each terminal to collaborate with each other without direct communication. When the data in the database changes (such as data is created, modified or deleted), the event bus will capture these changes and broadcast them as events to all terminals participating in the collaboration. It should be noted that as long as this requirement is met, the collaborative server can be built using any language and stack.

[0042] Optionally, after determining that the collaborative server acts as an online database and implements the event bus, it is necessary to select a specific database type and initialize it. Taking Firebase Realtime Database as an online real-time database as an example, the developer first enters the Firebase console, which is the entry point for managing and configuring Firebase services, creates a new project in the console, then starts the Realtime Database service in the new project, and configures the necessary initialization information, such as database structure, security rules, etc. Next, obtain the database connection information, and use this connection information to configure the Firebase SDK in the terminal and server so that they can communicate with the database. Since FirebaseRealtime Database provides real-time, scalable data storage and synchronization functions, Firebase is selected as the backend service, and its Realtime Database is used as an online database to store annotations and user data, so that document data can be synchronized between the terminal and the server in near real time, helping developers build real-time document processing applications.

[0043] S304: Define data operations and custom binding functions for data, store unique identifiers for data operations, and monitor data change events.

[0044] Optionally, after initialization, the database has the ability to store and process data. In the management and application of databases, the core task is to enable data processing operations to be correctly executed on the database. To convert data processing operations into specific database operation instructions, such as adding, deleting, modifying, and checking databases, it is necessary to standardize data access and modification behaviors. Based on this, when the structure and configuration of the database are determined, data operations and custom binding functions of data can be defined based on these structures and configurations, that is, a series of actions for creating, retrieving, updating, or deleting data stored in the database are defined. By defining clear data operations, the accuracy, consistency, and security of the data are ensured, and a listener is further set to listen to data change events, and the data operations are specifically displayed by the custom binding function.

[0045] Alternatively, taking Firebase Realtime Database as an online real-time database as an example, in Firebase Database, each data operation (such as adding a "He's a great speaker" comment, logging in a user named "Zhang San", etc.) can be accessed and operated through a unique reference (firebase.database.Reference). These references serve as unique identifiers for data operations, making it possible to accurately determine the data behavior to be operated. By storing the unique identifier of the data operation (firebase.database.References), a reference pointing to the data operation is created, and the changes in the data operation behavior are monitored by setting a listener (firebase.database.Reference#on), so that the data can be quickly accessed and modified when needed. After monitoring the data changes, the corresponding page changes are reflected in the custom binding function, and the page display and data changes are connected through the custom binding function to achieve synchronous updates of the user interface.

[0046] S306: Define a method for uniquely identifying the user and monitor changes in the user's authentication status.

[0047] Optionally, in addition to defining data operations, the key step of user management and permission control in real-time collaboration should also be emphasized. Specifically, a method should be defined to generate a unique identity for each user and implement a function that can monitor the user status in real time. This identity should be globally unique so that specific users can be accurately identified throughout the life cycle of the system.

[0048] Optionally, still taking the above Firebase Realtime Database as an example, initialize the Firebase Authentication service in the collaborative server-side code. When the user successfully logs in or registers through the Firebase Authentication service, Firebase will generate a unique identity (UID) for the user. This UID will be used as the unique key of the user data in the database to associate all the user's operations and data. Then, set the listener (firebase.auth.Auth#onAuthStateChanged) to track the user's authentication status changes in real time. When the user's authentication status changes, such as logging in or out, the listener is triggered, and then executes the corresponding logic, such as updating the user status, loading user data, etc. By using the Firebase authentication service and the real-time database's listening function, it can be ensured that when the user logs in, logs out, or other changes occur in the authentication status, the system can respond in real time and update the user's status information.

[0049] S308. Define a method to check whether the author exists in the database.

[0050] Optionally, the user's identity may include the author of the document and a common collaborative user, wherein the author of the document is the uploader of the document, and when the user is not the uploader of the current document, the user is a common collaborative user. When verifying whether the user is the author of the document, first determine which reference path in the database stores the author information, then define a method to search for the author information in the path, and return the search result to the collaborative server.

[0051] Alternatively, still taking the above Firebase Realtime Database as an example, use the once method (firebase.database.Reference#once) to read the author information in the database once. Unlike continuous monitoring (such as using firebase.auth.Auth#onAuthStateChanged), the once method will only be triggered once in the current state of the data and return a DataSnapshot object containing specific data to check whether a specific data item exists. Through the firebase.database.DataSnapshot#hasChild function, you can check whether the returned DataSnapshot object contains specific child items (such as UID) to indicate whether the author already exists in the database.

[0052] S310. Define the user's login method.

[0053] Optionally, in addition to verifying the author's identity, a login method should also be set for ordinary users other than the author. Specifically, taking the above Firebase Realtime Database as an example, if you want to implement anonymous login for ordinary users, you can call the firebase.auth.Auth#signInAnonymously method, which allows users to log in anonymously.

[0054] S312: Define a data writing method.

[0055] Optionally, in a real-time collaborative environment, multiple users may modify the same document at the same time. If there is no clear method for writing data, data conflicts or losses may occur, thereby destroying the consistency and accuracy of the data. Therefore, it is necessary to define specific data writing to ensure that the data is updated in a controllable and orderly manner, thereby maintaining the integrity and accuracy of the data. For example, in Firebase Realtime Database, the firebase.database.Reference#set method can be used to write or update data in the database, write data to the specified path, and create it if the path does not exist; if it already exists, it will be overwritten. Similarly, the firebase.database.Reference#remove method is used to delete data from the database. It will delete all data under the specified path. If there is no data under the path, no operation will be performed.

[0056] S314. Add server-side permission rules for writing data.

[0057] Optionally, in real-time collaborative application scenarios, especially when multiple users can access and modify data, correct permission control is crucial. In order to ensure the smoothness and real-time nature of document collaborative processing, when the user processes the document at the terminal, the permission of the current operating user is not checked in advance, and the permission check mechanism is defined on the collaborative server side. First, distinguish between read permissions and write permissions for data. For example, all users may need to be able to read document data, but only the author of the document or users with specific roles can modify or delete related data in the document. Therefore, according to the data permission requirements, developers need to write corresponding database rules to define which paths can be accessed and modified by which users. For example, a rule can be written to restrict only the document author to write document data, while allowing all users to read document data. By placing the permission control logic on the collaborative server side, while improving the security of document data, it can also simplify the development and maintenance of client code.

[0058] In an embodiment of the present application, a collaborative server initialization step in a collaborative document processing method is provided. Through the above-mentioned server initialization step, a collaborative server capable of providing collaborative services can be finally obtained. Based on the collaborative server, callback functions for various document processing events can be defined, and after establishing communication with the terminal, the callback function is bound to various document processing events in the terminal, so that the callback function is used to process various document processing events in the terminal, so that multiple team members can view, discuss and modify the same document at the same time, so as to achieve efficient real-time collaboration and communication and improve team work efficiency.

[0059] See also Figure 4 , Figure 4 A schematic diagram of the process flow of events in a collaborative document processing method provided in an embodiment of the present application.

[0060] like Figure 4 As shown, in the collaborative processing method of documents, the above step S206 may at least further include: S402. When a loading event for a document is monitored, a loading callback function corresponding to the loading event is triggered, and a corresponding network request is constructed through the processing flow defined in the loading callback function and sent to the collaborative server, so that the collaborative server calls the loading callback function to render the document data corresponding to the document in the database to obtain a document rendering file, and sends the document rendering file to the terminal.

[0061] Optionally, in the document collaborative processing method of the embodiment of the present application, multiple users need to edit and share the same document in real time. Before this, the user first expects to be able to quickly open and view the document, rather than waiting for a long time for the document content to load, which requires that the user's loading request can be processed quickly and accurately. Therefore, how to optimize the document loading process and increase the loading speed has become a key issue in improving the user experience, which is directly related to the fast and accurate presentation of the document content on the terminal.

[0062] Optionally, when the terminal generates a collaborative service call request based on a user operation, it will obtain a series of predefined callback functions in the collaborative server, including a loading callback function specifically used to handle loading events. After obtaining the loading callback function, the terminal will bind the loading callback function to the corresponding loading event in the terminal. When the user tries to open or load a document on the terminal, the document processing system of the terminal listens to this loading event, and when the document needs to be loaded, it automatically triggers the loading callback function bound to the loading event according to the previous binding relationship. At this time, the loading callback function is activated and ready to execute its preset loading logic. After the loading callback function is triggered, the collaborative server will use the parameters provided in the loading callback function (such as document ID, user ID, etc.) to retrieve the document data in the database, and use its own rendering engine to process these data to generate a document rendering file suitable for display on the terminal. After the rendering is completed, the collaborative server sends the generated document rendering file back to the terminal through the communication instance.

[0063] S404: Displaying a rendering result of the document in a display interface based on the document rendering file.

[0064] Optionally, after receiving the document rendering file from the collaborative server, the terminal immediately loads and displays the rendering result of the file in the display interface, so that the user can view the complete content of the document in real time on the terminal, thereby greatly improving the efficiency of document loading and viewing. At the same time, in the collaborative processing of documents, the terminal should be able to receive document update information from the collaborative server in real time, and dynamically update the corresponding part of the rendering result to keep the document up to date. In addition, users are also allowed to customize the rendering style of the document, including fonts, colors, margins, headers and footers, etc., to ensure that the document rendering results can be well displayed on different devices and screen sizes, and can also automatically adjust the layout and style to adapt to different display environments in accordance with personal preferences.

[0065] S406. When an annotation operation event for a document is monitored, the annotation operation callback function corresponding to the annotation operation event is triggered. The corresponding network request is constructed through the processing flow defined in the annotation operation callback function and sent to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and executes the annotation operation indicated by the annotation operation event when the current operating user is the uploader.

[0066] Optionally, in the process of multiple people collaboratively editing a document, different collaborators may have different understandings, questions or suggestions for different parts of the document. The annotation operation provides a convenient way of communication for this situation, allowing collaborators to directly add relevant instructions at specific locations in the document. These instructions can be questions, answers, suggestions or emphasis on a certain section of content. In this way, communication between collaborators is more intuitive and efficient, reducing the need for communication through additional channels such as emails and chat tools. Therefore, the demand for annotation operation functions in document collaborative processing has greatly increased, and multiple users often need to perform operations such as editing, reviewing and annotating on the same document in real time. Based on this, the annotation operation callback function is pre-defined in the collaborative server, so that the collaborative server can perform the annotation operation according to the callback function. When the terminal initiates a collaborative service call request, the collaborative server will return multiple callback functions including the annotation operation callback function to the terminal. After the terminal obtains the annotation operation callback function, it will bind the callback function to the annotation operation event to ensure that when the annotation operation occurs, the callback function can be automatically triggered and executed. In the process of document collaborative processing, the terminal continuously monitors the annotation operation event in the document, and when the user annotates on the document, the event is triggered. At this time, the annotation operation callback function corresponding to the annotation operation event is triggered, and the collaborative server can automatically call the annotation operation callback function to execute the user's annotation operation, add the user's annotation content to the document, and synchronously update it to the terminal of the current operating user and the terminals of other collaborative users.

[0067] It should be noted that the user's annotation operation includes at least one of an annotation adding operation, an annotation modifying operation, and an annotation deleting operation. For example, the annotation adding operation may be: highlighting the text "smart door lock" and adding an annotation to the text "basis for applying for compulsory execution"; the annotation deleting operation may be: deleting the highlighting of the text "smart door lock".

[0068] Alternatively, as the number of users participating in the collaboration increases, if certain permission controls are not implemented for users who perform annotation operations, any user may be able to modify sensitive information in the document, and annotation operations without permission controls are likely to cause the data in the document to be accidentally modified or deleted, which in turn causes data errors and confusion, affecting the normal operation of team collaboration and business decisions. Therefore, when designing and implementing the annotation operation function of the document collaboration processing system, the needs and implementation strategies of permission control should be fully considered, and permission management and optimization should be performed on annotation operation events to ensure the standardization and security of annotation operation processing.

[0069] Based on this, when executing the annotation operation callback function, user identity authentication is performed first. The identity of the user can include the author of the document and the ordinary collaborative user, where the author of the document is the uploader of the document, and the ordinary collaborative user is other users who have not uploaded the document in the collaborative service. By calling the user verification interface provided by the collaborative server, check whether the current operating user is the uploader of the document. If the verification passes, that is, the current operating user is the document uploader, the collaborative server is allowed to directly execute the user's annotation operation and add the user's annotation content to the document without performing other identity authentication operations. By restricting the execution permissions of the annotation operation, it can be prevented that non-authors arbitrarily add irrelevant or misleading comments, thereby maintaining the original intention and integrity of the document, while also ensuring the standardization of the document content.

[0070] Optionally, when each user enters the document collaborative processing system, the system will automatically assign a unique identity to the user that can identify the uniqueness of the user. When the user uploads a document for the first time, the unique identity corresponding to the user will be stored in the author information corresponding to the document in the database. When a user in the collaborative service triggers an annotation operation event, the unique identity of the current operating user is compared with the author information in the database. If it is determined that the unique identity of the current operating user is consistent with the author information in the database, it means that the current operating user is the uploader of the document, that is, the author. At this time, the author can have all the annotation rights to the document, so no other permission verification operations are performed. The author's annotation operation on the document is directly processed in the collaborative server, the annotation content is added to the document, and the document status is updated.

[0071] It should be noted that, in a feasible implementation, the author information corresponding to the current document in the database can be cleared after the document is closed and not saved to save storage resources. In other words, the author of the document can log in as a common user when opening the document subsequently, rather than as the author. In another feasible implementation, the author information can also be retained after the document is closed, and the author automatically opens the document as the author the next time it is opened, without the need to log in, to facilitate user operations. This embodiment of the application is not limited to this.

[0072] S408. When an annotation operation event for a document is monitored, the annotation operation callback function corresponding to the annotation operation event is triggered. The corresponding network request is constructed through the processing flow defined in the annotation operation callback function and sent to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and when the current operating user is not the uploader, the login status of the current operating user is determined and the annotation operation indicated by the annotation operation event is executed according to the login status.

[0073] Optionally, when judging the above permissions, it is possible to determine that the current operating user is not the author of the document, but only an ordinary user in the collaborative service. In this case, it is necessary to further determine the identity of the current user to determine whether the user has the permission to comment. Therefore, if the current user is not the author, an additional login status check can be set to check whether the login status of the current operating user is logged in or not logged in, to determine whether the user has the permission to comment, and perform subsequent corresponding annotation operations.

[0074] Optionally, the login name entered by the user is used to verify the login status of the user. Taking the PDF.JS Express viewer running on the browser as a terminal for document collaborative processing as an example, the user will enter a user name when logging in and the browser will store the unique identity corresponding to the user name at this time. Therefore, if the current user is already logged in, the unique identity corresponding to the user name can be found in the browser's memory. When judging the user's login status, it can be judged by finding whether the unique identity corresponding to the current user name is in the browser's memory information. For example, if the user name entered by user Zhang San is "Zhang Supervisor", the unique identity A1 corresponding to "Zhang Supervisor" will be stored in the browser memory, and then the browser memory information is searched for whether there is an identity identical to A1. If there is, it proves that Zhang San is a logged-in user; if not found, it proves that Zhang San is a non-logged-in user. The identity information used to judge the login status can also be other information such as user ID, which is not limited in the embodiment of the present application.

[0075] Optionally, in a feasible implementation, the unique identity used to identify the uniqueness of the user's identity can be permanent. When a user logs in using his unique identity, the document information opened by the user will be associated with the unique identity and stored, so that when the user logs in using the unique identity later, he can directly access all historical documents viewed by the user based on the historical document information associated with the unique identity, and directly annotate the historical documents. In another feasible implementation, the login information can also be chosen not to be saved. Before each annotation operation, the user is asked to re-enter the identity information for a new anonymous login, and the anonymous login information is associated with the annotation operation to distinguish the annotation operations of different users in a collaborative processing process, while reducing the amount of data storage and saving storage space.

[0076] Optionally, in order to prevent non-logged-in users from making annotations, which would affect the security and uniformity of the document, it is necessary to ensure that only users who have logged in to the system have the authority to annotate the document. Then, when a user attempts to make an annotation and is identified as a logged-in user, the collaborative server will store the unique identity information of the current operating user. This information is the only proof of the user's identity, ensuring that the system can accurately identify the current operating user. After confirming the uniqueness of the user's identity, it can be checked whether the current operating user has the right to annotate the document according to the preset annotation permission rules. After confirming that the user has the annotation permission, the user will be allowed to perform the annotation operation. In this process, the collaborative server will record the annotation operation performed by the user and associate it with the user's unique identity information, and then store the annotation content and the associated user unique identity information in the corresponding database of the collaborative server. This storage method allows the annotations to be tracked and audited later to understand the creator, creation time, and possible modification history of each annotation.

[0077] Optionally, the comment permission rule can be set to allow all logged-in users to have comment operation permissions, so that after determining that the user is logged in, the user is allowed to directly perform the corresponding comment operation without additional permission checks. The comment permission rule can also set different comment operation permissions for different logged-in operation users, allowing users to perform corresponding comment operations within the corresponding permission range, avoiding confusion in comment operations and causing arbitrary tampering of document information.

[0078] It should be noted that since the user's login information can be saved or not, that is, the user may log in with his real name or anonymously. Therefore, in the case of anonymous login, even if the annotation operation is actually performed by the same user, the user's unique identity information associated with the annotation operation content will be different if the time of opening the document and performing the annotation operation is different.

[0079] Optionally, if the current operating user is determined to be a non-logged-in user after judging the login status, in order to ensure that the document is not arbitrarily tampered with and improve the security of the system, the user currently performing the annotation operation should be determined to have no corresponding authority, and the collaborative server should reject the user's annotation operation and send a corresponding prompt message to the terminal corresponding to the user. The prompt message can only indicate that the current user is not logged in and rejects the annotation operation; it can also prompt the current user to log in at the same time.

[0080] Optionally, if corresponding annotation operation permission rules are set for the logged-in user, when the logged-in user performs annotation operations outside the permission scope, the collaborative server should also reject the annotation operations beyond the permission scope and send a corresponding prompt message to the user.

[0081] In an embodiment of the present application, a method for collaborative processing of documents is provided. When a user's loading event for a document is monitored, the corresponding loading callback function in the collaborative server is triggered, and the loading logic in the function is executed, so that the collaborative server can find the target file in the database and render it, and further display the target file in the terminal. Through the execution of the loading callback function, the document rendering and instant transmission on the collaborative server side are realized, the rendering burden of the terminal is reduced, the loading speed of the document is accelerated, and the user can view the document content faster, thereby improving the overall user experience. At the same time, by setting the annotation operation event and its corresponding annotation operation callback function, the annotation operation callback function is triggered in real time after the annotation operation event is monitored, and the corresponding annotation operation is processed by the collaborative server, so that team members can add annotations in real time to the collaborative document through the interaction between the terminal and the collaborative server to mark the points that need to be discussed, assign tasks or raise questions, reduce the waiting time for file integration and transmission in traditional team work, help team members communicate and collaborate better, and improve work efficiency. Further, by introducing user identity authentication and login status check mechanism in the annotation operation, the security of the document can be significantly improved, and the unauthorized user can be effectively prevented from modifying the document at will, and the integrity and security of the document content can be guaranteed.

[0082] See also Figure 5 , Figure 5 A flowchart of a collaborative document processing method applied to a collaborative server provided in an embodiment of the present application.

[0083] like Figure 5 As shown, the collaborative processing method of the document, applied to the collaborative server, may at least include: S502: In response to the collaboration service invocation request sent by the terminal, at least one callback function corresponding to the collaboration service invocation request is sent to the terminal.

[0084] Optionally, various callback functions are predefined in the collaborative server to guide the terminal on how to interact with the server in subsequent operations to handle collaborative document processing events. When a user needs to perform a collaborative service operation, the user operation will generate a collaborative service call request in the terminal. When the collaborative server receives the request sent by the terminal, it will send one or more specific callback functions corresponding to the request to the terminal based on factors such as the document status and service configuration, so that the terminal can bind various document processing events with the corresponding callback functions, thereby realizing collaborative processing of documents.

[0085] S504: When receiving a network request constructed by the terminal through the processing flow defined in the target callback function, processing a target document processing event based on the target callback function.

[0086] Optionally, when it is detected that a user operation has triggered a document processing event, the terminal will construct a corresponding network request based on the processing flow defined in the callback function bound to the document processing event, and send the network request to the collaborative server. At this time, the collaborative server will parse the received network request and execute the corresponding callback function based on the parsing result to respond to the user's document processing operation to handle the document processing event triggered by it.

[0087] In an embodiment of the present application, a method for collaborative processing of documents is provided, which is applied to a collaborative server. In response to a collaborative service call request sent by a terminal, at least one callback function corresponding to the collaborative service call request is sent to the terminal; when a network request constructed by the terminal through the processing flow defined in the target callback function is received, a target document processing event is processed based on the target callback function. When the terminal needs to call the collaborative service of the collaborative server, the collaborative server can send the required callback function to the terminal so that the terminal can bind the document processing event and the corresponding callback function, and after receiving the corresponding network request from the terminal, the corresponding callback function is executed according to the request to process the document processing event, thereby realizing the collaborative processing of documents between the terminals through the collaborative server.

[0088] See also Figure 6 , Figure 6 A structural block diagram of a collaborative processing device for documents applied to a terminal provided in an embodiment of the present application.

[0089] like Figure 6 As shown, the document collaborative processing device 600, applied to a terminal, includes: The function determination module 610 is used to generate a collaboration service call request based on the user operation, send the collaboration service call request to the collaboration server and receive at least one callback function returned by the collaboration server; Function binding module 620, used to bind each callback function with the document processing event corresponding to each callback function in the terminal; Function execution module 630 is used to trigger the target callback function corresponding to the target document processing event when monitoring the target document processing event for the document, build the corresponding network request through the processing flow defined in the target callback function and send it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function.

[0090] Optionally, the target document processing event is a loading event; the function execution module 630 is also used to trigger the loading callback function corresponding to the loading event, build a corresponding network request through the processing flow defined in the loading callback function and send it to the collaborative server, so that the collaborative server calls the loading callback function to render according to the document data corresponding to the document in the database to obtain a document rendering file, and sends the document rendering file to the terminal; display the rendering result of the document in the display interface based on the document rendering file.

[0091] Optionally, the target document processing event is an annotation operation event; the function execution module 630 is also used to trigger the annotation operation callback function corresponding to the annotation operation event, and build a corresponding network request through the processing flow defined in the annotation operation callback function and send it to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and when the current operating user is the uploader, executes the annotation operation indicated by the annotation operation event.

[0092] Optionally, the function execution module 630 is also used to trigger the annotation operation callback function corresponding to the annotation operation event, and build a corresponding network request through the processing flow defined in the annotation operation callback function and send it to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and when the current operating user is not the uploader, judge the login status of the current operating user and perform the annotation operation indicated by the annotation operation event according to the login status.

[0093] Optionally, the login status is a logged-in status or a non-logged-in status; the logged-in status is used to instruct the collaborative server to store unique identification information used to prove the uniqueness of the identity of the current operating user, and to execute the annotation operation indicated by the annotation operation event and associate the annotation operation with the unique identification information; the non-logged-in status is used to instruct the collaborative server to generate corresponding login prompt information and send it to the terminal.

[0094] Optionally, the annotation operation includes at least one of an annotation adding operation, an annotation modifying operation, and an annotation deleting operation.

[0095] Optionally, the document collaborative processing device 600 is further used to establish a communication module, before the function determination module generates a collaborative service call request based on the user operation, to create a communication instance with the collaborative server, and to communicate with the collaborative server based on the communication instance.

[0096] See also Figure 7 , Figure 7 A structural block diagram of a collaborative processing device for documents applied to a collaborative server provided in an embodiment of the present application.

[0097] like Figure 7 As shown, the document collaborative processing device 700, applied to the collaborative server, includes: The function sending module 710 is used to respond to the collaborative service calling request sent by the terminal and send at least one callback function corresponding to the collaborative service calling request to the terminal; The function execution module 720 is used to process a target document processing event based on the target callback function when receiving a network request constructed by the terminal through the processing flow defined in the target callback function.

[0098] In an embodiment of the present application, a document collaborative processing device is provided, which is applied to a collaborative server. Among them, a function sending module is used to respond to a collaborative service call request sent by a terminal, and send at least one callback function corresponding to the collaborative service call request to the terminal; a function execution module is used to process a target document processing event based on the target callback function when a network request constructed by the terminal through the processing flow defined in the target callback function is received. Through the function sending module, when the terminal needs to call the collaborative service of the collaborative server, the collaborative server can send the required callback function to the terminal, so that the terminal can bind the document processing event and the corresponding callback function, and after receiving the corresponding network request from the terminal, the corresponding callback function is executed according to the request to process the document processing event, thereby realizing the collaborative processing of documents between the terminals through the collaborative server.

[0099] An embodiment of the present application further provides a computer storage medium, which can store multiple instructions, and the instructions are suitable for being loaded by a processor and executing the steps of any method in the above embodiments.

[0100] See also Figure 8 , Figure 8 FIG. 1 shows a schematic diagram of the structure of a terminal provided in an embodiment of the present application. Figure 8 As shown, the terminal 800 may include: at least one terminal processor 801 , at least one network interface 804 , a user interface 803 , a memory 805 , and at least one communication bus 802 .

[0101] The communication bus 802 is used to realize the connection and communication among the above-mentioned components.

[0102] The user interface 803 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 803 may also include a standard wired interface and a wireless interface.

[0103] The network interface 804 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0104] Among them, the terminal processor 801 may include one or more processing cores. The terminal processor 801 uses various interfaces and lines to connect various parts in the entire terminal 800, and executes various functions and processes data of the terminal 800 by running or executing instructions, programs, code sets or instruction sets stored in the memory 805, and calling data stored in the memory 805. Optionally, the terminal processor 801 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The terminal processor 801 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the terminal processor 801, and it can be implemented separately through a chip.

[0105] Among them, the memory 805 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory, ROM). Optionally, the memory 805 includes a non-transitory computer-readable storage medium. The memory 805 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 805 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned various method embodiments, etc.; the data storage area may store data involved in the above-mentioned various method embodiments, etc. The memory 805 may also be optionally at least one storage device located away from the aforementioned terminal processor 801. As Figure 8 As shown, the memory 805 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a document co-processing program.

[0106] exist Figure 8 In the terminal 800 shown, the user interface 803 is mainly used to provide an input interface for the user and obtain the data input by the user, and the terminal processor 801 can be used to call the collaborative processing program of the document stored in the memory 805 and specifically perform the following operations: Generate a collaboration service call request based on the user operation, send the collaboration service call request to the collaboration server and receive at least one callback function returned by the collaboration server; Bind each callback function to the document processing event corresponding to each callback function in the terminal; When a target document processing event for a document is monitored, the target callback function corresponding to the target document processing event is triggered, and the corresponding network request is constructed through the processing flow defined in the target callback function and sent to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function.

[0107] In some embodiments, the target document processing event is a loading event; when the terminal processor 801 executes the target callback function corresponding to the triggered target document processing event, it constructs a corresponding network request through the processing flow defined in the target callback function and sends it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function. Specifically, the following steps are performed: triggering the loading callback function corresponding to the loading event, constructing a corresponding network request through the processing flow defined in the loading callback function and sending it to the collaborative server, so that the collaborative server calls the loading callback function to render according to the document data corresponding to the document in the database to obtain a document rendering file, and sending the document rendering file to the terminal; displaying the rendering result of the document in the display interface based on the document rendering file.

[0108] In some embodiments, the target document processing event is an annotation operation event; when the terminal processor 801 executes the target callback function corresponding to the triggered target document processing event, it constructs the corresponding network request through the processing flow defined in the target callback function and sends it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function. Specifically, the following steps are performed: triggering the annotation operation callback function corresponding to the annotation operation event, constructing the corresponding network request through the processing flow defined in the annotation operation callback function and sending it to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and performing the annotation operation indicated by the annotation operation event when the current operating user is the uploader.

[0109] In some embodiments, when the terminal processor 801 executes the target callback function corresponding to the triggered target document processing event, it constructs the corresponding network request through the processing flow defined in the target callback function and sends it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function. Specifically, the following steps are performed: triggering the annotation operation callback function corresponding to the annotation operation event, constructing the corresponding network request through the processing flow defined in the annotation operation callback function and sending it to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and when the current operating user is not the uploader, judging the login status of the current operating user and performing the annotation operation indicated by the annotation operation event according to the login status.

[0110] In some embodiments, the login status is a logged-in status or a non-logged-in status; the logged-in status is used to instruct the collaborative server to store unique identification information used to prove the uniqueness of the identity of the current operating user, and to execute the annotation operation indicated by the annotation operation event and associate the annotation operation with the unique identification information; the non-logged-in status is used to instruct the collaborative server to generate corresponding login prompt information and send it to the terminal.

[0111] In some embodiments, the annotation operation includes at least one of an annotation adding operation, an annotation modifying operation, and an annotation deleting operation.

[0112] In some embodiments, before generating a collaboration service call request based on a user operation, the terminal processor 801 further specifically performs the following steps: creating a communication instance with the collaboration server, and communicating with the collaboration server based on the communication instance.

[0113] See also Fig. 9 , Fig. 9 FIG. 1 shows a schematic diagram of the structure of a collaboration server provided in an embodiment of the present application. Fig. 9 As shown, the collaboration server 900 may include: at least one collaboration server processor 901 , at least one network interface 904 , a user interface 903 , a memory 905 , and at least one communication bus 902 .

[0114] The communication bus 902 is used to realize the connection and communication among the above-mentioned components.

[0115] The user interface 903 may include a display screen (Display) and a camera (Camera). Optionally, the user interface 903 may also include a standard wired interface and a wireless interface.

[0116] The network interface 904 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).

[0117] Among them, the collaborative server processor 901 may include one or more processing cores. The collaborative server processor 901 uses various interfaces and lines to connect various parts within the entire collaborative server 900, and executes various functions and processes data of the collaborative server 900 by running or executing instructions, programs, code sets or instruction sets stored in the memory 905, and calling data stored in the memory 905. Optionally, the collaborative server processor 901 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The collaborative server processor 901 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the collaborative server processor 901, and it can be implemented separately through a chip.

[0118] Among them, the memory 905 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory, ROM). Optionally, the memory 905 includes a non-transitory computer-readable storage medium. The memory 905 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 905 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 905 may optionally be at least one storage device located away from the aforementioned collaborative server processor 901. As Fig. 9 As shown, the memory 905 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a document co-processing program.

[0119] exist Fig. 9In the collaborative server 900 shown, the user interface 903 is mainly used to provide an input interface for the user and obtain the data input by the user, and the collaborative server processor 901 can be used to call the collaborative processing program of the document stored in the memory 905 and specifically perform the following operations: In response to the collaborative service invocation request sent by the terminal, sending at least one callback function corresponding to the collaborative service invocation request to the terminal; When a network request constructed by the terminal through the processing flow defined in the target callback function is received, a target document processing event is processed based on the target callback function.

[0120] 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. For example, the device embodiments described above are only schematic. For example, the division of modules is only a logical function division. There may be other division methods in actual implementation, such as multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.

[0121] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0122] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The above computer program product includes one or more computer instructions. When the above computer program instructions are loaded and executed on a computer, the above process or function according to the embodiment of this specification is generated in whole or in part. The above computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The above computer instructions can be stored in a computer-readable storage medium or transmitted through the above computer-readable storage medium. The above computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (Digital Subscriber Line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The above computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that includes one or more available media integrated. The above-mentioned available media can be magnetic media (for example, floppy disks, hard disks, tapes), optical media (for example, digital versatile discs (DVD)), or semiconductor media (for example, solid state drives (SSD)), etc.

[0123] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described action sequence, because according to the present application, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0124] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0125] The above is a description of a document collaborative processing method, device, storage medium and terminal provided in the present application. For technicians in this field, according to the ideas of the embodiments of the present application, there may be changes in the specific implementation methods and application scopes. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A method for collaboratively processing documents, characterized in that: Applied to a terminal, the method comprises: Generate a collaboration service call request based on the user operation, send the collaboration service call request to the collaboration server and receive at least one callback function returned by the collaboration server; Binding each callback function to a document processing event corresponding to each callback function in the terminal; When a target document processing event for a document is monitored, the target callback function corresponding to the target document processing event is triggered, and the corresponding network request is constructed through the processing flow defined in the target callback function and sent to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function.

2. The method according to claim 1, characterized in that The target document processing event is a loading event; The triggering of the target callback function corresponding to the target document processing event, constructing a corresponding network request through the processing flow defined in the target callback function and sending the request to the collaboration server, so that the collaboration server processes the target document processing event based on the target callback function, includes: Triggering a loading callback function corresponding to the loading event, constructing a corresponding network request through a processing flow defined in the loading callback function and sending the request to the collaboration server, so that the collaboration server calls the loading callback function to render a document rendering file according to the document data corresponding to the document in the database, and sends the document rendering file to the terminal; The rendering result of the document is displayed in a display interface based on the document rendering file.

3. The method according to claim 1, characterized in that The target document processing event is an annotation operation event; The triggering of the target callback function corresponding to the target document processing event, constructing a corresponding network request through the processing flow defined in the target callback function and sending the request to the collaboration server, so that the collaboration server processes the target document processing event based on the target callback function, includes: Trigger the annotation operation callback function corresponding to the annotation operation event, build a corresponding network request through the processing flow defined in the annotation operation callback function and send it to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and executes the annotation operation indicated by the annotation operation event when the current operating user is the uploader.

4. The method according to claim 3, characterized in that The triggering of the target callback function corresponding to the target document processing event, constructing a corresponding network request through the processing flow defined in the target callback function and sending the request to the collaboration server, so that the collaboration server processes the target document processing event based on the target callback function, includes: The annotation operation callback function corresponding to the annotation operation event is triggered, and the corresponding network request is constructed through the processing flow defined in the annotation operation callback function and sent to the collaborative server, so that the collaborative server calls the annotation operation callback function to verify whether the current operating user is the uploader of the document, and when the current operating user is not the uploader, the login status of the current operating user is determined and the annotation operation indicated by the annotation operation event is performed according to the login status.

5. The method according to claim 4, characterized in that The login status is a logged-in status or a not-logged-in status; The logged-in state is used to instruct the collaboration server to store unique identification information used to prove the uniqueness of the identity of the current operating user, and to perform the annotation operation indicated by the annotation operation event and associate the annotation operation with the unique identification information; The non-logged-in state is used to instruct the collaboration server to generate corresponding login prompt information and send it to the terminal.

6. The method according to any one of claims 3 to 5, characterized in that The annotation operation includes at least one of an annotation adding operation, an annotation modifying operation, and an annotation deleting operation.

7. The method according to claim 1, characterized in that Before generating the collaborative service call request based on the user operation, the method further includes: A communication instance is created with the collaboration server, and communication is performed with the collaboration server based on the communication instance.

8. A method for collaboratively processing documents, characterized in that: Applied to a collaboration server, the method comprises: In response to the collaborative service invocation request sent by the terminal, sending at least one callback function corresponding to the collaborative service invocation request to the terminal; When receiving a network request constructed by the terminal through the processing flow defined in the target callback function, a target document processing event is processed based on the target callback function.

9. A collaborative document processing device, characterized in that: Applied to a terminal, the device comprises: A function determination module, configured to generate a collaboration service call request based on a user operation, send the collaboration service call request to a collaboration server, and receive at least one callback function returned by the collaboration server; A function binding module, used to bind each callback function to a document processing event corresponding to each callback function in the terminal; A function execution module is used to trigger a target callback function corresponding to the target document processing event when a target document processing event for a document is monitored, and to build a corresponding network request through the processing flow defined in the target callback function and send it to the collaborative server, so that the collaborative server processes the target document processing event based on the target callback function.

10. A document collaborative processing device, characterized in that: Applied to a collaboration server, the device comprises: A function sending module, used to respond to the collaborative service calling request sent by the terminal, and send at least one callback function corresponding to the collaborative service calling request to the terminal; The function execution module is used to process a target document processing event based on the target callback function when receiving a network request constructed by the terminal through the processing flow defined in the target callback function.

Citation Information

Patent Citations

  • Data processing method and device based on cloud document component

    CN114257441A

  • Hypertext collaborative editing method, device and equipment

    CN114861611A

  • Online document display method and device, equipment and storage medium

    CN117806742A

  • System and method for immersive process design collaboration on mobile devices

    US20120096394A1

  • Method and apparatus for data processing based on a cloud document component

    US20240340335A1

Cited By

  • Server-free document processing and real-time report method and system

    CN121560963A