Method and apparatus for page jump, electronic device, storage medium
By responding to user operation instructions in the document, identifying the feature string in the document page and determining the target page, the problem of page redirection cannot be achieved in the prior art for text content without a jump link, and the page redirection function is realized without a preset link in the document.
Patent Information
- Application Number
- CN202111362516.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-17
- Publication Date
- 2025-06-20
- Estimated Expiration
- 2041-11-17
AI Technical Summary
In the prior art, documents need to set jump links in advance to enable click jumps to text content containing links, and page jumps cannot be achieved for text content without jump links.
By responding to user's operation instructions in the document, the corresponding area in the currently displayed document page is determined, the characters in the area are identified, and if there is a feature string, the target page is determined and the page jump is achieved.
When the document does not have a jump link in advance, it is possible to identify the feature string in the area corresponding to the user's operation instructions through character recognition, and determine the target page of the corresponding feature string, thereby realizing the page jump and improving the efficiency of document review.
Smart Images

Figure CN114168871B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of document processing, for example, to a method and apparatus for page jumping, an electronic device, and a storage medium. Background Art
[0002] For digital documents, in order to improve the speed of finding content and the reading speed, readers usually hope that they can jump to the corresponding text part by clicking on a certain table of contents item or page reference information in the text. For this purpose, a table of contents page is usually set in the document. The main purpose of setting the table of contents is to facilitate readers to have a general understanding of the content and structure of the full text before reading the document. When readers need to further understand a certain part of the content, they can rely on the table of contents to save the time for finding the document page.
[0003] In the process of implementing the embodiments of the present disclosure, it is found that at least the following problems exist in the related art:
[0004] In the prior art, a document needs to set a jump link in advance to achieve a click jump to the text content containing the link, and it is impossible to achieve a page jump to the text content without a set jump link. Summary of the Invention
[0005] To have a basic understanding of some aspects of the disclosed embodiments, a simple summary is given below. The summary is not a general review, nor is it intended to identify key / important constituent elements or delineate the protection scope of these embodiments, but rather serves as a preface to the subsequent detailed description.
[0006] The embodiments of the present disclosure provide a method and apparatus for page jumping, an electronic device, and a storage medium, so as to achieve a page jump to the text content without a set jump link.
[0007] In some embodiments, the method for page jumping includes: in response to a user's operation instruction in a document, determining a region corresponding to the operation instruction in the currently displayed document page; identifying characters in the region; in the case where a first feature string exists in the identified characters, determining a target page corresponding to the first feature string in the document; and jumping from the currently displayed document page to the target page.
[0008] In some embodiments, the determining a region corresponding to the operation instruction in the currently displayed document page includes: detecting whether the currently displayed document page includes a table of contents region; and in the case where the currently displayed document page includes a table of contents region, determining a region corresponding to the operation instruction in the table of contents region.
[0009] In some embodiments, detecting whether the currently displayed document page includes a table of contents region includes:
[0010] Determine whether the currently displayed document page includes a preset second feature string; the second feature string is a string characterizing the document directory; in the case where the currently displayed document page includes the preset second feature string, determine that the currently displayed document page contains a directory area; in the case where the currently displayed document page does not include the preset second feature string, perform an identification process on the currently displayed document page to determine whether the currently displayed document page contains a directory area.
[0011] In some embodiments, performing an identification process on the currently displayed document page to determine whether the currently displayed document page contains a directory area includes: determining whether the currently displayed document page is a picture; in the case where the currently displayed document page is a picture, performing image recognition on the currently displayed document page to obtain the page text corresponding to the currently displayed document page; determining whether the string in the page text includes the second feature string; in the case where the string in the page text includes the second feature string, determining that the currently displayed document page contains a directory area.
[0012] In some embodiments, determining a target page corresponding to the first feature string in the document includes: detecting whether there are numbers in the area; if there are numbers, determining the target page according to the numbers; if there are no numbers, determining the target page according to a preset matching strategy.
[0013] In some embodiments, determining the target page according to the numbers includes: detecting the page number area of each document page; for the document page with a page number area, identifying the page number information in the page number area; determining the page with the same page number information as the numbers as the target page.
[0014] In some embodiments, after detecting the page number area of each document page, it further includes: for the document page without a page number area, obtaining the page index position corresponding to the first feature string; determining the page corresponding to the page index position as the target page.
[0015] In some embodiments, determining the target page according to a preset matching strategy includes: determining one or more document pages to be detected; detecting whether the first feature string exists in the one or more document pages to be detected; determining the document page with the first feature string as the target page.
[0016] In some embodiments, determining one or more document pages to be detected includes: obtaining the number of document pages; when the number of document pages is greater than N, obtaining N document pages and determining the obtained N document pages as the document pages to be detected; or, when the number of document pages is less than or equal to N, using all document pages as the document pages to be detected; where N is a preset positive integer.
[0017] In some embodiments, the first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
[0018] In some embodiments, a device for page jump includes: a first determination module configured to determine, in response to a user's operation instruction in a document, a region corresponding to the operation instruction in the currently displayed document page; an identification module configured to identify characters in the region; a second determination module configured to, when a first feature string exists in the identified characters, determine a target page corresponding to the first feature string in the document; and a jump module configured to jump from the currently displayed document page to the target page.
[0019] In some embodiments, the first determination module is configured to determine the region corresponding to the operation instruction in the currently displayed document page by the following method: detecting whether the currently displayed document page includes a table of contents region; when the currently displayed document page includes a table of contents region, determining the region corresponding to the operation instruction in the table of contents region.
[0020] In some embodiments, the first determination module is configured to detect whether the currently displayed document page includes a table of contents region by the following method: determining whether the currently displayed document page includes a preset second feature string; the second feature string is a string for characterizing a document table of contents; when the currently displayed document page includes the preset second feature string, determining that the currently displayed document page includes a table of contents region; when the currently displayed document page does not include the preset second feature string, performing an identification process on the currently displayed document page to determine whether the currently displayed document page includes a table of contents region.
[0021] In some embodiments, the first determination module is configured to perform recognition processing on the currently displayed document page to determine whether the currently displayed document page contains a table of contents area by: determining whether the currently displayed document page is a picture; in the case where the currently displayed document page is a picture, performing image recognition on the currently displayed document page to obtain the page text corresponding to the currently displayed document page; determining whether the string in the page text includes the second feature string; and in the case where the string in the page text includes the second feature string, determining that the currently displayed document page contains a table of contents area.
[0022] In some embodiments, the second determination module is configured to determine a target page corresponding to the first feature string in the document by: detecting whether there are numbers in the area;
[0023] If there are numbers, determining the target page according to the numbers; if there are no numbers, determining the target page according to a preset matching strategy.
[0024] In some embodiments, the second determination module is configured to determine the target page according to the numbers by: detecting the page number area of each document page; for the document page with a page number area, recognizing the page number information in the page number area; and determining the page with the same page number information as the numbers as the target page.
[0025] In some embodiments, the second determination module is further configured to, for the document page without a page number area, obtain the page index position corresponding to the first feature string; and determine the page corresponding to the page index position as the target page.
[0026] In some embodiments, the second determination module is configured to determine the target page according to a preset matching strategy by: determining one or more document pages to be detected; detecting whether the first feature string exists in the one or more document pages to be detected; and determining the document page with the first feature string as the target page.
[0027] In some embodiments, the second determination module is configured to determine one or more document pages to be detected by: obtaining the number of document pages; in the case where the number of document pages is greater than N, obtaining N document pages and determining the obtained N document pages as the document pages to be detected; or, in the case where the number of document pages is less than or equal to N, taking all the document pages as the document pages to be detected; where N is a preset positive integer.
[0028] In some embodiments, the first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
[0029] In some embodiments, an electronic device includes a processor and a memory storing program instructions, and the processor is configured to execute the above-mentioned method for page jump when running the program instructions.
[0030] In some embodiments, a storage medium stores program instructions, and the program instructions execute the above-mentioned method for page jump when running.
[0031] The method, device, electronic device, and storage medium for page jump provided by the embodiments of the present disclosure can achieve the following technical effects: in response to a user's operation instruction, determine the area corresponding to the operation instruction in the currently displayed document page; by recognizing the characters in the area and determining a target page when a first feature string exists in the recognized characters, and after determining the target page, further implement a jump from the currently displayed document page to the target page. By adopting the above method, in the case where no jump link is pre-set in the document, it is possible to recognize the feature string in the area corresponding to the user operation instruction by character recognition and determine the target page corresponding to the feature string, thereby realizing page jump.
[0032] The above general description and the following description are only exemplary and explanatory, and are not used to limit the present application. Brief Description of the Drawings
[0033] One or more embodiments are exemplarily illustrated by corresponding drawings. These exemplary illustrations and the drawings do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings are shown as similar elements. The drawings do not constitute a scale limitation, and among them:
[0034] Figure 1 is a schematic diagram of a method for page jump provided by an embodiment of the present disclosure;
[0035] Figure 2 is a schematic diagram of another method for page jump provided by an embodiment of the present disclosure;
[0036] Figure 3 is a schematic diagram of another method for page jump provided by an embodiment of the present disclosure;
[0037] Figure 4 is a schematic diagram of another method for page jump provided by an embodiment of the present disclosure;
[0038] Figure 5It is a schematic diagram of another method for page jumping provided by an embodiment of the present disclosure;
[0039] Figure 6 It is a schematic diagram of another method for page jumping provided by an embodiment of the present disclosure;
[0040] Figure 7 It is a schematic diagram of a method for PDF document page jumping provided by an embodiment of the present disclosure;
[0041] Figure 8 It is a schematic diagram of a device for page jumping provided by an embodiment of the present disclosure;
[0042] Figure 9 It is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure;
[0043] Figure 10 It is a schematic diagram of clicking on a document page provided by an embodiment of the present disclosure. Detailed implementation manners
[0044] In order to more comprehensively understand the features and technical content of the embodiments of the present disclosure, the implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings. The attached drawings are only for reference and explanation purposes and are not used to limit the embodiments of the present disclosure. In the following technical descriptions, for the sake of explanation, numerous details are provided to give a full understanding of the disclosed embodiments. However, one or more embodiments can still be implemented without these details. In other cases, well-known structures and devices can be shown in a simplified manner.
[0045] In the specification, claims and above-mentioned drawings of the embodiments of the present disclosure, terms such as "first", "second", etc. are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that such used data can be interchanged under appropriate circumstances so as to implement the embodiments of the present disclosure described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion.
[0046] Unless otherwise specified, the term "plurality" means two or more.
[0047] In the embodiments of the present disclosure, the character " / " indicates that the front and rear objects are in an "or" relationship. For example, A / B means: A or B.
[0048] The term "and / or" is a description of the association relationship of objects and indicates that three relationships can exist. For example, A and / or B means: A or B, or, the three relationships of A and B.
[0049] The term "corresponding" may refer to an association relationship or a binding relationship. That A corresponds to B means there is an association relationship or a binding relationship between A and B.
[0050] As shown in combination with Figure 1 The embodiments of the present disclosure provide a method for page jump, including:
[0051] Step S101, in response to a user's operation instruction in a document, determine the area in the currently displayed document page corresponding to the operation instruction;
[0052] Step S102, identify the characters in the area corresponding to the operation instruction;
[0053] Step S103, in the case where a first feature string exists in the identified characters, determine the target page corresponding to the first feature string in the document;
[0054] Step S104, jump from the currently displayed document page to the target page.
[0055] By using the method for page jump provided by the embodiments of the present disclosure, it is possible to, in response to a user's operation instruction, determine the area in the currently displayed document page corresponding to the operation instruction; by identifying the characters in the area and in the case where a first feature string exists in the identified characters, determine the target page, and after determining the target page, further realize jumping from the currently displayed document page to the target page. By adopting the above method, even when there is no pre-set jump link in the document, it is also possible to identify the feature string in the area corresponding to the user operation instruction by character recognition and determine the target page corresponding to the feature string, thereby realizing page jump.
[0056] Optionally, the document includes a word document, a PDF document, etc. Optionally, the operation instruction includes a click instruction, and the area corresponding to the operation instruction is the click area corresponding to the click instruction.
[0057] Optionally, the first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
[0058] Optionally, determine the digits at preset positions among the recognized characters as the strings representing the document chapters. In some embodiments, the string representing the document chapter is the digit at the first character position among the recognized characters. For example: if the digit at the first character position among the recognized characters is "1", "1.1", or "1.2.1", then "1", "1.1", or "1.2.1" is determined as the string representing the document chapter. In some embodiments, if the string representing the document chapter is the digit at the first position among the recognized characters, then it is within parentheses. For example: if the digit within parentheses at the first character position among the recognized characters is "(1)", then "(1)" is determined as the string representing the document chapter.
[0059] Optionally, determine the Chinese characters or English characters at set positions among the recognized characters as the strings representing the chapter titles. In some embodiments, the string representing the chapter title is the Chinese character or English character after the string representing the document chapter. For example: if "2.1 Platform and Architecture" is recognized, where "2.1" is the string representing the document chapter, then "Platform and Architecture" is the string representing the chapter title.
[0060] Optionally, determine the string with page reference information as the string representing the page reference. For example: "Refer to page X", "See details on page X", etc.
[0061] In some embodiments, the first feature string is only the string used to represent the document chapter, such as "1", "1.1", or "1.2.1". In some embodiments, the first feature string is only the string used to represent the chapter title, such as "Platform and Architecture". In some embodiments, the first feature string includes the string used to represent the document chapter and the string used to represent the chapter title, such as "2.1 Platform and Architecture". In some embodiments, the first feature string includes the string used to represent the document chapter and the string used to represent the page reference, such as "1.1 Refer to page X" or "Chapter 1.1 Refer to page X". In some embodiments, the first feature string includes the string used to represent the chapter title and the string used to represent the page reference, such as: "Platform and Architecture See details on page X". In some embodiments, the first feature string includes the string used to represent the document chapter, the string used to represent the chapter title, and the string used to represent the page reference, such as: "2.1 Platform and Architecture See details on page X".
[0062] Optionally, determine the area corresponding to the operation instruction in the currently displayed document page, including: detecting whether the currently displayed document page contains a table of contents area; in the case where the currently displayed document page contains a table of contents area, determine the area corresponding to the operation instruction in the table of contents area.
[0063] Combined Figure 2 As shown, in some embodiments, the following method for page jumping is provided:
[0064] S201, in response to a user's operation instruction in a document, detect whether the currently displayed document page contains a table of contents area; if the currently displayed document page contains a table of contents area, perform step S202; if the currently displayed document page does not contain a table of contents area, end the page jump.
[0065] S202, determine the area corresponding to the operation instruction in the table of contents area.
[0066] S203, identify the characters in the area corresponding to the operation instruction.
[0067] S204, if a first feature string exists in the identified characters, determine the target page corresponding to the first feature string in the document.
[0068] S205, jump from the currently displayed document page to the target page, and then end the page jump.
[0069] In this way, without adding jump links to the table of contents area of the document, when browsing the table of contents area of the document, it is also possible to perform feature string recognition on the area corresponding to the user's operation instruction in the table of contents area of the document, and determine the target page corresponding to the feature string, thereby realizing the jump from the table of contents area to the body text page, making it more convenient for users to consult the document.
[0070] Optionally, detecting whether the currently displayed document page contains a table of contents area includes:
[0071] Determine whether the currently displayed document page includes a preset second feature string; the second feature string is a string characterizing the document table of contents;
[0072] If the currently displayed document page includes a preset second feature string, determine that the currently displayed document page contains a table of contents area;
[0073] If the currently displayed document page does not include a preset second feature string, perform recognition processing on the currently displayed document page to determine whether the currently displayed document page contains a table of contents area.
[0074] Identify the characters in the currently displayed document page. If the preset second feature string is recognized, it is determined that the currently displayed document page includes the preset second feature string; if the preset second feature string is not recognized, it is determined that the currently displayed document page does not include the preset second feature string. Optionally, the second feature string is a preset keyword. In some embodiments, the preset keywords are: "Table of Contents", "Outline", "Content", etc.
[0075] Optionally, perform an identification process on the currently displayed document page to determine whether the currently displayed document page contains a table of contents area, including:
[0076] Determine whether the currently displayed document page is a picture;
[0077] If the currently displayed document page is a picture, perform image recognition on the currently displayed document page to obtain the page text corresponding to the currently displayed document page;
[0078] Determine whether the string in the page text includes the second feature string;
[0079] If the string in the page text includes the second feature string, it is determined that the currently displayed document page contains a table of contents area.
[0080] Optionally, perform image recognition on the currently displayed document page to obtain the page text corresponding to the currently displayed document page, including: using OCR character recognition technology to recognize the characters in the currently displayed document page to obtain the page text corresponding to the currently displayed document page.
[0081] Generally, the document pages in scanned documents are usually pictures. Therefore, it is necessary to perform character recognition on the document pages in picture form to obtain the text information in the pictures, and then determine whether the table of contents area is included according to the strings in the recognized text information. In this way, it is also possible to determine the table of contents area for pages in picture form, improving the success rate of table of contents area recognition, and further improving the success rate of jumping from the table of contents area to the body text page, making it more convenient for users to view documents.
[0082] Combined Figure 3 As shown, in some embodiments, the following method for page jumping is provided:
[0083] S301. In response to a user's operation instruction in the document, determine whether the currently displayed document page includes a preset second feature string. If the currently displayed document page includes the preset second feature string, determine that the currently displayed document page contains a table of contents area and execute step S305. If the currently displayed document page does not include the preset second feature string, execute step S302.
[0084] S302. Determine whether the currently displayed document page is a picture. If the currently displayed document page is a picture, execute step S303. If the currently displayed document page is not a picture, end the page jump.
[0085] S303. Perform image recognition on the currently displayed document page to obtain the page text corresponding to the currently displayed document page, and then execute step S304.
[0086] S304. Determine whether the string in the page text includes the second feature string. If the string in the page text includes the second feature string, determine that the currently displayed document page contains a table of contents area and execute step S305. If the string in the page text does not include the second feature string, end the page jump.
[0087] S305. Determine the area corresponding to the operation instruction in the table of contents area, and then execute step S306.
[0088] S306. Recognize the characters in the area corresponding to the operation instruction, and then execute step S307.
[0089] S307. If a first feature string exists in the recognized characters, determine the target page corresponding to the first feature string in the document, and then execute step S308.
[0090] S308. Jump from the currently displayed document page to the target page, and then end the page jump.
[0091] Optionally, determining the target page corresponding to the first feature string in the document includes: detecting whether there are numbers in the area corresponding to the operation instruction; if there are numbers, determine the target page corresponding to the first feature string according to the numbers; if there are no numbers, determine the target page corresponding to the first feature string according to a preset matching strategy.
[0092] In this way, regardless of whether there are numbers in the area corresponding to the operation instruction, the target page can be determined, thereby providing a jump basis for realizing the jump from the currently displayed document page to the target page.
[0093] Optionally, detect whether there is a number in the area corresponding to the operation instruction, including: obtaining the string in the area corresponding to the operation instruction, determining whether the characters at the preset number of digits of the string are numeric characters, and if the characters at the preset number of digits of the string are numeric characters, determining that there is a number in the area corresponding to the operation instruction; if the characters at the preset number of digits of the string are not numeric characters, determining that there is no number in the area corresponding to the operation instruction. And determine the number at the preset number of digits in the string as the number for determining the target page. For example, if the characters at the last m digits of the string in the area corresponding to the operation instruction are numeric characters, it is determined that there is a number in the area corresponding to the operation instruction, and the m-digit number is determined as the page number of the target page to be jumped to, where m is a positive integer.
[0094] Combined with Figure 4 As shown, in some embodiments, the following method for page jumping is provided:
[0095] S401, in response to the user's operation instruction in the document, determine the area corresponding to the operation instruction in the currently displayed document page.
[0096] S402, identify the characters in the area corresponding to the operation instruction.
[0097] S403, determine whether there is a first feature string in the identified characters. If there is a first feature string in the identified characters, execute step S404; if there is no first feature string in the identified characters, end the page jump. The first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
[0098] S404, detect whether there is a number in the area corresponding to the operation instruction. If there is a number, execute step S405; if there is no number, execute step S406.
[0099] S405, determine the target page according to the number, and then execute step S407.
[0100] S406, determine the target page according to the preset matching strategy, and then execute step S407.
[0101] S407, jump from the currently displayed document page to the target page, and then end the page jump.
[0102] In this way, without adding jump links to the table of contents page of the document, when browsing the table of contents page of the document, it is also possible to perform string recognition in the table of contents page part of the document according to the area corresponding to the user's operation instruction. In the presence of the first feature string, page jumping is achieved, simplifying the jump function steps and making it more convenient for users to access the document.
[0103] Optionally, determining the target page according to the number includes: detecting the page number area of each document page; for the document pages with page number areas, identifying the page number information in the page number area; and determining the page with the same page number information as the number in the area corresponding to the operation instruction as the target page corresponding to the first feature string.
[0104] In this way, it is convenient to determine the page corresponding to the number in the area corresponding to the operation instruction, thereby providing a jump basis for realizing the jump from the currently displayed document page to the target page.
[0105] Optionally, if there are page numbers in the preset area of each document page, then determine the preset area of the document page as the page number area. For example, if there are page numbers at the bottom / top of the document page, then determine the bottom / top of the document page containing the page numbers as the page number area.
[0106] Optionally, after detecting the page number area of each document page, it further includes: for the document pages without page number areas, obtaining the page index position corresponding to the first feature string; and determining the page corresponding to the page index position as the target page. In this way, for the situation where the document page has no page number area or page number information, a method for realizing page jumping is provided, increasing the success rate of page jumping.
[0107] Optionally, obtaining the page index position corresponding to the first feature string includes: starting from the preset page in the document and counting, and determining the page when the count reaches the number in the area corresponding to the operation instruction as the page index position. Optionally, the preset page is the first page of the document.
[0108] Combined with Figure 5 As shown in the following, in some embodiments, the following method for page jumping is provided:
[0109] S501, in response to the user's operation instruction in the document, determine the area corresponding to the operation instruction in the currently displayed document page.
[0110] S502, identify the characters in the area corresponding to the operation instruction.
[0111] S503. Determine whether there is a first feature string among the recognized characters. If there is a first feature string among the recognized characters, execute step S504; if there is no first feature string among the recognized characters, end the page jump. The first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
[0112] S504. Detect whether there are numbers in the area corresponding to the operation instruction. If there are numbers, execute step S505; if there are no numbers, execute step S508.
[0113] S505. Detect whether there is a page number area on each document page; if there is a page number area on the document page, execute step S506, if there is no page number area on the document page, execute step S507.
[0114] S506. Identify the page number information in the page number area; determine the page with the same page number as the number as the target page, and then execute step S509.
[0115] S507. Obtain the page index position corresponding to the first feature string; determine the page corresponding to the page index position as the target page, and then execute step S509.
[0116] S508. Determine the target page according to the preset matching strategy, and then execute step S509.
[0117] S509. Jump from the currently displayed document page to the target page, and then end the page jump.
[0118] In this way, without pre-adding jump links to the document, during document browsing, string recognition is performed on the area corresponding to the user's operation instruction. When there is a first feature string, page jump is achieved according to the number in the area corresponding to the operation instruction or according to the preset matching strategy, simplifying the jump function steps and making it more convenient for users to consult the document.
[0119] Optionally, determining the target page according to the preset matching strategy includes: determining one or more document pages to be detected; detecting whether there is a first feature string in the one or more document pages to be detected; determining the document page with the first feature string as the target page.
[0120] In this way, page jump can be achieved only through the first feature string, increasing the success rate of page jump.
[0121] Optionally, when there are multiple document pages to be detected that contain the first feature string, randomly select one document page from the multiple document pages containing the first feature string and determine it as the target page, or select the document page closest to the currently displayed document page from the multiple document pages containing the first feature string and determine it as the target page.
[0122] Optionally, the document pages to be detected may include the currently displayed document page, or may not include the currently displayed document page. For example, when the number of document pages to be detected exceeds a preset threshold, the document pages to be detected do not include the currently displayed document page. In this way, detection resources can be saved. When the number of document pages to be detected does not exceed the preset threshold, the document pages to be detected include the currently displayed document page. In this way, the accuracy of detection can be improved.
[0123] Optionally, determining one or more document pages to be detected includes: obtaining the number of document pages; when the number of document pages is greater than N, obtaining N document pages and determining the obtained N document pages as the document pages to be detected; or, when the number of document pages is less than or equal to N, taking all document pages as the document pages to be detected; where N is a preset positive integer. In this way, since the maximum matching range for obtaining the document pages to be detected is set, infinite matching can be prevented, and the efficiency of implementing page jumps is improved.
[0124] Optionally, take the N pages after / before the currently displayed document page as the document pages to be detected. Optionally, when the number of pages after / before the currently displayed document page is less than N, take all the pages after / before the currently displayed document page as the document pages to be detected. Optionally, N is a preset fixed value, and in some embodiments, 1 ≤ N ≤ 20.
[0125] Optionally, obtain the chapter corresponding to the string characterizing the document chapter in the area corresponding to the operation instruction, obtain the number of document pages corresponding to this chapter, when the number of document pages corresponding to this chapter is greater than N, obtain N document pages and determine the obtained N document pages as the document pages to be detected; or, when the number of document pages corresponding to this chapter is less than or equal to N, take all the document pages corresponding to this chapter as the document pages to be detected. For example, the document pages corresponding to the second chapter are pages 24 to 36, which do not exceed 20 pages, then pages 24 to 36 are all determined as the document pages to be detected.
[0126] Combined with Figure 6 As shown, in some embodiments, the following method for page jumping is provided:
[0127] S601. In response to a user's operation instruction in a document, determine the area in the currently displayed document page corresponding to the operation instruction.
[0128] S602. Identify the characters in the area corresponding to the operation instruction.
[0129] S603. Determine whether a first feature string exists in the identified characters. If the first feature string exists in the identified characters, execute step S604; if the first feature string does not exist in the identified characters, end the page jump. The first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
[0130] S604. Detect whether there are numbers in the area corresponding to the operation instruction. If there are numbers, execute step S605; if there are no numbers, execute step S608.
[0131] S605. Detect whether there is a page number area on each document page; if there is a page number area on the document page, execute step S606; if there is no page number area on the document page, execute step S607.
[0132] S606. Identify the page number information in the page number area; determine the page with the same page number information as the number as the target page, and then execute step S610.
[0133] S607. Obtain the page index position corresponding to the first feature string; determine the page corresponding to the page index position as the target page, and then execute step S610.
[0134] S608. Determine one or more document pages to be detected; detect whether a first feature string exists in the one or more document pages to be detected; if the first feature string exists in the document pages to be detected, execute step S609; if the first feature string does not exist in the document pages to be detected, end the page jump.
[0135] S609. Determine the document page with the first feature string as the target page, and then execute step S610.
[0136] S610. Jump from the currently displayed document page to the target page, and then end the page jump.
[0137] In this way, without adding jump links to the table of contents page of the document, when browsing the table of contents page of the document, string recognition can also be performed in the table of contents page section of the document according to the area corresponding to the user's operation instruction. In the presence of the first feature string, page jumping is achieved according to the numbers in the area corresponding to the operation instruction, or according to whether the first feature string exists in the document page to be detected, simplifying the jump function steps and making it more convenient for users to consult the document.
[0138] As shown in combination with Figure 7 In some embodiments, the following method for PDF document page jumping is provided:
[0139] S701, in response to a user's click instruction on a PDF page in the document, determine whether the currently displayed PDF page includes a preset second feature string; if the currently displayed PDF page includes the preset second feature string, determine that the currently displayed PDF page contains a table of contents area and execute step S705; if the currently displayed PDF page does not include the preset second feature string, execute step S702.
[0140] S702, determine whether the currently displayed PDF page is a picture; if the currently displayed PDF page is a picture, execute step S703; if the currently displayed PDF page is not a picture, end the page jump.
[0141] S703, perform image recognition on the currently displayed PDF page to obtain the page text corresponding to the currently displayed PDF page, and then execute step S704.
[0142] S704, determine whether the string in the page text includes the second feature string; if the string in the page text includes the second feature string, determine that the currently displayed PDF page contains a table of contents area and execute step S705. If the string in the page text does not include the second feature string, end the page jump.
[0143] S705, determine the click area corresponding to the click instruction in the table of contents area, and then execute step S706.
[0144] S706, recognize the characters in the click area, and then execute step S707.
[0145] S707, determine whether there is a string for characterizing the document chapter among the recognized characters. If there is a string for characterizing the document chapter among the recognized characters, execute step S708; if there is no string for characterizing the document chapter among the recognized characters, end the page jump.
[0146] S708. Determine whether there is a string for characterizing the chapter title among the recognized characters. If there is a string for characterizing the chapter title among the recognized characters, execute step S709; if there is no string for characterizing the chapter title among the recognized characters, end the page jump.
[0147] S709. Detect whether there are numbers in the click area. If there are numbers, execute step S710; if there are no numbers, execute step S713.
[0148] S710. Detect whether there is a page number area on each PDF page; if there is a page number area on each PDF page, execute step S711, if there is no page number area on the PDF page, execute step S712.
[0149] S711. Identify the page number information in the page number area; determine the page with the same page number information as the number in the click area as the target page, and then execute step S715.
[0150] S712. Obtain the page index position corresponding to the first feature string; determine the page corresponding to the page index position as the target page, and then execute step S715.
[0151] S713. Determine one or more PDF pages to be detected; detect whether there is a first feature string in the one or more PDF pages to be detected; if there is a first feature string in the PDF page to be detected, execute step S714; if there is no first feature string in the PDF page to be detected, end the page jump.
[0152] S714. Determine the target page according to the PDF page where the first feature string exists, and then execute step S715.
[0153] S715. Jump from the currently displayed PDF page to the target page, and then end the page jump.
[0154] In this way, without pre-adding jump links to the table of contents page of the PDF document, when browsing the table of contents area of the PDF document, it is also possible to perform string recognition in the table of contents section of the PDF document according to the click area corresponding to the user's click instruction, and then implement page jump, making it more convenient for users to view the PDF document. In the above embodiment, by determining whether the currently displayed PDF page includes a preset second feature string, and at the same time performing image recognition for the case where the currently displayed PDF page is a picture and characters cannot be directly recognized, and then performing character recognition on the text obtained by the image recognition, to determine whether the currently displayed PDF page contains a table of contents area, this can improve the recognition probability of the table of contents area and avoid ineffective recognition of the table of contents area. After recognizing whether the currently displayed PDF page contains a table of contents area, recognize the characters in the click area, first determine the string representing the document chapter, and then determine the string representing the chapter title. In the case where there are strings representing the document chapter and strings representing the chapter title, then determine the numbers in the click area and perform page jump, which improves the probability that the information recognized in the click area is table of contents entry information, and the page jump is more in line with the user's operation purpose. The above embodiment can not only match the page number information in the PDF page for page jump, but also perform page jump through the page index position corresponding to the first feature string in the click area when there is no page number information in the PDF page, and can also match the pages containing the first feature string in each PDF page of the PDF document for page jump. Since multiple jump methods are provided, the success rate of page jump is improved.
[0155] As shown in combination with Figure 8 the following, an embodiment of the present disclosure provides a device for page jump, including: a first determination module 801, an identification module 802, a second determination module 803, and a jump module 804. The first determination module 801 is configured to, in the document, respond to a user's operation instruction and determine an area in the currently displayed document page corresponding to the operation instruction. The identification module 802 is configured to identify characters in the area. The second determination module 803 is configured to, in the case where a first feature string exists in the recognized characters, determine a target page corresponding to the first feature string in the document. The jump module 804 is configured to jump from the currently displayed document page to the target page.
[0156] Using the device for page jump provided by the embodiments of the present disclosure, in response to a user's operation instruction, determine the area corresponding to the operation instruction in the currently displayed document page; by identifying the characters in the area and determining the target page when the first feature string exists in the identified characters, after determining the target page, further implement the jump from the currently displayed document page to the target page. By adopting the above method, in the case where no jump link is pre-set in the document, it is possible to identify the feature string in the area corresponding to the user operation instruction by character recognition and determine the target page corresponding to the feature string, thereby realizing the page jump.
[0157] Optionally, the first determination module is configured to determine the area corresponding to the operation instruction in the currently displayed document page in the following manner:
[0158] Detect whether the currently displayed document page contains a table of contents area; in the case where the currently displayed document page contains a table of contents area, determine the area corresponding to the operation instruction in the table of contents area.
[0159] Optionally, the first determination module is configured to detect whether the currently displayed document page contains a table of contents area in the following manner:
[0160] Determine whether the currently displayed document page includes a preset second feature string; the second feature string is a string characterizing the document table of contents; in the case where the currently displayed document page includes the preset second feature string, determine that the currently displayed document page contains a table of contents area; in the case where the currently displayed document page does not include the preset second feature string, perform an identification process on the currently displayed document page to determine whether the currently displayed document page contains a table of contents area.
[0161] Optionally, the first determination module is configured to perform an identification process on the currently displayed document page in the following manner to determine whether the currently displayed document page contains a table of contents area:
[0162] Determine whether the currently displayed document page is a picture; in the case where the currently displayed document page is a picture, perform image recognition on the currently displayed document page to obtain the page text corresponding to the currently displayed document page; determine whether the string in the page text includes the second feature string; in the case where the string in the page text includes the second feature string, determine that the currently displayed document page contains a table of contents area.
[0163] Optionally, the second determination module is configured to determine the target page corresponding to the first feature string in the document in the following manner:
[0164] Whether there is a number in the detection area; if there is a number, determine the target page according to the number; if there is no number, determine the target page according to a preset matching strategy.
[0165] Optionally, the second determination module is configured to determine the target page according to the number in the following manner:
[0166] Detect the page number area of each document page; for the document page with a page number area, identify the page number information in the page number area; determine the page with the same page number information as the number as the target page.
[0167] Optionally, the second determination module is further configured to, for the document page without a page number area, obtain the page index position corresponding to the first feature string; determine the page corresponding to the page index position as the target page.
[0168] Optionally, the second determination module is configured to determine the target page according to a preset matching strategy in the following manner:
[0169] Determine one or more document pages to be detected; detect whether the first feature string exists in the one or more document pages to be detected; determine the document page with the first feature string as the target page.
[0170] Optionally, the second determination module is configured to determine one or more document pages to be detected in the following manner:
[0171] Obtain the number of document pages; when the number of document pages is greater than N, obtain N document pages and determine the obtained N document pages as the document pages to be detected; or, when the number of document pages is less than or equal to N, use all document pages as the document pages to be detected; where N is a preset positive integer.
[0172] Optionally, the first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
[0173] Combined Figure 9 As shown, an embodiment of the present disclosure provides an electronic device, including a processor 900 and a memory 901 storing program instructions. Optionally, the electronic device may further include a communication interface 902 and a bus 903. Among them, the processor 900, the communication interface 902, and the memory 901 can complete mutual communication through the bus 903. The communication interface 902 can be used for information transmission. The processor 900 can call the program instructions in the memory 901 to execute the method for page jump in the above embodiment.
[0174] In addition, when the program instructions in the above-mentioned memory 901 are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium.
[0175] As a computer-readable storage medium, the memory 901 can be used to store software programs and computer-executable programs, such as the program instructions / modules corresponding to the methods in the embodiments of the present disclosure. The processor 900 executes functional applications and data processing by running the program instructions / modules stored in the memory 901, that is, implements the method for page jump in the above embodiments.
[0176] The memory 901 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created according to the use of the terminal device, etc. In addition, the memory 901 may include high-speed random access memory and may also include non-volatile memory.
[0177] Using the electronic device provided by the embodiments of the present disclosure, in response to a user's operation instruction, determine the area corresponding to the operation instruction in the currently displayed document page; by identifying the characters in the area and determining a target page when a first feature string exists in the identified characters, after determining the target page, further implement the jump from the currently displayed document page to the target page. By adopting the above method, in the case where no jump link is pre-set in the document, it is possible to identify the feature string in the area corresponding to the user operation instruction by character recognition and determine the target page corresponding to the feature string, thereby realizing page jump.
[0178] Optionally, the electronic device is a computer, a tablet, a smart phone, etc.
[0179] The embodiments of the present disclosure provide a storage medium storing program instructions, and the program instructions execute the above-mentioned method for page jump when running.
[0180] The embodiments of the present disclosure provide a computer program product. The computer program product includes a computer program stored on a computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer is made to execute the above-mentioned method for page jump.
[0181] The above-mentioned computer-readable storage medium may be a transient computer-readable storage medium or a non-transient computer-readable storage medium.
[0182] The technical solution of the embodiments of the present disclosure can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in the embodiments of the present disclosure. The foregoing storage medium may be a non-transitory storage medium, including: various media that can store program codes such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, or may also be a transitory storage medium.
[0183] In combination Figure 10 As shown, in some embodiments, when the currently displayed document page includes a preset keyword "Table of Contents", it is confirmed that the currently displayed document page is a table of contents page. The user clicks on the text in the table of contents page to determine the desired jump page. When a string "3.1 XXXXXX" indicating the document chapter and chapter title is recognized in the corresponding area clicked by the mouse, and a number 16 is recognized in the corresponding area clicked by the mouse, then in response to the user's mouse click behavior, it jumps to page 16 of the document.
[0184] The above description and the accompanying drawings fully illustrate the embodiments of the present disclosure, enabling those skilled in the art to practice them. Other embodiments may include structural, logical, electrical, process, and other changes. Embodiments merely represent possible variations. Unless explicitly required, individual components and functions are optional, and the order of operations may vary. Parts and features of some embodiments may be included in or replace parts and features of other embodiments. Moreover, the terms used in this application are only for describing embodiments and do not limit the claims. As used in the description of the embodiments and the claims, unless the context clearly indicates otherwise, the singular forms "a", "an", and "the" are intended to also include the plural forms. Similarly, as used in this application, the term "and / or" refers to any and all possible combinations of one or more of the associated listed items. Additionally, when used in this application, the term "comprise" and its variants "comprises" and / or "comprising" etc. mean the presence of the stated features, wholes, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or groups of these. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, or apparatus that includes the element. Herein, each embodiment may focus on the differences from other embodiments, and the same or similar parts among the embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method parts disclosed in the embodiments, the relevant parts may refer to the description of the method parts.
[0185] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner may depend on the specific application and design constraints of the technical solution. The skilled person may use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the embodiments of the present disclosure. The skilled person can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0186] In the embodiments disclosed herein, the disclosed methods, products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units can be merely a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Additionally, the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect coupling or communication connection of devices or units can be in electrical, mechanical, or other forms. The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to implement this embodiment. Additionally, in the embodiments of the present disclosure, the various functional units can be integrated in one processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.
[0187] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram can represent a module, a program segment, or a part of code that contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions marked in the block can occur in a different order than that marked in the accompanying drawings. For example, two consecutive blocks can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. In the descriptions corresponding to the flowcharts and block diagrams in the accompanying drawings, the operations or steps corresponding to different blocks can also occur in a different order than that disclosed in the description. Sometimes, there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the reverse order, depending on the functions involved. Each block in the block diagram and / or flowchart, as well as combinations of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A method for page jump, characterized in that, Including: In response to a user's operation instruction in a document, determining a region corresponding to the operation instruction in the currently displayed document page; Identifying characters in the region; When a first feature string exists in the identified characters, determining a target page corresponding to the first feature string in the document; Jumping from the currently displayed document page to the target page; The determining of the region corresponding to the operation instruction in the currently displayed document page includes: determining whether the currently displayed document page includes a preset second feature string; when the currently displayed document page includes the preset second feature string, determining that the currently displayed document page includes a table of contents region; or, when the currently displayed document page does not include the preset second feature string, performing an identification process on the currently displayed document page to determine whether the currently displayed document page includes a table of contents region; when the currently displayed document page includes a table of contents region, determining a region corresponding to the operation instruction in the table of contents region.
2. The method according to claim 1, characterized in that, The second feature string is a string characterizing the document table of contents.
3. The method according to claim 1, characterized in that, Performing an identification process on the currently displayed document page to determine whether the currently displayed document page includes a table of contents region includes: Determining whether the currently displayed document page is a picture; When the currently displayed document page is a picture, performing image recognition on the currently displayed document page to obtain the page text corresponding to the currently displayed document page; Determining whether the string in the page text includes the second feature string; When the string in the page text includes the second feature string, determining that the currently displayed document page includes a table of contents region.
4. The method according to claim 1, characterized in that, Determining a target page corresponding to the first feature string in the document includes: Detecting whether there are numbers in the region; If there are numbers, determining the target page according to the numbers; If there are no numbers, determining the target page according to a preset matching strategy.
5. The method according to claim 4, characterized in that, Determining the target page according to the numbers includes: Detecting the page number regions of each document page; For a document page with a page number region, identifying the page number information in the page number region; Determining the page with the same page number information as the number as the target page.
6. The method according to claim 5, characterized in that, After detecting the page number regions of each document page, it further includes: For a document page without a page number region, obtaining the page index position corresponding to the first feature string; Determining the page corresponding to the page index position as the target page.
7. The method according to claim 4, characterized in that, Determining the target page according to a preset matching strategy includes: Determining one or more document pages to be detected; Detecting whether the first feature string exists in the one or more document pages to be detected; Determining the document page with the first feature string as the target page.
8. The method according to claim 7, characterized in that, The determining of one or more document pages to be detected includes: Obtaining the number of document pages; When the number of the document pages is greater than N, obtain N document pages and determine the obtained N document pages as the document pages to be detected; or, when the number of the document pages is less than or equal to N, use all the document pages as the document pages to be detected; where N is a preset positive integer.
9. The method according to any one of claims 1 to 8, characterized in that, The first feature string includes one or more of a string for characterizing a document chapter, a string for characterizing a chapter title, and a string for characterizing a page reference.
10. A device for page jump, characterized in that, Comprising: A first determination module, configured to determine, in response to a user's operation instruction in a document, a region corresponding to the operation instruction in the currently displayed document page; An identification module, configured to identify characters in the region; A second determination module, configured to, when a first feature string exists in the identified characters, determine a target page corresponding to the first feature string in the document; A jump module, configured to jump from the currently displayed document page to the target page; The first determination module is configured to determine the region corresponding to the operation instruction in the currently displayed document page in the following manner: determine whether the currently displayed document page includes a preset second feature string; When the currently displayed document page includes a preset second feature string, determine that the currently displayed document page includes a table of contents region; or, when the currently displayed document page does not include a preset second feature string, perform an identification process on the currently displayed document page to determine whether the currently displayed document page includes a table of contents region; When the currently displayed document page includes a table of contents region, determine the region corresponding to the operation instruction in the table of contents region.
11. An electronic device, comprising a processor and a memory storing program instructions, characterized in that, The processor is configured to execute the method for page jump according to any one of claims 1 to 9 when running program instructions.
12. A storage medium storing program instructions, characterized in that, The program instructions execute the method for page jump according to any one of claims 1 to 9 when running.
Citation Information
Patent Citations
Display packing and device of text document in support of page turn function
CN101571850A
Electronic document generation method and equipment
CN109871521A