Online document annotation display method and device and storage medium

By obtaining and querying the annotation data in online documents, the annotation loss problem caused by inconsistency between the editing page and the historical details page is solved, and the precise display of the annotation content is achieved.

CN119886076APending Publication Date: 2025-04-25BEIJING 58 INFORMATION TTECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411943807.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-04-25

AI Technical Summary

Technical Problem

When the editing page of an online document is inconsistent with the history details page, the text content and index position of the annotation cannot be accurately positioned, resulting in the loss of the annotation.

Method used

By obtaining the annotation data of the current online document, including the location information of the target annotation object, the target text content and paragraph identification, read the current text content. If the content is different from the target text, query the location of the target text content and render the annotation content in the determined display area.

Benefits of technology

Ensure that historical annotation content is accurately displayed in the current online document, avoiding the loss of annotations, and achieving accurate display of annotation content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119886076A_ABST
    Figure CN119886076A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an online document annotation display method and device and a storage medium, and the method comprises the steps: obtaining annotation data corresponding to a current online document, the annotation data comprising position information of a target annotation object, target text content and paragraph identification, the target annotation object is an associated element when the user adds the target annotation content in an editing page corresponding to the historical online document. And reading the corresponding current text content from the current online document according to the position information of the target annotation object. And if the current text content is different from the target text content, querying the target text content in the current online document according to the paragraph identifier corresponding to the target annotation object so as to determine a position corresponding to the target text content. According to the position corresponding to the target text content, the display area corresponding to the target annotation content is determined, and the target annotation content is rendered in the display area, so that the target annotation content is accurately displayed in the current online document.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of text editing, and in particular to an annotation display method, device and storage medium for online documents. Background Art

[0002] With the rapid development of Internet technology, online documents are gradually being widely used in work. Online documents refer to documents that can be created, edited, stored and shared on the Internet. Such documents allow users to access and collaborate on editing files through a web browser or dedicated applications without the need to install specific local software.

[0003] Usually, online documents are divided into edit pages and detail pages. When a user creates an annotation on the edit page of a document, the annotation text content and the document text content's index position relative to the document are stored on the server. When a user opens the document's detail page, the client obtains the annotation text content, index position and other information corresponding to the document from the server, and displays the annotation text content in the form of an annotation card next to the annotation underlined text.

[0004] However, when the user modifies the document text content on the editing page, causing the current editing page to be inconsistent with the historical details page, the annotation text content saved when creating the annotation and its index position relative to the document are only relative to the historical details page before the modification. Therefore, the location of the annotation underlined text cannot be accurately located based on the previously stored index position, resulting in the loss of the annotation. Summary of the invention

[0005] The embodiments of the present invention provide a method, a device and a storage medium for displaying annotations of an online document, so as to accurately display the annotation contents in the online document.

[0006] In a first aspect, an embodiment of the present invention provides a method for displaying annotations of an online document, the method comprising:

[0007] Acquire annotation data corresponding to the current online document, the annotation data including location information of a target annotation object, target text content corresponding to the target annotation object, and paragraph mark corresponding to the target annotation object, the target annotation object being an element associated when a user adds target annotation content in an editing page corresponding to a historical online document;

[0008] According to the position information of the target annotation object, reading the current text content corresponding to the position information from the current online document;

[0009] If the current text content is different from the target text content, searching the current online document for the target text content according to the paragraph mark corresponding to the target annotation object to determine the position corresponding to the target text content;

[0010] According to the position corresponding to the target text content, a display area corresponding to the target annotation content is determined, and the target annotation content is rendered in the display area to display the target annotation content in the current online document.

[0011] In a second aspect, an embodiment of the present invention provides an annotation display device for an online document, the device comprising:

[0012] An acquisition module, used to acquire annotation data corresponding to the current online document, wherein the annotation data includes location information of a target annotation object, target text content corresponding to the target annotation object, and paragraph mark corresponding to the target annotation object. The target annotation object is an element associated when a user adds target annotation content in an editing page corresponding to a historical online document;

[0013] A reading module, configured to read, according to the location information of the target annotation object, the current text content corresponding to the location information from the current online document;

[0014] A query module, for querying the target text content in the current online document according to the paragraph mark corresponding to the target annotation object if the current text content is different from the target text content, so as to determine the position corresponding to the target text content;

[0015] The determination module is used to determine the display area corresponding to the target annotation content according to the position corresponding to the target text content, and render the target annotation content in the display area to display the target annotation content in the current online document.

[0016] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor can at least implement the annotation display method for online documents as described in the first aspect.

[0017] In a fourth aspect, an embodiment of the present invention provides a non-transitory machine-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor can at least implement the method for displaying annotations of online documents as described in the first aspect.

[0018] In a fifth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program or instructions. When the computer program or instructions are executed by a processor, the processor is enabled to implement the method for displaying annotations of online documents as in the first aspect above.

[0019] In the annotation display scheme of online documents provided by the embodiment of the present invention, after the user adds the target annotation content for the target annotation object in the editing page corresponding to the historical online document, the user or other users modify the document content in the historical online document. If the position information corresponding to the target annotation object in the historical online document after the modification changes, the target annotation content will be displayed based on the annotation data corresponding to the target annotation content stored in the server, and the problem of annotation loss will occur. In order to avoid the problem of historical annotation content loss after opening the current online document, when displaying the historical annotation content in the current online document, the position of the target annotation object in the current online document is verified based on the position information corresponding to the target annotation object, the target text content, and the paragraph mark, and the target annotation content is rendered based on the verified position of the target annotation object to ensure that the target annotation content can be accurately displayed in the current online document.

