Data search method, device, electronic device, and computer-readable storage medium

By marking the location information of high-frequency search records in the database and creating a word segmentation index table, the problem of inefficient data query is solved, and efficient data search is achieved.

CN115774717BActive Publication Date: 2025-08-15BEIJING HYDROPHIS NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211522829.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-30
Publication Date
2025-08-15
Estimated Expiration
2042-11-30

AI Technical Summary

Technical Problem

When facing a large number of data tables, the prior art causes inefficient data query by traversing all records and affects the user experience.

Method used

Obtain high-frequency search records in the database, mark their position information, and perform word segmentation operations to create word segmentation index tables. Use keyword matching high-frequency word segmentation to obtain data position information, and avoid traversing each data table.

Benefits of technology

Improve data search efficiency, reduce disk I/O operations through precise data matching, and improve query speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115774717B_ABST
    Figure CN115774717B_ABST
Patent Text Reader

Abstract

The present invention relates to data search technology and discloses a data search method, including: obtaining high-frequency search records of each data table in a preset database, marking the position information of each high-frequency search record in the corresponding data table; performing word segmentation operations on the high-frequency search records to obtain high-frequency word segments; using the high-frequency word segments as indexes, creating a word segmentation index table consisting of the high-frequency word segments and the position information of the corresponding high-frequency search records; receiving text to be searched input by a user, identifying keywords of the text to be searched; in the word segmentation index table, querying the position information corresponding to the high-frequency word segmentation that matches the keyword, and obtaining data corresponding to the queried position information as search results. The present invention also proposes a data search method, an electronic device, and a computer-readable storage medium. The present invention can improve data search efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data search technology, and in particular to a data search method, device, electronic device and computer-readable storage medium. Background Art

[0002] Data search capability is very important for certain professional websites or systems. For example, the enterprise information query system provides data search functions that can be used to query various relevant information of the target enterprise.

[0003] Traversing database data based on query conditions is a common data search method. However, when a system contains a large number of data tables, comparing all records in all tables against the query conditions and returning only those that meet the conditions will result in a large number of disk I / O operations, resulting in low data query efficiency and a poor user experience. Therefore, improving data search capabilities is a critical issue. Summary of the Invention

[0004] The present invention provides a data search method, device, electronic device and computer-readable storage medium, the main purpose of which is to improve data search efficiency.

[0005] To achieve the above-mentioned purpose, the present invention provides a data search method, comprising:

[0006] Obtain high-frequency search records for each data table in a preset database, and mark the location information of each high-frequency search record in the corresponding data table;

[0007] Performing a word segmentation operation on the high-frequency search records to obtain high-frequency word segments;

[0008] Using the high-frequency segmented words as indexes, creating a segmented word index table consisting of the high-frequency segmented words and location information of corresponding high-frequency search records;

[0009] Receiving a text to be searched input by a user, and identifying keywords in the text to be searched;

[0010] In the word segmentation index table, the location information corresponding to the high-frequency word segmentation that matches the keyword is searched, and the data corresponding to the searched location information is obtained as the search result.

[0011] Optionally, obtaining high-frequency search records in each data table in a preset database includes:

[0012] Obtaining operation logs within a preset time period from the preset database;

[0013] According to the operation log, the number of operations performed on each data record in each data table is counted in sequence;

[0014] The fields whose operation times are greater than or equal to the preset operation threshold are selected as high-frequency search records of the corresponding data table.

[0015] Optionally, performing a word segmentation operation on the high-frequency search records to obtain high-frequency word segments includes:

[0016] Using at least two word segmentation algorithms, segment the high-frequency search records to obtain word segmentation results corresponding to each word segmentation algorithm;

[0017] The segmentations in the intersection of different segmentation results are regarded as determined segmentations, and the segmentations in the non-intersection of different segmentation results are regarded as pending segmentations;

[0018] The segmentations that contain the same characters in the pending segmentations and are located adjacent to each other in the high-frequency search records are used as a comparison group;

[0019] Sequentially calculating the information loss of each word in each comparison group relative to the high-frequency search record;

