CN112015771B - Data retrieval method and device, electronic equipment and computer storage medium - Google Patents

Data retrieval method and device, electronic equipment and computer storage medium Download PDF

Info

Publication number
CN112015771B
CN112015771B CN202011105140.7A CN202011105140A CN112015771B CN 112015771 B CN112015771 B CN 112015771B CN 202011105140 A CN202011105140 A CN 202011105140A CN 112015771 B CN112015771 B CN 112015771B
Authority
CN
China
Prior art keywords
retrieval
configuration
configuration parameters
matching
request
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
CN202011105140.7A
Other languages
Chinese (zh)
Other versions
CN112015771A (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 Xintang Sichuang Educational Technology Co Ltd
Original Assignee
Beijing Xintang Sichuang Educational 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 Xintang Sichuang Educational Technology Co Ltd filed Critical Beijing Xintang Sichuang Educational Technology Co Ltd
Priority to CN202011105140.7A priority Critical patent/CN112015771B/en
Publication of CN112015771A publication Critical patent/CN112015771A/en
Application granted granted Critical
Publication of CN112015771B publication Critical patent/CN112015771B/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/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries

Abstract

The embodiment of the application provides a data retrieval method, a data retrieval device, electronic equipment and a computer storage medium, wherein the data retrieval method comprises the following steps: acquiring a retrieval configuration rule corresponding to a retrieval request of a user from a configuration platform; analyzing the retrieval configuration rule to generate structured data containing retrieval elements; and generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule. According to the method and the device, the retrieval configuration rule corresponding to the retrieval request is obtained from the configuration platform, only the configuration parameters and the operation relation in the retrieval configuration rule need to be analyzed, when the retrieval request of a user changes, the configuration parameters and the operation relation need to be analyzed, the retrieval request can be converted into the DSL statement, developers do not need to provide development versions corresponding to each retrieval request, one development version is shared in the whole retrieval process, the quick positioning of different retrieval requests can be achieved, and the efficiency of data retrieval is improved.

Description

Data retrieval method and device, electronic equipment and computer storage medium
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a data retrieval method and device, electronic equipment and a computer storage medium.
Background
In the big data era, with more and more business demands in various fields and platforms, it is also gradually becoming a trend to provide users with business information needed by fast and conveniently retrieving from massive data.
The method is characterized in that a full-text retrieval function is provided based on inverted indexes, wherein apache Lucene provides a Java toolkit with powerful functions such as indexing and retrieval, and the Elasticisarch takes Lucene as a retrieval core and provides an analysis engine for retrieval and data.
However, the existing Elasticsearch needs a complex programming technology during secondary development, and in an actual production environment, when a business requirement of a user changes, Java Client toolkits of corresponding versions provided by developers are required to develop Java programs, so that a retrieval result is obtained, and retrieval is time-consuming and labor-consuming. Therefore, it is necessary to provide a data retrieval method for quickly and accurately locating information corresponding to service requirements.
Disclosure of Invention
In view of this, embodiments of the present application provide a data retrieval method, an apparatus, an electronic device, and a computer storage medium, so as to overcome the defect in the prior art that each service requirement requires a Java Client toolkit of a corresponding version provided by a developer to develop a Java program, thereby obtaining a retrieval result, which results in time and labor consumption for retrieval.
In a first aspect, an embodiment of the present application provides a data retrieval method, where the method includes:
acquiring a retrieval configuration rule corresponding to a retrieval request of a user from a configuration platform, wherein the retrieval configuration rule comprises configuration parameters and an operation relation between the configuration parameters;
analyzing the retrieval configuration rule to generate structured data containing retrieval elements;
and generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule.
In a second aspect, an embodiment of the present application provides another data retrieval method, where the method includes:
according to retrieval key information obtained after analyzing a retrieval request of a user, matching the retrieval key information in a configuration platform to obtain configuration parameters and an operation relation between the configuration parameters, wherein the configuration platform stores a plurality of configuration parameters for processing the retrieval request in advance and the operation relation between the configuration parameters;
and generating a retrieval configuration rule according to the configuration parameters and the operational relationship between the configuration parameters, and sending the retrieval configuration rule to a retrieval driving engine so that the retrieval driving engine generates structured data containing retrieval elements according to the retrieval configuration rule.
In a third aspect, an embodiment of the present application provides a data retrieval device, where the device includes an obtaining module, an analyzing module, and a statement generating module;
the acquisition module is used for acquiring a retrieval configuration rule corresponding to a retrieval request of a user from a configuration platform, wherein the retrieval configuration rule comprises configuration parameters and an operation relation between the configuration parameters;
the analysis module is used for analyzing the retrieval configuration rule to generate structured data containing retrieval elements;
and the statement generating module is used for generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule.
In a fourth aspect, an embodiment of the present application provides another data retrieval apparatus, where the apparatus includes a matching module and a retrieval configuration rule generating module;
the matching module is used for matching the retrieval key information in a configuration platform according to the retrieval key information obtained after analyzing the retrieval request of the user to obtain an operation relation between configuration parameters and an operation relation between the configuration parameters, wherein the configuration platform stores a plurality of configuration parameters for processing the retrieval request in advance and the operation relation between the configuration parameters;
the retrieval configuration rule generating module is used for generating a retrieval configuration rule according to the operation relation between the configuration parameters and the configuration parameters, and sending the retrieval configuration rule to a retrieval driving engine so that the retrieval driving engine generates structured data containing retrieval elements according to the retrieval configuration rule.
In a fifth aspect, an embodiment of the present application provides an electronic device, including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the corresponding operation of the data retrieval method according to the first aspect or the second aspect.
In a sixth aspect, the present application provides a computer storage medium, on which a computer program is stored, and the program, when executed by a processor, implements the data retrieval method according to the first aspect or the second aspect.
The embodiment of the application provides a data retrieval method, a data retrieval device, electronic equipment and a computer storage medium, wherein the data retrieval method comprises the following steps: acquiring a retrieval configuration rule corresponding to a retrieval request of a user from a configuration platform, wherein the retrieval configuration rule comprises configuration parameters and an operation relation between the configuration parameters; analyzing the retrieval configuration rule to generate structured data containing retrieval elements; and generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule. According to the method and the device, the retrieval configuration rule corresponding to the retrieval request is obtained from the configuration platform, only the configuration parameters and the operation relation in the retrieval configuration rule need to be analyzed, when the retrieval request of a user changes, the configuration parameters and the operation relation in the retrieval configuration rule also need to be analyzed, the retrieval request can be converted into the DSL statement, developers do not need to provide development versions corresponding to each retrieval request, one development version is shared in the whole retrieval process, the quick positioning of different retrieval requests can be realized, and the efficiency of data retrieval is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a flowchart of a data retrieval method according to an embodiment of the present application;
FIG. 2 is a flow chart of another data retrieval method provided by an embodiment of the present application;
fig. 3 is a block diagram of a search driving engine according to an embodiment of the present application;
fig. 4 is a block diagram of a data retrieval apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of another data retrieval apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make those skilled in the art better understand the technical solutions in the embodiments of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, but not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application shall fall within the scope of the protection of the embodiments in the present application.
It should be noted that, in the present application, a plurality refers to two or more, for example, a plurality of configuration versions.
The following further describes specific implementations of embodiments of the present application with reference to the drawings of the embodiments of the present application.
The Elasticissearch cluster is used as a non-relational distributed database, can quickly store a large amount of data and can provide real-time query, provides full-text retrieval capability service on the basis of the Elasticissearch, and in an actual production environment, retrieval request data of a user needs to be packaged into DSL statements of the Elasticissearch in a corresponding format, and then requests are initiated to the Elasticissearch to obtain retrieval results. In the process of packaging the retrieval request data of the user into the DSL statement of the Elasticissearch in the corresponding format, in a first realizable mode, Java program development is carried out by a Java Client toolkit of a corresponding version provided by a developer for the Elasticissearch, an interface is provided for retrieval logic corresponding to each retrieval request, when the retrieval request of the user changes, the developer needs to provide a new development version, namely needs to develop corresponding codes, in an actual production environment, corresponding edition sending actions are needed, and the recompilation, deployment and restart of programs involved in the edition sending process are very heavy operations in actual work; for example, the search request of the user is to search for the stem and knowledge points of the test question, and corresponds to a search engine developed by Java program codes, when the search request of the user is updated to the picture size or picture color in the search test question, a search engine developed by another Java program code is needed, that is, the codes of the search engine are not flexible, the search engine and the search engine are completely independent and cannot be shared, and the search engine developed by one Java program code can only correspond to one search request. In a second implementation manner, the retrieval configuration rule including the operational relationship between the configuration parameters and the configuration parameters is obtained by matching the retrieval request of the user through a developed configuration platform, the retrieval configuration rule is read by a retrieval driving engine, the operational relationship between the configuration parameters and the configuration parameters is analyzed, the configuration parameters are distributed in a module to which the configuration parameters belong, each configuration parameter is subjected to logic processing according to the operational relationship, so that structured data is generated, and finally, DSL statements corresponding to the retrieval request are generated according to the structured data and a preset DSL conversion rule; illustratively, the retrieval request of the user is a question stem and a knowledge point of a retrieval test question, and corresponds to a retrieval driving engine provided by the application, and when the retrieval request of the user is updated to the size or the color of a picture in the retrieval test question, the retrieval request of the user corresponds to the same retrieval driving engine; compared with the first realizable mode, when the retrieval request of the user changes, the data retrieval method provided by the application can convert the retrieval request into the DSL statement only by analyzing the configuration parameters and the operation relation through the retrieval driving engine, developers are not required to provide development versions corresponding to each retrieval request, one development version is shared in the whole retrieval process, namely, the retrieval driving engine only uses one set of codes, the quick positioning of different retrieval requests can be realized, and the efficiency of data retrieval is improved.
The first embodiment,
A first embodiment of the present application provides a data retrieval method, as shown in fig. 1, where fig. 1 is a flowchart of the data retrieval method provided in the first embodiment of the present application, and the data retrieval method includes the following steps:
step 101, obtaining a retrieval configuration rule corresponding to a retrieval request of a user from a configuration platform.
Wherein retrieving the configuration rule at least comprises the configuration parameters and the operational relationship between the configuration parameters.
The data retrieval method provided in the first embodiment of the application is executed by a retrieval driving engine, the retrieval driving engine acquires a retrieval configuration rule corresponding to a retrieval request of a user from a configuration platform, for example, the retrieval request of the user is to query the high-test true questions of the beijing area in 2010 and 2014, the retrieval driving engine acquires configuration parameters and an operation relationship between the configuration parameters from the configuration platform, for example, the configuration parameters include volume labels and the high-test true questions of the year and the beijing area, and the operation relationship includes year or operation, only volume labels belonging to the beijing area are filtered, and only identifiers belonging to the high-test true questions are filtered. The retrieval driving engine is realized by the same set of codes, is irrelevant to retrieval requests of users and is only relevant to retrieval, and can analyze different retrieval configuration rules, thereby realizing the support of different retrieval requests.
Step 102, analyzing the retrieval configuration rule to generate structured data containing retrieval elements.
The structured data in the present application can be set by those skilled in the art as appropriate according to actual needs, and the structured data may include a search element. In one possible approach, the structured data may be implemented in a form that contains data elements and corresponding element values, such as: { search field: XXXX; searching the table name: XXXX; … … search condition: XXXX }. Alternatively, a field form may be adopted, and the structured data includes at least data of a corresponding field (table _ name: A) and field value (term: ID).
Optionally, in an embodiment of the present application, according to the configuration parameters in the retrieved configuration rule and the operational relationship between the configuration parameters, at least one of the following parsing processes is performed on the configuration parameters: and splicing, assembling, associating and logically operating to generate structured data containing the retrieval elements.
Illustratively, the configuration parameters include year, volume labels and high-examination questions in the beijing area, the operation relationship indicates to perform or operation on the year, only filter volume labels and marks belonging to the beijing area, and only filter marks belonging to the high-examination questions, and the like, the search driving engine performs analysis processing on the year, volume labels and high-examination questions in the beijing area according to the operation relationship, and the analysis processing includes at least one of the following: concatenate, assemble, associate, and logically operate to generate structured data containing search elements including search keywords such as year, beijing, and college entrance examination questions.
Optionally, in an embodiment of the present application, the operation relationship indicates that an operation related to a retrieval type corresponding to the DSL statement is performed on the configuration parameter, and the structured data is structured data of retrieval logic supporting the retrieval type.
Optionally, in an embodiment of the present application, the retrieval type includes at least one of nested matching, combined matching, boolean group matching, and default keyword; when the operation relation indicates that the nesting matching operation is carried out on the configuration parameters, carrying out logic processing of depth and breadth expansion on the configuration parameters to generate structured data for nesting matching; when the operation relation indicates that the configuration parameters are subjected to combined matching operation, carrying out logic processing of logic branches on the configuration parameters to generate structured data for carrying out combined matching; when the operation relation indicates that Boolean group matching operation is performed on the configuration parameters, performing logic circulation logic processing on the configuration parameters to generate structured data for performing Boolean group matching; and when the operation relation indicates that default assignment operation is performed on the configuration parameters, performing logic processing of default values and default keywords on the configuration parameters, and generating structured data containing the default assignments.
If the configuration parameters and the operational relationship are different, the structured data generated after the configuration parameter analysis processing is also different, four examples are listed here to explain the analysis processing of the configuration parameters according to the retrieval configuration rule, and the first example is to perform infinite extension of the breadth of the horizontal logic and deep extension of the vertical logic between the configuration parameters, such as a tree structure, in order to support boolean logic operation between different screening conditions, so as to generate structured data including data for performing nested matching (nested), thereby improving the accuracy of the retrieval result. In a second example, in a scenario where the same field value may be different in a search request of a user, the operational relationship between configuration parameters in the search configuration rule is also different, and therefore, in the embodiment of the present application, the logical processing of logical branching is further performed on the configuration parameters, for example, when the configuration parameter has _ video is 0 in the search request, a union of data "has _ video is 0" and data "has _ video does not exist" is taken, otherwise, data "has _ video completely matches" is taken, for example, when has _ video is 3, data "has _ video is 3" is taken, so that structured data including data for performing combination matching (combine) is generated. In a third example, in the search driver engine, a boolean group matching (object) type is used to support loop processing on multiple groups of data of the same condition, and there may be a scene of multiple groups of filter conditions in a search request of a user, and loop processing needs to be implemented on the multiple groups of conditions, so in the embodiment of the present application, a logical processing of logical loop is further performed on configuration parameters, for example, to filter beijing college titles in two years, 2010 and 2014, where year in the paperTagList represents year, paperTagId "599 dcce" represents beijing regional volume label, and src. In the embodiment of the present application, a default assignment matching is used in the search driver engine to support logical processing on default values and default keywords, for example, filtering the true questions of high entrance examination in two years 2010 and 2014, without defining a region to which the true questions belong, defining a "default" keyword for identifying a default logical branch, and defining a "default value" keyword for identifying a default value, thereby generating structured data containing data for performing default assignments. The method and the device provide various retrieval types, so that the configuration of the retrieval request is diversified, and the efficiency of data retrieval is improved.
Optionally, in one embodiment of the present application, the search type includes at least one of a perfect match, a range match, a participle match, a phrase match, a script match, a boolean match, and a presence match.
The retrieval types in the application also comprise complete matching (term/term), range matching (range), participle matching (match), phrase matching (matchPhrase), script matching (script), Boolean matching (bool) and existence matching (exists).
Optionally, in an embodiment of the present application, the retrieval configuration rule includes a recall configuration rule, the data retrieval method is performed by a retrieval driving engine, the retrieval driving engine includes an application section, an index section and a filtering section corresponding to the recall configuration rule, and the data retrieval method further includes: adding an identifier to the configuration parameters in the recall configuration rule through the application part; describing a retrieval index name, a retrieval index type and a retrieval result field corresponding to the retrieval request through an index part; the filtering conditions and keywords related to the retrieval type corresponding to the DSL statement are described by the filtering section.
The retrieval driving engine acquires retrieval configuration rules from the configuration platform, the retrieval configuration rules comprise recall configuration rules, and the retrieval driving engine comprises a recall module which is used for analyzing and processing the recall configuration rules to generate structured data containing retrieval elements. The recall module comprises an application part, an index part and a screening part, and the recall module specifically comprises the following components: the application part is used for distinguishing a unique identifier of a set of complete retrieval configuration rules, and identifiers can be added to configuration parameters in the recall configuration rules through the application part, wherein the identifiers are dimension identifiers corresponding to retrieval requests of users or interface dimension identifiers corresponding to elastic search; the index part is used for describing a retrieval index name, a retrieval index type and a retrieval field corresponding to the retrieval request; the screening part is used for describing how to splice, assemble, associate, logically operate and the like the configuration parameters corresponding to the retrieval request, that is, when the configuration parameters are analyzed, the configuration parameters need to be combined with the retrieval types corresponding to the DSL statements, for example, the combination and nesting among the configuration parameters support the logical operation (AND, OR, NOT) among the configuration parameters, the depth infinite nesting and the infinite extension of the breadth of the logical operation support, the circular assembly of array parameters support, the execution of different business logic branches due to different parameters support, the configuration of default logic branches and default parameter values support, and the screening logic commonly used for full-text retrieval support.
Optionally, in an embodiment of the present application, the search driving engine further includes at least one of a page turning section, an expansion section, a sorting section, and a version section corresponding to the recall configuration rule, and the data search method further includes: describing the page turning behavior of the retrieval result through a page turning part; describing an expansion field related to the retrieval request through an expansion part; describing a ranking policy of a retrieval result corresponding to the retrieval request by the ranking section; hot rollback, hot switches, and hot deployments between multiple configuration versions are described by the versions section.
The recall module further comprises a page turning part, an expansion part, a sorting part and a version part, and the page turning part, the expansion part, the sorting part and the version part are as follows: the page turning part is used for describing parameters of page turning behaviors of the retrieval result, simultaneously supports limitation of maximum page turning depth, can be used for scenes such as anti-crawlers and the like, and can understand that the page turning behaviors of the retrieval result can be defaulted, for example, each page shows ten pieces of data related to the retrieval result, and only five pages can be viewed each time; the expansion part is used for transmitting other parameters in the retrieval request, so that the expansibility of the retrieval request is increased, and the integrity and the accuracy of the retrieval result are improved; the sorting part is used for describing a sorting strategy name and ascending and descending information of the retrieval result; the version section is used to describe configuration version information, and hot rollback, hot switch, and hot deployment among multiple configuration versions.
Optionally, in an embodiment of the present application, when the retrieval configuration rule includes a sorting configuration rule, parsing the retrieval configuration rule to generate structured data including the retrieval element includes: analyzing the sorting configuration rule, setting a sorting mode for the retrieval result of the retrieval request according to the analysis result, and generating corresponding structured data indicating the sorting mode.
The retrieval driving engine acquires retrieval configuration rules from a configuration platform, the retrieval configuration rules comprise sequencing configuration rules, the retrieval driving engine comprises a sequencing module, it needs to be noted that a sequencing part in the recall module is used for setting a unique identifier of the sequencing module and is used for connecting the recall module and the sequencing module, the sequencing module is used for analyzing the sequencing configuration rules, a sequencing mode is set for a retrieval result of a retrieval request according to an analysis result, and corresponding structured data indicating the sequencing mode is generated. Optionally, calculating the text matching degree of the configuration parameters through a sorting module to obtain a basic value; calculating to obtain a comprehensive value through different function combinations according to the index field and the weight of the index field; calculating according to the parameters of the retrieval request to obtain an adjustment value; and matching the sorting mode of the retrieval result according to the basic value, the comprehensive value and the adjusting value. Illustratively, the text matching degree of the configuration parameters is calculated through a BM25 algorithm in the sorting module to obtain a basic value, and the weights of different characteristic values can be weighted according to single matching, nested type matching and Boolean type matching in the retrieval types to obtain a basic value representing the text matching degree; calculating a characteristic value through fields in the index and the weight of the index fields, and calculating the characteristic value through functions such as a random function, an attenuation function and the like to obtain a comprehensive value; and calculating the characteristic value through the parameters in the retrieval request of the user to obtain an adjustment value. The sorting module controls and configures the basic value, the comprehensive value and the adjusting value to match sorting configuration parameters in a final sorting mode of the retrieval result, so that the effectiveness and the accuracy of the retrieval result are improved.
And 103, generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule.
The retrieval driving engine in the application generates a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule, wherein the DSL statement is an inquiry statement in the Elasticissearch and in a corresponding format.
Further, the retrieval configuration rule corresponding to the retrieval request of the user is obtained from the configuration platform, and optionally, in an embodiment of the present application, the data retrieval method further includes: comparing various retrieval results obtained according to various retrieval configuration rules through a retrieval driving engine to obtain comparison results; and modifying the retrieval driving engine according to the comparison result.
According to the method and the device, various retrieval configuration rules corresponding to retrieval requests of users are obtained from a configuration platform, a retrieval driving engine can obtain various retrieval results according to the various retrieval configuration rules, and parameters corresponding to a recall module and a sorting module in the retrieval driving engine are modified after the various retrieval results are compared, so that the accuracy of the retrieval results obtained by the retrieval driving engine according to the retrieval configuration rules is improved.
Furthermore, the retrieval driving engine comprises a cache module, and the retrieval configuration rules are cached through the cache module, so that the retrieval configuration rules corresponding to a plurality of retrieval requests are compared, and parameters in the retrieval driving engine are modified, so that the accuracy of retrieval results obtained by the retrieval driving engine according to the retrieval configuration rules is improved.
Further, on the basis of step 101-103, optionally, in an embodiment of the present application, the data retrieval method further includes the following steps: transmitting the DSL statement to an Elasticissearch for processing, and acquiring a retrieval result corresponding to the retrieval request; and sending the retrieval result to the user.
In the embodiment of the application, after the DSL statement is obtained, the DSL statement is also submitted to an Elasticsearch for query processing, a retrieval result corresponding to the retrieval request is obtained, and the retrieval result is returned to the user.
According to the data retrieval method, the retrieval configuration rule corresponding to the retrieval request is obtained from the configuration platform, and only configuration parameters and operation relations in the retrieval configuration rule need to be analyzed to generate structured data containing retrieval elements; and generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule. When the retrieval request of the user changes, the retrieval request can be converted into the DSL statement only by analyzing the configuration parameters and the operation relation in the retrieval configuration rule through the retrieval driving engine, developers are not required to provide a development version corresponding to each retrieval request, professional programming developers are not required, one development version is shared in the whole retrieval process, the quick positioning of different retrieval requests can be realized, the data retrieval efficiency is improved, and the query experience of the user is improved.
Example II,
A second embodiment of the present application provides a data retrieval method, where the data retrieval method is executed by a configuration platform, as shown in fig. 2, fig. 2 is a flowchart of another data retrieval method provided in the second embodiment of the present application, and the data retrieval method includes the following steps:
step 201, according to the retrieval key information obtained after analyzing the retrieval request of the user, matching the retrieval key information in the configuration platform to obtain the configuration parameters and the operation relationship between the configuration parameters.
The configuration platform is stored with a plurality of configuration parameters for processing the retrieval request and operation relations among the configuration parameters in advance. The configuration platform in the present application has a storage function, and the embodiments of the present application are not limited thereto.
Optionally, in an embodiment of the present application, when the retrieval request is used to request to perform a data recall operation, the retrieval key information is matched in the configuration platform according to the retrieval key information corresponding to the retrieval request to obtain a recall configuration parameter; when the retrieval result corresponding to the retrieval request is subjected to sorting operation, sorting configuration parameters which are obtained by matching the retrieval result are configured on the configuration platform according to the retrieval key information corresponding to the retrieval request, wherein the configuration parameters comprise recall configuration parameters and sorting configuration parameters.
The retrieval request is analyzed to obtain retrieval key information, the configuration platform matches the retrieval key information to obtain configuration parameters and an operation relation between the configuration parameters, the configuration parameters comprise recall configuration parameters and sequencing configuration parameters, and the configuration parameters are related to the retrieval request of the user.
Optionally, in an embodiment of the present application, when the retrieval request includes multiple sets of data in multiple sets of conditional scenarios, the retrieval request is matched in the configuration platform, and a configuration parameter for supporting nesting and an operation relationship for indicating a nested matching operation on the configuration parameter are obtained; when retrieval variables of retrieval requests have different values, matching the retrieval requests in a configuration platform to obtain different configuration parameters for supporting logic branches and an operation relation for indicating the combination and matching operation of the configuration parameters; when the retrieval object of the retrieval request comprises an array, matching the retrieval request in a configuration platform to obtain configuration parameters for supporting logic loop processing and an operation relation for indicating Boolean group matching operation on the configuration parameters; and when the retrieval key information in the retrieval request is a default value, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting the logic processing of the default value and the default keyword and an operation relation for indicating default assignment operation on the configuration parameters.
If the retrieval requests are different, configuration parameters and operation relations obtained by matching the retrieval requests in the configuration platform are also different, four examples are listed here to illustrate the matching of the retrieval requests in the configuration platform, and in the first example, when various Boolean logic operation relations exist among different configuration parameters, the configuration platform is used for matching the retrieval request configuration to support the infinite expansion of the transverse Boolean logic operation and the infinite nested operation relation of the longitudinal Boolean logic operation among the configuration parameters, so that the accuracy of the retrieval configuration rule is improved. In a second example, when values of retrieval variables of the retrieval requests are different, in the example, when the configuration parameter has _ video is 0, the logical branch of the data union in which "has _ video is 0" and "has _ video field does not exist" is taken, otherwise, another logical branch of the data in which "has _ video completely matches" is taken, that is, values of the configuration parameters are different, and corresponding operational relationships are also different, and the configuration platform configures, for the retrieval request, different configuration parameters for supporting the logical branches and an operational relationship for indicating a combined matching operation on the configuration parameters. A third example, when the retrieval object of the retrieval request includes an array, is to filter the beijing college entrance examination questions of two years of 2010 and 2014, wherein year in the paperTagList represents year, paperTagId "599 dcce" represents beijing area volume label, src. In a fourth example, when the retrieval key information in the retrieval request is a default value, in the example, the true topic of the college entrance examination in two years, namely 2010 and 2014, is screened, and the region to which the true topic belongs is not defined, the configuration platform configures, for the retrieval request, configuration parameters for retrieving any region to which the true topic belongs and an operation relationship for indicating default assignment operation on the configuration parameters. The configuration platform can match different retrieval requests to obtain configuration parameters and operation relations suitable for the retrieval requests, so that the retrieval requests can be different through the different configuration parameters and operation relations, decoupling between the retrieval requests and the retrieval driving engine is achieved, and the retrieval driving engine can have independent logic and does not change along with the different retrieval requests.
Step 202, generating a retrieval configuration rule according to the configuration parameters and the operational relationship between the configuration parameters, and sending the retrieval configuration rule to a retrieval driving engine, so that the retrieval driving engine generates structured data containing retrieval elements according to the retrieval configuration rule.
The configuration platform is a storage tool and related to retrieval requests of users, and when the retrieval requests of the users are different, the configuration platform is used for embodying the retrieval requests, namely the configuration platform is used for matching retrieval key information to obtain configuration parameters and embodying the operation relationship between the configuration parameters. The retrieval driving engine is realized by the same set of codes, is irrelevant to the retrieval request of a user and only relevant to the retrieval, and can analyze different retrieval configuration rules, thereby realizing the decoupling of the retrieval request and the retrieval driving engine and supporting different retrieval requests.
Further, on the basis of step 201-202, optionally, in an embodiment of the present application, the data retrieval method further includes the following steps: acquiring an updated retrieval request; and dynamically generating a retrieval configuration rule corresponding to the updated retrieval request in the configuration platform according to the updated retrieval request so as to realize dynamic configuration.
In the retrieval process, if the retrieval request of the user is updated, the updated retrieval request is obtained, and the retrieval configuration rule corresponding to the updated retrieval request is dynamically generated in the configuration platform, so that the retrieval driving engine generates the retrieval result corresponding to the updated retrieval request according to the updated retrieval configuration rule, the response speed to the retrieval request is improved, and the retrieval experience of the user is improved.
Example III,
The data retrieval method provided in the first embodiment of the present application is executed by a retrieval driver engine, and the data retrieval method provided in the second embodiment of the present application is executed by a configuration platform, and the implementation of the data retrieval method is described through interaction between the retrieval driver engine and the configuration platform in the embodiment of the present application, as shown in fig. 3, fig. 3 is a structural block diagram of a retrieval driver engine provided in the embodiment of the present application.
The retrieval request of the user is obtained through the configuration platform 31, the retrieval request of the user is analyzed to obtain retrieval key information, and the retrieval key information is matched to obtain the configuration parameters and the operation relation between the configuration parameters. The configuration platform 31 may be an arbitrarily configured configuration platform 31 having a storage function. The configuration platform 31 further generates a retrieval configuration rule according to the configuration parameters and the operational relationship between the configuration parameters, and sends the retrieval configuration rule to the retrieval driving engine 32.
The search driver engine 32 acquires a search arrangement rule corresponding to a search request from the arrangement platform 31, and the search driver engine 32 has an independent logic and analyzes the search arrangement rule to generate structured data including a search element. Optionally, the retrieval driving engine 32 includes a recall module 321 and a sorting module 322, the recall module 321 is configured to perform a formatted query parsing process on a recall configuration rule in the retrieval configuration rules, the recall module 321 converts recall configuration parameters and call data into various matching modes corresponding to retrieval types, where the retrieval types include, but are not limited to, nested matching (nested), combined matching (combine), boolean group matching (object), default matching (default), perfect matching (term/term), range matching (range), participle matching (match), phrase matching (matchscript), script matching (script), boolean matching (bone), existence matching (exists), and the like as in the first embodiment, and when the recall module 321 converts the recall configuration parameters and the call data, structured data including retrieval elements can be generated through matching modes such as perfect matching, range query, structured query, and the like, it can be understood that structured data including search elements may also be generated in other matching manners, which is not limited in this embodiment of the present application; the sorting module 322 is configured to match and sort the sorting configuration rules in the retrieval configuration rules, and generate structured data including the retrieval elements through matching manners such as full-text retrieval, matching weights, and sorting scripts, for example, the text matching degree of the configuration parameters is calculated through the matching manner of the full-text retrieval, the index field is calculated through the matching weights, the parameters in the retrieval request of the user are calculated through the matching manner of the sorting scripts, and the calculation results of each part are configured in a controlled manner, so that the sorting configuration parameters are matched in the final sorting manner of the retrieval results, which can be understood, or the structured data including the retrieval elements can be generated through other matching manners, which does not limit the embodiment of the present application; then, the retrieval driving engine 32 further generates a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule, and transmits the DSL statement to the Elasticsearch33 for processing, so as to obtain a retrieval result corresponding to the retrieval request. Different retrieval requests are reflected by the configuration parameters matched with the retrieval requests in the configuration platform and the operation relation between the configuration parameters, the retrieval driving engine is irrelevant to the different retrieval requests and only relevant to retrieval, and different retrieval configuration rules can be analyzed to support the different retrieval requests. When the retrieval request of a user changes, the retrieval request can be converted into a DSL statement only by analyzing the configuration parameters and the operation relation in the retrieval configuration rule through the retrieval driving engine, developers are not required to provide a development version corresponding to each retrieval request, professional programming developers are not required, one development version is shared in the whole retrieval process, the quick positioning of different retrieval requests can be realized, the data retrieval efficiency is improved, and the query experience of the user is improved.
The retrieval driving engine 32 further comprises a caching module 323, an ABTest324 and a version module 325, wherein the caching module 323 is used for caching a plurality of retrieval configuration rules; the ABTest324 is used for making different configuration strategies for the same retrieval request, namely configuring a plurality of retrieval configuration rules for one retrieval request, comparing a plurality of retrieval results obtained according to the plurality of retrieval configuration rules to obtain a comparison result, and modifying parameters in the retrieval driving engine 32 according to the comparison result so as to improve the accuracy of the retrieval result obtained by the retrieval driving engine 32 according to the retrieval configuration rules; the version module 325 is configured to control hot rollback, hot switch, and hot deployment among multiple configuration versions, it should be noted that the version portion in the recall module 321 is configured to describe version information of each retrieval configuration rule, and the version module 325 manages the retrieval configuration rules of multiple versions through the version information of each retrieval configuration rule.
Example four,
As shown in fig. 4, fig. 4 is a data retrieval device provided in this embodiment of the present application, where the device 40 includes an obtaining module 401, an analyzing module 402, and a statement generating module 403;
the obtaining module 401 is configured to obtain, from the configuration platform, a retrieval configuration rule corresponding to a retrieval request of a user, where the retrieval configuration rule includes a configuration parameter and an operation relationship between the configuration parameters;
the analysis module 402 is configured to analyze the search configuration rule to generate structured data including search elements;
the statement generating module 403 is configured to generate a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule.
Optionally, in an embodiment of the present application, the parsing module 402 is further configured to perform, according to the retrieved configuration rule, at least one of the following parsing processes on the configuration parameter: and splicing, assembling, associating and logically operating to generate structured data containing the retrieval elements.
Optionally, in an embodiment of the present application, the operation relationship indicates that an operation related to a retrieval type corresponding to the DSL statement is performed on the configuration parameter, and the structured data is structured data of retrieval logic supporting the retrieval type.
Optionally, in an embodiment of the present application, the retrieval type includes at least one of nested matching, combined matching, boolean group matching, and default keywords, and the parsing module 402 is further configured to, when the operation relationship indicates that the nested matching operation is performed on the configuration parameter, perform logic processing of depth and breadth expansion on the configuration parameter, and generate structured data including data used for performing the nested matching; when the operation relation indicates that the configuration parameters are subjected to combined matching operation, carrying out logic processing of logic branches on the configuration parameters to generate structured data for carrying out combined matching; when the operation relation indicates that Boolean group matching operation is performed on the configuration parameters, performing logic circulation logic processing on the configuration parameters to generate structured data for performing Boolean group matching; and when the operation relation indicates that default assignment operation is performed on the configuration parameters, performing logic processing of default values and default keywords on the configuration parameters, and generating structured data containing the default assignments.
Optionally, in one embodiment of the present application, the search type includes at least one of a perfect match, a range match, a participle match, a phrase match, a script match, a boolean match, and a presence match.
Optionally, in an embodiment of the present application, the retrieval configuration rule includes a recall configuration rule, the data retrieval method is executed by a retrieval driving engine, the retrieval driving engine includes an application portion, an index portion and a filtering portion, the application portion corresponds to the recall configuration rule, and the parsing module 402 is further configured to add an identifier to the configuration parameter in the recall configuration rule; describing a retrieval index name, a retrieval index type and a retrieval field corresponding to the retrieval request through the index part; the filtering conditions and keywords related to the retrieval type corresponding to the DSL statement are described by the filtering section.
Optionally, in an embodiment of the present application, the search driving engine further includes at least one of a page turning part, an expansion part, a sorting part, and a version part corresponding to the recall configuration rule, and the parsing module 402 is further configured to describe a page turning behavior of the search result through the page turning part; describing an expansion field related to the retrieval request through an expansion part; describing a ranking policy of a retrieval result corresponding to the retrieval request by the ranking section; hot rollback, hot switches, and hot deployments between multiple configuration versions are described by the versions section.
Optionally, in an embodiment of the present application, when the retrieval configuration rule includes a sorting configuration rule, the parsing module 402 is further configured to parse the sorting configuration rule, set a sorting manner for the retrieval result of the retrieval request according to the parsing result, and generate corresponding structured data indicating the sorting manner.
Optionally, in an embodiment of the present application, the retrieval configuration rule obtained from the configuration platform and corresponding to the retrieval request of the user includes multiple types, and the data retrieval device 40 further includes a modification module, where the modification module is configured to compare multiple types of retrieval results obtained according to the multiple types of retrieval configuration rules by using the retrieval driving engine to obtain a comparison result; and modifying the retrieval driving engine according to the comparison result.
Optionally, in an embodiment of the present application, the data retrieving device 40 further includes a retrieval result sending module, where the retrieval result sending module is configured to transmit the DSL statement to the Elasticsearch for processing, and obtain a retrieval result corresponding to the retrieval request; and sending the retrieval result to the user.
The data retrieval device of this embodiment is used to implement the corresponding data retrieval method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the data retrieval device of this embodiment can refer to the description of the corresponding part in the foregoing method embodiments, and is not repeated herein.
Example V,
An embodiment of the present application provides a data retrieval apparatus, as shown in fig. 5, fig. 5 is the data retrieval apparatus provided in the embodiment of the present application, and the data retrieval apparatus 50 includes a matching module 501 and a retrieval configuration rule generating module 502;
the matching module 501 is configured to match the retrieval key information in the configuration platform according to the retrieval key information obtained by analyzing the retrieval request of the user, so as to obtain an operational relationship between the configuration parameters and a plurality of configuration parameters, where the configuration platform stores a plurality of configuration parameters for processing the retrieval request in advance and an operational relationship between the configuration parameters;
the retrieval configuration rule generating module 502 is configured to generate a retrieval configuration rule according to the configuration parameters and the operational relationship between the configuration parameters, and send the retrieval configuration rule to the retrieval driving engine, so that the retrieval driving engine generates structured data including retrieval elements according to the retrieval configuration rule.
Optionally, in an embodiment of the present application, the matching module 501 is further configured to, when the retrieval request is used to request to perform a data recall operation, match the retrieval key information in the configuration platform according to the retrieval key information corresponding to the retrieval request to obtain a recall configuration parameter; the matching module 501 is further configured to, when performing a sorting operation on a retrieval result corresponding to the retrieval request, configure, on the configuration platform, a sorting configuration parameter obtained by matching the retrieval result according to the retrieval key information corresponding to the retrieval request, where the configuration parameter includes a recall configuration parameter and a sorting configuration parameter.
Optionally, in an embodiment of the present application, the matching module 501 is further configured to, when the retrieval request includes multiple sets of data in multiple sets of conditional scenarios, match the retrieval request in the configuration platform to obtain configuration parameters for supporting nesting and an operation relationship for indicating a nesting matching operation on the configuration parameters; the matching module 501 is further configured to, when retrieval variables of the retrieval requests have different values, match the retrieval requests in the configuration platform to obtain different configuration parameters for supporting the logic branches and an operation relationship for instructing to perform a combination matching operation on the configuration parameters; the matching module 501 is further configured to, when a retrieval object of the retrieval request includes an array, match the retrieval request in the configuration platform to obtain a configuration parameter for supporting logic loop processing and an operation relationship for indicating to perform boolean matching operation on the configuration parameter; the matching module 501 is further configured to, when the retrieval key information in the retrieval request is a default value, match the retrieval request in the configuration platform to obtain a configuration parameter for supporting logic processing of the default value and the default keyword and an operation relationship for indicating default assignment operation on the configuration parameter.
Optionally, in an embodiment of the present application, the data retrieving apparatus 50 further includes a dynamic generation module, where the dynamic generation module is configured to obtain the updated retrieving request; and dynamically generating a retrieval configuration rule corresponding to the updated retrieval request in the configuration platform according to the updated retrieval request so as to realize dynamic configuration.
The data retrieval device of this embodiment is used to implement the corresponding data retrieval method in the foregoing multiple method embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described herein again. In addition, the functional implementation of each module in the data retrieval device of this embodiment can refer to the description of the corresponding part in the foregoing method embodiments, and is not repeated herein.
Example six,
Based on any data retrieval method described in the first to third embodiments, the embodiments of the present application provide an electronic device, and it should be noted that the data retrieval method of the present embodiment may be executed by any appropriate electronic device with data processing capability, including but not limited to: server, mobile terminal (such as mobile phone, PAD, etc.), PC, etc. As shown in fig. 6, fig. 6 is a structural diagram of an electronic device according to an embodiment of the present application. The specific embodiments of the present application do not limit the specific implementation of the electronic device. The electronic device 60 may include: a processor (processor)602, a communication Interface 604, a memory 606, and a communication bus 608.
Wherein: the processor 602, communication interface 604, and memory 606 communicate with one another via a communication bus 608.
A communication interface 604 for communicating with other electronic devices or servers.
The processor 602 is configured to execute the computer program 610, and may specifically perform relevant steps in the above-described data retrieval method embodiment.
In particular, the computer program 610 may comprise computer program code comprising computer operating instructions.
The processor 602 may be a central processing unit CPU, or an application Specific Integrated circuit asic, or one or more Integrated circuits configured to implement embodiments of the present application. The intelligent device comprises one or more processors which can be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
A memory 606 for storing a computer program 610. Memory 606 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The computer program 610 may be specifically adapted to cause the processor 602 to perform the following operations:
acquiring a retrieval configuration rule corresponding to a retrieval request of a user from a configuration platform, wherein the retrieval configuration rule comprises configuration parameters and an operation relation between the configuration parameters;
analyzing the retrieval configuration rule to generate structured data containing retrieval elements;
and generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule.
Optionally, in an embodiment of the present application, the computer program 610 may be further configured to cause the processor 602, when parsing the search configuration rule to generate the structured data including the search element, to perform at least one of the following parsing processes on the configuration parameters according to the configuration parameters in the search configuration rule and the operational relationship between the configuration parameters: and splicing, assembling, associating and logically operating to generate structured data containing the retrieval elements.
In an optional embodiment, the operational relationship indicates that an operation related to a retrieval type corresponding to the DSL statement is performed on the configuration parameter, and the structured data is structured data of retrieval logic supporting the retrieval type.
Optionally, in an embodiment of the present application, the retrieval type includes at least one of nested matching, combined matching, boolean group matching, and a default keyword, and the computer program 610 may be further configured to enable the processor 602, when the operation relationship indicates that the nested matching operation is performed on the configuration parameter, to perform logic processing of depth and breadth expansion on the configuration parameter, and generate a structured data containing data for performing the nested matching; the computer program 610 may be further configured to enable the processor 602 to perform logical processing of logical branching on the configuration parameters when the operation relationship indicates that a combination matching operation is performed on the configuration parameters, and generate a configuration file containing structured data for performing combination matching; the computer program 610 may be further configured to cause the processor 602 to perform logic processing of a logic loop on the configuration parameters when the operation relationship indicates that a boolean group matching operation is performed on the configuration parameters, and generate a data structure containing structured data for performing boolean group matching; the computer program 610 may be further configured to enable the processor 602 to perform logic processing on default values and default keywords on the configuration parameters when the operation relationship indicates that a default assignment operation is performed on the configuration parameters, and generate structured data containing data for performing the default assignment.
In an alternative embodiment, the search type includes at least one of a full match, a range match, a participle match, a phrase match, a script match, a boolean match, and a presence match.
Optionally, in an embodiment of the present application, the retrieval configuration rule comprises a recall configuration rule, the data retrieval method is performed by a retrieval driving engine, the retrieval driving engine comprises an application part, an index part and a filter part corresponding to the recall configuration rule, and the computer program 610 is further operable to cause the processor 602 to: adding an identifier to the configuration parameters in the recall configuration rule through the application part; describing a retrieval index name, a retrieval index type and a retrieval field corresponding to the retrieval request through the index part; the filtering conditions and keywords related to the retrieval type corresponding to the DSL statement are described by the filtering section.
Optionally, in an embodiment of the present application, the search driving engine further includes at least one of a page turning section, an expansion section, a sorting section, and a version section corresponding to the recall configuration rule, and the computer program 610 may be further configured to cause the processor 602 to: describing the page turning behavior of the retrieval result through a page turning part; describing an expansion field related to the retrieval request through an expansion part; describing a ranking policy of a retrieval result corresponding to the retrieval request by the ranking section; hot rollback, hot switches, and hot deployments between multiple configuration versions are described by the versions section.
Optionally, in an embodiment of the present application, the retrieval configuration rule includes a sorting configuration rule, and the computer program 610 may be further configured to enable the processor 602, when analyzing the retrieval configuration rule and generating structured data including the retrieval element, to analyze the sorting configuration rule, set a sorting manner for a retrieval result of the retrieval request according to the analysis result, and generate corresponding structured data indicating the sorting manner.
Optionally, in an embodiment of the present application, the obtaining of the retrieval configuration rule corresponding to the retrieval request of the user from the configuration platform includes multiple types, and the computer program 610 may be further configured to cause the processor 602 to perform the following steps: comparing various retrieval results obtained according to various retrieval configuration rules through a retrieval driving engine to obtain comparison results; and modifying the retrieval driving engine according to the comparison result.
Optionally, in an embodiment of the present application, the computer program 610 may be further configured to cause the processor 602 to perform the following steps: transmitting the DSL statement to an Elasticissearch for processing, and acquiring a retrieval result corresponding to the retrieval request; and sending the retrieval result to the user.
The computer program 610 may particularly be adapted to cause the processor 602 to perform the steps of: according to retrieval key information obtained after analyzing a retrieval request of a user, matching the retrieval key information in a configuration platform to obtain configuration parameters and an operation relation between the configuration parameters, wherein the configuration platform stores a plurality of configuration parameters for processing the retrieval request and the operation relation between the configuration parameters in advance; and generating a retrieval configuration rule according to the configuration parameters and the operation relation between the configuration parameters, and sending the retrieval configuration rule to a retrieval driving engine so that the retrieval driving engine generates structured data containing retrieval elements according to the retrieval configuration rule.
Optionally, in an embodiment of the present application, the computer program 610 may be further configured to enable the processor 602, when obtaining an operational relationship between a configuration parameter and the configuration parameter by matching the retrieval key information in the configuration platform according to the retrieval key information obtained by analyzing the retrieval request of the user, and when the retrieval request is used for requesting to perform a data recall operation, obtain a recall configuration parameter by matching the retrieval key information in the configuration platform according to the retrieval key information corresponding to the retrieval request; when the retrieval result corresponding to the retrieval request is subjected to sorting operation, sorting configuration parameters which are obtained by matching the retrieval result are configured on the configuration platform according to the retrieval key information corresponding to the retrieval request, wherein the configuration parameters comprise recall configuration parameters and sorting configuration parameters.
Optionally, in an embodiment of the present application, the computer program 610 may be further configured to cause the processor 602 to perform the following steps: when the retrieval request comprises a plurality of groups of data under a plurality of groups of condition scenes, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting nesting and an operation relation for indicating the nesting matching operation of the configuration parameters; when retrieval variables of retrieval requests have different values, matching the retrieval requests in a configuration platform to obtain different configuration parameters for supporting logic branches and an operation relation for indicating the combination and matching operation of the configuration parameters; when the retrieval object of the retrieval request comprises an array, matching the retrieval request in a configuration platform to obtain configuration parameters for supporting logic loop processing and an operation relation for indicating Boolean group matching operation on the configuration parameters; and when the retrieval key information in the retrieval request is a default value, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting the logic processing of the default value and the default keyword and an operation relation for indicating default assignment operation on the configuration parameters.
Optionally, in an embodiment of the present application, the computer program 610 may be further configured to cause the processor 602 to perform the following steps: acquiring an updated retrieval request; and dynamically generating a retrieval configuration rule corresponding to the updated retrieval request in the configuration platform according to the updated retrieval request so as to realize dynamic configuration. It can be understood that, for convenience and brevity of description, it can be clearly understood by those skilled in the art that the specific working processes of the above-described devices and modules may refer to the corresponding process descriptions in the foregoing method embodiments, and are not described herein again.
Example seven,
Based on the data retrieval methods described in the first to third embodiments, an embodiment of the present application provides a computer storage medium storing a computer program, and the computer program, when executed by a processor, implements the data retrieval methods described in the first to third embodiments.
It should be noted that, according to the implementation requirement, each component/step described in the embodiment of the present application may be divided into more components/steps, and two or more components/steps or partial operations of the components/steps may also be combined into a new component/step to achieve the purpose of the embodiment of the present application.
The above-described methods according to embodiments of the present application may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD ROM, a RAM, a floppy disk, a hard disk, or a magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium downloaded through a network and to be stored in a local recording medium, so that the methods described herein may be stored in such software processes on a recording medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware such as an ASIC or FPGA. It will be appreciated that the computer, processor, microprocessor controller or programmable hardware includes memory components (e.g., RAM, ROM, flash memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor or hardware, implements the data retrieval methods described herein. Further, when a general-purpose computer accesses code for implementing the data retrieval method shown herein, execution of the code transforms the general-purpose computer into a special-purpose computer for performing the data retrieval method shown herein.
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.
Those of ordinary skill in the art will appreciate that the various illustrative elements and method steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. 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 embodiments of the present application.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above embodiments are only used for illustrating the embodiments of the present application, and not for limiting the embodiments of the present application, and those skilled in the relevant art can make various changes and modifications without departing from the spirit and scope of the embodiments of the present application, so that all equivalent technical solutions also belong to the scope of the embodiments of the present application, and the scope of patent protection of the embodiments of the present application should be defined by the claims.

Claims (15)

1. A method for data retrieval, the method comprising:
a retrieval driving engine acquires retrieval configuration rules corresponding to a retrieval request of a user from a configuration platform, wherein the retrieval configuration rules comprise configuration parameters and operation relations between the configuration parameters, and the retrieval driving engine is irrelevant to the retrieval request of the user and analyzes different retrieval configuration rules by using a set of codes;
analyzing the retrieval configuration rule to generate structured data containing retrieval elements;
generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule;
the operation relation indicates that the configuration parameters are operated related to a retrieval type corresponding to a DSL statement, the structured data is structured data supporting retrieval logic of the retrieval type, and the retrieval type comprises at least one of nesting matching, combination matching, Boolean group matching and default keywords; when the operation relation indicates that the nesting matching operation is carried out on the configuration parameters, carrying out logic processing of depth and breadth expansion on the configuration parameters to generate structured data for nesting matching; when the operation relation indicates that the configuration parameters are subjected to combined matching operation, performing logic processing of logic branches on the configuration parameters to generate structured data for combined matching; when the operation relation indicates that Boolean group matching operation is performed on the configuration parameters, performing logic circulation logic processing on the configuration parameters to generate structured data for performing Boolean group matching; and when the operation relation indicates that default assignment operation is performed on the configuration parameters, performing logic processing of default values and default keywords on the configuration parameters, and generating structured data containing the default assignments.
2. The method of claim 1, wherein parsing the search configuration rule to generate structured data including search elements comprises:
according to the configuration parameters in the retrieval configuration rule and the operation relationship between the configuration parameters, performing at least one of the following analysis processing on the configuration parameters: and splicing, assembling, associating and logically operating to generate structured data containing the retrieval elements.
3. The method of claim 1, wherein the search type further comprises at least one of a full match, a range match, a participle match, a phrase match, a script match, a boolean match, and a presence match.
4. The method of any one of claims 1-3, wherein retrieving configuration rules comprises recalling configuration rules, wherein the data retrieval method is performed by a retrieval driven engine comprising an application portion, an index portion, and a filter portion corresponding to the recall configuration rules, and wherein the method further comprises:
adding, by the application portion, an identification to a configuration parameter in the recall configuration rule;
describing a retrieval index name, a retrieval index type and a retrieval field corresponding to the retrieval request through the index part;
the screening conditions and keywords related to the retrieval type corresponding to the DSL statement are described by the screening part.
5. The method of claim 4, wherein the search driver engine further comprises at least one of a page flip section, an expansion section, a sort section, and a version section corresponding to the recall configuration rule, the method further comprising:
describing page turning behaviors of the retrieval result through the page turning part;
describing an extension field related to the retrieval request through the extension part;
describing a ranking policy of a retrieval result corresponding to the retrieval request by the ranking part;
hot rollback, hot switches, and hot deployments between multiple configuration versions are described by the version section.
6. The method according to any one of claims 1 to 3, wherein when the search configuration rule comprises a sort configuration rule, parsing the search configuration rule to generate structured data including search elements comprises:
and analyzing the sorting configuration rule, setting a sorting mode for the retrieval result of the retrieval request according to the analysis result, and generating corresponding structured data indicating the sorting mode.
7. The method of claim 4, wherein the retrieval driving engine obtains the retrieval configuration rule corresponding to the retrieval request of the user from the configuration platform, and the method further comprises:
comparing various retrieval results obtained according to the various retrieval configuration rules through the retrieval driving engine to obtain comparison results;
and modifying the retrieval driving engine according to the comparison result.
8. The method according to any one of claims 1-3, further comprising:
transmitting the DSL statement to an Elasticissearch for processing, and acquiring a retrieval result corresponding to the retrieval request;
and sending the retrieval result to the user.
9. A method for data retrieval, the method comprising:
according to retrieval key information obtained after analyzing a retrieval request of a user, matching the retrieval key information in a configuration platform to obtain configuration parameters and an operation relation between the configuration parameters, wherein the configuration platform stores a plurality of configuration parameters for processing the retrieval request in advance and the operation relation between the configuration parameters; when the retrieval request comprises a plurality of groups of data under a plurality of groups of condition scenes, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting nesting and an operation relation for indicating the nesting matching operation on the configuration parameters; when retrieval variables of the retrieval requests have different values, matching the retrieval requests in the configuration platform to obtain different configuration parameters for supporting logic branches and an operation relation for indicating the combination and matching operation of the configuration parameters; when the retrieval object of the retrieval request comprises an array, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting logic loop processing and an operation relation for indicating Boolean group matching operation on the configuration parameters; when the retrieval key information in the retrieval request is a default value, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting the logic processing of the default value and the default keyword and an operation relation for indicating default assignment operation on the configuration parameters;
and generating a retrieval configuration rule according to the operation relationship between the configuration parameters and the configuration parameters, and sending the retrieval configuration rule to a retrieval driving engine so that the retrieval driving engine generates structured data containing retrieval elements according to the retrieval configuration rule, wherein the retrieval driving engine is irrelevant to the retrieval request of the user and analyzes different retrieval configuration rules by using a set of codes.
10. The method according to claim 9, wherein the matching the retrieval key information in the configuration platform according to the retrieval key information obtained by analyzing the retrieval request of the user to obtain the operational relationship between the configuration parameters comprises:
when the retrieval request is used for requesting to perform data recall operation, matching the retrieval key information in a configuration platform according to the retrieval key information corresponding to the retrieval request to obtain recall configuration parameters;
when the retrieval result corresponding to the retrieval request is subjected to sorting operation, according to the retrieval key information corresponding to the retrieval request, sorting configuration parameters obtained by matching the retrieval result are configured on a configuration platform, wherein the configuration parameters comprise the recall configuration parameters and the sorting configuration parameters.
11. The method of claim 9, further comprising:
acquiring an updated retrieval request;
and dynamically generating a retrieval configuration rule corresponding to the updated retrieval request in the configuration platform according to the updated retrieval request so as to realize dynamic configuration.
12. A data retrieval device is characterized by comprising an acquisition module, an analysis module and a statement generation module;
the retrieval driving engine is irrelevant to the retrieval request of the user, and different retrieval configuration rules are analyzed by using a set of codes;
the analysis module is used for analyzing the retrieval configuration rule to generate structured data containing retrieval elements; the operation relation indicates that the configuration parameters are operated related to a retrieval type corresponding to a DSL statement, the structured data is structured data supporting retrieval logic of the retrieval type, and the retrieval type comprises at least one of nesting matching, combination matching, Boolean group matching and default keywords; when the operation relation indicates that the nesting matching operation is carried out on the configuration parameters, carrying out logic processing of depth and breadth expansion on the configuration parameters to generate structured data for nesting matching; when the operation relation indicates that the configuration parameters are subjected to combined matching operation, performing logic processing of logic branches on the configuration parameters to generate structured data for combined matching; when the operation relation indicates that Boolean group matching operation is performed on the configuration parameters, performing logic circulation logic processing on the configuration parameters to generate structured data for performing Boolean group matching; when the operation relation indicates that default assignment operation is performed on the configuration parameters, performing logic processing of default values and default keywords on the configuration parameters to generate structured data for performing default assignment;
and the statement generating module is used for generating a DSL statement corresponding to the retrieval request according to the structured data and a preset DSL conversion rule.
13. A data retrieval device is characterized by comprising a matching module and a retrieval configuration rule generating module;
the matching module is used for matching the retrieval key information in a configuration platform according to the retrieval key information obtained after analyzing the retrieval request of the user to obtain an operation relation between configuration parameters and an operation relation between the configuration parameters, wherein the configuration platform stores a plurality of configuration parameters for processing the retrieval request in advance and the operation relation between the configuration parameters; when the retrieval request comprises a plurality of groups of data under a plurality of groups of condition scenes, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting nesting and an operation relation for indicating the nesting matching operation on the configuration parameters; when retrieval variables of the retrieval requests have different values, matching the retrieval requests in the configuration platform to obtain different configuration parameters for supporting logic branches and an operation relation for indicating the combination and matching operation of the configuration parameters; when the retrieval object of the retrieval request comprises an array, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting logic loop processing and an operation relation for indicating Boolean group matching operation on the configuration parameters; when the retrieval key information in the retrieval request is a default value, matching the retrieval request in the configuration platform to obtain configuration parameters for supporting the logic processing of the default value and the default keyword and an operation relation for indicating default assignment operation on the configuration parameters;
the retrieval configuration rule generating module is used for generating a retrieval configuration rule according to the operation relation between the configuration parameters and the configuration parameters, and sending the retrieval configuration rule to a retrieval driving engine so that the retrieval driving engine generates structured data containing retrieval elements according to the retrieval configuration rule, and the retrieval driving engine is irrelevant to the retrieval request of the user and analyzes different retrieval configuration rules by using a set of codes.
14. An electronic device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the data retrieval method of any one of claims 1-11.
15. A computer storage medium, on which a computer program is stored which, when being executed by a processor, carries out a data retrieval method as claimed in any one of claims 1 to 11.
CN202011105140.7A 2020-10-15 2020-10-15 Data retrieval method and device, electronic equipment and computer storage medium Active CN112015771B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011105140.7A CN112015771B (en) 2020-10-15 2020-10-15 Data retrieval method and device, electronic equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011105140.7A CN112015771B (en) 2020-10-15 2020-10-15 Data retrieval method and device, electronic equipment and computer storage medium

Publications (2)

Publication Number Publication Date
CN112015771A CN112015771A (en) 2020-12-01
CN112015771B true CN112015771B (en) 2021-06-29

Family

ID=73527360

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011105140.7A Active CN112015771B (en) 2020-10-15 2020-10-15 Data retrieval method and device, electronic equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN112015771B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112988661B (en) * 2021-02-19 2024-03-19 金蝶软件(中国)有限公司 Balance table updating method and related equipment thereof
CN115934794A (en) * 2022-11-30 2023-04-07 二十一世纪空间技术应用股份有限公司 Elastic management method for mass multi-source heterogeneous remote sensing space data query

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861753A (en) * 2017-06-26 2018-03-30 平安普惠企业管理有限公司 APP generations index, search method and system and readable storage medium storing program for executing
CN110647667A (en) * 2019-09-24 2020-01-03 北京华顺信安科技有限公司 DSL statement conversion and query method and device for asset retrieval
CN110727651A (en) * 2019-09-05 2020-01-24 深圳平安通信科技有限公司 Log processing method and device, terminal equipment and computer readable storage medium
CN111046060A (en) * 2019-12-11 2020-04-21 杭州安恒信息技术股份有限公司 Data retrieval method, device, equipment and medium based on elastic search
CN111143400A (en) * 2019-12-26 2020-05-12 长城计算机软件与系统有限公司 Full-stack type retrieval method, system, engine and electronic equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5320637B2 (en) * 2008-03-31 2013-10-23 株式会社Jsol Data search system, system, program, and data search method
JP4745417B2 (en) * 2009-04-21 2011-08-10 株式会社東芝 Information retrieval apparatus and program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107861753A (en) * 2017-06-26 2018-03-30 平安普惠企业管理有限公司 APP generations index, search method and system and readable storage medium storing program for executing
CN110727651A (en) * 2019-09-05 2020-01-24 深圳平安通信科技有限公司 Log processing method and device, terminal equipment and computer readable storage medium
CN110647667A (en) * 2019-09-24 2020-01-03 北京华顺信安科技有限公司 DSL statement conversion and query method and device for asset retrieval
CN111046060A (en) * 2019-12-11 2020-04-21 杭州安恒信息技术股份有限公司 Data retrieval method, device, equipment and medium based on elastic search
CN111143400A (en) * 2019-12-26 2020-05-12 长城计算机软件与系统有限公司 Full-stack type retrieval method, system, engine and electronic equipment

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
牵梦u.elasticsearch之排序和分页问题.《https://blog.csdn.net/qq_37891300/article/details/100108292》.2019, *
虚无境.ElasticSearch实战系列二: ElasticSearch的DSL语句使用教程---图文详解.《https://www.cnblogs.com/xuwujing/p/11567053.html》.2019, *
阿里云开发者社区.DSL的诞生|复杂sql转成Elasticsearch DSL深入详解.《https://developer.aliyun.com/article/707478》.2017, *

Also Published As

Publication number Publication date
CN112015771A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN111522922B (en) Log information query method and device, storage medium and computer equipment
US9785714B2 (en) Method and/or system for searching network content
CN111400186B (en) Performance test method and system
CN112015771B (en) Data retrieval method and device, electronic equipment and computer storage medium
US9311345B2 (en) Template based database analyzer
CA2245089A1 (en) Search system for providing fulltext search over web pages of world wide web servers
Biswas et al. Boa meets python: A boa dataset of data science software in python language
Wagner et al. Problem characterization and abstraction for visual analytics in behavior-based malware pattern analysis
CN111026670B (en) Test case generation method, test case generation device and storage medium
US8489631B2 (en) Distributing a query
US8489643B1 (en) System and method for automated content aggregation using knowledge base construction
CN108763323B (en) Meteorological grid point file application method based on resource set and big data technology
KR101877828B1 (en) User interface integrated platform system based on artificial intelligence
CN111400681A (en) Data permission processing method, device and equipment
CN109614312A (en) Method for generating test case, device, electronic equipment and storage medium
CN115033894A (en) Software component supply chain safety detection method and device based on knowledge graph
CN103324567B (en) A kind of adjustment method of application engine and debug system
KR100557874B1 (en) Method of scientific information analysis and media that can record computer program thereof
Mirandola et al. UML based performance modeling of distributed systems
CN116719735A (en) Test case generation method and device
CN112579604A (en) Test system number making method, device, equipment and storage medium
CN116991872A (en) Data query method, device and computer readable storage medium
CN112235124A (en) Method and device for configuring pico-cell, storage medium and electronic device
CN105912573A (en) Data updating method and data updating device
CN110472125B (en) Multistage page cascading crawling method and equipment based on web crawler

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
GR01 Patent grant
GR01 Patent grant