[0020] Specifically, first, the annotation data corresponding to the current online document can be obtained. The annotation data includes the position information of the target annotation object, the target text content corresponding to the target annotation object, and the paragraph mark corresponding to the target annotation object. The target annotation object is the element associated when the user adds the target annotation content in the editing page corresponding to the historical online document. Then, according to the position information of the target annotation object in the stored annotation data, the current text content corresponding to the position information is read from the current online document, and the current text content is compared with the target text content corresponding to the target annotation object in the stored annotation data. If the current text content is not the same as the target text content, the target text content is queried in the current online document according to the paragraph mark corresponding to the target annotation object to determine the position corresponding to the target text content. Then, according to the position corresponding to the target text content, the display area corresponding to the target annotation content is determined, and the target annotation content is rendered in the display area to display the target annotation content in the current online document.

[0021] In the above scheme, by reading the current text content corresponding to the position information of the target annotation object in the annotation data from the current online document, and comparing the current text content with the target text content in the annotation data to determine the position of the target text content corresponding to the target annotation object in the current online document, and then determining the display area corresponding to the target annotation according to the position of the target text content corresponding to the target annotation object in the current online document, so as to render the target annotation content in the display area, thereby realizing the accurate display of the annotation content in the online document. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0023] Figure 1 A flowchart of a method for displaying annotations of an online document provided by an embodiment of the present invention;

[0024] Figure 2 A schematic diagram of an editing page corresponding to a historical online document provided by an embodiment of the present invention;

[0025] Figure 3 A flowchart for determining a position corresponding to target text content provided by an embodiment of the present invention;

[0026] Figure 4 A schematic diagram of determining location information corresponding to target text content provided by an embodiment of the present invention;

[0027] Figure 5 A schematic diagram of an application of an online document annotation display method provided by an embodiment of the present invention;

[0028] Figure 6 A flowchart of an annotation display process provided by an embodiment of the present invention;

[0029] Figure 7 A flowchart of determining a display area corresponding to target annotation content provided by an embodiment of the present invention;

[0030] Figure 8a A schematic diagram of an application of an annotation card display provided by an embodiment of the present invention;

[0031] Figure 8b A schematic diagram of another application of annotation card display provided by an embodiment of the present invention;

[0032] Fig. 9A schematic diagram of a document page provided by an embodiment of the present invention;

[0033] Fig.10 A schematic diagram of the structure of an online document annotation display device provided by an embodiment of the present invention;

[0034] Fig.11 For Fig.10 A schematic structural diagram of an electronic device corresponding to the online document annotation display device provided in the illustrated embodiment. DETAILED DESCRIPTION

[0035] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0036] In addition, the step sequence in the following method embodiments is only an example and not a strict limitation.

[0037] For online document systems, users are usually more concerned about being able to view and edit documents quickly and stably. In this case, a read-write separation architecture can be used to design online documents to optimize the user experience. Online documents based on read-write separation include edit pages and detail pages. When a user needs to edit the content of an online document, the user can perform the corresponding editing operation on the edit page corresponding to the online document. When a user needs to view the content of an online document, the user can view the corresponding content on the detail page corresponding to the online document.

[0038] However, for such a read-write separated online document, when the editing page changes and is inconsistent with the previous detail page, the position corresponding to the annotation object is determined based on the position index of the annotation object previously stored by the server relative to the previous detail page, and the annotation content is rendered based on the position corresponding to the annotation object. The problem of annotation loss often occurs. The annotation object is a specific text in the document associated with the user's previous addition of the annotation content. Therefore, how to accurately display the annotation content in a read-write separated online document has become a problem that needs to be solved urgently.

[0039] In order to solve the above technical problems, a new annotation display scheme for online documents is provided in an embodiment of the present invention. When displaying historical annotation content in the current online document, the position information, target text content, and paragraph mark corresponding to the target annotation object can be combined to verify the position of the target annotation object in the current online document. Based on the verified position of the target annotation object, the target annotation content is rendered to ensure that the target annotation content can be accurately displayed in the current online document.

[0040] The execution process of the annotation display method for online documents provided in this article is described in detail below in conjunction with the following embodiments.

[0041] The annotation display method for an online document provided by an embodiment of the present invention can be used to display the annotation content in an online document. In short, when a user opens the current online document, the previously added annotation content can be accurately displayed in the current online document. In addition, the annotation display method can be executed by an electronic device, which can be a terminal device such as a PC, a laptop, a smart phone, or a server. The server can be a physical server including an independent host, or a virtual server, or a cloud server or a server cluster.

[0042] Figure 1 A flowchart of a method for displaying annotations of an online document provided by an embodiment of the present invention, such as Figure 1 As shown, the execution subject of the method can be an online document annotation display device, which can be implemented as software or a combination of software and hardware. Specifically, the method includes the following steps:

[0043] 101. Obtain annotation data corresponding to the current online document, the annotation data including location information of a target annotation object, target text content corresponding to the target annotation object, and paragraph mark corresponding to the target annotation object. The target annotation object is an element associated when a user adds target annotation content in an editing page corresponding to a historical online document.

[0044] 102. According to the position information of the target annotation object, read the current text content corresponding to the position information from the current online document.

[0045] 103. If the current text content is different from the target text content, the target text content is queried in the current online document according to the paragraph mark corresponding to the target annotation object to determine the corresponding position of the target text content.