[0020] The segmentation word with the largest information loss is selected as the determined segmentation word of the corresponding comparison group, and all the determined segmentations are collected as the high-frequency segmentations.

[0021] Optionally, the sequentially calculating the information loss of each word in each comparison group relative to the high-frequency search record includes:

[0022] Taking each segmentation in each comparison group as a target segmentation in turn, and removing the target segmentation from the high-frequency search records to obtain a comparison field;

[0023] Performing vector conversion on the high-frequency search records to obtain a high-frequency search record vector matrix, and performing vector conversion on the comparison fields to obtain a comparison field vector matrix;

[0024] The distance between the high-frequency search record vector matrix and the comparison field vector matrix is calculated, and the distance is used as the information loss of the corresponding target word relative to the high-frequency search record.

[0025] Optionally, identifying keywords of the text to be searched includes:

[0026] According to the preset business rules, the text to be searched is subjected to regular expression judgment;

[0027] When the search text meets the regular judgment, the output result of the regular judgment is used as the keyword of the text to be searched;

[0028] When the search text does not meet the regular judgment, the text to be searched is segmented to obtain one or more segmented words to be searched;

[0029] Generate a word vector for each word segment to be searched and a text vector matrix for the text to be searched;

[0030] Calculate the key value of each to-be-searched segmentation in sequence according to the word vector of each to-be-searched segmentation and the text vector matrix of the to-be-searched text;

[0031] The to-be-searched segmented words whose key values satisfy the preset key value conditions are selected as the keywords of the to-be-searched text.

[0032] Optionally, the step of sequentially calculating the key value of each to-be-searched segmentation according to the word vector of each to-be-searched segmentation and the text vector matrix of the to-be-searched text includes:

[0033] The key value of each word to be searched is calculated using the following key value algorithm:

[0034]

[0035] Wherein, K is the key value, |W| is the text vector matrix of the text to be searched, T is the matrix transpose symbol, || is the modulus symbol, is the word vector of the word to be searched.

[0036] In order to solve the above problem, the present invention further provides a data search method, the device comprising:

[0037] A high-frequency search record acquisition module is used to obtain high-frequency search records of each data table in a preset database and mark the position information of each high-frequency search record in the corresponding data table;

[0038] A word segmentation index table creation module is used to perform a word segmentation operation on the high-frequency search records to obtain high-frequency word segments, and use the high-frequency word segments as indexes to create a word segmentation index table consisting of the high-frequency word segments and the location information of the corresponding high-frequency search records;

[0039] The data search module based on the index table is used to receive the text to be searched input by the user, identify the keywords of the text to be searched, query the position information corresponding to the high-frequency segmentation that matches the keyword in the segmentation index table, and obtain the data corresponding to the queried position information as the search result.

[0040] Optionally, the index table creation module performs a word segmentation operation on the high-frequency search records by the following operations:

[0041] Using at least two word segmentation algorithms, segment the high-frequency search records to obtain word segmentation results corresponding to each word segmentation algorithm;

[0042] The segmentations in the intersection of different segmentation results are regarded as determined segmentations, and the segmentations in the non-intersection of different segmentation results are regarded as pending segmentations;

[0043] The segmentations containing the same characters in the pending segmentations and located adjacently in the high-frequency search records are used as comparison groups;

[0044] Calculating the information loss of each word in each comparison group relative to the high-frequency search record in sequence;

[0045] The segmentation word with the largest information loss is selected as the determined segmentation word of the corresponding comparison group, and all the determined segmentations are collected as the high-frequency segmentations.

[0046] In order to solve the above problem, the present invention further provides an electronic device, comprising:

[0047] a memory storing at least one computer program; and

[0048] The processor executes the program stored in the memory to implement the data search method described above.

[0049] In order to solve the above problem, the present invention also provides a computer-readable storage medium, in which at least one computer program is stored. The at least one computer program is executed by a processor in an electronic device to implement the above-mentioned data search method.

