Document processing method and device, computer device and storage medium
By dividing the text information in a PDF document into information fragments and processing them according to retrieval rules, the problems of information extraction errors and clutter in existing technologies are solved, achieving more efficient and accurate document retrieval and the generation of new target documents.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- GREE ELECTRIC APPLIANCE INC OF ZHUHAI
- Filing Date
- 2023-12-04
- Publication Date
- 2026-07-03
AI Technical Summary
Existing technologies contain errors and biases when extracting information from PDF documents, and the extracted content is disorganized, resulting in low retrieval efficiency.
The text information in the target document is divided into multiple information fragments. The information fragments are retrieved according to the retrieval rules to obtain the location information of the retrieval results. The results are then marked on the display interface to generate a new target document for proofreading and classifying the retrieval results.
It improves the accuracy of document retrieval and user experience, avoids errors and disorder in retrieval results, and enhances retrieval efficiency.
Smart Images

Figure CN117634476B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document processing technology, and in particular to a document processing method, apparatus, computer device and storage medium. Background Technology
[0002] In work and study, it's often necessary to record work and study content in documents. However, the text content in these documents is usually lengthy, making it difficult to quickly and accurately locate the required information when searching. For example, bidding projects typically have tender documents and bid documents, each with different formats and voluminous text. Manually processing and organizing this information is extremely inefficient. In today's information age, tender documents are generally stored and published in PDF format, and paper versions are usually scanned and saved as PDF files. One way to solve the problem of processing and organizing tender document information is to extract specific content from PDF documents.
[0003] However, current methods for parsing PDF documents using open-source parsing libraries, especially those containing Chinese characters, often suffer from errors and inaccuracies. Furthermore, the extracted content often contains numerous spaces and is disorganized. Therefore, accurately extracting information from documents has become a pressing issue that needs to be addressed. Summary of the Invention
[0004] In view of this, in order to solve the above-mentioned technical problem of accurately extracting information from documents, embodiments of the present invention provide a document processing method, apparatus, computer equipment, and storage medium.
[0005] In a first aspect, embodiments of the present invention provide a document processing method, including:
[0006] Divide the text information in the target document into multiple information fragments;
[0007] The search results are obtained by searching multiple information fragments according to the search rules corresponding to the target document.
[0008] Obtain the location information of the search results in the target document for display purposes;
[0009] When a first operation is received in response to the search results, a new target document is generated based on the search results.
[0010] In one possible implementation, dividing the text information in the target document into multiple information fragments includes:
[0011] Extract text information and symbol information from the target document;
[0012] The text information is divided into multiple information segments based on the symbol information;
[0013] Each of the information segments is assigned a number, and the number corresponds one-to-one with the information segment.
[0014] In one possible implementation, the step of retrieving multiple information fragments according to the retrieval rules corresponding to the target document to obtain retrieval results includes:
[0015] Determine at least one rule function corresponding to the retrieval rule;
[0016] Generate a rule function array based on at least one of the rule functions;
[0017] The rule function array is traversed based on each of the information fragments;
[0018] The information segment that successfully traversed the array of rule functions is identified as the first information segment;
[0019] The content in the first information fragment that matches the rule function array is taken as the search result.
[0020] In one possible implementation, the method further includes:
[0021] When the retrieval rule corresponds to multiple rule functions, and each of the information fragments fails to traverse the array of rule functions, a second information fragment is determined from the multiple information fragments, and the second information fragment conforms to at least one of the rule functions;
[0022] The second information segment is divided into multiple sub-information segments;
[0023] The step of traversing the array of rule functions is performed based on multiple sub-information fragments;
[0024] The sub-information fragment that is successfully traversed through the array of rule functions is identified as the first information fragment.
[0025] In one possible implementation, obtaining the location information of the search results in the target document for display includes:
[0026] Determine the target number corresponding to the first information segment;
[0027] The location of the target number is determined from the target document and used as the location information;
[0028] The search results are displayed in the first display area;
[0029] When the first display area receives a second operation on the search result, the target document is displayed in the second display area while the location information is marked.
[0030] In one possible implementation, generating a new target document based on the search result upon receiving a first operation on the search result includes:
[0031] When a first operation confirming that the search result and the location information are correct is received, the category information of the search result is determined according to the search rules and / or location information corresponding to the search result;
[0032] The search results are categorized and output according to the category information to obtain at least one new target document.
[0033] In one possible implementation, the method further includes:
[0034] Associate the location information corresponding to each of the search results in the new target document;
[0035] When a third operation is received for the new target document, the target document is opened, and the location information corresponding to the third operation is marked.
[0036] In a second aspect, embodiments of the present invention provide a document processing apparatus, comprising:
[0037] The segmentation module is used to divide the text information in the target document into multiple information fragments;
[0038] The retrieval module is used to retrieve multiple information fragments according to the retrieval rules corresponding to the target document, and obtain retrieval results;
[0039] The acquisition module is used to acquire the location information of the search results in the target document for display purposes;
[0040] The generation module is used to generate a new target document based on the search results when a first operation is received for the search results.
[0041] Thirdly, embodiments of the present invention provide a computer device, including: a processor and a memory, wherein the processor is configured to execute a document processing program stored in the memory to implement the document processing method described in any one of the first aspects above.
[0042] Fourthly, embodiments of the present invention provide a storage medium storing one or more programs, which can be executed by one or more processors to implement the document processing method described in any one of the first aspects.
[0043] The document processing solution provided in this invention divides the text information in a target document into multiple information segments; searches these segments according to the retrieval rules corresponding to the target document to obtain retrieval results; obtains the location information of the retrieval results within the target document for display; and generates a new target document based on the retrieval results when a first operation is received. This allows for proofreading of retrieval results during document retrieval, avoiding errors that can easily occur when directly extracting retrieval content. Outputting the retrieved information in a new document prevents the retrieval content from becoming disorganized, improving the accuracy of document retrieval and user experience. Attached Figure Description
[0044] Figure 1 A flowchart illustrating a document processing method provided in an embodiment of the present invention;
[0045] Figure 2 A flowchart illustrating another document processing method provided in an embodiment of the present invention;
[0046] Figure 3 A schematic diagram of a retrieval interface for a document processing method provided in an embodiment of the present invention;
[0047] Figure 4 This is a schematic diagram of the structure of a document processing device provided in an embodiment of the present invention;
[0048] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0050] To facilitate understanding of the embodiments of the present invention, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of the present invention.
[0051] Figure 1 This is a flowchart illustrating a document processing method provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the method specifically includes:
[0052] S11. Divide the text information in the target document into multiple information segments.
[0053] The document processing method provided in this invention is applied to computer devices, including but not limited to desktop computers, tablet computers, servers, etc. Specifically, it retrieves multiple information fragments in a document and displays the retrieval results and corresponding location information in the document, facilitating user verification and correction, and generating new documents based on the retrieval results, thus ensuring the accuracy and regularity of the document retrieval.
[0054] In this embodiment, the target document may include, but is not limited to, a PDF document. The text extraction tool obtains all text information in the target document and divides all text information into multiple different information segments according to a pre-defined set of special symbols (for example, dividing each segment into two periods or semicolons).
[0055] S12. Search for multiple information fragments according to the retrieval rules corresponding to the target document to obtain retrieval results.
[0056] In this embodiment, the search rules input by the user are obtained and used to search for target documents according to the requirements. The search rules can be, for example, including keyword A and keyword B, including keyword A or keyword B, including keyword A but not including keyword B, not including multiple keywords, etc.
[0057] Each information segment is traversed sequentially according to the retrieval rules to determine whether it conforms to the retrieval rules. If it conforms to the retrieval rules, the current information segment is determined as the retrieval result. Alternatively, the content in the current retrieval result that conforms to the retrieval rules is determined as the retrieval result (for example, if the information segment includes three sentences separated by commas, the sentences that conform to the retrieval results are determined as the retrieval results).
[0058] S13. Obtain the location information of the search results in the target document for display.
[0059] In this embodiment, the position of the information fragment corresponding to the search result within the text is used as location information. The search result is displayed in the first display area on the terminal screen. The target document is adjusted to the page containing the corresponding location information, and this page is displayed in the second display area next to the first display area. The location information or the information fragment corresponding to the location information is marked. The marking method can be highlighting, bolding, underlining, etc., and the specific marking method is not specifically limited in this embodiment. For example, when a search rule is entered in the input box on the left side of the software interface, the extracted search results are displayed below the input box. When the input box is clicked, the target document is displayed on the right side of the interface, and the information fragment of the extracted search result is located. The source text corresponding to the information fragment in the target document is highlighted. The user can compare and judge whether the search result is correct, and can make modification operations in the input box.
[0060] S14. When a first operation is received for the search result, a new target document is generated based on the search result.
[0061] In this embodiment, the user can modify and adjust the search results based on their location information within the target document. The first operation is used to adjust or modify the search results and determine their correctness. It can also be a selection operation on the search results, with the selected search results used to generate a new target document. When an operation confirming the correctness of the search results is received, at least one new target document is generated from the selected search results or the information fragments corresponding to the search results according to preset rules. The new target document can be a Word document, an Excel document, etc. The preset rules can be categorized according to search rules, grouping search results with the same or similar search rules into one category and generating a corresponding new target document. This new target document can be named using search rules. Similar search rules can be defined as two search rules containing at least one identical search expression (e.g., search rule 1: contains A and contains B, and search rule 2: contains A and contains C, both containing a search expression containing A, therefore they are similar), or categorized according to whether the search results are adjacent in location (e.g., grouping search results in the same paragraph or adjacent paragraphs into the same category and generating a new target document). Alternatively, a new target document can be generated for all categories, and tables in the new target document can be generated corresponding to the search results for each category. When classifying according to search rules, the tables are named according to the search rules corresponding to the search results in the current table.
[0062] As an example, after modifying the search results, the user selects the set of search results to be exported and clicks "Export." They can choose to export as Excel or Word, exporting the information fragments corresponding to the search results and categorizing them according to preset rules. The document contains multiple information tables, where the table names are statements corresponding to the search rules, and the content is information fragments. Furthermore, the user can select the set of search results and click "Export Selection Report." A pop-up window appears on the display interface for filling in selection information. If the required items are already included in the search results set, they are automatically filled; otherwise, the user needs to add them. The automatic filling logic is as follows: each selection information item is divided into an information item (key) and an information value (value). The condition is that if the included keyword A contains the information item (key), the corresponding search information is filled into the information value (value).
[0063] The document processing method provided in this invention divides the text information in a target document into multiple information segments; searches these segments according to the retrieval rules corresponding to the target document to obtain retrieval results; obtains the location information of the retrieval results within the target document for display; and generates a new target document based on the retrieval results when a first operation is received. This allows for proofreading of retrieval results during document retrieval, avoiding errors that can easily occur when directly extracting retrieval content. Outputting the retrieved information in a new document prevents the retrieval content from becoming disorganized, improving the accuracy of document retrieval and user experience.
[0064] Figure 2 This is a flowchart illustrating another document processing method provided in an embodiment of the present invention, as shown below. Figure 2 As shown, the method specifically includes:
[0065] S21. Extract text information and symbol information from the target document; divide the text information into multiple information segments based on the symbol information; and number each information segment.
[0066] In this embodiment, text and symbols in the target document are identified and extracted by text recognition software. The text information is divided according to preset symbols to obtain multiple information fragments. The symbols may include, but are not limited to, periods, semicolons, commas, exclamation marks, etc.
[0067] Furthermore, each information fragment is sequentially numbered according to its position in the target document, with each fragment corresponding to a number. The numbering rules may include, but are not limited to, numbering the information fragments in ascending order according to their position in the document. The position of each number in the target document is also recorded.
[0068] S22. Determine at least one rule function corresponding to the retrieval rule; generate a rule function array based on the at least one rule function; traverse the rule function array based on each information fragment; determine the information fragment that successfully traverses the rule function array as the first information fragment; take the content in the first information fragment that matches the rule function array as the retrieval result.
[0069] In this embodiment, each retrieval rule can contain multiple sub-rules. For example, the rule "Does not contain A and does not contain B" contains two sub-rules: "Does not contain A" and "Does not contain B". Since each sub-rule is actually a rule function in the program, the retrieval rule is split into at least one rule function, and an array is used to store the rule functions, resulting in a rule function array corresponding to the retrieval rule. Each information fragment is taken as input, and the rule function array is traversed. When any rule function returns false, the loop is exited, indicating that the match with the rule function array has failed, and the information fragment is determined to not conform to the retrieval rule. If no function returns false during the traversal of the rule function array, it indicates that the information fragment has successfully traversed the rule function array, the current information fragment conforms to the retrieval rule, and the information fragment is determined to be the first information fragment. The first information fragment can be directly used as the retrieval result, or, since the first information fragment may contain multiple sub-information fragments, the content of the sub-information fragments that conform to the rule function array can be used as the retrieval result (for example, if information fragments are divided according to periods, there may be multiple sub-information fragments separated by commas or pauses between two periods).
[0070] Specifically, such as Figure 3The diagram shows a retrieval interface of a document processing method according to an embodiment of the present invention. Area 1 is the retrieval rule input area, where users can input keywords, the page range of the target document to be retrieved, symbols of the retrieval rules, etc. Area 2 is the final generated retrieval rule. When a retrieval rule is selected, the retrieval result can be displayed in Area 3. Area 3 is the retrieval result corresponding to each retrieval rule. Area 4 is the target document, and the displayed page is the page where the retrieval result is located. When the user clicks on the location of the retrieval result from Area 3, the retrieval result can be marked in Area 4. This retrieval method can be implemented using the JavaScript programming language. 1. In the program, the character for "contains" corresponds to '+', "remove" corresponds to '-', "and" corresponds to '&', "or" corresponds to '|', the left parenthesis corresponds to '(', and the right parenthesis corresponds to ')'. When the user enters the keyword to be searched and clicks the input logic operation button, a retrieval rule string is constructed. 2. The retrieval rule string is traversed, and the symbols '&', '|', '(', etc. are placed into the operation character array in the order of traversal. The content of "+keyword", "-keyword", etc. is replaced with the symbol * to obtain an array in the form of ['(', '*', '|', '*', ')']. The remaining content of "+keyword", "-keyword", etc. are placed into the Boolean (true or false) judgment array in the order of traversal. 3. The Boolean judgment array is traversed. 1. Break the array. When the current element is "+keyword", execute the include(document information, keyword) function to determine if the document information contains the keyword. When the current element is "-keyword", execute the except(document information, keyword) function to determine if the document information excludes the keyword. The above functions return a boolean type, i.e., true / false, and put the return value into a new boolean array. 4. Traverse the operand character array and the boolean array, replace the symbol * in the operand character array with the elements in the boolean array in order, and then concatenate the elements in the operand character array into a logical operation string in the form of "(true|false)". 5. Call the built-in JavaScript function eval() to process the logical operation string. If the processing result is equal to 1, it means that the match is successful; otherwise, the match fails.
[0071] In one possible implementation, when a retrieval rule corresponds to multiple rule functions, and each information fragment fails to traverse the rule function array, a second information fragment is determined from the multiple information fragments, the second information fragment conforming to at least one of the rule functions; the second information fragment is divided into multiple sub-information fragments; the step of traversing the rule function array is performed based on the multiple sub-information fragments; and the sub-information fragment that successfully traverses the rule function array is determined as the first information fragment.
[0072] Specifically, since an information segment may contain multiple sub-segments, if one sub-segment conforms to the retrieval rule while any other sub-segment does not, the final retrieval result may not conform to the retrieval rule. Therefore, when multiple rule functions exist, each sub-segment needs to be retrieved. When all information segments fail to be retrieved, a second information segment is determined from the multiple information segments. The second information segment is the one that conforms to at least one rule function. When multiple information segments conform to at least one rule function, the information segment that conforms to the most rule functions is determined as the second information segment, that is, the information segment closest to the retrieval rule is determined as the second information segment. The second information segment is then divided according to all the symbols it contains to obtain multiple sub-segments. The step of traversing the rule function array is then performed. If a sub-segment successfully traverses the rule function array, then the sub-segment, or the second information segment containing the sub-segment, is determined as the first information segment.
[0073] S23. Determine the target number corresponding to the first information fragment; determine the location of the target number in the target document as location information; display the search results in the first display area; when the first display area receives the second operation on the search results, display the target document in the second display area while marking the location information.
[0074] In this embodiment, the location of the target number in the target document is determined based on the target number corresponding to the first information fragment, and the retrieved first information fragment is displayed in the first display area of the terminal screen for the user to view. When a user clicks on the first information fragment, the target document is displayed in the second display area adjacent to the first display area. The displayed page of the target document is the page where the first information fragment is located, and the first information fragment is marked as a reminder to the user of the location of the search result. When there are multiple first information fragments, the paragraph containing each first information fragment can be extracted and displayed in the second display area.
[0075] S24. Upon receiving the first operation confirming the correctness of the search results and location information, determine the category information of the search results based on the search rules and / or location information corresponding to the search results; classify and output the search results according to the category information to obtain at least one new target document.
[0076] In this embodiment, the user can adjust and modify the search rules or search results based on the first information fragment, and select the final required first information fragment. When a first operation confirming the correctness of the search results and location information is received, the search rule corresponding to the determined search result is used as the category information of the search result (e.g., the search results corresponding to the same search rule are determined as the same category information), or the location information corresponding to the search result is determined as its category information (e.g., the search results of pages 1-3 of the target document are determined as the same category information), or the location information and search rule corresponding to the search result are determined as its category information (e.g., the search results of pages 1-3 of the target document that conform to the same search rule are determined as the same category information). The search results of the same category information are output as a new target document.
[0077] In one possible implementation, the location information corresponding to each search result in the new target document is associated; when a third operation is received for the new target document, the target document is opened, and the location information corresponding to the third operation is marked. That is, each search result in the new target document is linked to its corresponding location information in the target document; when a click operation is received on a search result in the new target document, the target document is opened, the page containing the search result is displayed, and the search result is marked.
[0078] The document processing method provided in this invention extracts text information and symbol information from a target document; divides the text information into multiple information segments based on the symbol information; and assigns a number to each information segment. It determines at least one rule function corresponding to a retrieval rule; generates a rule function array based on the at least one rule function; traverses the rule function array based on each information segment; determines the information segment that successfully traverses the rule function array as the first information segment; and uses the content of the first information segment that conforms to the rule function array as the retrieval result. It determines the target number corresponding to the first information segment; determines the location of the target number in the target document as location information; displays the retrieval result in a first display area; when the first display area receives a second operation on the retrieval result, it displays the target document in a second display area while simultaneously annotating the location information. When a first operation confirming the correctness of the retrieval result and location information is received, it determines the category information of the retrieval result based on the retrieval rule and / or location information corresponding to the retrieval result; and outputs the retrieval result according to the category information, obtaining at least one new target document. Therefore, by simultaneously displaying and annotating the content corresponding to the source document on the interface displaying the retrieval result, the problem of erroneous or biased retrieved information can be avoided. By using search rules, the retrieved information is categorized and arranged, and then exported as an Excel or Word document. This avoids the problem of disorganized and chaotic search results, improves the accuracy and efficiency of document retrieval, and optimizes the user experience.
[0079] Figure 4 This is a schematic diagram of the structure of a document processing device provided in an embodiment of the present invention, as shown below. Figure 4 As shown, the device specifically includes:
[0080] The segmentation module 41 is used to divide the text information in the target document into multiple information fragments;
[0081] The retrieval module 42 is used to retrieve multiple information fragments according to the retrieval rules corresponding to the target document and obtain retrieval results;
[0082] The acquisition module 43 is used to acquire the location information of the search results in the target document for display purposes;
[0083] The generation module 44 is used to generate a new target document based on the search results when a first operation is received for the search results.
[0084] In one possible implementation, the extraction module 45 is used to extract text information and symbol information from the target document;
[0085] The segmentation module is specifically used to divide the text information into multiple information segments based on the symbol information;
[0086] The numbering module 46 is used to number each of the information segments, and the number corresponds one-to-one with the information segment.
[0087] In one possible implementation, the determining module 47 is used to determine at least one rule function corresponding to the retrieval rule;
[0088] The generation module is specifically used to generate a rule function array based on at least one of the rule functions;
[0089] The retrieval module is specifically used to traverse the rule function array based on each information fragment;
[0090] The information segment that successfully traversed the array of rule functions is identified as the first information segment;
[0091] The content in the first information fragment that matches the rule function array is taken as the search result.
[0092] In one possible implementation, the determining module is further configured to determine a second information fragment from the multiple information fragments when the retrieval rule corresponds to multiple rule functions and each information fragment fails to traverse the array of rule functions; the second information fragment conforms to at least one of the rule functions.
[0093] The segmentation module is further configured to divide the second information segment into multiple sub-information segments;
[0094] The determining module is further configured to perform a step of traversing the rule function array based on multiple sub-information fragments;
[0095] The sub-information fragment that is successfully traversed through the array of rule functions is identified as the first information fragment.
[0096] In one possible implementation, the determining module is specifically used to determine the target number corresponding to the first information fragment;
[0097] The location of the target number is determined from the target document and used as the location information;
[0098] Display module 48 is used to display the search results in the first display area;
[0099] When the first display area receives a second operation on the search result, the target document is displayed in the second display area while the location information is marked.
[0100] In one possible implementation, the determining module is specifically used to determine the category information of the search result based on the search rules and / or location information corresponding to the search result when a first operation confirming that the search result and the location information are correct is received;
[0101] The generation module is specifically used to classify and output the search results according to the category information to obtain at least one new target document.
[0102] In one possible implementation, the association module 49 is used to associate the location information corresponding to each of the search results in the new target document;
[0103] When a third operation is received for the new target document, the target document is opened, and the location information corresponding to the third operation is marked.
[0104] The document processing device provided in this embodiment can be as follows: Figure 4 The apparatus shown can perform, as Figure 1-2 All steps of the Chinese document processing method, thereby achieving Figure 1-2 For details on the technical effects of the document processing method shown, please refer to [link / reference]. Figure 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0105] Figure 5 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Figure 5The computer device 500 shown includes at least one processor 501, a memory 502, at least one network interface 504, and other user interfaces 503. The various components in the computer device 500 are coupled together via a bus system 505. It is understood that the bus system 505 is used to implement communication between these components. In addition to a data bus, the bus system 505 also includes a power bus, a control bus, and a status signal bus. However, for clarity, ... Figure 5 The general designated all buses as Bus System 505.
[0106] The user interface 503 may include a display, keyboard, or clicking device (e.g., mouse, trackball, touchpad, or touchscreen).
[0107] It is understood that the memory 502 in the embodiments of the present invention can be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. The non-volatile memory can be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. The volatile memory can be random access memory (RAM), which is used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), and Direct Rambus RAM (DRRAM). The memory 502 described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0108] In some implementations, memory 502 stores elements, executable units or data structures, or subsets thereof, or extended sets thereof: operating system 5021 and application program 5022.
[0109] The operating system 5021 includes various system programs, such as the framework layer, core library layer, and driver layer, used to implement various basic business functions and handle hardware-based tasks. The application program 5022 includes various applications, such as a media player and a browser, used to implement various application functions. The program implementing the method of this embodiment can be included in the application program 5022.
[0110] In this embodiment of the invention, by calling the program or instructions stored in memory 502, specifically the program or instructions stored in application program 5022, processor 501 executes the method steps provided in each method embodiment, including, for example:
[0111] Divide the text information in the target document into multiple information fragments;
[0112] The search results are obtained by searching multiple information fragments according to the search rules corresponding to the target document.
[0113] Obtain the location information of the search results in the target document for display purposes;
[0114] When a first operation is received in response to the search results, a new target document is generated based on the search results.
[0115] In one possible implementation, dividing the text information in the target document into multiple information fragments includes:
[0116] Extract text information and symbol information from the target document;
[0117] The text information is divided into multiple information segments based on the symbol information;
[0118] Each of the information segments is assigned a number, and the number corresponds one-to-one with the information segment.
[0119] In one possible implementation, the step of retrieving multiple information fragments according to the retrieval rules corresponding to the target document to obtain retrieval results includes:
[0120] Determine at least one rule function corresponding to the retrieval rule;
[0121] Generate a rule function array based on at least one of the rule functions;
[0122] The rule function array is traversed based on each of the information fragments;
[0123] The information segment that successfully traversed the array of rule functions is identified as the first information segment;
[0124] The content in the first information fragment that matches the rule function array is taken as the search result.
[0125] In one possible implementation, the method further includes:
[0126] When the retrieval rule corresponds to multiple rule functions, and each of the information fragments fails to traverse the array of rule functions, a second information fragment is determined from the multiple information fragments, and the second information fragment conforms to at least one of the rule functions;
[0127] The second information segment is divided into multiple sub-information segments;
[0128] The step of traversing the array of rule functions is performed based on multiple sub-information fragments;
[0129] The sub-information fragment that is successfully traversed through the array of rule functions is identified as the first information fragment.
[0130] In one possible implementation, obtaining the location information of the search results in the target document for display includes:
[0131] Determine the target number corresponding to the first information segment;
[0132] The location of the target number is determined from the target document and used as the location information;
[0133] The search results are displayed in the first display area;
[0134] When the first display area receives a second operation on the search result, the target document is displayed in the second display area while the location information is marked.
[0135] In one possible implementation, generating a new target document based on the search result upon receiving a first operation on the search result includes:
[0136] When a first operation confirming that the search result and the location information are correct is received, the category information of the search result is determined according to the search rules and / or location information corresponding to the search result;
[0137] The search results are categorized and output according to the category information to obtain at least one new target document.
[0138] In one possible implementation, the location information corresponding to each of the search results in the new target document is associated;
[0139] When a third operation is received for the new target document, the target document is opened, and the location information corresponding to the third operation is marked.
[0140] The methods disclosed in the above embodiments of the present invention can be applied to or implemented by processor 501. Processor 501 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the integrated logic circuit of the hardware in processor 501 or by instructions in the form of software. The processor 501 may be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present invention can be directly embodied in the execution of a hardware decoding processor, or executed by a combination of hardware and software units in the decoding processor. The software units may be located in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 502. Processor 501 reads the information in memory 502 and, in conjunction with its hardware, completes the steps of the above method.
[0141] It is understood that the embodiments described herein can be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), general-purpose processors, controllers, microcontrollers, microprocessors, other electronic units for performing the functions described herein, or combinations thereof.
[0142] For software implementation, the techniques described herein can be implemented by units that perform the functions described herein. The software code can be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.
[0143] The computer device provided in this embodiment may be as follows: Figure 5 The computer device shown can perform, for example Figure 1-2 All steps of the Chinese document processing method, thereby achieving Figure 1-2 For details on the technical effects of the document processing method shown, please refer to [link / reference]. Figure 1-2 The relevant descriptions are presented concisely and will not be elaborated upon here.
[0144] This invention also provides a storage medium (computer-readable storage medium). This storage medium stores one or more programs. The storage medium may include volatile memory, such as random access memory; the memory may also include non-volatile memory, such as read-only memory, flash memory, hard disk, or solid-state drive; the memory may also include combinations of the above types of memory.
[0145] When one or more programs in the storage medium can be executed by one or more processors to implement the document processing method described above that is executed on the device side.
[0146] The processor is used to execute a document processing program stored in memory to implement the following steps of a document processing method executed on the device side:
[0147] Divide the text information in the target document into multiple information fragments;
[0148] The search results are obtained by searching multiple information fragments according to the search rules corresponding to the target document.
[0149] Obtain the location information of the search results in the target document for display purposes;
[0150] When a first operation is received in response to the search results, a new target document is generated based on the search results.
[0151] In one possible implementation, dividing the text information in the target document into multiple information fragments includes:
[0152] Extract text information and symbol information from the target document;
[0153] The text information is divided into multiple information segments based on the symbol information;
[0154] Each of the information segments is assigned a number, and the number corresponds one-to-one with the information segment.
[0155] In one possible implementation, the step of retrieving multiple information fragments according to the retrieval rules corresponding to the target document to obtain retrieval results includes:
[0156] Determine at least one rule function corresponding to the retrieval rule;
[0157] Generate a rule function array based on at least one of the rule functions;
[0158] The rule function array is traversed based on each of the information fragments;
[0159] The information segment that successfully traversed the array of rule functions is identified as the first information segment;
[0160] The content in the first information fragment that matches the rule function array is taken as the search result.
[0161] In one possible implementation, the method further includes:
[0162] When the retrieval rule corresponds to multiple rule functions, and each of the information fragments fails to traverse the array of rule functions, a second information fragment is determined from the multiple information fragments, and the second information fragment conforms to at least one of the rule functions;
[0163] The second information segment is divided into multiple sub-information segments;
[0164] The step of traversing the array of rule functions is performed based on multiple sub-information fragments;
[0165] The sub-information fragment that is successfully traversed through the array of rule functions is identified as the first information fragment.
[0166] In one possible implementation, obtaining the location information of the search results in the target document for display includes:
[0167] Determine the target number corresponding to the first information segment;
[0168] The location of the target number is determined from the target document and used as the location information;
[0169] The search results are displayed in the first display area;
[0170] When the first display area receives a second operation on the search result, the target document is displayed in the second display area while the location information is marked.
[0171] In one possible implementation, generating a new target document based on the search result upon receiving a first operation on the search result includes:
[0172] When a first operation confirming that the search result and the location information are correct is received, the category information of the search result is determined according to the search rules and / or location information corresponding to the search result;
[0173] The search results are categorized and output according to the category information to obtain at least one new target document.
[0174] In one possible implementation, the location information corresponding to each of the search results in the new target document is associated;
[0175] When a third operation is received for the new target document, the target document is opened, and the location information corresponding to the third operation is marked.
[0176] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0177] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0178] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A document processing method characterized by, include: Divide the text information in the target document into multiple information fragments; The search results are obtained by searching multiple information fragments according to the search rules corresponding to the target document. Obtain the location information of the search results in the target document for display purposes; When a first operation is received in response to the search results, a new target document is generated based on the search results. The step of retrieving multiple information fragments according to the retrieval rules corresponding to the target document to obtain retrieval results includes: Determine at least one rule function corresponding to the retrieval rule; Generate a rule function array based on at least one of the rule functions; The rule function array is traversed based on each of the information fragments; The information segment that successfully traversed the array of rule functions is identified as the first information segment; The content in the first information fragment that matches the rule function array is taken as the search result; When the retrieval rule corresponds to multiple rule functions, and each of the information fragments fails to traverse the array of rule functions, a second information fragment is determined from the multiple information fragments, and the second information fragment conforms to at least one of the rule functions; The second information segment is divided into multiple sub-information segments; The step of traversing the array of rule functions is performed based on multiple sub-information fragments; The sub-information fragment that is successfully traversed through the array of rule functions is identified as the first information fragment; When a first operation is received regarding the search result, generating a new target document based on the search result includes: When a first operation confirming that the search result and the location information are correct is received, the category information of the search result is determined according to the search rules and / or location information corresponding to the search result; The search results are categorized and output according to the category information to obtain at least one new target document.
2. The method of claim 1, wherein, The process of dividing the text information in the target document into multiple information fragments includes: Extract text information and symbol information from the target document; The text information is divided into multiple information segments based on the symbol information; Each of the information segments is assigned a number, and the number corresponds one-to-one with the information segment.
3. The method of claim 1, wherein, The step of obtaining the location information of the search results in the target document for display includes: Determine the target number corresponding to the first information segment; The location of the target number is determined from the target document and used as the location information; The search results are displayed in the first display area; When the first display area receives a second operation on the search result, the target document is displayed in the second display area while the location information is marked.
4. The method of claim 1, wherein, The method further includes: Associate the location information corresponding to each of the search results in the new target document; When a third operation is received for the new target document, the target document is opened, and the location information corresponding to the third operation is marked.
5. A document processing device, characterized in that, include: The segmentation module is used to divide the text information in the target document into multiple information fragments; The retrieval module is used to retrieve multiple information fragments according to the retrieval rules corresponding to the target document, and obtain retrieval results; The acquisition module is used to acquire the location information of the search results in the target document for display purposes; A generation module is used to generate a new target document based on the search results when a first operation is received for the search results. The step of retrieving multiple information fragments according to the retrieval rules corresponding to the target document to obtain retrieval results includes: Determine at least one rule function corresponding to the retrieval rule; Generate a rule function array based on at least one of the rule functions; The rule function array is traversed based on each of the information fragments; The information segment that successfully traversed the array of rule functions is identified as the first information segment; The content in the first information fragment that matches the rule function array is taken as the search result; When the retrieval rule corresponds to multiple rule functions, and each of the information fragments fails to traverse the array of rule functions, a second information fragment is determined from the multiple information fragments, and the second information fragment conforms to at least one of the rule functions; The second information segment is divided into multiple sub-information segments; The step of traversing the array of rule functions is performed based on multiple sub-information fragments; The sub-information fragment that is successfully traversed through the array of rule functions is identified as the first information fragment; When a first operation is received regarding the search result, generating a new target document based on the search result includes: When a first operation confirming that the search result and the location information are correct is received, the category information of the search result is determined according to the search rules and / or location information corresponding to the search result; The search results are categorized and output according to the category information to obtain at least one new target document.
6. A computer device, characterized in that, include: A processor and a memory, the processor being configured to execute a document processing program stored in the memory to implement the document processing method according to any one of claims 1 to 4.
7. A storage medium, characterized in that, The storage medium stores one or more programs, which can be executed by one or more processors to implement the document processing method according to any one of claims 1 to 4.