[0046] 104. Determine a display area corresponding to the target annotation content according to the position corresponding to the target text content, and render the target annotation content in the display area to display the target annotation content in the current online document.

[0047] In actual applications, after a user adds target annotation content to a target annotation object in the editing page corresponding to a historical online document, the user or other users modify the document content in the historical online document. If the position information corresponding to the target annotation object in the modified online document and the historical online document changes, the target annotation content will be displayed based on the annotation data corresponding to the target annotation content stored on the server, and the annotation will be lost. In order to avoid the problem of historical annotation content being lost after opening the current online document, when displaying the target annotation content in the current online document, the position of the target annotation object in the current online document is verified based on the position information corresponding to the target annotation object, the target text content, and the paragraph mark. Based on the verified position of the target annotation object, the target annotation content is rendered to ensure that the target annotation content can be accurately displayed in the current online document.

[0048] In specific implementation, when a user opens the current online document, the annotation display device obtains the annotation data corresponding to the current online document. The annotation data includes the location information of the target annotation object, the target text content corresponding to the target annotation object, and the paragraph mark corresponding to the target annotation object. The target annotation object is the element associated when the user adds the target annotation content in the editing page corresponding to the historical online document. The element can be a specific text content, table, etc. in the online document.

[0049] For example, if Figure 2 The figure shows the editing page corresponding to the historical online document. When the user wants to add the annotation content "12" to the selected text content "196b.4821748" in the historical online document, the selected area shown in the historical online document is the target annotation object, the target text content corresponding to the target annotation object is 196b.4821748, and the target annotation content associated with the target annotation object is 12.

[0050] In addition, in order to more accurately display the target annotation content in the current online document, after the user adds the target annotation content to the target annotation object in the editing page corresponding to the historical online document, the location information of the target annotation object in the historical online document and the paragraph mark corresponding to the target annotation object can also be stored.

[0051] Among them, the position index representation method can be used to represent each position in the online document, that is, the position information of the target annotation object can also be represented by the position index. In an optional embodiment, any position in the online document can be represented by a unique integer, and when the user creates an annotation, the position representation corresponding to the starting position of the target annotation object and the position representation corresponding to the ending position of the target annotation object can be saved as the position information corresponding to the target annotation object, so that when the target annotation content associated with the target annotation object is displayed later, the starting and ending positions corresponding to the target annotation object can be accurately obtained.

[0052] Online documents support simultaneous online editing by multiple people. It often happens that after user A adds target annotation content to a target annotation object in a historical online document and clicks publish, user B opens the online document again and modifies the document text content in the online document, causing the start and end position information corresponding to the target annotation object to change. At this time, the target annotation object cannot be located based on the start and end position information corresponding to the target annotation object in the historical online document stored on the server.

[0053] Therefore, in an embodiment of the present invention, a paragraph tag can also be added to each paragraph in the online document. After user A adds target annotation content in the historical online document, the paragraph tag corresponding to the paragraph where the target annotation object is located can also be stored in the server.

[0054] The paragraph identifier can be represented by a string. Preferably, in practical applications, in order to ensure the uniqueness of the paragraph identifier, a 21-bit unique string can be generated. Each paragraph in the online document is numbered in turn, and the number corresponding to each paragraph is used as the paragraph identifier. In this way, when user A adds the target annotation content in the historical online document, the paragraph number of the target annotation object can be determined as the paragraph identifier corresponding to the target annotation object.

[0055] After obtaining the position information, paragraph mark and target text content corresponding to the target annotation object in the current online document, the current text content corresponding to the position information can be read from the current online document according to the position information of the target annotation object, and the current text content is compared with the target text content corresponding to the target annotation object stored in the annotation data to determine whether the position of the target annotation object in the current online document has changed.

[0056] If the current text content is different from the target text content, the target text content is queried in the current online document according to the paragraph mark corresponding to the target annotation object to determine the corresponding position of the target text content. Specifically, the target paragraph where the target annotation object is located can be located according to the paragraph mark corresponding to the target annotation object, and the target text content can be queried in the target paragraph to determine the corresponding position of the target text content.

[0057] Next, according to the position corresponding to the target text content, the display area corresponding to the target annotation content is determined, and the target annotation content is rendered in the display area to display the target annotation content in the current online document.

[0058] In actual applications, the target annotation content is designed to be displayed in a specific area of ​​the document or in an independent interface, and the target annotation content is usually associated with the target annotation object in the document, so the target annotation content can be displayed next to or near the target annotation object for users to view. Then, in an embodiment of the present invention, the display position and display area corresponding to the target annotation content can be determined according to the position corresponding to the target text content, and the target annotation content can be rendered in the display area to display the target annotation content in the current online document.

[0059] Among them, the specific implementation process of rendering the target annotation content in the display area to display the target annotation content in the current online document may include: generating an annotation card corresponding to the target annotation content in the display area; and displaying the target annotation content in the annotation card corresponding to the target annotation content.

[0060] In summary, the embodiments of the present invention read the current text content corresponding to the position information of the target annotation object in the annotation data from the current online document, and compare the current text content with the target text content in the annotation data to determine the position corresponding to the target text content corresponding to the target annotation object in the current online document, and then determine the display area corresponding to the target annotation according to the position of the target text content corresponding to the target annotation object in the current online document, so as to render the target annotation content in the display area, thereby realizing the accurate display of the annotation content in the online document.

[0061] The specific implementation process of creating the target annotation content in the above embodiment is described.