[0050] In an embodiment of the present invention, high-frequency segmentation is obtained by segmenting high-frequency search records, and a segmentation index table indexed by high-frequency segmentation is created. The keywords corresponding to the text to be searched are matched with the high-frequency segmentation in the segmentation index table, and the data location information pointed to by the high-frequency segmentation matching the keyword is obtained. The search result is obtained according to the obtained location information. This operation mode, on the one hand, directly obtains accurate data by using the segmentation index table during the data search process, without traversing the data records of each data table, thereby improving data search efficiency. On the other hand, by matching the keywords of the text to be searched with the high-frequency segmentation in the segmentation index table, the data search comparison object can be accurately searched, thereby improving data search efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] Figure 1 A flowchart of a data search method provided by one embodiment of the present invention;

[0052] Figure 2 A schematic diagram of a detailed implementation flow of one step in a data search method provided in one embodiment of the present invention;

[0053] Figure 3 A schematic diagram of a detailed implementation flow of another step in the data search method provided by one embodiment of the present invention;

[0054] Figure 4 A schematic diagram of a detailed implementation flow of another step in the data search method provided by one embodiment of the present invention;

[0055] Figure 5 A schematic diagram of a detailed implementation flow of another step in the data search method provided by one embodiment of the present invention;

[0056] Figure 6 A functional module diagram of a data search method provided by one embodiment of the present invention;

[0057] Figure 7 A schematic diagram of the structure of an electronic device for implementing the data search method provided by one embodiment of the present invention.

[0058] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION

[0059] 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.

[0060] The embodiment of the present application provides a data search method. The execution subject of the data search method includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the data search method can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server can be an independent server or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0061] Reference Figure 1 FIG. 1 is a flow chart of a data search method provided by an embodiment of the present invention.

[0062] In this embodiment, the data search method includes:

[0063] S1. Obtain high-frequency search records for each data table in a preset database, and mark the location information of each high-frequency search record in the corresponding data table;

[0064] In the embodiments of the present invention, an enterprise information query system is used as an example for illustration. The enterprise information query system provides comprehensive, reliable, and transparent data information of a certain number of various enterprises, such as enterprise microblogs, business scope, organizational structure, business status, enterprise news, credit information, office address, employee information, and related information.

[0065] In the embodiment of the present invention, the preset database refers to a database that stores the above-mentioned various types of enterprise information data in a certain organizational form. Preferably, the preset database can adopt a relational database, such as Oracle, MySQL and DB2.

[0066] In the embodiment of the present invention, the high-frequency search records refer to data contents in the data table that are accessed relatively frequently.

[0067] For details, see Figure 2 As shown, the step of obtaining high-frequency search records of each data table in the preset database includes:

[0068] S11, obtaining the operation log within a preset time period from the preset database;

[0069] S12. Counting the number of operations performed on each data record in each data table according to the operation log;

[0070] S13: Select data records whose operation times are greater than or equal to a preset operation threshold as high-frequency search records of the corresponding data table.

[0071] In the embodiment of the present invention, the preset time period may be 1 month or 3 months, and the specific time period may be set according to actual business operation conditions.

[0072] In the embodiment of the present invention, the operations include but are not limited to reading, modifying, inserting, and deleting each data record.

[0073] For example, various types of information about company personnel have different attributes, such as position, equity, and years of service. Different attributes correspond to different data records stored in the preset database. Analysis of the operation logs reveals that the company's CTO role is the most frequently searched. The data records corresponding to the CTO role can be considered high-frequency search records.

[0074] In an embodiment of the present invention, the preset operation threshold may be adjusted according to actual business conditions. For example, when the preset time period is one week, the preset operation threshold may refer to 200 operations per day on the data record.

[0075] In an embodiment of the present invention, the position information of each high-frequency search record in the corresponding data table may be marked by the ID of the data table where the high-frequency search record is located and the row and column information of the high-frequency search record in the corresponding data table.

[0076] In an embodiment of the present invention, by acquiring and marking high-frequency search records of each data table in the preset database, it is convenient to limit the scanning range of the data table in the preset database in subsequent data search operations, which is beneficial to improving data search efficiency.

[0077] S2. Perform a word segmentation operation on the high-frequency search records to obtain high-frequency word segments, and use the high-frequency word segments as indexes to create a word segmentation index table consisting of the high-frequency word segments and location information of the corresponding high-frequency search records;

