CN110019295B - Database retrieval method, device, system and storage medium - Google Patents

Database retrieval method, device, system and storage medium Download PDF

Info

Publication number
CN110019295B
CN110019295B CN201710874615.0A CN201710874615A CN110019295B CN 110019295 B CN110019295 B CN 110019295B CN 201710874615 A CN201710874615 A CN 201710874615A CN 110019295 B CN110019295 B CN 110019295B
Authority
CN
China
Prior art keywords
retrieval
condition
sub
search
target sub
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.)
Active
Application number
CN201710874615.0A
Other languages
Chinese (zh)
Other versions
CN110019295A (en
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.)
Beijing Gridsum Technology Co Ltd
Original Assignee
Beijing Gridsum Technology 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 Beijing Gridsum Technology Co Ltd filed Critical Beijing Gridsum Technology Co Ltd
Priority to CN201710874615.0A priority Critical patent/CN110019295B/en
Publication of CN110019295A publication Critical patent/CN110019295A/en
Application granted granted Critical
Publication of CN110019295B publication Critical patent/CN110019295B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/24Querying
    • G06F16/242Query formulation
    • G06F16/2425Iterative querying; Query formulation based on the results of a preceding query

Abstract

The invention discloses a database retrieval method, a device, a system and a storage medium, wherein the method comprises the following steps: when a retrieval request carrying a first retrieval condition is received, processing the first retrieval condition to obtain a second retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition; searching by using a second searching condition to obtain a first searching result; and determining a second retrieval result matched with the first retrieval condition in the first retrieval result. Based on the method disclosed by the invention, the first retrieval condition can be firstly relaxed to obtain the second retrieval condition, and then the second retrieval condition is used for retrieval, so that the texts which accord with the first retrieval condition are all in the first retrieval result, and then the second retrieval result matched with the first retrieval condition is determined, and the finally obtained second retrieval result is comprehensive and accurate, thereby improving the retrieval accuracy.

Description