[0062] When the user wants to add target annotation content to the target annotation object in the historical online document, the annotation adding request can be triggered for the target annotation object in the editing page corresponding to the historical online document. After receiving the annotation adding request triggered by the user, the annotation display device displays the generated annotation card in the annotation area corresponding to the target annotation object in the editing page in response to the annotation adding operation triggered by the user for the target annotation object in the editing page corresponding to the historical online document. In response to the target annotation content input by the user in the annotation card, the target annotation content is displayed in the annotation card, and the position information corresponding to the target annotation object, the target text content corresponding to the target annotation object, the paragraph mark corresponding to the target annotation object, and the offset corresponding to the target annotation object are stored.

[0063] The offset is used to describe the distance or number of characters between the starting position of the target annotation object and the starting position of the paragraph where the target annotation object is located.

[0064] In addition, when storing the annotation data corresponding to the target annotation object, you can also determine an annotation identifier for the target annotation object, and upload the annotation identifier, the location information corresponding to the target annotation object, the target text content corresponding to the target annotation object, the paragraph identifier corresponding to the target annotation object, and the offset corresponding to the target annotation object to the server, so as to store the annotation data associated with each annotation object on the server.

[0065] In addition, in actual applications, the user may modify other text content in the document, causing the position (start and end position) corresponding to the target annotation object to change, or may modify the target text content, causing the position corresponding to the target annotation object to change. Then, after modifying the text content corresponding to the target annotation object in the online document, the annotation data corresponding to the target annotation object can be updated again.

[0066] Assume that user A adds a target annotation content "There may be a problem here" to the target text content "1234" in the historical online document. Then, after user B views the target annotation content, he modifies the target text content to "123456". At this time, the target text content and location information corresponding to the target annotation object in the annotation data stored on the server have changed, and the target text content corresponding to the target annotation object in the annotation data can be updated to "123456".

[0067] In order to avoid deviations in the annotation data, which may cause errors in the subsequent display of the annotation content based on the annotation data, each time the user clicks to publish, the annotation data corresponding to all annotations in the document are updated and confirmed again, so that all data information stored in the annotation data is the latest data.

[0068] Combined with Figure 3 The process of determining the position of the target text content in the current online document is described.

[0069] Figure 3 A flowchart of determining a position corresponding to a target text content is provided in an embodiment of the present invention, such as Figure 3 As shown, specifically, the annotation data also includes an offset corresponding to the target annotation object. The method includes the following steps:

[0070] 301. Determine a target paragraph corresponding to the target text content in the current online document according to the paragraph identifier corresponding to the target annotation object.

[0071] 302. According to the offset corresponding to the target annotation object, determine the starting position corresponding to the target text content in the target paragraph.

[0072] 303. According to the starting position corresponding to the target text content, the target text content is searched in the current document to determine the ending position corresponding to the target text content.

[0073] When determining the position information of the target text content in the current online document, the target paragraph corresponding to the target text content in the current online document can be determined first according to the paragraph identifier corresponding to the target annotation object, and then the starting position corresponding to the target text content in the target paragraph can be determined according to the offset corresponding to the target annotation object.

[0074] Combined with Figure 4 The position information corresponding to the target text content is described. Figure 4 As shown, assuming that the paragraph identifier corresponding to the target annotation object is 3, the offset corresponding to the target annotation object is 20, and the target text content corresponding to the target annotation object is "one two three four five six". According to the paragraph identifier and the mapping relationship between the paragraph identifier and the paragraph, the target paragraph corresponding to the target text in the current online document is determined to be paragraph 3. Locate paragraph 3 in the current online document. Starting from the starting position of paragraph 3, calculate the position corresponding to the 20th character, and determine the position corresponding to the 21st character as the starting position corresponding to the target text content.

[0075] That is, the position information is equivalent to the starting position corresponding to the target text content. Then, after determining the position information of the target text content in the current online document, the target text content can be queried in the current online document according to the position information corresponding to the target text content to determine the ending position corresponding to the target text content. Alternatively, the ending position corresponding to the target text content can be determined according to the number of characters corresponding to the target text content and the starting position corresponding to the target text content.

[0076] The embodiment of the present invention, in combination with the paragraph mark corresponding to the target annotation object and the offset corresponding to the target annotation object, can accurately query the target text content in the current document to accurately locate the position corresponding to the target text content, and then can render the target annotation content according to the position corresponding to the located target text content, so that the user can more conveniently view the added target annotation content.

[0077] Figure 5 A schematic diagram of an application of an online document annotation display method provided by an embodiment of the present invention, such as Figure 5 As shown, the execution subject of the annotation display method may be an annotation display device for an online document, and the annotation display device is communicatively connected with a client.

[0078] The client can be any computing device with certain data transmission capabilities. When a user wants to view the current online document, he can send a request to open the current online document through the client. The annotation display device refers to a device that can provide users with annotation display services for online documents.

[0079] In an embodiment of the present invention, when the annotation display device detects an online document opening request triggered by a user, the annotation display device can obtain annotation data corresponding to the current online document, and display the corresponding annotation in the current online document based on the annotation data. Figure 6 The annotation display processing process of the annotation display device is described.

[0080] The annotation display device first obtains the annotation data corresponding to the current online document, wherein the annotation data includes the position index of the target annotation object, the target text content corresponding to the target annotation object, and the paragraph mark corresponding to the target annotation object.