[0078] It is understandable that when a user searches for a target data, due to information gaps and the flexibility of information expression, in most cases, the information text to be searched entered by the user is related to the target data rather than the complete target data. Therefore, word segmentation of the high-frequency search records can effectively cover various situations of the search text entered by the user and ensure the accuracy of data search.

[0079] For details, see Figure 3 As shown, the word segmentation operation is performed on the high-frequency search record to obtain high-frequency word segments, including:

[0080] S21. Segment the high-frequency search records using at least two segmentation algorithms, and obtain segmentation results corresponding to each segmentation algorithm;

[0081] S22, taking the segmentations in the intersection of different segmentation results as determined segmentations, and taking the segmentations in the non-intersection of different segmentation results as pending segmentations;

[0082] S23, grouping the pending segmented words that contain the same characters and are located adjacent to each other in the high-frequency search records into a comparison group;

[0083] S24, sequentially calculating the information loss of each word in each comparison group relative to the high-frequency search record;

[0084] S25. Select the segmentation with the largest information loss as the determined segmentation of the corresponding comparison group, and collect all the determined segmentations as the high-frequency segmentations.

[0085] It is understood that common word segmentation algorithms include string matching, semantic segmentation, and statistical segmentation algorithms. String matching algorithms further include forward maximum matching, reverse maximum matching, and shortest path segmentation. Commonly used word segmentation algorithms are mature technologies and will not be elaborated on in detail in the present embodiments.

[0086] In the embodiment of the present invention, the number of word segmentation algorithms used and the specific algorithms can be set according to actual conditions.

[0087] For example, suppose that "Li Shengli's words are indeed reasonable" is segmented by the first word segmentation algorithm, and the first word segmentation results are "Li", "Shengli", "Said", "Indeed", "Real", and "Reason". Segmented by the second word segmentation algorithm, the second word segmentation results are "Li", "Shengli", "Said", "Indeed", and "Reason". Among them, the two word segmentations "Li" and "Shengli" are the overlapping parts of the first word segmentation algorithm and the second word segmentation algorithm, and are determined word segmentations. "Said", "Indeed", "Real", "Reason" and "Said", "Indeed", and "Reason" are pending word segmentations. "Said" and "Said" are grouped into a comparison group. "Indeed" and "Indeed" are grouped into a comparison group. "Real", "Reason" and "Reason" are grouped into a comparison group, and the information loss of each word in each comparison group relative to the high-frequency search record is calculated in turn.

[0088] For details, see Figure 4 As shown, the information loss of each word in each comparison group relative to the high-frequency search record is calculated in sequence, including:

[0089] S241, taking each segmentation in each comparison group as a target segmentation in turn, and removing the target segmentation from the high-frequency search records to obtain a comparison field;

[0090] S242. Perform vector conversion on the high-frequency search record to obtain a high-frequency record vector matrix, and perform vector conversion on the comparison field to obtain a comparison vector matrix;

[0091] S243: Calculate the distance between the high-frequency record vector matrix and the comparison vector matrix, and use the distance as the information loss of the corresponding target word relative to the high-frequency search record.

[0092] In an embodiment of the present invention, a model with a word vector conversion function, such as a word2vec model and an NLP (Natural Language Processing) model, may be used to convert the high-frequency search records and the comparison fields into vectors respectively.

[0093] In an embodiment of the present invention, a Chebyshev distance formula may be used to calculate the distance between the high-frequency recording vector matrix and the comparison vector matrix.

[0094] It can be understood that when the distance is larger, it means that the information loss value caused by the absence of the target segmentation in the high-frequency search record is larger, the impact of the target segmentation on the high-frequency search record is also greater, and the target segmentation is closer to the correct segmentation method. Therefore, the segmentation with the largest information loss is selected as the determined segmentation of the corresponding comparison group.

[0095] In an embodiment of the present invention, when a high-frequency search record contains multiple high-frequency segmented words, the multiple high-frequency segmented words can be jointly indexed. The following is a record in the segmented word index table:

