CN110704444A - Searching method and device based on dictionary tree, computer equipment and storage medium - Google Patents

Searching method and device based on dictionary tree, computer equipment and storage medium Download PDF

Info

Publication number
CN110704444A
CN110704444A CN201910943399.XA CN201910943399A CN110704444A CN 110704444 A CN110704444 A CN 110704444A CN 201910943399 A CN201910943399 A CN 201910943399A CN 110704444 A CN110704444 A CN 110704444A
Authority
CN
China
Prior art keywords
preset
dictionary tree
hot data
data
service system
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910943399.XA
Other languages
Chinese (zh)
Inventor
李�荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Shenzhen Qianhai Huanrong Lianyi Information Technology Service Co Ltd
Original Assignee
Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd filed Critical Shenzhen Qianhai Huanlianyi Information Technology Service Co Ltd
Priority to CN201910943399.XA priority Critical patent/CN110704444A/en
Publication of CN110704444A publication Critical patent/CN110704444A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2462Approximate or statistical queries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2468Fuzzy queries

Abstract

The embodiment of the invention discloses a searching method and device based on a dictionary tree, computer equipment and a storage medium. The method comprises the following steps: counting hot data in a service system; constructing a dictionary tree according to the hot data; and if the keywords to be inquired input by the user are received, inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm. The dictionary tree is built according to the hot data, the hot data related to the keywords to be inquired are inquired from the dictionary tree through a preset DFS algorithm, the search and inquiry speed can be greatly improved, the waiting time of a user is reduced, and the use experience of the user is improved.

Description