Database retrieval method, device, system and storage medium
Technical Field
The present invention relates to the field of natural language processing, and in particular, to a database retrieval method, apparatus, system, and storage medium.
Background
Distributed databases, such as the Elastic Search database, have powerful full-text indexing capabilities and can approach the real-time processing of full-text retrieval requests.
At present, when a certain content needs to be precisely matched in an Elastic Search database, a word segmentation means is mainly adopted for searching the Elastic Search database: firstly, segmenting words of the text in the retrieval condition and the Elastic Search database, then matching the segmentation results of the retrieval condition and the segmentation results of the text, and searching the target text meeting the retrieval condition from the Elastic Search database.
However, since the last character of the search condition repeatedly appears in the segmentation result of the search condition, the situation that the text which originally meets the search condition is not searched easily occurs, and the search accuracy is low.
Disclosure of Invention
In view of the above, the present invention has been made to provide a database retrieval method, apparatus, system and storage medium that overcome or at least partially solve the above problems.
The specific technical scheme is as follows:
a database retrieval method, comprising:
when a retrieval request carrying a first retrieval condition is received, processing the first retrieval condition to obtain a second retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition;
searching by using the second searching condition to obtain a first searching result;
and determining a second retrieval result matched with the first retrieval condition in the first retrieval result.
Preferably, the processing the first search condition to obtain a second search condition includes:
determining retrieval sub-conditions in the first retrieval condition and a logical relation among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logical negation and retrieval texts;
for at least one of the retrieval sub-conditions, determining a target sub-condition in the retrieval sub-condition;
and for at least one target sub-condition, carrying out deletion processing on the target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition.
Preferably, for each search sub-condition containing a logical negation, the determining a target sub-condition in the search sub-condition includes:
determining the retrieval sub-condition containing the logical negation as a target sub-condition;
the deleting process of the target sub-condition includes:
performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word;
judging whether all the first search terms cover the search text of the target sub-condition;
and if not, deleting the target sub-condition.
Preferably, for each search sub-condition that does not contain a logical negation, the determining a target sub-condition in the search sub-condition includes:
performing word segmentation on the retrieval text which does not contain the retrieval sub-condition of the logical negation to obtain at least one second retrieval word;
judging whether a second search word with the same last character as the search text exists in the at least one second search word, wherein the second search word with the same last character as the search text contains at least two characters;
if yes, the second search word with the tail character identical to the tail character of the search text and each remaining second search word in the search text of the search sub-condition are related through logic and to form a target sub-condition;
the deleting process of the target sub-condition includes:
and deleting the tail character of the second search word with the tail character identical to the tail character of the search text in the target sub-condition.
Preferably, the method further comprises the following steps:
and carrying out deduplication processing on each second search term of the deleted tail character.
A database retrieval apparatus comprising: the system comprises a condition processing module, a retrieval module and a matching module;
the condition processing module is used for processing a first retrieval condition to obtain a second retrieval condition when receiving a retrieval request carrying the first retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition;
the retrieval module is used for retrieving by using the second retrieval condition to obtain a first retrieval result;
and the matching module is used for determining a second retrieval result matched with the first retrieval condition in the first retrieval result.
Preferably, the condition processing module is specifically configured to:
determining retrieval sub-conditions in the first retrieval condition and a logical relation among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logical negation and retrieval texts; for at least one of the retrieval sub-conditions, determining a target sub-condition in the retrieval sub-condition; and for at least one target sub-condition, carrying out deletion processing on the target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition.
Preferably, for each of the search sub-conditions including a logical negation, the condition processing module is specifically configured to:
determining the retrieval sub-condition containing the logical negation as a target sub-condition; performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word; judging whether all the first search terms cover the search text of the target sub-condition; and if not, deleting the target sub-condition.
A database retrieval system, comprising:
a memory for storing a program;
and the processor is used for executing the program, and the program executes the database retrieval method in any one of the above technical schemes when running.
A storage medium having stored thereon a program which, when executed by a processor, implements a database retrieval method according to any one of the preceding claims.
By means of the technical scheme, the database retrieval method, the database retrieval device, the database retrieval system and the storage medium can relax the first retrieval condition in the retrieval conditions to obtain the second retrieval condition; then, searching in the database by using the second searching condition to obtain a first searching result; finally, a second search result matching the first search condition is determined from the first search result.
The invention can firstly relax the first retrieval condition to obtain the second retrieval condition, and then the second retrieval condition is used for retrieval, thereby ensuring that the texts which accord with the first retrieval condition are all in the first retrieval result, and then determining the second retrieval result which is matched with the first retrieval condition, and ensuring that the finally obtained second retrieval result is comprehensive and accurate, thereby improving the retrieval accuracy.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 illustrates a method flow diagram of a database retrieval method;
FIG. 2 illustrates a partial method flow diagram of a database retrieval method;
FIG. 3 illustrates a method flow diagram of yet another portion of a database retrieval method;
FIG. 4 illustrates a method flow diagram of a further portion of a database retrieval method;
fig. 5 shows a schematic configuration diagram of the database retrieval apparatus.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, an embodiment of the present invention provides a database retrieval method, which may include the following steps:
s10, when receiving a retrieval request carrying a first retrieval condition, processing the first retrieval condition to obtain a second retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition;
in the process of executing step S10, the first search condition is composed of search sub-conditions and logical relations between the search sub-conditions, the current logical relations are classified into logical and or logical, and the search sub-conditions are composed of search texts or logical not and search texts; in the process of processing the first retrieval condition, each retrieval sub-condition can be processed in sequence, and the processed retrieval sub-conditions are combined, so that second retrieval conditions with the number of retrieval results not less than that of the first retrieval condition are obtained.
In a specific implementation process, in step S10, the following steps may be specifically adopted to "process the first search condition to obtain the second search condition", and a flowchart of the method is shown in fig. 2:
s101, determining retrieval sub-conditions in a first retrieval condition and logic relations among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logic negation and retrieval texts;
in the process of executing step S101, punctuation marks included in the search text are automatically removed in the process of word segmentation, so that text omission occurs when a search sub-condition including a logical negation is used for searching.
For example, search sub-condition A is defined by the logical negation and search text "sunlight. The retrieval sub-condition B formed after the word segmentation is formed by logical negation and retrieval text "sunny". It can be seen that the original text in the database that meets the retrieval sub-condition a, e.g. the text C containing "sunny" cannot be retrieved by the retrieval sub-condition B.
Therefore, due to the particularity of the negation logic in the search sub-condition, in order to relax the search sub-condition formed by the negation logic and the search text, the search text in the search sub-condition needs to be deleted; for the search sub-condition composed of the search text, the search text in the search sub-condition only needs to be relaxed.
S102, determining a target sub-condition in at least one retrieval sub-condition;
in the process of executing step S102, since the relaxing means is different for the search sub-condition including the logical negation and the search sub-condition not including the logical negation, the processing procedure for searching the text in the search sub-condition is also different accordingly.
For the search sub-condition containing logical negation, the search text needs to be deleted to relax the search sub-condition, and the deletion rule is related to the punctuation mark position in the search text, for example, for the search sub-condition a, the search text "sunlight" is deleted. Text C containing "sunny" cannot be retrieved after "positive" in bright ". Therefore, a deletion rule related to the punctuation mark may be set, specifically, all the search texts before a certain punctuation mark may be deleted, for example, all the texts after a certain punctuation mark may be deleted.
For the retrieval sub-condition not containing the logical negation, namely the retrieval sub-condition formed by the retrieval text, the retrieval range of the retrieval text is only required to be widened. For example, for the retrieval sub-condition D composed of the retrieval text "sunny" the retrieval sub-condition D can be relaxed to be composed of "sunny" and "bright" and the logical and therebetween, because it is possible to retrieve not only the text C containing "sunny" but also the retrieval text E containing "sunny" and "bright".
For each search sub-condition containing a non-logical negation, the following steps may be specifically adopted in the step S102 of "determining a target sub-condition in the search sub-condition", and a flowchart of the method is shown in fig. 3:
s1001, performing word segmentation on the search text which does not contain the search sub-condition of the logical negation to obtain at least one second search word;
in the process of executing step S1001, for the search sub-condition D, the search text "sunny" is segmented, and the second search words obtained by the segmentation are "sunny", "bright", and "bright", respectively.
S1002, judging whether a second search word with the same tail character as the tail character of the search text exists in at least one second search word, wherein the second search word with the same tail character as the tail character of the search text comprises at least two characters;
in the process of executing step S1002, it is determined that the last character of the second search word "bright" is the same as the last character "red" of the search text for the result of the word segmentation of the search sub-condition D in step S1001.
Of course, in addition to the search sub-condition D in which only one second search word has the same last character as the last character of the search text in the word segmentation result, another type of search sub-condition is included, and there are at least two second search words having the same last character as the last character of the search text in the word segmentation result, for example, for the search sub-condition E "310 ww", the word segmentation results are "310 ww", "310 w", "310" and "w", where the last characters of the second search words "310 ww" and "310 w" are both the same as the last character "w" of the search text "310 ww".
S1003, if yes, the second search terms with the same tail characters as those of the search text and the remaining second search terms in the search text of the search sub-condition are related through logic and to form a target sub-condition;
in the process of executing step S1003, the target sub-conditions for the search condition D are "sunny", "bright" and "charm", and the logical and between the second search terms; the target sub-condition of the search sub-condition E is composed of "310 ww", "310 w", "310" and "w" and the logical and between the second search terms.
S103, for at least one target sub-condition, carrying out deletion processing on the target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition.
In the process of executing step S103, for each search sub-condition containing a logical negation, it is preferable that the search sub-condition is determined as a target sub-condition, and the following steps may be specifically adopted in step S103, where a flowchart of the method is shown in fig. 4:
s1004, performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word;
in the process of executing step S1004, for the search sub-condition a, the search sub-condition a is determined as the target sub-condition, and further, the search text "sunlight" included in the search sub-condition a is searched. The bright "is participated, and the first retrieval word is obtained as" sunshine "," bright "and" bright ".
S1005, judging whether all the first search terms cover the search text of the target sub-condition; if not, go to step S1006;
in the process of executing step S1005, each of the first search words "sunny", "bright" and "bright" obtained in step S1004 is combined, the search text obtained by the combination is "sunny", and it is determined whether the search text "sunny" is equal to the search text "sunny" in the search sub-condition a. Bright, obviously, not equal to, the search text "sunshine". One more punctuation mark in bright "is provided. ", the target sub-conditions may be eliminated altogether.
S1006, delete target sub-condition.
It should be noted that if all the first search terms can cover the search text of the target sub-condition, no processing is performed on the target sub-condition.
For each of the search sub-conditions including a non-logical negation, the following steps may be specifically adopted in the step S103 of "performing a pruning process on the target sub-condition":
deleting the tail character of a second search word with the tail character identical to that of the search text in the target sub-condition;
specifically, for the search condition D, the second search words included in the target sub-condition include "sunny", "bright" and "charm", and the last character of the second search word "bright" may be removed; for the search condition E, the second search term included in the target sub-condition has "310 ww", "310 w", "310" and "w", and the last characters of the two second search terms "310 ww" and "310 w" can be removed to obtain "310 w" and "310", but for the second search term "310 ww" in which the last character is deleted once, because the obtained last character of "310 w" is also the same as the last character "w" of the search text, the last character of "310 w" can be further removed until no last character of the second search term other than the second search term "w" is the same as the last character of the search text.
Of course, since the deletion operation on the search condition D results in the second search terms of the three deletion end characters, i.e., "310" and "310", it is preferable that the second search terms of the deletion end characters are subjected to a deduplication process to remove two "310".
S20, using the second search condition to search, and obtaining a first search result;
in the process of executing step S20, according to the prior art scheme, the second search condition and the text in the database may be segmented, and then the segmentation result of the second search condition and the segmentation result of the text are used to perform matching, so as to search for the text meeting the second search condition from the database.
S30, determining a second retrieval result matched with the first retrieval condition in the first retrieval result;
in the process of executing step S30, the retrieved texts may be sequentially verified by using the first retrieval condition, and if the verification is passed, that is, the first retrieval condition is met, the matching is completed.
The above steps S101 to S103 are only one preferred implementation of the process of "processing the first search condition to obtain the second search condition" in step S10 disclosed in the embodiment of the present application, and the specific implementation of this process may be arbitrarily set according to its own requirements, and is not limited herein.
The above steps S1001 to S1003 are only one preferred implementation of the "determining the target sub-condition in the search sub-condition" process in step S102 disclosed in the embodiment of the present application, and the specific implementation of this process may be arbitrarily set according to its own requirements, and is not limited herein.
The above steps S1004 to S1006 are only one preferred implementation manner of the process of "performing the deletion processing on the target sub-condition" in step S103 disclosed in the embodiment of the present application, and the specific implementation manner of this process may be arbitrarily set according to the needs of the user, and is not limited herein.
According to the database retrieval method provided by the embodiment of the invention, the first retrieval condition can be firstly relaxed to obtain the second retrieval condition, and then the second retrieval condition is used for retrieval, so that the texts conforming to the first retrieval condition are all in the first retrieval result, and then the second retrieval result matched with the first retrieval condition is determined, and the finally obtained second retrieval result is comprehensive and accurate, so that the retrieval accuracy is improved.
The database retrieval method provided by the embodiment can be particularly applied to an Elastic Search database, and when the Elastic Search database is retrieved, the first retrieval condition in the retrieval conditions can be relaxed, so that the second retrieval condition that the data of the retrieval result is not less than the first retrieval condition is obtained; and then, searching in the Elastic Search data by using the second searching condition, wherein the searching process specifically comprises the following steps: firstly, segmenting words of a second retrieval condition and a text in an Elastic Search database, then matching the word segmentation result of the second retrieval condition with the word segmentation result of the text, and searching a target text meeting the second retrieval condition from the Elastic Search database; finally, a second search result which is matched with the first search condition in the first search result is determined, namely, the text which meets the first search condition is selected from the target text.
Based on the database retrieval method provided in the foregoing embodiment, an embodiment of the present invention correspondingly provides an apparatus for executing the database retrieval method, a schematic structural diagram of which is shown in fig. 5, where the apparatus includes: a condition processing module 10, a retrieval module 20 and a matching module 30;
the condition processing module 10 is configured to, when a retrieval request carrying a first retrieval condition is received, process the first retrieval condition to obtain a second retrieval condition, where a number of retrieval results corresponding to the second retrieval condition is not less than a number of retrieval results corresponding to the first retrieval condition;
the retrieval module 20 is configured to perform retrieval using the second retrieval condition to obtain a first retrieval result;
and the matching module 30 is used for determining a second retrieval result which is matched with the first retrieval condition in the first retrieval result.
Optionally, the condition processing module 10 is specifically configured to:
determining retrieval sub-conditions in the first retrieval condition and a logical relation among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logical negation and retrieval texts; for at least one retrieval sub-condition, determining a target sub-condition in the retrieval sub-condition; and deleting at least one target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition.
Optionally, for each of the search sub-conditions including a logical negation, the condition processing module is specifically configured to:
determining the retrieval sub-condition containing the logical negation as a target sub-condition; performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word; judging whether all the first search terms cover the search text of the target sub-condition; and if not, deleting the target sub-condition.
The database retrieval device provided by the embodiment of the invention can firstly relax the first retrieval condition to obtain the second retrieval condition, and then the second retrieval condition is used for retrieval, so that the texts which accord with the first retrieval condition are all in the first retrieval result, and then the second retrieval result matched with the first retrieval condition is determined, and the finally obtained second retrieval result is comprehensive and accurate, thereby improving the retrieval accuracy.
The database retrieval system comprises a processor and a memory, wherein the condition processing module, the retrieval module and the matching module are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to one or more than one, and the text can be accurately retrieved by adjusting the parameters of the kernel.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium on which a program is stored, the program implementing the database retrieval method when executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the database retrieval method is executed when the program runs.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
when a retrieval request carrying a first retrieval condition is received, processing the first retrieval condition to obtain a second retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition;
searching by using the second searching condition to obtain a first searching result;
and determining a second retrieval result matched with the first retrieval condition in the first retrieval result.
Wherein, the processing the first search condition to obtain a second search condition comprises:
determining retrieval sub-conditions in the first retrieval condition and a logical relation among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logical negation and retrieval texts;
for at least one of the retrieval sub-conditions, determining a target sub-condition in the retrieval sub-condition;
and for at least one target sub-condition, carrying out deletion processing on the target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition.
Wherein, for each search sub-condition containing a logical negation, the determining a target sub-condition in the search sub-condition comprises:
determining the retrieval sub-condition containing the logical negation as a target sub-condition;
the deleting process of the target sub-condition includes:
performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word;
judging whether all the first search terms cover the search text of the target sub-condition;
and if not, deleting the target sub-condition.
Wherein, for each search sub-condition not containing a logical negation, the determining a target sub-condition in the search sub-condition comprises:
performing word segmentation on the retrieval text which does not contain the retrieval sub-condition of the logical negation to obtain at least one second retrieval word;
judging whether a second search word with the same last character as the search text exists in the at least one second search word, wherein the second search word with the same last character as the search text contains at least two characters;
if yes, the second search word with the tail character identical to the tail character of the search text and each remaining second search word in the search text of the search sub-condition are related through logic and to form a target sub-condition;
the deleting process of the target sub-condition includes:
and deleting the tail character of the second search word with the tail character identical to the tail character of the search text in the target sub-condition.
Wherein, still include:
and carrying out deduplication processing on each second search term of the deleted tail character.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
when a retrieval request carrying a first retrieval condition is received, processing the first retrieval condition to obtain a second retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition;
searching by using the second searching condition to obtain a first searching result;
and determining a second retrieval result matched with the first retrieval condition in the first retrieval result.
Wherein, the processing the first search condition to obtain a second search condition comprises:
determining retrieval sub-conditions in the first retrieval condition and a logical relation among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logical negation and retrieval texts;
for at least one of the retrieval sub-conditions, determining a target sub-condition in the retrieval sub-condition;
and for at least one target sub-condition, carrying out deletion processing on the target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition.
Wherein, for each search sub-condition containing a logical negation, the determining a target sub-condition in the search sub-condition comprises:
determining the retrieval sub-condition containing the logical negation as a target sub-condition;
the deleting process of the target sub-condition includes:
performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word;
judging whether all the first search terms cover the search text of the target sub-condition;
and if not, deleting the target sub-condition.
Wherein, for each search sub-condition not containing a logical negation, the determining a target sub-condition in the search sub-condition comprises:
performing word segmentation on the retrieval text which does not contain the retrieval sub-condition of the logical negation to obtain at least one second retrieval word;
judging whether a second search word with the same last character as the search text exists in the at least one second search word, wherein the second search word with the same last character as the search text contains at least two characters;
if yes, the second search word with the tail character identical to the tail character of the search text and each remaining second search word in the search text of the search sub-condition are related through logic and to form a target sub-condition;
the deleting process of the target sub-condition includes:
and deleting the tail character of the second search word with the tail character identical to the tail character of the search text in the target sub-condition.
Wherein, still include:
and carrying out deduplication processing on each second search term of the deleted tail character.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (6)

