A page processing method, device, apparatus and storage medium
By converting the encoding information of target words in the viewing state into index information in the editing state in the page processing method of multi-person collaborative editing, the problem of annotation word index offset is solved, and accurate positioning of words and annotations is achieved.
Patent Information
- Application Number
- CN202410002378.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2044-01-02
AI Technical Summary
When multiple people are collaboratively editing a document, the word index of the annotations may shift, causing misalignment.
By querying the encoding information of the target word in the viewing state and converting it into index information in the editing state, the correct word can be accurately located when multiple people are collaboratively editing.
Even during collaborative editing by multiple people, it can still accurately locate the words to add comment information, ensuring the accuracy between words and annotations.
Smart Images

Figure CN117910439B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of computer processing, and in particular to a page processing method and device, equipment and a storage medium. BACKGROUND
[0002] In the knowledge sharing, project and other scenarios, a real-time collaboration library such as YJS is used to develop a page, so as to support multiple people to collaboratively edit a document in the page and to make the team closely cooperate and improve the efficiency.
[0003] In the process of multiple people collaboration, members in the team can real-time feedback their opinions, add comments in the document and edit the content of the document.
[0004] In the real-time collaboration library such as YJS, after the content of the document is edited, the index of the word to which the comment is added is offset, so that the comment is added to other words, and the positioning disorder problem is caused. SUMMARY
[0005] The present application provides a page processing method and device, equipment and a storage medium, to solve the problem of how to track the word commented when multiple people collaboratively edit the document in the page.
[0006] According to an aspect of the present application, a page processing method is provided, comprising:
[0007] If a loading request of a client is received, a page is found according to the loading request, the page has a viewing state and an editing state, the viewing state records a published version of a document, and the editing state records a collaborative editing state of the document by multiple users;
[0008] If the page has a first target word in the viewing state, the coding information of the first target word is queried, the first target word is a word to which comment information has been added in the document;
[0009] The coding information of the first target word is converted into index information in the editing state;
[0010] The viewing state of the page is sent to the client for display, and the first target word is prompted according to the index information in the viewing state.
[0011] According to another aspect of the present application, a page processing device is provided, comprising:
[0012] A page finding module is configured to find a page according to a loading request of a client if the loading request of the client is received, the page has a viewing state and an editing state, the viewing state records a published version of a document, and the editing state records a collaborative editing state of the document by multiple users;
[0013] The encoding information query module is configured to query encoding information of the first target word if the page has the first target word in the viewing state, the first target word being a word in the document to which comment information has been added.
[0014] The index information conversion module is configured to convert the encoding information of the first target word into index information in the editing state.
[0015] The viewing state sending module is configured to send the viewing state of the page to the client for display and prompt the first target word according to the index information in the viewing state.
[0016] According to another aspect of the present application, there is provided an electronic device, comprising:
[0017] at least one processor; and
[0018] a memory in communication with the at least one processor; wherein
[0019] the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the processing method of the page according to any one of the embodiments of the present application.
[0020] According to another aspect of the present application, there is provided a computer readable storage medium storing a computer program for enabling a processor to perform the processing method of the page according to any one of the embodiments of the present application when executed by the processor.
[0021] In the embodiment, if a loading request of the client is received, the page is found according to the loading request, the page has a viewing state and an editing state, the viewing state records a published version of the document, and the editing state records a state of collaborative editing of the document by multiple users; if the page has a first target word in the viewing state, the encoding information of the first target word is queried, the first target word being a word in the document to which comment information has been added; the encoding information of the first target word is converted into index information in the editing state; and the viewing state of the page is sent to the client for display and the first target word is prompted according to the index information in the viewing state. For the document collaboratively edited by multiple users, the word to which comment information is added in the viewing state is tracked by its encoding information, and the encoding information is mapped into index information in the editing state. Even if the index information is offset when multiple people collaboratively edit, the correct index information can still be located according to the encoding information, so as to locate the correct word for prompting, thereby ensuring the accuracy between the word and the comment.
[0022] It is to be understood that the details described in this section are not intended to identify key or critical elements of the embodiments of the application or to limit the scope of the application. Other features of the present application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS
[0023] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly introduced as follows. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative effort based on these drawings.
[0024] Figure 1 is a flow chart of a page processing method according to an embodiment of the present application;
[0025] Figure 2A is an example diagram of a viewing state of a page according to an embodiment of the present application;
[0026] Figure 2B is an example diagram of an editing state of a page according to an embodiment of the present application;
[0027] Figure 3 is an example diagram of a word offset according to an embodiment of the present application;
[0028] Figure 4A and Figure 4B is an example diagram of index information according to an embodiment of the present application;
[0029] Figure 5A and Figure 5B is an example diagram of encoding information according to an embodiment of the present application;
[0030] Figure 6 is a flow chart of a page processing method according to an embodiment of the present application;
[0031] Figure 7 is a flow chart of a page processing method according to an embodiment of the present application;
[0032] Figure 8 is a flow chart of a page processing method according to an embodiment of the present application;
[0033] Figure 9 is a structural schematic diagram of a page processing device according to an embodiment of the present application;
[0034] Figure 10 is a structural schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0035] In order to make the person skilled in the art better understand the technical scheme of the present application, the technical scheme in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor should belong to the scope of protection of the present application.
[0036] It should be noted that the terms "first", "second" and the like in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to these processes, methods, products or devices.
[0037] Embodiment one
[0038] Figure 1 A flowchart of a page processing method provided by the first embodiment of the present application, the present embodiment can be applied to the case of recording annotations on the basis of the encoding information of each word in the editing state of the page, and the method can be executed by a page processing device. The page processing device can be realized in the form of hardware and / or software, and can be configured in an electronic device. As shown in the figure, the method comprises: Figure 1
[0039] Step 101: If a loading request of a client is received, the page is searched according to the loading request.
[0040] In actual application, the device of the user can include mobile terminals such as mobile phones, tablet computers, personal digital assistants, wearable devices (such as glasses, watches, etc.), and can also include fixed terminals such as personal computers and notebook computers.
[0041] Generally, the device is cross-platform (i.e. operating system), for example, Android, iOS, Windows, Harmony OS (Harmony OS) and the like.
[0042] The client supporting multi-person collaboration can be installed in different platforms, such as a browser, an application with a built-in micro browser, a widget in an application, a standalone multi-person collaboration application, and the like. The client can send a request header information to a server through a Hypertext Transfer Protocol (HTTP), a Hypertext Transfer Protocol Secure (HTTPS), or the like to request loading of a certain page.
[0043] The content of the loading request can include an identifier of the page requested by the user to load and / or a feature of the page. The identifier of the page can be information capable of representing a uniquely determined page, such as a Uniform Resource Identifier (URI). The Uniform Resource Identifier can specifically include a Uniform Resource Locator (URL) or a Uniform Resource Name (URN), and the like.
[0044] Further, the client can find an IP (Internet Protocol) address mapped by a Domain Name (Domain Name) in the page URL through DNS (Domain Name System) resolution. After successfully obtaining the IP address, the client can request connection to the server at the IP address. After successfully connecting to the server at the IP address, the client can send a request header information to the server at the IP address through a HTTP or HTTPS to request loading of a web page. After receiving the loading request, the server waits for processing, finds resources of the corresponding page, and finally returns the resources of the page to the client.
[0045] To support multi-person collaborative editing, the page can be developed using a real-time collaboration library of a front end such as YJS. YJS provides users with commonly used data types (so-called Shared Types, which are collectively referred to as YModel here) such as YText, YArray, and YMap. In YJS, the data in the YModel instances of YText, YArray, or YMap is stored in a bidirectional linked list.
[0046] Each item in the chain table (or each item) uniquely records the data modified by a user operation, and it can be considered that the operation on YModel in the above example is finally converted into append, insert, split, merge and other structural transformations on the chain table. Each item in the chain table is serialized and coded and distributed, and based on the guarantee of the CRDT (Conflict-Free Replicated Data Type, Conflict-Free Replicated Data Type) algorithm, each client can receive all the items, so that no matter in what order the client receives the items, they can all reconstruct the completely consistent state of the document.
[0047] In the embodiment, the page has a viewing state and an editing state, wherein, as shown in Figure 2A the viewing state is a state of viewing the document in the page, which records the published version of the document, and the published version can be the initial version or the version at a moment of collaborative editing by multiple users, and allows a user to add comment information to a word in the document, as shown in Figure 2B the editing state records the state of collaborative editing of the document by multiple users, and the content of the editing state is updated in real time as the user edits the document.
[0048] Generally, for the same document, the viewing state lags behind the editing state on the time axis.
[0049] Further, the collaborative editing of the document by multiple users can include deleting a word in the document, adding a word in the document, and the like.
[0050] Among them, the deletion of the word in the document is usually a logical deletion, that is, the word in the document is marked as deleted, and it does not necessarily mean that the word in the document is deleted in the database, and the deleted word can be an originally existing word in the document or a word added by a user, and the embodiment does not limit this.
[0051] Step 102, if the page has a first target word in the viewing state, the encoding information of the first target word is queried.
[0052] When the page is in the viewing state, the user is allowed to view the document and is prohibited to collaboratively edit the document, in addition, multiple users are allowed to select a word in the document by long pressing, word drawing and the like, and add comment information (i.e. annotation) to the word.
[0053] For convenience of distinction, the word to which the comment information has been added in history can be recorded as the first target word, that is, the first target word is the word to which the comment information has been added in the document.
[0054] When the page is in the editing state, multiple users are allowed to collaboratively edit the document, and are prohibited from selecting words in the document by using the underlining method and adding comment information (i.e., annotations) to the words.
[0055] In either the viewing state or the editing state, the index information Index and the encoding information of each word in the document are unified, i.e., the index information Index is information of a common index position in the viewing state and the editing state, and the encoding information is information (such as an ID) that is common to the viewing state and the editing state and that identifies a word in the document.
[0056] Further, when the page is in the viewing state, the index information Index and the encoding information (such as an ID) of each word in the document are not separately edited, and the index information Index and the encoding information (such as an ID) are kept synchronized with the index information Index and the encoding information (such as an ID) in the editing state.
[0057] Multiple users collaboratively edit the document in the editing state of the page, and continuously add new words to the document, so that the index information Index of some or all of the words in the document continuously changes.
[0058] For example, as shown in FIG. 2A, the document has multiple words A, B, C, D, and E, and a user selects to add comment information to B, C, D, and E. Figure 3
[0059] If the current user or other users edit the document of the page thereafter, new words X, Y, and Z are added before the word A.
[0060] As shown in FIG. 2B, if the selected positions are recorded using the index information, the position of the start (Start) is recorded as 2, and the position of the end (End) is recorded as 5. Figure 4A As shown in FIG. 2C, after the editing, the selected positions (i.e., 2-5) change, and the content at the same positions changes from the words B, C, D, and E to the words Y, Z, A, and B.
[0061] Figure 4B As shown in FIG. 2D, if the selected positions are recorded using the encoding information (ID), the position of the start (Start) is recorded as B, and the position of the end (End) is recorded as D.
[0062] As shown in FIG. 2E, after the editing, the selected positions (i.e., B-D) do not change, and the content at the same positions remains the words B, C, D, and E. Figure 5A
[0063] As shown in FIG. 2F, after the editing, the selected positions (i.e., B-D) do not change, and the content at the same positions remains the words B, C, D, and E. Figure 5B
[0064] Therefore, in the case that the words of the comment information added in the index information are misaligned, the embodiment traces the words of the comment information added from the index information Index of the words of the comment information to the encoding information (such as ID) thereof in the viewing state, and tracks the words of the comment information added using the encoding information (such as ID).
[0065] If the corresponding page is found according to the loading request, the comment state of the page can be checked in a database, a configuration file, or the like, and if the comment state of the page is that the comment has been added, that is, the document of the page exists in the viewing state, the first target word, the encoding information of the first target word recorded when the comment information is added in advance can be queried in the database or the configuration file or the like.
[0066] Step 103, converting the encoding information of the first target word into index information in the editing state.
[0067] Since the page is processed by using the index information Index of the words, when the encoding information (such as ID) of the first target word is queried in the viewing state of the page, the encoding information (such as ID) of the first target word can be converted into the index information Index of the first target word in the editing state.
[0068] In a specific implementation, a model structure (such as Y.Doc of YJS) constructed for a document can be queried in a collaborative library (such as YJS) supporting multi-user editing, and the model structure and the data structure of the document are in one-to-one correspondence.
[0069] Taking the Doc of YJS as an example, YJS provides an API (Application Program Interface, application program interface) of Y.Doc (hereinafter referred to as Doc) as a model structure of a document, and acts as a role of a container. Since shared types data is hung on the Doc instance, the shared types data can store all shared types data.
[0070] When data is synchronized, multiple Doc instances can be created, a Y.Array instance is mounted, elements are inserted into the Doc instance Y.Array instance, and onSync functions are used to synchronize them. Subsequent operations are the same as inserting elements and synchronizing respectively.
[0071] Among them, when data synchronization is involved, the API: calling encodeStateAsUpdate will convert the state of its parameter (a YJS document instance) into an update object, and calling applyUpdate function will apply update to another YJS Doc instance.
[0072] Furthermore, since the model structure (such as Doc) is large in size, updating and saving the model structure (such as Doc) corresponding to the editing state is costly. Therefore, a snapshot mechanism provided by the collaboration library (such as YJS snapshot) can be used to generate snapshot information of the model structure when the user finishes editing and saves the document.
[0073] When converting encoded information into index information, it is possible to query the snapshot information generated by the collaborative library that supports multi-user editing when the document is edited (i.e., the user saves the document), and map the snapshot information to the model structure built for the document.
[0074] Since snapshot information does not save the full amount of data, the size of snapshot information is smaller than that of the model structure, which can greatly reduce costs.
[0075] Then, the index information corresponding to the encoding information of the first target word in the edit state can be queried in the model structure (such as Doc), that is, the word represented by the encoding information of the first target word can be queried, and the index information of that word can be queried.
[0076] Step 104: Send the page's view status to the client for display, and prompt the first target word in the view status according to the index information.
[0077] The server sends the page's view state (including the index information of the first target keyword) to the client. Under protocols such as HTTP or HTTPS, the client can receive an HTML file from the server. The client can parse the HTML file, generating a tree-structured object, namely the DOM (Document Object Model). Each object is a node on the DOM, and these objects can represent resources such as text and images. Once parsing is complete, the page can be displayed for the user to view.
[0078] The client searches for the first target word based on the index information and performs prompting operations on the first target word on the page, such as highlighting or underlining, indicating that the first target word has been added with comment information by the user.
[0079] In the embodiment, if a loading request of a client is received, a page is searched according to the loading request, the page has a viewing state and an editing state, the viewing state records a published version of a document, and the editing state records a state of collaborative editing of the document by multiple users; if the page has a first target word in the viewing state, coding information of the first target word is queried, the first target word is a word in the document to which comment information has been added; the coding information of the first target word is converted into index information in the editing state; the viewing state of the page is sent to the client for display, and the first target word is prompted according to the index information in the viewing state. For the document collaboratively edited by multiple users, the word to which the comment information is added in the viewing state is tracked by using the coding information thereof, and the coding information thereof is mapped into the index information in the editing state. Even if the index information thereof is offset when multiple people collaboratively edit, the correct index information can be located according to the coding information, so that the correct word is prompted, and the accuracy between the word and the comment is ensured.
[0080] Embodiment Two
[0081] Figure 6 A flowchart of a processing method of a page provided in Embodiment Two of the application is provided, and the embodiment adds a viewing comment operation on the basis of the foregoing embodiment. As shown in the figure, the method comprises the following steps. Figure 6
[0082] Step 601: If a loading request of a client is received, a page is searched according to the loading request.
[0083] The page has a viewing state and an editing state, the viewing state records a published version of a document, and the editing state records a state of collaborative editing of the document by multiple users.
[0084] Step 602: If the page has a first target word in the viewing state, coding information of the first target word is queried.
[0085] The first target word is a word in the document to which comment information has been added.
[0086] Step 603: The coding information of the first target word is converted into index information in the editing state.
[0087] Step 604: The viewing state of the page is sent to the client for display, and the first target word is prompted according to the index information in the viewing state.
[0088] Step 605: If a browsing request triggered by the client for the first target word is received, comment information added to the first target word is queried according to the browsing request.
[0089] Step 606: The comment information added to the first target word is sent to the client for display.
[0090] In actual application, when the user views the first target word, the user can trigger the first target word by clicking, hovering, etc. Figure 2A As shown in the "copy number directly translated is conflict-free", the user intends to view the comment information added to the first target word (such as Figure 2A test), at this time, the client generates a browsing request for the first target word, and sends the browsing request to the server through HTTP or HTTPS, etc.
[0091] When the user adds comment information to a word of a page, the server can store the mapping relationship between the encoding information and the comment information in the database for the word of the page.
[0092] When the server receives the browsing request triggered for the first target word, the server queries the encoding information (such as ID) of the first target word according to the browsing request, queries the comment information added to the first target word in the database according to the mapping of the encoding information (such as ID) of the first target word, and sends the comment information of the first target word to the client.
[0093] As shown in the "copy number directly translated is conflict-free", the user intends to view the comment information added to the first target word (such as Figure 2A The client displays the comment information of the first target word in the page in the form of a comment box, a pop-up window, etc. for the user to view.
[0094] In addition to the content of the comment information itself (such as Figure 2A test), the comment information can also include the name of the user, the time of the comment, etc.
[0095] In addition, the user who adds the comment information is provided with controls for editing the comment information, deleting the comment information, etc., and the user who views the comment information is provided with controls for interaction, such as liking, commenting on the comment information, etc.
[0096] Embodiment Three
[0097] Figure 7 A flowchart of a page processing method provided by Embodiment Three of the present application is provided, and the present embodiment adds the operation of adding a comment on the basis of the foregoing embodiments. As shown in the "copy number directly translated is conflict-free", the method comprises: Figure 7
[0098] Step 701: If a loading request of the client is received, the page is queried according to the loading request.
[0099] The page has a viewing state and an editing state, the viewing state records the published version of the document, and the editing state records the state of the collaborative editing of the document by multiple users.
[0100] Step 702: If the page has a first target word in the viewing state, the encoding information of the first target word is queried.
[0101] The first target word is a word in the document to which the comment information is added.
[0102] In step 703, the encoding information of the first target word is converted into index information in the editing state.
[0103] In step 704, the viewing state of the page is sent to the client for display, and the first target word is prompted according to the index information in the viewing state.
[0104] In step 705, if the comment request of the client is received, the word to which the comment information is added by the client in the document is determined as the second target word according to the comment request.
[0105] During the process of viewing the document of the page, the user can trigger the selection of one or more words by using long pressing, word drawing and the like, and add comment information to the one or more words. At this time, the client generates a comment request for the selected word and the added comment information, and sends the comment request to the server through HTTP or HTTPS and the like.
[0106] When the server receives the comment request of the client, the word to which the comment information is added by the client in the document is parsed from the comment request, and is recorded as the second target word.
[0107] In step 706, the index information of the second target word in the editing state is queried.
[0108] In this embodiment, the server can query the index information Index of the second target word in the editing state in the structure of the page.
[0109] In step 707, the index information of the second target word is converted into the encoding information of the second target word.
[0110] In this embodiment, the word to which the comment information is added can be tracked based on the encoding information (such as ID) of the word. When the index information Index of the second target word in the editing state is queried in the structure of the page, the index information Index can be converted into the encoding information (such as ID) of the second target word.
[0111] In a specific implementation, the model structure (such as Doc) constructed for the document can be queried in a collaborative library (such as YJS) supporting multi-user editing.
[0112] Further, in order to reduce the cost, the snapshot information generated by the collaborative library (such as YJS) supporting multi-user editing for the model structure (such as Doc) of the document when the editing of the document is completed can be queried, and the snapshot information is mapped to the model structure (such as Doc) constructed for the document.
[0113] In the model structure (such as Doc), the index information Index corresponding to the encoding information (such as ID) of the second target word is queried, that is, the word (that is, the second target word) to which the index information Index belongs in the model structure (such as Doc) is queried, and the encoding information (such as ID) of the word (that is, the second target word) is queried.
[0114] Step 708, record the encoding information and the comment information for the second target word in the page.
[0115] The server can store the mapping relationship between the encoding information (such as ID) and the comment information of the second target word in the current page in the database to support subsequent viewing of the comment information added to the second target word in the viewing state.
[0116] Embodiment Four
[0117] Figure 8 A flowchart of a page processing method provided by Embodiment Four of the present application is provided, and the present embodiment adds the operation of editing a document on the basis of the foregoing embodiments. As shown in the flowchart of the page processing method provided by Embodiment Four of the present application, the method comprises: Figure 8
[0118] Step 801, if a loading request of a client is received, then the page is found according to the loading request.
[0119] The page has a viewing state and an editing state, the viewing state records a published version of the document, and the editing state records a state of collaborative editing of the document by multiple users.
[0120] Step 802, if the page has a first target word in the viewing state, then the encoding information of the first target word is queried.
[0121] The first target word is a word in the document to which comment information has been added.
[0122] Step 803, the encoding information of the first target word is converted into index information in the editing state.
[0123] Step 804, the viewing state of the page is sent to the client for display, and the first target word is prompted according to the index information in the viewing state.
[0124] Step 805, if an editing request of the client is received, then the editing state of the page is sent to the client for display.
[0125] In actual application, the user can click a specified control on the page to request switching the page from the viewing state to the editing state, at this time, the client can generate an encoding request and send the editing request to the server through HTTP or HTTPS or the like.
[0126] When the server receives an editing request for the current page, the server sends the editing state of the page to the client according to the editing request, and the client displays the editing state of the current page in the page.
[0127] In step 806, if the client edits the document in the editing state, the index information of each word in the document in the editing state is updated.
[0128] In actual applications, the user can operate and edit the document in the page in the client according to business requirements, such as adding a word (for example, the content in the middle box shown in FIG. 8), deleting a word, and the like. Figure 2B At this time, the server can update the index information of each word in the document in the editing state according to the operation of the user editing the document, so as to ensure the normal operation of the page.
[0129] Embodiment Five
[0130] Figure 9 A structural schematic diagram of a page processing device provided by Embodiment Five of the present application is shown in FIG. 9. Figure 9 As shown in FIG. 9, the device includes:
[0131] A page searching module 901 is configured to search for a page according to a loading request of a client if the loading request is received, wherein the page has a viewing state and an editing state, the viewing state records a published version of a document, and the editing state records a state of collaborative editing of the document by multiple users.
[0132] An encoding information querying module 902 is configured to query encoding information of a first target word if the page has the first target word in the viewing state, wherein the first target word is a word in the document to which comment information has been added.
[0133] An index information converting module 903 is configured to convert the encoding information of the first target word into index information in the editing state.
[0134] A viewing state sending module 904 is configured to send the viewing state of the page to the client for display and to prompt the first target word according to the index information in the viewing state.
[0135] In an embodiment of the present application, the index information converting module 903 includes:
[0136] A model structure querying module is configured to query a model structure constructed for the document in a collaborative library supporting multi-user editing.
[0137] An index information mapping module is configured to query, in the model structure, index information corresponding to the encoding information of the first target word in the editing state.
[0138] In one embodiment of the present application, further comprising:
[0139] The comment information query module is configured to query the comment information added to the first target word according to the browsing request if the browsing request triggered by the client for the first target word is received.
[0140] The comment information sending module is configured to send the comment information added to the first target word to the client for display.
[0141] In one embodiment of the present application, the comment information query module comprises:
[0142] The encoding information determination module is configured to query the encoding information of the first target word according to the browsing request.
[0143] The comment information mapping module is configured to query the comment information added to the first target word which is mapped to the encoding information of the first target word.
[0144] In one embodiment of the present application, further comprising:
[0145] The word determination module is configured to determine the word added to the comment information in the document by the client as a second target word according to the comment request if the comment request of the client is received.
[0146] The index information query module is configured to query the index information of the second target word in the editing state.
[0147] The encoding information conversion module is configured to convert the index information of the second target word into the encoding information of the second target word.
[0148] The comment record module is configured to record the encoding information and the comment information for the second target word in the page.
[0149] In one embodiment of the present application, the encoding information conversion module comprises:
[0150] The model structure query module is configured to query the model structure constructed for the document in the collaborative library supporting multi-user editing.
[0151] The encoding information mapping module is configured to query the encoding information corresponding to the index information of the second target word in the model structure.
[0152] In one embodiment of the present application, the model structure query module comprises:
[0153] The snapshot information query module is configured to query the snapshot information generated for the model structure of the document by the collaborative library supporting multi-user editing when the document is completed.
[0154] a snapshot information mapping module, configured to map the snapshot information to a model structure constructed for the document.
[0155] In an embodiment of the present application, further comprising:
[0156] an editing state sending module, configured to send the editing state of the page to the client for display if the editing request of the client is received;
[0157] an index information updating module, configured to update index information of each word in the document in the editing state if the document is edited in the editing state by the client.
[0158] The page processing apparatus provided by the embodiments of the present application can execute the page processing method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of executing the page processing method.
[0159] Embodiment six
[0160] Figure 10 A structural schematic diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not intended to limit implementations of the present application described and / or claimed in this document.
[0161] As Figure 10 shown, the electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., connected in communication with the at least one processor 11, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0162] A plurality of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.
[0163] The processor 11 can be various general and / or special-purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the processing method of a page.
[0164] In some embodiments, the processing method of a page can be implemented as a computer program tangibly embodied in a computer readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program can be loaded and / or installed onto the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded onto the RAM 13 and executed by the processor 11, one or more steps of the processing method of a page described above can be performed. Alternatively, in other embodiments, the processor 11 can be configured to perform the processing method of a page by any other appropriate means, such as by means of firmware.
[0165] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.
[0166] Computer programs for implementing the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer program, when executed, can cause instructions defined in the flow charts and / or block diagrams to be implemented. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as a stand-alone software package, and partially on a remote machine or entirely on a remote machine or server.
[0167] In the context of the present application, a computer-readable storage medium can be a tangible medium that can contain or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer-readable storage medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0168] To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
[0169] The systems and techniques described here can be implemented in a computing system that includes a back end component, e.g., as a data server, or that includes a middleware component, e.g., an application server, or that includes a front end component, e.g., a user computer having a graphical user interface or a Web browser through which a user can interact with an implementation of the systems and techniques described here, or any combination of such back end, middleware, or front end components. The components of the system can be interconnected by any form or medium of digital data communication, e.g., a communication network. Examples of communication networks include a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0170] The computing system can include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. A server can be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.
[0171] Embodiment Seven
[0172] The embodiment of the application further provides a computer program product, which comprises a computer program, and the computer program implements the page processing method provided in any embodiment of the application when executed by a processor.
[0173] The computer program code implementing the application can be written in one or more programming languages or combinations of languages including object oriented languages such as Java, Smalltalk, C++ or conventional procedural programming languages such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0174] It should be understood that the various forms of flow shown above can be used to reorder, add, or remove steps. For example, the steps recited in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, which are not limited herein.
[0175] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method of processing a page, characterized by, The method comprises the following steps: If a loading request of a client is received, a page is searched according to the loading request, the page is developed by using a real-time collaboration library, has a viewing state and an editing state, the viewing state records a published version of a document, and the editing state records a state of collaborative editing of the document by multiple users; index information and coding information of words of the document in the viewing state are kept synchronous with index information and coding information of the words of the document in the editing state; the document is collaboratively edited in the editing state, and when a new word is added in the document, index information of part or all of the words in the document changes; If the page has a first target word in the viewing state, coding information of the first target word is queried, the first target word is a word in the document to which comment information is added; A model structure constructed for the document is queried in a collaboration library supporting multi-user editing; Index information corresponding to the coding information of the first target word in the editing state is queried in the model structure; The viewing state of the page is sent to the client for display, and the first target word is prompted according to the index information in the viewing state; If a comment request of the client is received, a word to which comment information is added by the client in the document is determined as a second target word according to the comment request; Index information of the second target word in the editing state is queried; Coding information corresponding to the index information of the second target word is queried in the model structure; The coding information and the comment information of the second target word in the page are recorded, including: a mapping relationship between the coding information and the comment information of the second target word in the page is stored in a database.
2. The method of claim 1, wherein, Further comprising: If a browsing request triggered by the client for the first target word is received, comment information added to the first target word is queried according to the browsing request; The comment information added to the first target word is sent to the client for display.
3. The method of claim 2, wherein, The comment information added to the first target word is queried according to the browsing request, comprising: Coding information of the first target word is queried according to the browsing request; The comment information added to the first target word is queried according to the coding information of the first target word.
4. The method of claim 1, wherein, The model structure constructed for the document in the collaboration library supporting multi-user editing comprises: Snapshot information generated by the collaboration library supporting multi-user editing for the model structure of the document when the document is completed is queried; The snapshot information is mapped to the model structure constructed for the document.
5. The method according to any one of claims 1-3, characterized in that, Further comprising: If an editing request of the client is received, the editing state of the page is sent to the client for display; If the client edits the document in the editing state, index information of each word in the document in the editing state is updated.
6. A processing device of a page, characterized by, Comprising: The page searching module is configured to search for a page according to a loading request of a client if the loading request is received, wherein the page is developed by using a real-time collaboration library, has a viewing state and an editing state, the viewing state records a published version of a document, and the editing state records a state of collaborative editing of the document by multiple users. The coding information querying module is configured to query coding information of a first target word if the page has the first target word in the viewing state, wherein the first target word is a word in the document to which comment information is added, index information and coding information of words in the document in the viewing state are kept synchronous with index information and coding information of words in the document in the editing state, the document is collaboratively edited in the editing state, and index information of part or all of the words in the document changes when a new word is added in the document. The model structure querying module is configured to query a model structure constructed for the document in the collaboration library supporting multi-user editing. The index information mapping module is configured to query, in the model structure, index information corresponding to the coding information of the first target word in the editing state. The viewing state sending module is configured to send the viewing state of the page to the client for display and to prompt the first target word according to the index information in the viewing state. The word determining module is configured to determine a word to which comment information is added by the client in the document as a second target word if a comment request of the client is received. The index information querying module is configured to query index information of the second target word in the editing state. The coding information mapping module is configured to query coding information corresponding to the index information of the second target word in the model structure. The comment recording module is configured to record the coding information and the comment information for the second target word in the page, including storing a mapping relationship between the coding information and the comment information for the second target word of the page in a database.
7. An electronic device, comprising: The electronic device includes: at least one processor; and a memory connected with the at least one processor in communication; wherein the memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to execute the page processing method in any one of claims 1-5.
8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is used to enable the processor to implement the page processing method in any one of claims 1-5 when executed.
Citation Information
Patent Citations
Document indexing method and device and document retrieving method and device
CN110413570A
Document comment display method and device, equipment and medium
CN114417784A
Document processing method and device, equipment and medium
CN115079872A