[0081] Then, determine whether the position corresponding to the target annotation object in the current online document has changed from the position corresponding to the target annotation object in the historical online document when the annotation data was previously stored. Specifically, according to the position index of the target annotation object in the annotation data, read the current text content corresponding to the position information from the current online document. And compare whether the current text content corresponding to the current position is consistent with the target text content corresponding to the target annotation object.

[0082] If the current text content is different from the target text content, that is, the document text content in the current online document has changed relative to the document text content in the historical online document, so that the position of the target annotation object in the current online document has changed, then the target text content can be queried in the current online document according to the paragraph mark corresponding to the target annotation object to determine the corresponding position of the target text content. Finally, according to the corresponding position of the target text content, the display area corresponding to the target annotation content is determined, and the target annotation content is rendered in the display area to display the target annotation content in the current online document.

[0083] If the current text content is the same as the target text content, that is, the document text content in the current online document has not changed relative to the document text content in the historical online document, then at this time, the position corresponding to the target text content can be determined according to the position index of the target annotation object in the annotation data, and the display area corresponding to the target annotation content can be determined according to the position corresponding to the target text content, and the target annotation content can be rendered in the display area to display the target annotation content in the current online document.

[0084] Furthermore, after the user clicks to publish, he or she can confirm the annotation data corresponding to each annotation content in the online document again, and update the confirmed annotation data to the server.

[0085] In an embodiment of the present invention, when displaying annotation content in a current online document, the current text content corresponding to the position information of the target annotation object is read from the current online document to determine whether the position corresponding to the target annotation object in the current online document has changed from the position corresponding to the target annotation object in the historical online document corresponding to the previous storage of annotation data. If changed, the position corresponding to the target text content is determined based on the paragraph mark corresponding to the target annotation object, and then the display area corresponding to the target annotation content is located based on the position corresponding to the target text content, and the target annotation content is rendered in the display area to accurately display the target annotation content in the current online document to avoid losing the annotation content.

[0086] After determining the position corresponding to the target text content, the target text content can be marked in the current online document to indicate that there is an annotation associated with the target text content. After the position of the target text content in the document is marked, in order to better read the target annotation content, it is necessary to consider the positioning of the annotation card, that is, in which display area to display the target annotation content to better facilitate user reading.

[0087] The process of determining the display area corresponding to the target annotation content is described in detail below in conjunction with the following embodiments.

[0088] Figure 7A flowchart of determining a display area corresponding to a target annotation content provided by an embodiment of the present invention, such as Figure 7 Specifically, the method comprises the following steps:

[0089] 701. Determine a display area size corresponding to the target annotation content according to the number of characters in the target annotation content and the text style corresponding to the target annotation content.

[0090] 702. Determine a display area corresponding to the target annotation content according to a position corresponding to the target text content and a display area size corresponding to the target annotation content.

[0091] When determining the display area corresponding to the target annotation content, the display area size corresponding to the target annotation content can be determined according to the number of characters in the target annotation content and the text style corresponding to the target annotation content. Then, the display area corresponding to the target annotation content is determined according to the position corresponding to the target text content and the display area size corresponding to the target annotation content.

[0092] Among them, the target annotation content is displayed in the form of an annotation card, so the display area corresponding to the target annotation content is the display area corresponding to the annotation card corresponding to the target annotation content. The annotation card is to better explain the target text content in the online document, so the annotation card displayed in the document corresponds to the target text content, which can save the user's search time. Therefore, the annotation card needs to be as close as possible to the position corresponding to the associated target text content.

[0093] In an embodiment of the present invention, after the position corresponding to the target text content is determined, the annotation card can be positioned next to the associated text by absolute positioning. In specific implementation, the starting position of the display area corresponding to the target annotation content is determined according to the position corresponding to the target text content, and the display area corresponding to the target annotation content is determined according to the starting position of the display area corresponding to the target annotation content and the size of the display area corresponding to the target annotation content.

[0094] However, in actual applications, it often happens that the annotation objects associated with multiple annotation contents are relatively concentrated in the text. In this case, when the annotation card is positioned next to the associated text through absolute positioning, the display areas corresponding to multiple annotation cards may overlap, that is, there is a conflict in the positions of the display areas corresponding to multiple annotation contents.

[0095] For example, if Figure 8aAs shown, there are four annotations in paragraph 1. According to the original positioning rules, annotation cards 1-1, 1-2, 1-3 and 1-4 must all be positioned next to paragraph 1. The four annotation cards have the same position, which causes a conflict. Therefore, the positions of the annotation cards other than annotation card 1-1 need to be corrected. The positions of subsequent annotation cards are still updated by absolute positioning based on the determined annotation card positions, so that they can be arranged in sequence behind annotation card 1-1. In this case, due to the influence of the annotation card in paragraph 1, the position of annotation card 3-1 calculated based on the target text content will also have a position conflict. Therefore, its position can also be calculated based on the previously determined annotation card position, so that it can be arranged in sequence behind the previous annotation card. However, there may be a situation where the annotation card in paragraph 1 does not affect the positioning of the annotation cards in subsequent paragraphs, such as Figure 8b As shown, for the annotation card 4-1, there is no position conflict with the previous annotation card list, and it can be absolutely positioned next to the paragraph 4 through the position of the text content associated with 4-1.

[0096] Then in an optional embodiment, when determining the display area corresponding to the target annotation content, it is possible to first determine whether there is a position conflict between the display areas corresponding to multiple annotation contents in the document. If there is a position conflict, the position corresponding to the target annotation content can be calculated in combination with the position of the previously determined annotation content, so that it can be arranged in sequence after the previous annotation content.