1. A database retrieval method, comprising:
when a retrieval request carrying a first retrieval condition is received, processing the first retrieval condition to obtain a second retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition;
searching by using the second searching condition to obtain a first searching result;
determining a second retrieval result matched with the first retrieval condition in the first retrieval result;
wherein, the processing the first search condition to obtain a second search condition comprises:
determining retrieval sub-conditions in the first retrieval condition and a logical relation among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logical negation and retrieval texts;
for at least one of the retrieval sub-conditions, determining a target sub-condition in the retrieval sub-condition;
for at least one target sub-condition, carrying out deletion processing on the target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition;
wherein, for each search sub-condition containing a logical negation, the determining a target sub-condition in the search sub-condition comprises:
determining the retrieval sub-condition containing the logical negation as a target sub-condition;
the deleting process of the target sub-condition includes:
performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word;
judging whether all the first search terms cover the search text of the target sub-condition;
and if not, deleting the target sub-condition.
2. The method of claim 1, wherein for each search sub-condition that does not contain a logical negation, said determining a target sub-condition in the search sub-condition comprises:
performing word segmentation on the retrieval text which does not contain the retrieval sub-condition of the logical negation to obtain at least one second retrieval word;
judging whether a second search word with the same last character as the search text exists in the at least one second search word, wherein the second search word with the same last character as the search text contains at least two characters;
if yes, the second search word with the tail character identical to the tail character of the search text and each remaining second search word in the search text of the search sub-condition are related through logic and to form a target sub-condition;
the deleting process of the target sub-condition includes:
and deleting the tail character of the second search word with the tail character identical to the tail character of the search text in the target sub-condition.
3. The method of claim 2, further comprising:
and carrying out deduplication processing on each second search term of the deleted tail character.
4. A database retrieval apparatus, comprising: the system comprises a condition processing module, a retrieval module and a matching module;
the condition processing module is used for processing a first retrieval condition to obtain a second retrieval condition when receiving a retrieval request carrying the first retrieval condition, wherein the number of retrieval results corresponding to the second retrieval condition is not less than that of the retrieval results corresponding to the first retrieval condition;
the retrieval module is used for retrieving by using the second retrieval condition to obtain a first retrieval result;
the matching module is used for determining a second retrieval result matched with the first retrieval condition in the first retrieval result;
the condition processing module is specifically configured to:
determining retrieval sub-conditions in the first retrieval condition and a logical relation among the retrieval sub-conditions, wherein the retrieval sub-conditions in the first retrieval condition are composed of retrieval texts or are composed of logical negation and retrieval texts; for at least one of the retrieval sub-conditions, determining a target sub-condition in the retrieval sub-condition; for at least one target sub-condition, carrying out deletion processing on the target sub-condition, and replacing the target sub-condition with the deleted target sub-condition to obtain a second retrieval condition;
wherein, for each of the retrieval sub-conditions comprising a logical negation, the condition processing module is specifically configured to:
determining the retrieval sub-condition containing the logical negation as a target sub-condition; performing word segmentation on the retrieval text of the target sub-condition to obtain at least one first retrieval word; judging whether all the first search terms cover the search text of the target sub-condition; and if not, deleting the target sub-condition.
5. A database retrieval system, comprising:
a memory for storing a program;
a processor for executing the program, which when executed performs the database retrieval method of any one of claims 1 to 3.
6. A storage medium, characterized in that a program is stored thereon, which when executed by a processor implements the database retrieval method according to any one of claims 1 to 3.
CN201710874615.0A 2017-09-25 2017-09-25 Database retrieval method, device, system and storage medium Active CN110019295B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710874615.0A CN110019295B (en) 2017-09-25 2017-09-25 Database retrieval method, device, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710874615.0A CN110019295B (en) 2017-09-25 2017-09-25 Database retrieval method, device, system and storage medium