[0096] Company ID (index 1) Employee Title (Index 2) Location information 123456 CEO Infotable-123

[0097] The high-frequency words 123456 and CEO form a joint index, and the location information of the corresponding high-frequency search records is Infotable-123. "Infotable" represents the name of the data table corresponding to the high-frequency search records. In practical applications, the data table ID can also be used. "123" represents the row number of the corresponding high-frequency search record in the "Infotable" data table.

[0098] S3. Receive the text to be searched input by the user, identify the keywords of the text to be searched, query the word segmentation index table for location information corresponding to high-frequency word segmentations matching the keywords, and obtain data corresponding to the queried location information as search results.

[0099] In the embodiment of the present invention, the enterprise information query system utilizes an embedded browser to allow the user to input information to be retrieved, ie, the text to be searched, in the browser address bar.

[0100] In the embodiment of the present invention, the keyword refers to the most direct information representing the search object in the text to be searched. For example, the text to be searched input by the user is "A company's listing time", and the keywords are "A company" and "listing time".

[0101] In the embodiment of the present invention, a semantic recognition technology or a regular expression judgment method may be used to identify keywords in the text to be searched.

[0102] For details, see Figure 5 As shown, the identifying of keywords of the text to be searched includes:

[0103] S31, performing regular expression judgment on the text to be searched according to preset business rules;

[0104] When the search text meets the regularization judgment, S32 is executed, and the output result of the regularization judgment is used as the keyword of the text to be searched;

[0105] When the search text does not meet the regularization judgment, S33 is executed to segment the text to be searched to obtain one or more segmented words to be searched;

[0106] S34, generating a word vector for each word segment to be searched and a text vector matrix for the text to be searched;

[0107] S35, calculating the key value of each to-be-searched segmentation in sequence according to the word vector of each to-be-searched segmentation and the text vector matrix of the to-be-searched text;

[0108] S36: Select the to-be-searched segmented words whose key values meet the preset key value conditions as the keywords of the to-be-searched text.

[0109] Exemplarily, the preset business rules include but are not limited to company domain name rules, company email rules, company ID rules, etc. For example, regular expressions are used to determine whether the text to be searched complies with the company domain name rules. If the judgment result is that it complies, the keyword corresponding to the text to be searched is the company's domain name.

[0110] Furthermore, if the text to be searched does not conform to any of the preset business rules, a method of calculating key values of the word segments corresponding to the text to be searched may be used to further mine keywords corresponding to the text to be searched.

[0111] It is understandable that when the text to be searched contains a large number of word segments to be searched, not every word segment to be searched can reflect the characteristics of the text to be searched. Therefore, it is necessary to screen the multiple word segments to be searched. The embodiment of the present invention calculates the key value of each word segment to be searched in turn according to the word vector of each word segment to be searched and the text vector matrix of the text to be searched, so as to screen out the characteristic word segments that are representative of the text to be searched according to the key value, so as to obtain the key features of the text to be searched.

[0112] Specifically, the step of calculating the key value of each word to be searched in sequence according to the word vector of each word to be searched and the text vector matrix of the text to be searched includes:

[0113] The key value of each word to be searched is calculated using the following key value algorithm:

[0114]

[0115] Wherein, K is the key value, |W| is the text vector matrix of the text to be searched, T is the matrix transpose symbol, || is the modulus symbol, The word vector for each word to be searched.

[0116] In an embodiment of the present invention, the preset key value condition can be to sort the key values of each word to be searched from large to small, and select the top N words to be searched as the keywords, where N can be 1 or 2, etc., and can be set according to actual conditions.

[0117] Exemplarily, the text to be searched includes: word segmentation A to be searched, word segmentation B to be searched and word segmentation C to be searched, wherein the key value of word segmentation A to be searched is 80, the key value of word segmentation B to be searched is 70, and the key value of word segmentation C to be searched is 30. If N is 2, word segmentation A to be searched and word segmentation B to be searched are selected as the keywords corresponding to the text to be searched in order of the key values from large to small.