[0097] Specifically, the position information corresponding to each annotation card located before the target annotation content is determined, and the display area size corresponding to each annotation card located before the target annotation content is determined. According to the position information corresponding to each annotation card located before the target annotation content and the display area size corresponding to each annotation card located before the target annotation content, it is determined whether there is a position conflict between each annotation card located before the target annotation content and the annotation card corresponding to the target annotation content.

[0098] If there is no position conflict, the starting position of the display area corresponding to the target annotation content is determined according to the position corresponding to the target text content, and the display area corresponding to the target annotation content is determined according to the starting position of the display area corresponding to the target annotation content and the display area size corresponding to the target annotation content. If there is a position conflict, the display area corresponding to the target annotation content is determined according to the position information corresponding to each annotation card located before the target annotation content and the display area size corresponding to the target text content.

[0099] The embodiment of the present invention determines the size of the display area corresponding to the target annotation content according to the number of characters in the target annotation content and the text style corresponding to the target annotation content, and determines the display area corresponding to the target annotation content according to the position corresponding to the target text content and the size of the display area corresponding to the target annotation content. In this way, the display position corresponding to the annotation card corresponding to the target annotation content can be accurately located.

[0100] Among them, when the current online document includes multiple annotation contents, the annotation card list can be used to display the multiple annotation contents, and the annotation cards corresponding to the various annotation contents are added in sequence in the annotation card list. The document content and the annotation card list are on the same page. When the user reads the page, the page will be scrolled up and down. Since the annotation card is an explanation of a part of the document content, according to the above, the annotation card is positioned next to the corresponding text content. Therefore, when reading, synchronous scrolling will have a better user experience. Therefore, in the embodiment of the present invention, the document content and the annotation card list in the online document share the same scroll bar.

[0101] That is, the multiple annotation cards included in the current online document can be displayed in the annotation card list in sequence according to the position information of the annotation objects associated therewith, and the document content in the current online document and the annotation card list share the same scroll bar.

[0102] In addition, in the embodiment of the present invention, when the user clicks on the target annotation object, the annotation card corresponding to the target annotation content associated with the target annotation object can be positioned next to the target annotation object through absolute positioning.

[0103] However, when there are many annotations in the online document, the scroll bar will be expanded, thereby increasing the overall height of the page displaying the document, such as Fig. 9 As shown, the blank area below paragraph 4 is the height of the expanded annotation card. When the user reads an online document, he will scroll down the page, and the document content and the annotation card will scroll up together. When paragraph 4 scrolls into the visible area, when you click on the underlined text corresponding to annotation 4-4, the position of annotation card 4-4 is determined and displayed based on the position of the text content corresponding to the annotation object associated with annotation card 4-4. After moving up, it is displayed next to paragraph 4. Due to the movement of 4-4, all annotation cards above annotation card 4-4 will be recalculated based on the position data of 4-4 to avoid position conflicts and scroll up. This will result in the following Fig. 9 As shown in the figure, since the annotation card list moves up, some content overflows from the top of the annotation card list.

[0104] In the embodiment of the present invention, in order to prevent the height of the document page from being stretched, when the user is sliding and there is content overflowing at the top of the annotation card list, the position data corresponding to the overflowing content at the top of the annotation card list can be set to a negative number to hide this part of the content. In addition, there will be a blank area at the bottom of the document page that was left after the annotation card list was moved up. At this time, the height of this extra area needs to be subtracted from the overall height of the page document to avoid excessive blank space at the bottom of the page.

[0105] During specific implementation, it is determined whether there is a position conflict between the annotation card corresponding to the target annotation content associated with the target annotation object and the annotation cards located before the target annotation content when the annotation card corresponding to the target annotation content is positioned next to the target annotation object; if there is a position conflict, the multiple annotation cards currently overflowing the annotation card list are determined; and the position information corresponding to the multiple annotation cards currently overflowing the annotation card list is set to a negative number.

[0106] In addition, the user scrolling event is detected. If it is detected that the user scrolls the document content in the current online document, the page scrolling event and the user mouse scrolling event corresponding to the current online document are monitored; if it is determined that the page has scrolled to the top of the page based on the page scrolling event, the user sliding distance is determined based on the user mouse scrolling event; based on the user sliding distance, the corresponding position of the index annotation card in the annotation list is updated so that it slides down accordingly, thereby achieving backfilling.

[0107] From the above description, it can be seen that: when the user clicks on the target annotation object, the annotation card corresponding to the target annotation content associated with the target annotation object is positioned next to the target annotation object through absolute positioning, which can make the target annotation object and the target annotation content more smoothly linked.

[0108] Furthermore, when content overflows from the top of the annotation card list while the user is sliding the document, the position data corresponding to the overflowing content at the top of the annotation card list can be set to a negative number to hide this part of the content, and the position data corresponding to other annotation cards in the annotation card list can be re-determined to avoid position conflicts. According to the user's sliding distance, the position corresponding to the index annotation card in the annotation list is updated so that it slides down accordingly and the overflowing content is backfilled. This allows the annotation cards to be displayed more smoothly and provides a better user experience.

[0109] Fig.10 A schematic diagram of the structure of an online document annotation display device provided by an embodiment of the present invention, such as Fig.10 As shown, the device includes: an acquisition module 11, a reading module 12, a query module 13, and a determination module 14.