Publications (2)

Publication Number Publication Date
CN110019295A CN110019295A (en) 2019-07-16
CN110019295B true CN110019295B (en) 2021-07-27

Family

ID=67186360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710874615.0A Active CN110019295B (en) 2017-09-25 2017-09-25 Database retrieval method, device, system and storage medium

Country Status (1)

Country Link
CN (1) CN110019295B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413307B (en) * 2019-07-26 2023-11-24 网易(杭州)网络有限公司 Code function association method and device and electronic equipment
CN112256741A (en) * 2020-09-07 2021-01-22 长沙市到家悠享网络科技有限公司 Supply and demand matching method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104011713A (en) * 2011-12-28 2014-08-27 乐天株式会社 Search device, searching method, search program and recording medium
CN104156454A (en) * 2014-08-18 2014-11-19 腾讯科技(深圳)有限公司 Search term correcting method and device
CN104268175A (en) * 2014-09-15 2015-01-07 乐视网信息技术(北京)股份有限公司 Data search device and method thereof

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101679011B1 (en) * 2014-06-26 2016-11-24 주식회사 알티베이스 Method and Apparatus for moving data in DBMS

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104011713A (en) * 2011-12-28 2014-08-27 乐天株式会社 Search device, searching method, search program and recording medium
CN104156454A (en) * 2014-08-18 2014-11-19 腾讯科技(深圳)有限公司 Search term correcting method and device
CN104268175A (en) * 2014-09-15 2015-01-07 乐视网信息技术(北京)股份有限公司 Data search device and method thereof

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵旭;搜索引擎关键技术研究及性能优化;《中国优秀硕士学位论文全文数据库信息科技辑》;20090315;全文 *