Searching method and device based on dictionary tree, computer equipment and storage medium
Technical Field
The invention relates to the technical field of data search, in particular to a search method and device based on a dictionary tree, computer equipment and a storage medium.
Background
At present, because the data volume of a service system is continuously increased, sometimes required information needs to be quickly searched according to certain keywords, most systems cache hot data in advance through a cache such as redis or memcache, and the access speed is improved. However, in the prior art, a search is performed by using an ambiguous query. The fuzzy query mode needs to match all the files in the service system, and the efficiency is low.
Disclosure of Invention
The embodiment of the invention provides a searching method, a searching device, computer equipment and a storage medium based on a dictionary tree, and aims to solve the problems of low efficiency and low speed of the existing searching method.
In a first aspect, an embodiment of the present invention provides a search method based on a trie, which includes:
counting hot data in a service system;
constructing a dictionary tree according to the hot data;
and if the keywords to be inquired input by the user are received, inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
The further technical scheme is that the counting of hot data in the service system comprises:
judging whether the current time reaches a preset time node or not;
and if the current time reaches the preset time node, acquiring hot data of the service system in a preset characteristic counting time period, wherein the end point of the characteristic counting time period is the preset time node, and the starting point of the characteristic counting time period is the time starting point of a preset time length before the preset time node.
The further technical scheme is that the acquiring hot data of the service system in a preset characteristic statistic time period comprises:
counting the query times of the data of the service system in the characteristic counting time period;
and acquiring a preset amount of data from the service system as hot data according to the sequence of the query times from high to low.
According to a further technical scheme, the querying hot data related to the keyword to be queried from the dictionary tree according to a preset DFS algorithm comprises the following steps:
judging whether the data volume in the dictionary tree is larger than a preset data volume threshold value or not;
if the data volume in the dictionary tree is larger than a preset data volume threshold value; and starting multithreading, and simultaneously inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
The further technical scheme is that the method also comprises the following steps:
and marking the leaf nodes which are inquired in the dictionary tree.
In a second aspect, an embodiment of the present invention further provides a search apparatus based on a trie, which includes:
the first statistical unit is used for counting hot data in the business system;
the construction unit is used for constructing a dictionary tree according to the hot data;
and the first query unit is used for querying hot data related to the keyword to be queried from the dictionary tree according to a preset DFS algorithm if the keyword to be queried input by a user is received.
A further technical solution is that the first statistical unit includes:
the first judgment unit is used for judging whether the current time reaches a preset time node or not;
the first obtaining unit is configured to obtain hot data of the service system in a preset feature statistics time period if the current time reaches the preset time node, where an end point of the feature statistics time period is the preset time node, and a start point of the feature statistics time period is a time start point of a preset time duration before the preset time node.
A further technical solution is that the first obtaining unit includes:
the second statistical unit is used for counting the query times of the data of the service system in the characteristic statistical time period;
and the second acquisition unit is used for acquiring data with preset quantity from the service system as hot data according to the sequence of the query times from high to low. In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the above method when executing the computer program.
In a fourth aspect, the present invention also provides a computer-readable storage medium, which stores a computer program, and the computer program can implement the above method when being executed by a processor.
The embodiment of the invention provides a searching method and device based on a dictionary tree, computer equipment and a storage medium. Wherein the method comprises the following steps: counting hot data in a service system; constructing a dictionary tree according to the hot data; and if the keywords to be inquired input by the user are received, inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm. According to the embodiment of the invention, the dictionary tree is constructed according to the hot data, and the hot data related to the keywords to be inquired is inquired from the dictionary tree through the preset DFS algorithm, so that the search and inquiry speed can be greatly improved, the waiting time of a user is reduced, and the use experience of the user is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a searching method based on a dictionary tree according to an embodiment of the present invention;
fig. 2 is a schematic sub-flow diagram of a searching method based on a dictionary tree according to an embodiment of the present invention;
fig. 3 is a schematic sub-flow diagram of a searching method based on a dictionary tree according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a dictionary tree according to an embodiment of the present invention;
fig. 5 is a schematic sub-flow diagram of a search method based on a dictionary tree according to an embodiment of the present invention;
FIG. 6 is a schematic block diagram of a search apparatus based on a dictionary tree according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a first statistical unit of a search apparatus based on a dictionary tree according to an embodiment of the present invention;
fig. 8 is a schematic block diagram of a first obtaining unit of a search apparatus based on a dictionary tree according to an embodiment of the present invention;
fig. 9 is a schematic block diagram of a first query unit of a trie-based search apparatus according to an embodiment of the present invention;
FIG. 10 is a block diagram illustrating an apparatus for dictionary-tree based search according to another embodiment of the present invention;
fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a searching method based on a dictionary tree according to an embodiment of the present invention. As shown, the method includes the following steps S1-S3.
And S1, counting hot data in the business system.
In the embodiment of the present invention, the business system refers to a business management system in an enterprise, and the business management system includes a large amount of data. Enterprise personnel search the data in the business system according to the requirements of the enterprise personnel.
In order to improve the speed of search query, hot data in a business system is counted in real time in the embodiment of the invention. It should be noted that, in order to prevent the statistical thread (i.e., the thread executing step S1) from affecting the business system, it is necessary to separate out a statistical microservice to run alone.
Referring to FIG. 2, in one embodiment, the above step S1 specifically includes the following steps S11-S12.
And S11, judging whether the current time reaches the preset time node.
In a specific implementation, it is determined whether the current time reaches a preset time node, and the time node may be set by a person skilled in the art, for example, it may be set to each hour and minute (12:00, 12:01, 12:03, etc.).
And S12, if the current time reaches the preset time node, acquiring hot data of the service system in a preset characteristic statistic time period, wherein the end point of the characteristic statistic time period is the preset time node, and the start point of the characteristic statistic time period is the time start point of a preset time length before the preset time node.
In a specific implementation, if the current time reaches the preset time node, hot data of the service system in a preset characteristic counting time period is acquired, wherein an end point of the characteristic counting time period is the preset time node, and a starting point of the characteristic counting time period is a time starting point of a preset time length before the preset time node. The preset time period can be set by a person skilled in the art, for example, in an embodiment, the preset time period is 1 min.
And if the current time does not reach the preset time node, continuing waiting for the arrival of the preset time node.
Referring to fig. 3, in an embodiment, the above step S12 specifically includes the following steps S101 to S102.
S101, counting the query times of the data of the service system in the characteristic counting time period.
In specific implementation, the query times of the data of the service system in the characteristic statistical time period are counted. The number of queries of data refers to the number of times the data is queried by a user.
And S102, acquiring a preset amount of data from the service system as hot data according to the sequence of the query times from high to low.
In specific implementation, a preset amount of data is acquired from the service system as hot data according to the sequence of the query times from high to low. The predetermined number may be set by one skilled in the art, for example, in one embodiment, the predetermined number is set to 1000.
And S2, constructing a dictionary tree according to the hot data.
In a specific implementation, a dictionary tree is constructed according to the hot data. For example, in one embodiment, the hot data is abcd, abd, bcd, efg, and hi. And constructing the dictionary tree by using the a, the b and the e as prefixes of the dictionary tree. The constructed dictionary tree is shown in fig. 4.
And S3, if the keyword to be queried input by the user is received, searching hot data related to the keyword to be queried from the dictionary tree according to a preset DFS algorithm.
In specific implementation, if a keyword to be queried input by a user is received, searching hot data related to the keyword to be queried from the dictionary tree according to a preset DFS algorithm.
The DFS (Depth-First-Search) algorithm is an algorithm proposed in the early computer field, and belongs to a graph algorithm, and the purpose to be achieved is simple, that is, each possible branch path is deep to the extent that the branch path cannot be deep, and each node can only be accessed once.
Referring to FIG. 5, in one embodiment, the above step S3 includes the following steps S31-S32.
And S31, judging whether the data volume in the dictionary tree is larger than a preset data volume threshold value.
In specific implementation, whether the data volume in the dictionary tree is larger than a preset data volume threshold value is judged.
The threshold value of the data amount may be set by those skilled in the art, and the present invention is not particularly limited thereto.
S32, if the data volume in the dictionary tree is larger than a preset data volume threshold value; and starting multithreading, and simultaneously inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
In specific implementation, if the data volume in the dictionary tree is greater than a preset data volume threshold value; and starting multithreading, and simultaneously inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm. Each thread can independently search without mutual interference, and the searching speed is greatly improved.
In order to avoid repeated searching, in this embodiment, the above method further includes the following steps: and marking the leaf nodes which are inquired in the dictionary tree. For the leaf node marked by a certain thread, other threads do not perform repeated searching any more, and the searching time is optimized to the maximum extent.
And if the data volume in the dictionary tree is not larger than a preset data volume threshold value, not starting multithreading.
By applying the technical scheme of the embodiment of the invention, hot data in the service system are counted; constructing a dictionary tree according to the hot data; and if the keywords to be inquired input by the user are received, inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm. The dictionary tree is built according to the hot data, the hot data related to the keywords to be inquired are inquired from the dictionary tree through a preset DFS algorithm, the search and inquiry speed can be greatly improved, the waiting time of a user is reduced, and the use experience of the user is improved.
Fig. 6 is a schematic block diagram of a searching apparatus 50 based on a dictionary tree according to an embodiment of the present invention. As shown in fig. 6, the present invention further provides a searching apparatus 50 based on the dictionary tree, corresponding to the above searching method based on the dictionary tree. The trie-based search apparatus 50 includes a unit for performing the above-described trie-based search method, and the trie-based search apparatus 50 may be configured in a server. Specifically, referring to fig. 6, the apparatus 50 includes a first statistics unit 51, a construction unit 52, and a first query unit 53.
The first statistical unit 51 is used for counting hot data in the business system.
A constructing unit 52, configured to construct a dictionary tree according to the trending data.
The first query unit 53 is configured to, if a keyword to be queried input by a user is received, query hot data related to the keyword to be queried from the dictionary tree according to a preset DFS algorithm.
In an embodiment, as shown in fig. 7, the first statistic unit 51 includes a first determining unit 511 and a first obtaining unit 512.
The first determining unit 511 is configured to determine whether the current time reaches a preset time node.
A first obtaining unit 512, configured to obtain hot data of the service system in a preset feature statistics time period if the current time reaches the preset time node, where an end point of the feature statistics time period is the preset time node, and a start point of the feature statistics time period is a time start point of a preset time duration before the preset time node.
In an embodiment, as shown in fig. 8, the first obtaining unit 512 includes a second statistic unit 5121 and a second obtaining unit 5122.
A second statistical unit 5121, configured to count the number of queries of the data of the service system in the feature statistical time period.
A second obtaining unit 5122, configured to obtain a preset number of data from the service system as hot data in order from high to low in the number of queries.
In an embodiment, as shown in fig. 9, the first query unit 53 includes a second determination unit 531 and a second query unit 532.
A second judging unit 531, configured to judge whether the data amount in the dictionary tree is greater than a preset data amount threshold.
A second query unit 532, configured to, if the data amount in the dictionary tree is greater than a preset data amount threshold; and starting multithreading, and simultaneously inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
In one embodiment, as shown in fig. 10, the trie-based search apparatus 50 further includes a marking unit 54.
A marking unit 54, configured to mark the leaf nodes that have been queried in the dictionary tree.
It should be noted that, as can be clearly understood by those skilled in the art, the specific implementation process of the above-mentioned search apparatus 50 based on the dictionary tree and each unit may refer to the corresponding description in the foregoing method embodiment, and for convenience and brevity of description, no further description is provided here.
The above-mentioned trie-based search apparatus 50 may be implemented in the form of a computer program that can be run on a computer device as shown in fig. 11.
Referring to fig. 11, fig. 11 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device 500 may be a terminal or a server, where the terminal may be an electronic device with a communication function, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a personal digital assistant, and a wearable device. The server may be an independent server or a server cluster composed of a plurality of servers.
Referring to fig. 11, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, causes the processor 502 to perform a dictionary tree based search method.
The processor 502 is used to provide computing and control capabilities to support the operation of the overall computer device 500.
The memory 504 provides an environment for the execution of the computer program 5032 in the non-volatile storage medium 503, and when the computer program 5032 is executed by the processor 502, the processor 502 may be enabled to execute a dictionary tree-based search method.
The network interface 505 is used for network communication with other devices. Those skilled in the art will appreciate that the configuration shown in fig. 11 is a block diagram of only a portion of the configuration associated with the present application and does not constitute a limitation of the computer device 500 to which the present application may be applied, and that a particular computer device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following steps:
counting hot data in a service system;
constructing a dictionary tree according to the hot data;
and if the keywords to be inquired input by the user are received, inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
In an embodiment, when the processor 502 implements the hot data step in the statistical service system, the following steps are specifically implemented:
judging whether the current time reaches a preset time node or not;
and if the current time reaches the preset time node, acquiring hot data of the service system in a preset characteristic counting time period, wherein the end point of the characteristic counting time period is the preset time node, and the starting point of the characteristic counting time period is the time starting point of a preset time length before the preset time node.
In an embodiment, when implementing the step of acquiring hot data of the service system in a preset feature statistics period, the processor 502 specifically implements the following steps:
counting the query times of the data of the service system in the characteristic counting time period;
and acquiring a preset amount of data from the service system as hot data according to the sequence of the query times from high to low.
In an embodiment, when implementing the step of querying hot data related to the keyword to be queried from the dictionary tree according to the preset DFS algorithm, the processor 502 specifically implements the following steps:
judging whether the data volume in the dictionary tree is larger than a preset data volume threshold value or not;
if the data volume in the dictionary tree is larger than a preset data volume threshold value; and starting multithreading, and simultaneously inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
In one embodiment, processor 502 further implements the steps of:
and marking the leaf nodes which are inquired in the dictionary tree.
It should be understood that, in the embodiment of the present Application, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable gate arrays (FPGAs) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
It will be understood by those skilled in the art that all or part of the flow of the method implementing the above embodiments may be implemented by a computer program instructing associated hardware. The computer program may be stored in a storage medium, which is a computer-readable storage medium. The computer program is executed by at least one processor in the computer system to implement the flow steps of the embodiments of the method described above.
Accordingly, the present invention also provides a storage medium. The storage medium may be a computer-readable storage medium. The storage medium stores a computer program. The computer program, when executed by a processor, causes the processor to perform the steps of:
counting hot data in a service system;
constructing a dictionary tree according to the hot data;
and if the keywords to be inquired input by the user are received, inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
In an embodiment, when the processor executes the computer program to implement the hot data step in the statistical business system, the following steps are specifically implemented:
judging whether the current time reaches a preset time node or not;
and if the current time reaches the preset time node, acquiring hot data of the service system in a preset characteristic counting time period, wherein the end point of the characteristic counting time period is the preset time node, and the starting point of the characteristic counting time period is the time starting point of a preset time length before the preset time node.
In an embodiment, when the processor executes the computer program to implement the step of obtaining the hot data of the service system in a preset feature statistic time period, the following steps are specifically implemented:
counting the query times of the data of the service system in the characteristic counting time period;
and acquiring a preset amount of data from the service system as hot data according to the sequence of the query times from high to low.
In an embodiment, when the processor executes the computer program to realize the step of querying popular data related to the keyword to be queried from the dictionary tree according to a preset DFS algorithm, the following steps are specifically realized:
judging whether the data volume in the dictionary tree is larger than a preset data volume threshold value or not;
if the data volume in the dictionary tree is larger than a preset data volume threshold value; and starting multithreading, and simultaneously inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
In an embodiment, the processor, in executing the computer program, further implements the steps of:
and marking the leaf nodes which are inquired in the dictionary tree.
The storage medium may be a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk, which can store various computer readable storage media.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of each unit is only one logic function division, and there may be another division manner in actual implementation. For example, various elements or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented.
The steps in the method of the embodiment of the invention can be sequentially adjusted, combined and deleted according to actual needs. The units in the device of the embodiment of the invention can be merged, divided and deleted according to actual needs. In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a terminal, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, while the invention has been described with respect to the above-described embodiments, it will be understood that the invention is not limited thereto but may be embodied with various modifications and changes.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A searching method based on a dictionary tree is characterized by comprising the following steps:
counting hot data in a service system;
constructing a dictionary tree according to the hot data;
and if the keywords to be inquired input by the user are received, inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
2. The trie-based search method according to claim 1, wherein counting hot data in the business system comprises:
judging whether the current time reaches a preset time node or not;
and if the current time reaches the preset time node, acquiring hot data of the service system in a preset characteristic counting time period, wherein the end point of the characteristic counting time period is the preset time node, and the starting point of the characteristic counting time period is the time starting point of a preset time length before the preset time node.
3. The trie-based search method according to claim 2, wherein the obtaining hot data of the service system in a preset feature statistic time period comprises:
counting the query times of the data of the service system in the characteristic counting time period;
and acquiring a preset amount of data from the service system as hot data according to the sequence of the query times from high to low.
4. The trie-based search method according to claim 1, wherein the searching hot data related to the keyword to be searched from the trie according to a preset DFS algorithm comprises:
judging whether the data volume in the dictionary tree is larger than a preset data volume threshold value or not;
if the data volume in the dictionary tree is larger than a preset data volume threshold value; and starting multithreading, and simultaneously inquiring hot data related to the keywords to be inquired from the dictionary tree according to a preset DFS algorithm.
5. The trie-based search method of claim 4, further comprising:
and marking the leaf nodes which are inquired in the dictionary tree.
6. A trie-based search apparatus, comprising:
the first statistical unit is used for counting hot data in the business system;
the construction unit is used for constructing a dictionary tree according to the hot data;
and the first query unit is used for querying hot data related to the keyword to be queried from the dictionary tree according to a preset DFS algorithm if the keyword to be queried input by a user is received.
7. The trie-based search apparatus of claim 6, wherein the first statistical unit comprises:
the first judgment unit is used for judging whether the current time reaches a preset time node or not;
the first obtaining unit is configured to obtain hot data of the service system in a preset feature statistics time period if the current time reaches the preset time node, where an end point of the feature statistics time period is the preset time node, and a start point of the feature statistics time period is a time start point of a preset time duration before the preset time node.
8. The trie-based search apparatus according to claim 7, wherein the first obtaining unit includes:
the second statistical unit is used for counting the query times of the data of the service system in the characteristic statistical time period;
and the second acquisition unit is used for acquiring data with preset quantity from the service system as hot data according to the sequence of the query times from high to low.
9. A computer arrangement, characterized in that the computer arrangement comprises a memory having stored thereon a computer program and a processor implementing the method according to any of claims 1-5 when executing the computer program.
10. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when being executed by a processor, is adapted to carry out the method according to any one of claims 1-5.
CN201910943399.XA 2019-09-30 2019-09-30 Searching method and device based on dictionary tree, computer equipment and storage medium Pending CN110704444A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910943399.XA CN110704444A (en) 2019-09-30 2019-09-30 Searching method and device based on dictionary tree, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910943399.XA CN110704444A (en) 2019-09-30 2019-09-30 Searching method and device based on dictionary tree, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110704444A true CN110704444A (en) 2020-01-17