[0110] The acquisition module 11 is used to obtain the annotation data corresponding to the current online document, and the annotation data includes the location information of the target annotation object, the target text content corresponding to the target annotation object, and the paragraph mark corresponding to the target annotation object. The target annotation object is the element associated when the user adds the target annotation content in the editing page corresponding to the historical online document.

[0111] The reading module 12 is used to read the current text content corresponding to the position information from the current online document according to the position information of the target annotation object.

[0112] The query module 13 is used to query the target text content in the current online document according to the paragraph mark corresponding to the target annotation object if the current text content is different from the target text content, so as to determine the position corresponding to the target text content.

[0113] The determination module 14 is used to determine the display area corresponding to the target annotation content according to the position corresponding to the target text content, and render the target annotation content in the display area to display the target annotation content in the current online document.

[0114] Optionally, the device also includes an annotation adding module, which is specifically used to: in response to an annotation adding operation triggered by a user for a target annotation object in an editing page corresponding to a historical online document, display a generated annotation card in the annotation area corresponding to the target annotation object in the editing page; in response to a target annotation content input by a user in the annotation card, display the target annotation content in the annotation card, and store the position information corresponding to the target annotation object, the target text content corresponding to the target annotation object, the paragraph mark corresponding to the target annotation object, and the offset corresponding to the target annotation object; wherein the offset is used to describe the distance or number of characters between the starting position of the target annotation object and the starting position of the paragraph where the target annotation object is located.

[0115] Optionally, the annotation data also includes: the offset corresponding to the target annotation object; the query module 13 is specifically used to: determine the target paragraph corresponding to the target text content in the current online document according to the paragraph identifier corresponding to the target annotation object; determine the starting position corresponding to the target text content in the target paragraph according to the offset corresponding to the target annotation object; and query the target text content in the current document according to the starting position corresponding to the target text content to determine the ending position corresponding to the target text content.

[0116] Optionally, the determination module 14 is specifically used to: determine the display area size corresponding to the target annotation content according to the number of characters of the target annotation content and the text style corresponding to the target annotation content; determine the display area corresponding to the target annotation content according to the position corresponding to the target text content and the display area size corresponding to the target annotation content.

[0117] Optionally, the determination module 14 is specifically used to: determine the position information corresponding to each annotation card located before the target annotation content; determine the display area size corresponding to each annotation card located before the target annotation content; judge whether there is a position conflict between the annotation cards located before the target annotation content and the annotation card corresponding to the target annotation content according to the position information corresponding to each annotation card located before the target annotation content and the display area size corresponding to each annotation card located before the target annotation content; if there is no position conflict, determine the starting position of the display area corresponding to the target annotation content according to the position corresponding to the target text content; determine the display area corresponding to the target annotation content according to the starting position of the display area corresponding to the target annotation content and the display area size corresponding to the target annotation content.

[0118] Optionally, the determination module 14 is further used to: if there is a position conflict, determine the display area corresponding to the target annotation content according to the position information corresponding to each annotation card located before the target annotation content and the display area size corresponding to the target text content.

[0119] Optionally, the multiple annotation cards contained in the current online document are displayed in the annotation card list in sequence according to the location information of the annotation objects associated with them, and the document content in the current online document and the annotation card list share the same scroll bar; the device also includes an association module, which is specifically used to: when the user clicks on the target annotation object, the annotation card corresponding to the target annotation content associated with the target annotation object is positioned next to the target annotation object through absolute positioning.

[0120] Optionally, the association module is also used to: determine whether there is a position conflict between the annotation card corresponding to the target annotation content associated with the target annotation object and the annotation cards located before the target annotation content when the annotation card corresponding to the target annotation content associated with the target annotation object is positioned next to the target annotation object; if there is a position conflict, determine the multiple annotation cards currently in the overflow annotation card list; and set the position information corresponding to the multiple annotation cards in the current overflow annotation card list to a negative number.

[0121] Optionally, the association module is also used to: if it is detected that the user scrolls the document content in the current online document, then monitor the page scroll event and user mouse scroll event corresponding to the current online document; if it is determined that the page has scrolled to the top of the page based on the page scroll event, then determine the user sliding distance based on the user mouse scroll event; and update the corresponding position of the index annotation card in the annotation list based on the user sliding distance.

[0122] Optionally, the determination module 14 is specifically configured to: generate an annotation card corresponding to the target annotation content in the display area; and display the target annotation content in the annotation card corresponding to the target annotation content.

[0123] Fig.10 The device shown can execute the annotation display method of the online document provided in the aforementioned embodiment. The detailed execution process and technical effects can be found in the description of the aforementioned embodiment, which will not be repeated here.

[0124] In one possible design, the above Fig.10 The structure of the online document annotation display device shown in FIG. 1 can be implemented as an electronic device, such as Fig.11 As shown, the electronic device may include: a processor 21 and a memory 22. The memory 22 stores executable codes, and when the executable codes are executed by the processor 21, the processor 21 can at least implement the online document annotation display method provided in the above-mentioned embodiment.

[0125] Optionally, the electronic device may further include a communication interface 23 for communicating with other devices.

[0126] In addition, an embodiment of the present invention provides a non-temporary machine-readable storage medium, on which executable code is stored. When the executable code is executed by a processor of an electronic device, the processor can at least implement the annotation display method for online documents provided in the aforementioned embodiment.

[0127] In addition, an embodiment of the present invention provides a computer program product. The computer program product includes a computer program or an instruction. When the computer program or the instruction is executed by a processor, the processor is enabled to implement the above Figure 1-9 The steps or functions of the method shown.