Also Published As

Publication number Publication date
CN110019295A (en) 2019-07-16

Similar Documents

Publication Publication Date Title
CN106649346B (en) Data repeatability checking method and device
US8468146B2 (en) System and method for creating search index on cloud database
CN106897342B (en) Data verification method and equipment
KR102391839B1 (en) Method and device for processing user personal, server and storage medium
CN109597982B (en) Abstract text recognition method and device
CN106648839B (en) Data processing method and device
CN110019295B (en) Database retrieval method, device, system and storage medium
CN108874379B (en) Page processing method and device
CN107577660B (en) Category information identification method and device and server
CN108108379B (en) Keyword word expansion method and device
CN108255891B (en) Method and device for judging webpage type
CN111026736B (en) Data blood margin management method and device and data blood margin analysis method and device
CN104572904A (en) Method and device for determining relevance level between tags
CN111897828A (en) Data batch processing implementation method, device, equipment and storage medium
CN107562533B (en) Data loading processing method and device
CN109558580B (en) Text analysis method and device
CN111125087A (en) Data storage method and device
CN106776654B (en) Data searching method and device
US8214336B2 (en) Preservation of digital content
US20170147256A1 (en) Memory storage recycling
CN109146395B (en) Data processing method, device and equipment
CN112579774A (en) Model training method, model training device and terminal equipment
CN113590805A (en) Method and device for searching textile commodity names based on knowledge graph
CN108121719B (en) Method and device for realizing data extraction conversion loading ETL
CN112491816A (en) Service data processing method and device

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 100080 No. 401, 4th Floor, Haitai Building, 229 North Fourth Ring Road, Haidian District, Beijing

Applicant after: Beijing Guoshuang Technology Co.,Ltd.

Address before: 100086 Beijing city Haidian District Shuangyushu Area No. 76 Zhichun Road cuigongfandian 8 layer A

Applicant before: Beijing Guoshuang Technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant