A method and apparatus for full-text retrieval and display of retrieval results

By using a multi-branch tree structure and full-text indexing technology, the shortcomings of full-text search systems in document structuring and encrypted display are addressed, enabling rapid document location and multi-version comparison, thus meeting data security and confidentiality requirements in specific scenarios.

CN115687566BActive Publication Date: 2025-10-31CHINESE PEOPLES LIBERATION ARMY UNIT 93114
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211209222.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-30
Publication Date
2025-10-31
Estimated Expiration
2042-09-30

AI Technical Summary

Technical Problem

Existing full-text search systems have shortcomings in document structuring and encrypted display, and cannot meet the requirements of full-text search, keyword highlighting, document structure organization and gridded confidential display in specific scenarios. They also cannot perform segmented browsing and accurately locate the chapter content of a document, nor can they perform multi-version comparison.

Method used

A multi-branch tree structure is used to store the document directory. The text content is obtained through breadth-first traversal, a full-text index is built, and the text is rasterized into multiple images with explicit digital watermarks to achieve full-text retrieval and structured display.

Benefits of technology

It enables quick location of document chapters, supports multi-document comparison and data security, meets the needs of full-text file search, keyword highlighting, document structure organization and gridded confidential display, and improves the confidentiality and traceability of text.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115687566B_ABST
    Figure CN115687566B_ABST
Patent Text Reader

Abstract

This invention discloses a method and apparatus for full-text retrieval and displaying retrieval results. The method includes: extracting the directory structure of the text to be retrieved, storing the directory structure in the form of a multi-branch tree; each node in the tree corresponds to an entry in the directory structure; traversing the multi-branch tree in a breadth-first search manner to obtain the text content between adjacent nodes; establishing a full-text index corresponding to the text to be retrieved based on the text content between adjacent nodes; rasterizing the text to be retrieved and adding a visible digital watermark to each image; obtaining search keywords; performing a full-text retrieval of the text to be retrieved based on the full-text index; and outputting an image corresponding to the retrieval results. The method of this invention displays the portion containing the retrieval results according to structured information, rasterizes the retrieval results, and adds a watermark.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of retrieval, and more specifically to a method and apparatus for full-text retrieval and displaying retrieval results. Background Technology

[0002] Full-text retrieval is a new information retrieval technology that emerged at the end of the 20th century. After decades of development, especially with the advancement of new-generation information technologies represented by computer technology, full-text retrieval has evolved from its initial string matching and simple Boolean logic retrieval techniques into a composite technology capable of comprehensively managing massive amounts of unstructured data, including text, audio, images, and moving images. Due to profound changes in its connotation and extension, full-text retrieval systems have become synonymous with a new generation of management systems, and the basic indicators for measuring full-text retrieval systems and the connotation of full-text retrieval itself have also undergone significant changes.

[0003] The main document management and full-text search systems in the industry include:

[0004] Baidu Wenku full-text search allows you to search by entering keywords and displays all the results. The text can be copied, but the document structure is not extracted, and the search results page does not add watermark information to the document content.

[0005] DouDing Library's full-text search allows users to search by keywords, and the results are displayed as images with the option to add watermarks. However, the retrieved documents are not displayed in a structured manner.

[0006] 360 Documents' full-text search allows users to search by keywords, and the results are displayed as images. However, the retrieved documents are not displayed in a structured way, nor are they watermarked.

[0007] In comparison, existing full-text search systems in the industry only perform full-text retrieval and display of documents, lacking in areas such as document structuring and encrypted display. For example, during full-text search and content browsing, they cannot structurally decompose documents, nor can they perform segmented browsing or accurately locate chapter content. Furthermore, they lack text comparison functions, cannot address the requirements for comparing multiple versions of documents and precise location, and cannot quickly and faithfully locate a specific chapter or table of contents. Clearly, they cannot meet the requirements of full-text document retrieval, keyword highlighting, document structure organization and rasterized secure display, comparison of different document versions, and data security in specific scenarios. Summary of the Invention

[0008] In view of this, the present invention provides a method and apparatus for full-text retrieval and display of retrieval results, which can solve the technical problems of insufficient document structure and encrypted display of retrieval results after existing full-text retrieval.

[0009] To solve the above-mentioned technical problems, the present invention is implemented as follows.

[0010] A method for full-text retrieval and displaying retrieval results includes:

[0011] Step S1: Extract the directory structure of the text to be retrieved, and store the directory structure in the form of a multi-branch tree; each node in the tree corresponds to an entry in the directory structure, and the node also stores a node identifier and semantic information of the chapter content corresponding to the directory entry of the node; the node identifier is used to identify the node and the category to which the content corresponding to the node belongs.

[0012] Step S2: Traverse the multi-way tree using breadth-first search to obtain the text content between each adjacent node;

[0013] Step S3: Based on the text content between each adjacent node, establish a full-text index corresponding to the text to be retrieved;

[0014] Step S4: Based on the directory structure of the text to be retrieved, the node identifiers of each node in the multi-way tree, and the semantic information corresponding to the nodes, the text to be retrieved is rasterized, that is, the text to be retrieved is divided into multiple text blocks of different lengths, each text block corresponding to an image; an explicit digital watermark is added to each image;

[0015] Step S5: Obtain search keywords, perform full-text search on the text to be searched based on the full-text index, and output the image corresponding to the search results.

[0016] Preferably, the step of extracting the directory structure of the text to be retrieved and storing the directory structure in the form of a multi-way tree includes:

[0017] Step S11: Read the directory structure of the text to be retrieved, and recursively read the subdirectories at various depths included in the current directory; read the current directory and establish the corresponding nodes in the multi-branch tree for each subdirectory and the current directory;

[0018] Step S12: If all directories of the text to be retrieved have been processed, the method ends; otherwise, the next directory of the current directory is taken as the current directory, and the process returns to step S11.

[0019] Preferably, step S2: traversing the multi-way tree in a breadth-first search manner to obtain the text content between adjacent nodes includes:

[0020] Step S21: Traverse the multi-way tree in a breadth-first search manner to obtain each pair of adjacent nodes, where each pair of adjacent nodes includes two adjacent nodes;

[0021] Step S22: For each of all adjacent node pairs, perform the following operations: obtain the node markers corresponding to the two nodes, and extract all the text between the two node markers from the text to be retrieved.

[0022] Preferably, step S3: establishing a full-text index corresponding to the text to be retrieved based on the text content between each adjacent node includes:

[0023] Based on the text content between each adjacent node, the extracted text content is submitted to the full-text search ES database to construct a full-text index.

[0024] The present invention provides a device for full-text retrieval and display of retrieval results, the device comprising:

[0025] Multi-branch tree module: configured to extract the directory structure of the text to be retrieved, and store the directory structure in the form of a multi-branch tree; each node in the tree corresponds to an entry in the directory structure, and the node also stores a node identifier and semantic information of the content of the chapter corresponding to the directory entry of the node; the node identifier is used to identify the node and the category to which the content corresponding to the node belongs;

[0026] Traversal module: configured to traverse the multi-way tree in a breadth-first search manner to obtain the text content between each adjacent node;

[0027] Index module: Configured to build a full-text index corresponding to the text to be retrieved based on the text content between each adjacent node;

[0028] Rasterization module: configured to rasterize the text to be retrieved based on the directory structure of the text to be retrieved, the node identifiers of each node in the multi-branch tree, and the semantic information corresponding to the nodes, that is, to divide the text to be retrieved into multiple text blocks of different lengths, each text block corresponding to an image; and to add an explicit digital watermark to each image;

[0029] Search module: Configured to obtain search keywords, perform full-text search on the text to be searched based on the full-text index, and output an image corresponding to the search results.

[0030] The present invention provides a computer-readable storage medium storing a plurality of instructions; the plurality of instructions are used by a processor to load and execute the method as described above.

[0031] The present invention provides an electronic device, characterized in that the electronic device comprises:

[0032] A processor is used to execute multiple instructions;

[0033] Memory, used to store multiple instructions;

[0034] The plurality of instructions are to be stored in the memory and loaded and executed by the processor as described above.

[0035] Beneficial effects:

[0036] This invention proposes a structured extraction method for full-text document retrieval and a full-function display method for structured documents. It can display data in raster format, add watermarks, and compare multiple documents. It can meet the requirements of full-text document retrieval, keyword highlighting, document structure organization and raster confidential display, comparison of different document versions, and data security in specific scenarios.