[0128] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the present embodiment. Those of ordinary skill in the art may understand and implement the present invention without creative effort.

[0129] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by adding a necessary general hardware platform, and of course can also be implemented by combining hardware and software. Based on such an understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a computer product, and the present invention can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0130] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for displaying annotations of online documents, characterized in that: include: Acquire annotation data corresponding to the current online document, the annotation data including location information of a target annotation object, target text content corresponding to the target annotation object, and paragraph mark corresponding to the target annotation object, the target annotation object being an element associated when a user adds target annotation content in an editing page corresponding to a historical online document; According to the position information of the target annotation object, reading the current text content corresponding to the position information from the current online document; If the current text content is different from the target text content, searching the current online document for the target text content according to the paragraph mark corresponding to the target annotation object to determine the position corresponding to the target text content; According to the position corresponding to the target text content, a display area corresponding to the target annotation content is determined, and the target annotation content is rendered in the display area to display the target annotation content in the current online document.

2. The method according to claim 1, characterized in that Before obtaining the annotation data corresponding to the current online document, the method further includes: In response to an annotation adding operation triggered by a user on a target annotation object in an editing page corresponding to a historical online document, displaying a generated annotation card in an annotation area corresponding to the target annotation object in the editing page; In response to the target annotation content input by the user in the annotation card, the target annotation content is displayed in the annotation card, and the position information corresponding to the target annotation object, the target text content corresponding to the target annotation object, the paragraph mark corresponding to the target annotation object, and the offset corresponding to the target annotation object are stored; The offset is used to describe the distance or the number of characters between the starting position of the target annotation object and the starting position of the paragraph where the target annotation object is located.

3. The method according to claim 1, characterized in that The annotation data also includes: an offset corresponding to the target annotation object; wherein, querying the target text content in the current online document according to the paragraph mark corresponding to the target annotation object to determine the position corresponding to the target text content includes: Determining, according to the paragraph identifier corresponding to the target annotation object, a target paragraph corresponding to the target text content in the current online document; Determining the starting position corresponding to the target text content in the target paragraph according to the offset corresponding to the target annotation object; According to the starting position corresponding to the target text content, the target text content is searched in the current document to determine the ending position corresponding to the target text content.

4. The method according to claim 1, characterized in that: The step of determining a display area corresponding to the target annotation content according to a position corresponding to the target text content includes: Determining the size of the display area corresponding to the target annotation content according to the number of characters in the target annotation content and the text style corresponding to the target annotation content; The display area corresponding to the target annotation content is determined according to the position corresponding to the target text content and the size of the display area corresponding to the target annotation content.

5. The method according to claim 4, characterized in that The step of determining the display area corresponding to the target annotation content according to the position corresponding to the target text content and the size of the display area corresponding to the target annotation content comprises: Determine the position information corresponding to each annotation card located before the target annotation content; Determine the display area size corresponding to each annotation card located before the target annotation content; According to the position information corresponding to each annotation card located before the target annotation content and the display area size corresponding to each annotation card located before the target annotation content, it is determined whether there is a position conflict between each annotation card located before the target annotation content and the annotation card corresponding to the target annotation content; If there is no position conflict, determining the starting position of the display area corresponding to the target annotation content according to the position corresponding to the target text content; The display area corresponding to the target annotation content is determined according to the starting position of the display area corresponding to the target annotation content and the size of the display area corresponding to the target annotation content.

6. The method according to claim 5, characterized in that The method further comprises: If there is a position conflict, the display area corresponding to the target annotation content is determined according to the position information corresponding to each annotation card located before the target annotation content and the display area size corresponding to the target text content.

7. The method according to claim 6, characterized in that The multiple annotation cards contained in the current online document are displayed in the annotation card list in sequence according to the position information of the annotation objects associated therewith, and the document content in the current online document and the annotation card list share the same scroll bar; the method further includes: When the user clicks on the target annotation object, the annotation card corresponding to the target annotation content associated with the target annotation object is positioned next to the target annotation object through absolute positioning.

8. The method according to claim 7, characterized in that The method further comprises: Determine whether there is a position conflict between the annotation card corresponding to the target annotation content associated with the target annotation object and each annotation card located before the target annotation content when positioning the annotation card corresponding to the target annotation content next to the target annotation object; If there is a position conflict, multiple annotation cards that currently overflow the annotation card list are determined; The position information corresponding to the multiple annotation cards in the current overflow annotation card list is set to a negative number.

9. The method according to claim 8, characterized in that The method further comprises: If it is detected that the user scrolls the document content in the current online document, monitoring the page scrolling event and the user mouse scrolling event corresponding to the current online document; If it is determined according to the page scrolling event that the page has scrolled to the top of the page, then according to the user mouse scrolling event, the user sliding distance is determined; According to the sliding distance of the user, the position corresponding to the index annotation card in the annotation list is updated.

10. The method according to claim 1, characterized in that The rendering of the target annotation content in the display area to display the target annotation content in the current online document includes: Generating an annotation card corresponding to the target annotation content in the display area; The target annotation content is displayed in the annotation card corresponding to the target annotation content.

11. An electronic device, characterized in that: include: A memory and a processor; wherein the memory stores executable code, and when the executable code is executed by the processor, the processor executes the annotation display method for an online document as described in any one of claims 1 to 10.

12. A non-transitory machine-readable storage medium, characterized in that: The non-transitory machine-readable storage medium stores executable code, and when the executable code is executed by a processor of an electronic device, the processor executes the annotation display method for an online document as described in any one of claims 1 to 10.