A full-text search engine method and system based on management system
The full-text search engine method addresses inefficient query processing in databases by using SQL fuzzy matching and index file creation to enhance retrieval efficiency and reduce database access pressure, thereby improving user experience.
Patent Information
- Application Number
- CN202010662421.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-10
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2040-07-10
AI Technical Summary
Existing database systems face inefficiencies in query processing due to unsupported indexing for fuzzy queries, leading to low query efficiency and poor user experience, especially with large volumes of application data.
Implement a full-text search engine method using SQL fuzzy matching, word segmentation, and index file creation to enhance retrieval efficiency by segmenting target words, establishing an index library, and periodically updating incremental data.
Reduces frequent database accesses, alleviates access pressure, and improves user experience by enabling efficient retrieval of target data through optimized indexing and incremental updates.
Smart Images

Figure CN111930879B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database technology, and more specifically, to a full-text search engine method and system based on a management system. Background Art
[0002] When customers use this management system, they are unable to accurately input specific terms such as merchant name / user name / payer, etc., and often have to perform fuzzy queries on the above fields.
[0003] As the amount of application data grows exponentially, the number of database applications has reached millions. Due to the indexing principles of relational databases such as Oracle, indexing is not supported for queries that match likes before and after, resulting in extremely low query efficiency and affecting the system user experience. We have made optimizations for this.
[0004] SUMMARY OF THE INVENTION
[0005] In order to overcome the deficiencies of the prior art, the present invention provides a full-text search engine method based on a management system to solve the problem of reducing the number of frequent database accesses and greatly reducing the pressure of database access.
[0006] The technical solution adopted by the present invention to solve its technical problem is: a full-text search engine method based on a management system, comprising the following steps: step one: using an SQL fuzzy matching method on a database to retrieve a target word from a data table in the database; step two: performing word segmentation processing on the target word in a target document to obtain a single word; step three: establishing an index file according to the frequency of occurrence of the single target data; step four: establishing a corresponding index library according to the index file so that a user can retrieve the single target data.
[0007] Preferably, the step of using the SQL fuzzy matching method on the database, before retrieving the target data from the data table of the database, further includes:
[0008] Pre-configure an XML file, wherein the XML file includes an SQL query statement;
[0009] Import an existing table into the database.
[0010] Preferably, after the corresponding index library is established according to the index file so that the user can retrieve the single target data, the step further includes:
[0011] When the user inputs a first target word, the first target word is segmented to obtain a query tree after segmentation;
[0012] The single word after word segmentation is searched and indexed according to the query tree to obtain a document link list of the single word in the query tree.
[0013] Preferably, after the single word after the word segmentation is searched and indexed according to the query tree, and a document list of the single word in the query tree is obtained, the step further includes:
[0014] For incremental words in the database, set up timed and quantitative queries;
[0015] Use the SQL fuzzy matching method to query incremental vocabulary regularly in order to load new vocabulary.
[0016] Preferably, before segmenting the target words in the target document to obtain a single word, the step of using a SQL fuzzy matching method on the database and retrieving the target words from a data table in the database further includes:
[0017] The target vocabulary is stored in the target document.
[0018] A full-text search engine system based on a management system, the system comprising:
[0019] A retrieval unit, used to use a SQL fuzzy matching method on a database to retrieve a target word from a data table of the database;
[0020] The first word segmentation unit is used to segment the target word in the target document to obtain a single word;
[0021] An index file creation unit, used to create an index file according to the frequency of occurrence of the single target data;
[0022] The database establishment unit is used to establish a corresponding index library according to the index file so that the user can retrieve the single target data.
[0023] Preferably, the system further comprises:
[0024] A configuration unit, used for pre-configuring an XML file, wherein the XML file includes an SQL query statement;
[0025] Database import unit, imports existing data tables into the database.
[0026] Preferably, the system further comprises
[0027] The second word segmentation unit is used to segment the first target word when the user inputs the first target word, and obtain a query tree after the segmentation;
[0028] The indexing unit is used to search and index the single word after word segmentation according to the query tree to obtain a document list of the single word in the query tree.
[0029] Preferably, the system further comprises:
[0030] A setting unit, used to set a timed and quantitative query for incremental words in the database;
[0031] The query unit is used to periodically use the SQL fuzzy matching method to query the incremental vocabulary in order to load new vocabulary.
[0032] Preferably, the system further comprises:
[0033] A storage unit is used to store the target vocabulary in the target document.
[0034] The beneficial effects of the present invention are: using the SQL fuzzy matching method on the database to retrieve the target vocabulary from the data table of the database; performing word segmentation processing on the target vocabulary in the target document to obtain a single vocabulary; establishing an index file according to the frequency of occurrence of the single target data; establishing a corresponding index library according to the index file, so that users can retrieve the single target data, reduce the number of frequent visits to the database, greatly reduce the pressure of database access and thus improve user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a flowchart of a full-text search engine method based on a management system.
[0036] Figure 2 It is a functional module diagram of a full-text search engine system based on a management system.
[0037] Figure 3 It is another functional module diagram of the full-text search engine system based on the management system. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0039] The specific implementation of the present invention is described in detail below in conjunction with specific embodiments:
[0040] Embodiment 1:
[0041] Figure 1 The implementation process of the full-text search engine method based on the management system provided in the first embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0042] In step S101, a sql fuzzy matching method is used on a database to retrieve a target word from a data table of the database;
[0043] The embodiment of the present invention is applicable to the field of database technology. According to project requirements, customers may input words, such as merchant name, customer name, payee name, etc. as query conditions to filter data. We first use the SQL fuzzy matching method to search for relevant words from merchant tables, customer information tables and other data tables, so as to perform subsequent word segmentation processing on the relevant words.
[0044] Preferably, before using the SQL fuzzy matching method on the database and searching the target vocabulary from the data table of the database, an XML file is pre-configured, and the XML file includes SQL query statements so that the SQL query statements are written into the XML configuration file. Thereafter, the system executes the relevant SQL query statements according to the XML configuration file and imports the existing data table into the database, so as to facilitate the acquisition of data such as merchant name, customer name, payee name, etc. in the existing data table.
[0045] In step S102, the target word in the target document is segmented to obtain a single word;
[0046] In the embodiment of the present invention, the data in the document is divided into individual words. For example, if the merchant name of document A is "Shenzhen Yum! Brands KFC" and "Shenzhen Yum! Brands" and document B is "Guangdong Shenzhen Yum! Brands Pizza Hut", then it will be segmented into "Shenzhen", "Guangdong", "Yum! Brands", "KFC", and "Pizza Hut", ignoring punctuation and stop words.
[0047] Preferably, before the target words in the target document are segmented to obtain individual words, a SQL fuzzy matching method is used on the database to retrieve the target words from a data table of the database, and then the target words are stored in the target document.
[0048] In step S103, an index file is created according to the frequency of occurrence of the single target data;
[0049] In the implementation of the present invention, according to the single words segmented in step S102, an index file is created for the document according to the frequency of occurrence of the single words in the document. For example, if "Shenzhen" appears 3 times and is distributed in different documents, the index file records the word "Shenzhen" as (A:2:0), which means that it appears twice in document A and is at the first position of the phrase; (B:1:1) means that it appears once in document B and is at the second position of the phrase. The words are sorted from high to low according to their frequency of occurrence, so document A is ahead of document B and is searched out earlier.
[0050] In step S104, a corresponding index library is established according to the index file, so that the user can retrieve the single target data.
[0051] In this embodiment, a corresponding index library is established according to the established index file. The index library can be regarded as a directory for retrieving corresponding documents, so that users can quickly locate documents corresponding to relevant words when searching.
[0052] Preferably, a corresponding index library is established according to the index file, so that after the user retrieves the single target data, when the user inputs the first target word, the first target word is segmented to obtain a query tree after segmentation, and the single word after segmentation is searched and indexed according to the query tree to obtain a document list of the single word in the query tree.
[0053] During the search process, when the user inputs a word, the word segmentation is similar to step S102, and then a query tree is obtained according to the frequency of occurrence of the word. The index is searched according to the query tree to obtain a document list for each word, and the result document is obtained from the document list. Then, the words are sorted from high to low according to the frequency of occurrence of the words and returned to the user. Term matching and word segmentation are used to intelligently divide the words input by the user; for example, the word "Shenzhen and Guangzhou" is segmented into "Shenzhen", "and", and "Guangzhou", "and" is the root node, "Shenzhen" is the left subtree, and "Guangzhou" is the right subtree. This is a query tree; then in the index list, find a collection of document lists that contain both "Shenzhen" and "Guangzhou", and the collection is the document we are looking for; the so-called document list, for example, "Shenzhen" is an index, and the document it is in appears in both document A and document B, and the corresponding "Shenzhen" appears at what position and the frequency of occurrence.
[0054] Further preferably, the single word after the word segmentation is searched and indexed according to the query tree. After the document list of the single word in the query tree is obtained, for the incremental words in the database, a timed and quantitative query is set, and the SQL fuzzy matching method is used to query the incremental words regularly so as to load new words.
[0055] In an embodiment of the present application, for incremental data, a scheduled task is set to perform quantitative query, with the creation time of the last recorded data as the start time, and the query statement is fuzzy matched with SQL at an interval of 1 hour to query the incremental data, and process according to steps S101 to S104; for example, new merchants may be added to the merchant data every hour. At this time, the last time the data was queried was 10 o'clock. At 11 o'clock, the program will be triggered again to use the time as the query condition to execute the above SQL query, thereby loading new data.
[0056] A person skilled in the art can understand that all or part of the steps in the above-mentioned embodiment method can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, such as ROM / RAM, disk, CD-ROM, etc.
[0057] Embodiment 2:
[0058] Figure 2 The structure of the full-text search engine system based on the management system provided by the second embodiment of the present invention is shown. For the convenience of description, only the part related to the embodiment of the present invention is shown, which is described in detail as follows:
[0059] A retrieval unit 201 is used to use a SQL fuzzy matching method to retrieve a target word from a data table in the database;
[0060] The first word segmentation unit 202 is used to perform word segmentation processing on the target word in the target document to obtain a single word;
[0061] An index file creation unit 203, configured to create an index file according to the frequency of occurrence of the single target data;
[0062] The database establishing unit 204 is used to establish a corresponding index library according to the index file so that the user can retrieve the single target data.
[0063] In the embodiment of the present invention, the sql fuzzy matching method is used on the database to retrieve the target vocabulary from the data table of the database; the target vocabulary in the target document is segmented to obtain a single vocabulary; an index file is established according to the frequency of occurrence of the single target data; a corresponding index library is established according to the index file, so that the user can retrieve the single target data, reduce the number of frequent database accesses, greatly reduce the pressure of database access, and thus improve the retrieval efficiency. The specific implementation of each unit can refer to the description of Example 1, which will not be repeated here.
[0064] Embodiment three:
[0065] Figure 3 The structure of a full-text search engine system based on a management system provided by Embodiment 3 of the present invention is shown. For ease of description, only the parts related to the embodiment of the present invention are shown, including:
[0066] A configuration unit 301 is used to pre-configure an XML file, wherein the XML file includes an SQL query statement;
[0067] A database import unit 302 imports an existing data table into a database;
[0068] A retrieval unit 303 is used to use a SQL fuzzy matching method to retrieve a target word from a data table in the database;
[0069] Storage unit 304, used to store the target vocabulary into the target document
[0070] The first word segmentation unit 305 is used to perform word segmentation processing on the target word in the target document to obtain a single word;
[0071] An index file creation unit 306, configured to create an index file according to the frequency of occurrence of the single target data;
[0072] A database building unit 307 is used to build a corresponding index library according to the index file so that the user can retrieve the single target data;
[0073] The second word segmentation unit 308 is used to segment the first target word when the user inputs the first target word, and obtain a query tree after segmentation;
[0074] An indexing unit 309 is used to search and index the single word after word segmentation according to the query tree to obtain a document list of the single word in the query tree;
[0075] A setting unit 310 is used to set a timing and a quantity for querying the incremental vocabulary in the database;
[0076] The query unit 311 is used to query the incremental vocabulary using the SQL fuzzy matching method at regular intervals so as to load new vocabulary.
[0077] In an embodiment of the present invention, an XML file is pre-configured, and the XML file includes an SQL query statement. An existing data table is imported into a database, an SQL fuzzy matching method is used for the database, a target word is retrieved from a data table of the database, the target word is stored in the target document, the target word in the target document is segmented to obtain a single word, an index file is established according to the frequency of occurrence of the single target data, and a corresponding index library is established according to the index file, so that a user can retrieve the single target data. When a user inputs a first target word, the first target word is segmented to obtain a query tree after segmentation, and the single word after segmentation is searched and indexed according to the query tree to obtain a document linked list of the single word in the query tree. For incremental words in the database, a timed and quantitative query is set, and the SQL fuzzy matching method is used to query the incremental words regularly, so as to load new words, reduce the number of frequent visits to the database, and greatly reduce the pressure of database access, thereby improving retrieval efficiency.
[0078] In the embodiment of the present invention, each unit of the full-text search engine system based on the management system can be implemented by a corresponding hardware or software unit. Each unit can be an independent software or hardware unit or integrated into one software or hardware unit, which is not intended to limit the present invention.
[0079] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A full-text search engine method based on a management system, characterized in that: The following steps are involved: Step 1: Using the SQL fuzzy matching method on the database, searching the target words from the data table of the database; Step 2: Segment the target words in the target document to obtain a single word; Step 3: Create an index file based on the frequency of occurrence of the single word; Step 4: Establishing a corresponding index library according to the index file so that the user can retrieve the single word; Before the target vocabulary is retrieved from the data table of the database using the SQL fuzzy matching method, the step further includes: Pre-configure an XML file, wherein the XML file includes an SQL query statement; Import existing data tables into the database; After the corresponding index library is established according to the index file so that the user can retrieve the single word, the step further includes: When the user inputs a first target word, the first target word is segmented to obtain a query tree after segmentation; The single word after word segmentation is searched and indexed according to the query tree to obtain a document list of the single word in the query tree; After the single word after the word segmentation is searched and indexed according to the query tree, and a document list of the single word in the query tree is obtained, the step further includes: For incremental words in the database, set up timed and quantitative queries; Use SQL fuzzy matching method to query incremental vocabulary regularly to load new vocabulary; Before the target words in the target document are segmented to obtain individual words, the SQL fuzzy matching method is used on the database to retrieve the target words from the data table of the database, and the step further includes: The target vocabulary is stored in the target document.
2. A full-text search engine system based on a management system, characterized in that: The system comprises: A configuration unit, used for pre-configuring an XML file, wherein the XML file includes an SQL query statement; Database import unit, imports existing data tables into the database; A retrieval unit, used to use a SQL fuzzy matching method on a database to retrieve a target word from a data table of the database; A storage unit, used for storing the target vocabulary into a target document; The first word segmentation unit is used to segment the target word in the target document to obtain a single word; An index file creation unit, used to create an index file according to the frequency of occurrence of the single word; A database building unit, used to build a corresponding index library according to the index file, so that the user can retrieve the single word; The second word segmentation unit is used to segment the first target word when the user inputs the first target word, and obtain a query tree after the segmentation; An indexing unit, used for searching and indexing a single word after word segmentation according to the query tree, and obtaining a document list of the single word in the query tree; A setting unit, used to set a timed and quantitative query for incremental words in the database; The query unit is used to periodically use the SQL fuzzy matching method to query the incremental vocabulary in order to load new vocabulary.
Citation Information
Patent Citations
Database inquiry method based on Lucene
CN106227788A