[0037] It has the following technical effects:

[0038] (1) This invention enables users to quickly locate the file and chapter to which the search content belongs. It also enables rapid on-screen comparison between different versions of the same file, satisfying users' basic requirement of conducting full-text text search, as well as allowing them to locate file content in a structured manner and quickly compare file version differences or content comparison of similar documents issued by different departments.

[0039] (2) This invention proposes a structured extraction method for full-text document retrieval. This invention decomposes the document into a structured form, extracts the structured content, performs full-text retrieval, displays the part containing the retrieval results according to the structured information, and rasterizes the retrieval results and adds a watermark.

[0040] (3) The present invention can provide functions such as data display document rasterization, watermark display, and multi-document comparison.

[0041] (4) This invention can extract text structure and content, solving the interoperability problem of large document browsing; this invention can perform text rasterization processing and add watermarks. The search results are displayed in the form of images and watermarks, meeting the requirements of strict data confidentiality and improving the confidentiality and traceability of the text. Attached Figure Description

[0042] Figure 1 This is a schematic diagram of the method for full-text retrieval and display of retrieval results provided by the present invention;

[0043] Figure 2 A flowchart illustrating the method for determining file structure provided by this invention;

[0044] Figure 3 This is a flowchart illustrating the method for reading node content provided by the present invention.

[0045] Figure 4A schematic diagram of the device structure for full-text retrieval and display of retrieval results provided by the present invention. Detailed Implementation

[0046] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0047] like Figures 1-3 As shown, this invention proposes a method for full-text retrieval and displaying retrieval results, comprising the following steps:

[0048] Step S1: Extract the directory structure of the text to be retrieved, and store the directory structure in the form of a multi-branch tree; each node in the tree corresponds to an entry in the directory structure, and the node also stores a node identifier and semantic information of the chapter content corresponding to the directory entry of the node; the node identifier is used to identify the node and the category to which the content corresponding to the node belongs.

[0049] Step S2: Traverse the multi-way tree using breadth-first search to obtain the text content between each adjacent node;

[0050] Step S3: Based on the text content between each adjacent node, establish a full-text index corresponding to the text to be retrieved;

[0051] Step S4: Based on the directory structure of the text to be retrieved, the node identifiers of each node in the multi-way tree, and the semantic information corresponding to the nodes, the text to be retrieved is rasterized, that is, the text to be retrieved is divided into multiple text blocks of different lengths, each text block corresponding to an image; an explicit digital watermark is added to each image;

[0052] Step S5: Obtain search keywords, perform full-text search on the text to be searched based on the full-text index, and output the image corresponding to the search results.

[0053] This invention is developed using JavaEE, employs the domestic DM database technology, and is built on Spring Boot. It uses technologies such as POI, ITEXT, PDFBOX, and Elasticsearch to read the document's directory structure, extract text content, rasterize the document content, add watermark information, and build a full-text search index. The front-end uses Vue to build the overall content interaction interface.

[0054] In this invention, document structure extraction involves reading the document's title / table of contents and other structures to organize the entire document into a tree structure; document content rasterization is achieved by converting the document into images, saving the file as multiple images, and adding explicit digital watermarks to the generated images to trace the document's origin and ensure data security.

[0055] Step S1: Extract the directory structure of the text to be retrieved, and store the extracted directory structure in the form of a multi-way tree; each node in the tree corresponds to an entry in the directory structure, and the nodes in the tree also store the node identifier and the semantic information of the corresponding chapter of the text to be retrieved corresponding to the node. The node identifier is used to identify the node and the category to which the content corresponding to the node belongs, including:

[0056] The document structure of the text to be retrieved is extracted by reading the directory structure of the text to be retrieved and organizing the text into a tree structure.

[0057] The step of extracting the directory structure of the text to be retrieved and storing the extracted directory structure in the form of a multi-way tree includes:

[0058] Step S11: Read the directory structure of the text to be retrieved, and recursively read the subdirectories at various depths included in the current directory; read the current directory and establish the corresponding nodes in the multi-branch tree for each subdirectory and the current directory;

[0059] Step S12: If all directories of the text to be retrieved have been processed, the method ends; otherwise, the next directory of the current directory is taken as the current directory, and the process returns to step S11.

[0060] The core of this invention is document content structuring. By reading the document's title / table of contents and other structures, the entire document is organized into a tree structure. The pseudocode for extracting the document structure is as follows:

[0061]

[0062] Step S2: Traverse the multi-way tree using breadth-first search to obtain the text content between adjacent nodes, including:

[0063] Step S21: Traverse the multi-way tree in a breadth-first search manner to obtain each pair of adjacent nodes, where each pair of adjacent nodes includes two adjacent nodes;

[0064] Step S22: For each of all adjacent node pairs, perform the following operations: obtain the node markers corresponding to the two nodes, and extract all the text between the two node markers from the text to be retrieved.

[0065] In this invention, each node is looped through. Taking a node with a page number as an example, the page number of the current node and the page number of the next node are obtained. All text between these two page numbers is extracted. The location of the node marker text is queried to find the position between two node markers, and then the text between the node markers is extracted. This allows the text within the document structure to be obtained, preparing for full-text search.

[0066]

[0067] Step S3: Based on the text content between adjacent nodes, establish a full-text index corresponding to the text to be retrieved, including:

[0068] Based on the text content between each adjacent node, the extracted text content is submitted to the full-text search ES database to construct full-text search content. The construction process uses the standard operations of ES.

[0069] Step S4: Based on the directory structure of the text to be retrieved, the node identifiers of each node in the multi-way tree, and the semantic information corresponding to the nodes, the text to be retrieved is rasterized, that is, the text to be retrieved is divided into multiple text blocks of different lengths, each text block corresponding to an image; an explicit digital watermark is added to each image, wherein:

[0070] The text content is rasterized, the file is saved as images in paginated form, and explicit digital watermarks are added to the generated images to trace the source of the file.

[0071] This invention uses a document-to-image method to save files as images in paginated form. When generating the images, an explicit digital watermark is added to trace the source of the files, ensuring data security.

[0072] PDF and Word are special formats, so some users' computers cannot view PDF files. They might convert PDF files to images, which not only saves space and allows for the addition of surface watermarks, but also enables viewing anytime, anywhere. The main core code is as follows:

[0073]

[0074] Step S5: Obtain search keywords, perform a full-text search on the text to be searched based on the full-text index, and output an image corresponding to the search results, wherein:

[0075] Enter search keywords, such as file name, chapter, or detailed content, to perform a full-text search. You can also set information such as major, file type, and publication time range, and the search results will be displayed.

[0076] In this invention, users can quickly locate the relevant file and chapter. Different versions of the same file can be quickly compared side-by-side, satisfying both the basic requirement of full-text text search and the ability to locate file content in a structured manner, quickly compare version differences, or compare content of similar documents issued by different departments.

[0077] During the display process, images and watermarks are used to ensure strict data confidentiality.

[0078] For unstructured files, it performs full-text search by matching file name and content; for video, audio, and other files, it allows for online preview and playback.

[0079] The present invention also provides a device for full-text retrieval and displaying retrieval results, such as... Figure 4 As shown, the device includes:

[0080] Multi-branch tree module: configured to extract the directory structure of the text to be retrieved, and store the directory structure in the form of a multi-branch tree; each node in the tree corresponds to an entry in the directory structure, and the node also stores a node identifier and semantic information of the content of the chapter corresponding to the directory entry of the node; the node identifier is used to identify the node and the category to which the content corresponding to the node belongs;

[0081] Traversal module: configured to traverse the multi-way tree in a breadth-first search manner to obtain the text content between each adjacent node;

[0082] Index module: Configured to build a full-text index corresponding to the text to be retrieved based on the text content between each adjacent node;

[0083] Rasterization module: configured to rasterize the text to be retrieved based on the directory structure of the text to be retrieved, the node identifiers of each node in the multi-branch tree, and the semantic information corresponding to the nodes, that is, to divide the text to be retrieved into multiple text blocks of different lengths, each text block corresponding to an image; and to add an explicit digital watermark to each image;

[0084] Search module: Configured to obtain search keywords, perform full-text search on the text to be searched based on the full-text index, and output an image corresponding to the search results.