[0118] In an embodiment of the present invention, by performing regular expression judgment on the text to be searched according to preset business rules, and then performing word segmentation and keyword value calculation on the text to be searched, the computing workload can be reduced, the time consumed in data retrieval can be reduced, and the efficiency of data retrieval can be improved.

[0119] In an embodiment of the present invention, in the word segmentation index table, the keywords are matched one by one with the index fields in the word segmentation index table, i.e., high-frequency word segmentations, and the position information corresponding to the matched high-frequency word segmentations is obtained. Finally, the corresponding data records are directly obtained according to the matched position information without traversing the data table in the preset database, thereby improving the efficiency of data retrieval.

[0120] In an embodiment of the present invention, high-frequency segmentation is obtained by segmenting high-frequency search records, and a segmentation index table indexed by high-frequency segmentation is created. The keywords corresponding to the text to be searched are matched with the high-frequency segmentation in the segmentation index table, and the data location information pointed to by the high-frequency segmentation matching the keyword is obtained. The search result is obtained according to the obtained location information. This operation mode, on the one hand, directly obtains accurate data by using the segmentation index table during the data search process, without traversing the data records of each data table, thereby improving data search efficiency. On the other hand, by matching the keywords of the text to be searched with the high-frequency segmentation in the segmentation index table, the data search comparison object can be accurately searched, thereby improving data search efficiency.

[0121] like Figure 6 FIG. 1 is a functional module diagram of a data search device provided by an embodiment of the present invention.

[0122] The data search device 100 described in the present invention can be installed in an electronic device. Based on the functions to be implemented, the data search device 100 includes: a high-frequency search record acquisition module 101, a word segmentation index table creation module 102, and an index table-based data search module 103. A module described in the present invention, also referred to as a unit, refers to a series of computer program segments that can be executed by an electronic device processor and can perform a fixed function, and is stored in the electronic device's memory.

[0123] In this embodiment, the functions of each module / unit are as follows:

[0124] The high-frequency search record acquisition module 101 is used to acquire high-frequency search records of each data table in a preset database and mark the position information of each high-frequency search record in the corresponding data table;

[0125] The word segmentation index table creation module 102 is used to perform word segmentation operations on the high-frequency search records to obtain high-frequency word segments, and use the high-frequency word segments as indexes to create a word segmentation index table consisting of the high-frequency word segments and the location information of the corresponding high-frequency search records;

[0126] The index table-based data search module 103 is used to receive the text to be searched input by the user, identify the keywords of the text to be searched, query the word segmentation index table for the location information corresponding to the high-frequency word segmentation that matches the keyword, and obtain the data corresponding to the queried location information as the search result.

[0127] In detail, each module in the data search method 100 of the embodiment of the present invention adopts the same Figures 1 to 5 The data search method described in the present invention is a technical means that is the same as that used in the present invention and can produce the same technical effects, so I will not go into details here.

[0128] like Figure 7 FIG. 1 is a schematic diagram of the structure of an electronic device for implementing a data search method provided by an embodiment of the present invention.

[0129] The electronic device 1 may include a processor 10 , a memory 11 , and a bus, and may further include a computer program stored in the memory 11 and executable on the processor 10 , such as a data search program.

[0130] The memory 11 includes at least one type of readable storage medium, and the readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (for example, an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 11 can be an internal storage unit of the electronic device 1, such as a mobile hard disk of the electronic device 1. In other embodiments, the memory 11 can also be an external storage device of the electronic device 1, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 1. Furthermore, the memory 11 can also include both an internal storage unit of the electronic device 1 and an external storage device. The memory 11 can not only be used to store application software and various types of data installed in the electronic device 1, such as the code of a data search program, etc., but can also be used to temporarily store data that has been output or is to be output.

[0131] In some embodiments, the processor 10 may be comprised of an integrated circuit, such as a single packaged integrated circuit or a plurality of packaged integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core (Control Unit) of the electronic device, connecting the various components of the entire electronic device using various interfaces and circuits. It executes or runs programs or modules (such as data search programs) stored in the memory 11 and calls data stored in the memory 11 to perform various functions of the electronic device 1 and process data.

[0132] The bus may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. The bus is configured to enable connection and communication between the memory 11 and at least one processor 10, etc.

[0133] Figure 7 Only the electronic device with components is shown, and it can be understood by those skilled in the art that Figure 7 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0134] For example, although not shown, the electronic device 1 may further include a power source (such as a battery) for powering the various components. Preferably, the power source may be logically connected to the at least one processor 10 via a power management device, thereby implementing functions such as charging management, discharging management, and power consumption management through the power management device. The power source may further include one or more DC or AC power sources, a recharging device, a power failure detection circuit, a power converter or inverter, a power status indicator, and other arbitrary components. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which will not be described in detail here.