Family

ID=69197433

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910943399.XA Pending CN110704444A (en) 2019-09-30 2019-09-30 Searching method and device based on dictionary tree, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110704444A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100011016A1 (en) * 2008-07-11 2010-01-14 Adobe Systems Incorporated Dictionary compilations
CN103150409A (en) * 2013-04-08 2013-06-12 深圳市宜搜科技发展有限公司 Method and system for recommending user search word
US20130204897A1 (en) * 2012-02-03 2013-08-08 International Business Machines Corporation Combined word tree text visualization system
CN107862026A (en) * 2017-10-31 2018-03-30 北京小度信息科技有限公司 Date storage method and device, data query method and device, electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100011016A1 (en) * 2008-07-11 2010-01-14 Adobe Systems Incorporated Dictionary compilations
US20130204897A1 (en) * 2012-02-03 2013-08-08 International Business Machines Corporation Combined word tree text visualization system
CN103150409A (en) * 2013-04-08 2013-06-12 深圳市宜搜科技发展有限公司 Method and system for recommending user search word
CN107862026A (en) * 2017-10-31 2018-03-30 北京小度信息科技有限公司 Date storage method and device, data query method and device, electronic equipment

Similar Documents

Publication Publication Date Title
CN110162695B (en) Information pushing method and equipment
TWI512506B (en) Sorting method and device for search results
US10346496B2 (en) Information category obtaining method and apparatus
CA2934280C (en) Long string pattern matching of aggregated account data
JP2013504118A (en) Information retrieval based on query semantic patterns
CN102750629B (en) Schedule association method and device
CN109388657B (en) Data processing method, device, computer equipment and storage medium
WO2018195105A1 (en) Document similarity analysis
US20150234883A1 (en) Method and system for retrieving real-time information
CN110928739B (en) Process monitoring method and device and computing equipment
WO2019052162A1 (en) Method, apparatus and device for improving data cleaning efficiency, and readable storage medium
CN111104540B (en) Image searching method, device, equipment and computer readable storage medium
CN109582155B (en) Recommendation method and device for inputting association words, storage medium and electronic equipment
US20140019454A1 (en) Systems and Methods for Caching Data Object Identifiers
CN106874332B (en) Database access method and device
CN109885729B (en) Method, device and system for displaying data
CN110580255A (en) method and system for storing and retrieving data
CN111488736A (en) Self-learning word segmentation method and device, computer equipment and storage medium
CN111435406A (en) Method and device for correcting database statement spelling errors
CN113568940A (en) Data query method, device, equipment and storage medium
CN110674387A (en) Method, apparatus, and computer storage medium for data search
CN108804550A (en) A kind of query word expanding method, device and electronic equipment
CN106708880B (en) Topic associated word acquisition method and device
CN116521816A (en) Data processing method, retrieval method, device, equipment and storage medium
CN110704444A (en) Searching method and device based on dictionary tree, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200117