[0085] The specific embodiments described above only illustrate the design principles of the present invention. The shapes and names of the components in this description may differ and are not limited. Therefore, those skilled in the art can modify or make equivalent substitutions to the technical solutions described in the foregoing embodiments; and these modifications and substitutions do not depart from the inventive spirit and technical solutions of the present invention, and should all fall within the protection scope of the present invention.

Claims

1. A method for full-text retrieval and displaying retrieval results, characterized in that, Includes the following steps: Step S1: Extract the directory structure of the text to be retrieved, and store the directory structure in the form of a multi-branch tree; each node in the tree corresponds to an entry in the directory structure, and the node also stores a node identifier and semantic information of the chapter content corresponding to the directory entry of the node; the node identifier is used to identify the node and the category to which the content corresponding to the node belongs. Step S2: Traverse the multi-way tree using breadth-first search to obtain the text content between each adjacent node; Step S3: Based on the text content between each adjacent node, establish a full-text index corresponding to the text to be retrieved; Step S4: Based on the directory structure of the text to be retrieved, the node identifiers of each node in the multi-way tree, and the semantic information corresponding to the nodes, the text to be retrieved is rasterized, that is, the text to be retrieved is divided into multiple text blocks of different lengths, each text block corresponding to an image; an explicit digital watermark is added to each image; Step S5: Obtain search keywords, perform full-text search on the text to be searched based on the full-text index, and output the image corresponding to the search results.

2. The method as described in claim 1, characterized in that, The step of extracting the directory structure of the text to be retrieved and storing the directory structure in the form of a multi-way tree includes: Step S11: Read the directory structure of the text to be retrieved, and recursively read the subdirectories at various depths included in the current directory; read the current directory and establish the corresponding nodes in the multi-branch tree for each subdirectory and the current directory; Step S12: If all directories of the text to be retrieved have been processed, the method ends; otherwise, the next directory of the current directory is taken as the current directory, and the process returns to step S11.

3. The method as described in any one of claims 1-2, characterized in that, Step S2: Traverse the multi-way tree using breadth-first search to obtain the text content between adjacent nodes, including: Step S21: Traverse the multi-way tree in a breadth-first search manner to obtain each pair of adjacent nodes, where each pair of adjacent nodes includes two adjacent nodes; Step S22: For each of all adjacent node pairs, perform the following operations: obtain the node markers corresponding to the two nodes, and extract all the text between the two node markers from the text to be retrieved.

4. The method as described in claim 3, characterized in that, Step S3: Based on the text content between adjacent nodes, establish a full-text index corresponding to the text to be retrieved, including: Based on the text content between each adjacent node, the extracted text content is submitted to the full-text search ES database to construct a full-text index.

5. A device for full-text retrieval and displaying retrieval results, characterized in that, The device includes: Multi-branch tree module: configured to extract the directory structure of the text to be retrieved, and store the directory structure in the form of a multi-branch tree; each node in the tree corresponds to an entry in the directory structure, and the node also stores a node identifier and semantic information of the content of the chapter corresponding to the directory entry of the node; the node identifier is used to identify the node and the category to which the content corresponding to the node belongs; Traversal module: configured to traverse the multi-way tree in a breadth-first search manner to obtain the text content between each adjacent node; Index module: Configured to build a full-text index for the text to be retrieved based on the text content between adjacent nodes; Rasterization module: configured to rasterize the text to be retrieved based on the directory structure of the text to be retrieved, the node identifiers of each node in the multi-branch tree, and the semantic information corresponding to the nodes, that is, to divide the text to be retrieved into multiple text blocks of different lengths, each text block corresponding to an image; and to add an explicit digital watermark to each image; Search module: Configured to obtain search keywords, perform full-text search on the text to be searched based on the full-text index, and output an image corresponding to the search results.

6. A computer-readable storage medium storing a plurality of instructions; the plurality of instructions being loaded by a processor and executing the method as claimed in any one of claims 1-4.

7. An electronic device, characterized in that, The electronic device includes: A processor is used to execute multiple instructions; Memory, used to store multiple instructions; The plurality of instructions are to be stored in the memory and loaded by the processor and executed as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Method and apparatus for preprocessing multiple documents and displaying searched result for retrieval

    CN101136018A

  • Watermark adding method and device

    CN108230220A