[0135] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.

[0136] Optionally, the electronic device 1 may further include a user interface, which may be a display or an input unit (such as a keyboard). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touch device. The display may also be appropriately referred to as a display screen or a display unit, which is used to display information processed in the electronic device 1 and to display a visual user interface.

[0137] It should be understood that the embodiment is for illustration only and the scope of the patent application is not limited to this structure.

[0138] The data search program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When executed in the processor 10, it can achieve the following:

[0139] Obtain high-frequency search records for each data table in a preset database, and mark the location information of each high-frequency search record in the corresponding data table;

[0140] Performing a word segmentation operation on the high-frequency search records to obtain high-frequency word segments;

[0141] Using the high-frequency segmented words as indexes, creating a segmented word index table consisting of the high-frequency segmented words and location information of corresponding high-frequency search records;

[0142] Receiving a text to be searched input by a user, and identifying keywords in the text to be searched;

[0143] In the word segmentation index table, the location information corresponding to the high-frequency word segmentation that matches the keyword is searched, and the data corresponding to the searched location information is obtained as the search result.

[0144] Furthermore, if the modules / units integrated into the electronic device 1 are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. The computer-readable storage medium can be volatile or non-volatile. For example, the computer-readable medium can include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).

[0145] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor of an electronic device, the computer program can implement:

[0146] Obtain high-frequency search records for each data table in a preset database, and mark the location information of each high-frequency search record in the corresponding data table;

[0147] Performing a word segmentation operation on the high-frequency search records to obtain high-frequency word segments;

[0148] Using the high-frequency segmented words as indexes, creating a segmented word index table consisting of the high-frequency segmented words and location information of corresponding high-frequency search records;

[0149] Receiving a text to be searched input by a user, and identifying keywords in the text to be searched;

[0150] In the word segmentation index table, the location information corresponding to the high-frequency word segmentation that matches the keyword is searched, and the data corresponding to the searched location information is obtained as the search result.

[0151] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.

[0152] Therefore, the embodiments should be considered in all respects as illustrative and non-restrictive, and the scope of the invention is defined by the appended claims rather than the foregoing description, and all changes that come within the meaning and range of equivalents of the claims are intended to be embraced therein. Any reference to a figure in a claim should not be construed as limiting the claim to which it relates.

[0153] Blockchain, as used in this article, refers to a novel application model for computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. Blockchain is essentially a decentralized database, a series of data blocks generated using cryptographic methods. Each block contains information about a batch of online transactions, used to verify the validity of this information (to prevent counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, the platform product service layer, and the application service layer.

[0154] The embodiments of the present application can acquire and process relevant data based on holographic projection technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to achieve the best results.

[0155] Furthermore, it is clear that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. Multiple units or devices recited in a system claim may also be implemented by a single unit or device through software or hardware. Second-order terms are used to indicate names and do not imply any particular order.

[0156] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.

Claims

1. A data search method, characterized in that: The method comprises: Obtain high-frequency search records for each data table in a preset database, and mark the location information of each high-frequency search record in the corresponding data table; Segment the high-frequency search records using no less than two segmentation algorithms to obtain segmentation results corresponding to each segmentation algorithm, taking the segmentations of the intersection of the different segmentation results as determined segmentations, taking the segmentations of the non-intersection of the different segmentation results as pending segmentations, taking the segmentations containing the same characters in the pending segmentations and being adjacent in the high-frequency search records as comparison groups, calculating the information loss of each segmentation in each comparison group relative to the high-frequency search record caused by removing the segmentation, selecting the segmentation with the largest information loss as the determined segmentation of the corresponding comparison group, and collecting all the determined segmentations as the high-frequency segmentations; Using the high-frequency segmented words as indexes, creating a segmented word index table consisting of the high-frequency segmented words and location information of corresponding high-frequency search records; Receiving a text to be searched input by a user, and identifying keywords in the text to be searched; In the word segmentation index table, the keyword is matched one by one with the high-frequency word segmentations in the word segmentation index table, and data of position information corresponding to the matched high-frequency word segmentations is obtained as a search result.

2. The data search method according to claim 1, wherein: The step of obtaining high-frequency search records in each data table in the preset database includes: Obtaining operation logs within a preset time period from the preset database; According to the operation log, the number of operations performed on each data record in each data table is counted in sequence; The fields whose operation times are greater than or equal to the preset operation threshold are selected as high-frequency search records of the corresponding data table.

3. The data search method according to claim 1, wherein: The step of sequentially calculating the information loss caused by removing each segmented word from each comparison group relative to the high-frequency search record includes: Taking each segmentation in each comparison group as a target segmentation in turn, and removing the target segmentation from the high-frequency search records to obtain a comparison field; Performing vector conversion on the high-frequency search records to obtain a high-frequency search record vector matrix, and performing vector conversion on the comparison fields to obtain a comparison field vector matrix; The distance between the high-frequency search record vector matrix and the comparison field vector matrix is calculated, and the distance is used as the information loss of the corresponding target word relative to the high-frequency search record.

4. The data search method according to claim 1, wherein: The identifying of keywords of the text to be searched includes: According to the preset business rules, the text to be searched is subjected to regular expression judgment; When the search text meets the regular judgment, the output result of the regular judgment is used as the keyword of the text to be searched; When the search text does not meet the regular judgment, the text to be searched is segmented to obtain one or more segmented words to be searched; Generate a word vector for each word segment to be searched and a text vector matrix for the text to be searched; Calculate the key value of each to-be-searched segmentation in sequence according to the word vector of each to-be-searched segmentation and the text vector matrix of the to-be-searched text; The to-be-searched segmented words whose key values satisfy the preset key value conditions are selected as the keywords of the to-be-searched text.

5. The data search method according to claim 4, wherein: The step of calculating the key value of each word to be searched in sequence according to the word vector of each word to be searched and the text vector matrix of the text to be searched includes: The key value of each word to be searched is calculated using the following key value algorithm: in, is the key value, is the text vector matrix of the text to be searched, is the matrix transpose symbol, To find the modulo symbol, is the word vector of the word to be searched.

6. A data search device, characterized in that: The device comprises: A high-frequency search record acquisition module is used to obtain high-frequency search records of each data table in a preset database and mark the position information of each high-frequency search record in the corresponding data table; a word segmentation index table creation module, configured to segment the high-frequency search records using at least two word segmentation algorithms, obtain word segmentation results corresponding to each word segmentation algorithm, use the segmentations of the intersection of different word segmentation results as determined segmentations, use the segmentations of the non-intersection of different word segmentation results as pending segmentations, use the segmentations of the pending segmentations that contain the same characters and are adjacent in position in the high-frequency search records as comparison groups, sequentially calculate the information loss of each segmentation in each comparison group relative to the high-frequency search record caused by removing the segmentation, select the segmentation with the largest information loss as the determined segmentation of the corresponding comparison group, aggregate all determined segmentations as high-frequency segmentations, and use the high-frequency segmentations as indexes to create a word segmentation index table consisting of the position information of the high-frequency segmentations and the corresponding high-frequency search records; The data search module based on the index table is used to receive the text to be searched input by the user, identify the keywords of the text to be searched, match the keywords with the high-frequency segmentations in the segmentation index table one by one, and obtain the data of the location information corresponding to the matched high-frequency segmentations as the search results.

7. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the data search method according to any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the data search method according to any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Database index creating method and device, equipment and medium

    CN113590632A

  • Quick number taking method and device, electronic equipment and storage medium

    CN113870478A