CN116303535A - Data query method and device, storage medium and electronic device - Google Patents

Data query method and device, storage medium and electronic device Download PDF

Info

Publication number
CN116303535A
CN116303535A CN202310226472.8A CN202310226472A CN116303535A CN 116303535 A CN116303535 A CN 116303535A CN 202310226472 A CN202310226472 A CN 202310226472A CN 116303535 A CN116303535 A CN 116303535A
Authority
CN
China
Prior art keywords
query
target
instruction
data
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310226472.8A
Other languages
Chinese (zh)
Inventor
张恩惠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202310226472.8A priority Critical patent/CN116303535A/en
Publication of CN116303535A publication Critical patent/CN116303535A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • G06F16/2445Data retrieval commands; View definitions
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data query method and device, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the data query method comprises the following steps: acquiring a query request input by a target object at a client, wherein the query request carries a data requirement to be queried; determining a query type corresponding to the target object based on the query request; determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server; and acquiring an execution result of the target instruction by the data service end to determine whether the query request is effectively responded, thereby solving the problems of low data query efficiency and the like between different end sides.

Description

Data query method and device, storage medium and electronic device
Technical Field
The application relates to the technical field of smart families, in particular to a data query method and device, a storage medium and an electronic device.
Background
At present, the number of front-end and back-end screening query components is relatively large, for example, if the front-end and back-end screening query components are displayed and used only in a front-end mode, and the standardization of the screening components on the transmission level of the front-end and back-end data interfaces is ignored. The current part B-terminal system screening query component has no standardization and unified development rule, and is greatly influenced by personal development habit of project developers. Therefore, when the new project related components are developed each time, the front end and the back end are required to develop and recheck codes, and interface transmission standards are formulated.
Aiming at the problem of low efficiency of data query between different end sides in the related technology, no effective solution has been proposed yet.
Accordingly, there is a need for improvements in the related art to overcome the drawbacks of the related art.
Disclosure of Invention
The embodiment of the invention provides a data query method and device, a storage medium and an electronic device, which are used for at least solving the problems of low data query efficiency and the like between different end sides.
According to an aspect of the embodiment of the invention, a data query method is provided, which is characterized in that a query request input by a target object at a client is obtained, wherein the query request carries a data requirement to be queried; determining a query type corresponding to the target object based on the query request; determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server; and acquiring an execution result of the target instruction by the data service end to determine whether the query request is effectively responded.
In an exemplary embodiment, determining, based on the query request, a query type corresponding to the target object includes: analyzing the query request and identifying a query field corresponding to the data requirement; matching the query field with a standard query field in the client, wherein the standard query field is field content corresponding to a target query request with a query frequency greater than a preset frequency; and determining the query type corresponding to the target object according to the query request determined by the matching result.
In an exemplary embodiment, determining, from a preset instruction library, a target instruction corresponding to the query type includes: determining rule information corresponding to the query type; inputting the rule information and the query type into the preset instruction library to obtain a target instruction, wherein the preset instruction library at least comprises: the method comprises the steps of obtaining first content corresponding to rule information, second content corresponding to query type, third content corresponding to instructions and corresponding relation among the first content, the second content and the third content.
In an exemplary embodiment, before sending the target instruction to the data server, the method further includes: configuring a corresponding target analyzer for the target instruction; the target analyzer is used for analyzing and executing the target instruction at a non-client; and sending the target analyzer to the data server.
In an exemplary embodiment, obtaining the execution result of the target instruction by the data service end to determine whether the query request is effectively responded to includes: extracting a candidate set in the execution result, wherein the candidate set comprises a plurality of groups of query response data; displaying the candidate set on a target display interface corresponding to the client; in the event that the target object is determined to consult the candidate set from the target display interface, it is determined that the query request is effectively responded to.
In an exemplary embodiment, after determining that the query request is effectively responded to, the method further comprises: determining the consulting frequency of the target object to a plurality of groups of inquiry response data in the candidate set; and carrying out association binding on the target query response data with highest reference frequency and the query request.
In an exemplary embodiment, after determining the target instruction corresponding to the query type from the preset instruction library, the method further includes: determining rule information corresponding to the target instruction and a target function; and packaging the target instructions with the same rule information and/or the same target function to obtain a target instruction component, and naming the target instruction component through a preset command rule.
According to another aspect of the embodiment of the present invention, there is also provided a data query apparatus, including: the acquisition module is used for acquiring a query request input by a target object at a client, wherein the query request carries data requirements to be queried; the determining module is used for determining the query type corresponding to the target object based on the query request; the sending module is used for determining a target instruction corresponding to the query type from a preset instruction library and sending the target instruction to a data server; and the response module is used for acquiring an execution result of the target instruction by the data server side so as to determine whether the query request is effectively responded.
According to yet another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described data query method when run.
According to still another aspect of the embodiments of the present invention, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the data query method through the computer program.
According to the method and the device, the query request input by the target object at the client is obtained, wherein the query request carries the data requirement to be queried; determining a query type corresponding to the target object based on the query request; determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server; and acquiring an execution result of the target instruction by the data service end to determine whether the query request is effectively responded. By adopting the technical scheme, the problems of low data query efficiency and the like between different end sides are solved, and the effect of improving the query efficiency is realized.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of an alternative data query method according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative data query method according to an embodiment of the present application;
FIG. 3 is a timing diagram of an alternative data query method according to an embodiment of the present application;
FIG. 4 is a diagram of an alternative data querying device according to an embodiment of the present invention;
FIG. 5 is a diagram of an alternative data querying device according to an embodiment of the invention;
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a data query method is provided. The data query method is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described data query method may be applied to a hardware environment constituted by a plurality of terminal devices 102 and servers 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to a plurality of terminal devices 102 through a network, and may be used to provide services (such as application services, etc.) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data operation services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a data query method is provided, which includes but is not limited to application to a terminal device, and it should be noted that the terminal device may be any device such as a mobile phone, a tablet, a computer, etc. that can install and run an application program related to the present invention, which is not limited to this embodiment. Fig. 2 is a flowchart of a data query method according to an embodiment of the present invention, the flowchart including the steps of:
step S202: acquiring a query request input by a target object at a client, wherein the query request carries a data requirement to be queried;
step S204: determining a query type corresponding to the target object based on the query request;
step S206: determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server;
step S208: and acquiring an execution result of the target instruction by the data service end to determine whether the query request is effectively responded.
Through the steps, a query request input by a target object at a client is obtained, wherein the query request carries data requirements to be queried; determining a query type corresponding to the target object based on the query request; determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server; and acquiring an execution result of the target instruction by the data service end to determine whether the query request is effectively responded. By adopting the technical scheme, the problems of low data query efficiency and the like between different end sides are solved, and the effect of improving the query efficiency is realized.
In an exemplary embodiment, determining, based on the query request, a query type corresponding to the target object includes: analyzing the query request and identifying a query field corresponding to the data requirement; matching the query field with a standard query field in the client, wherein the standard query field is field content corresponding to a target query request with a query frequency greater than a preset frequency; and determining the query type corresponding to the target object according to the query request determined by the matching result.
That is, the query field carried in the query request is matched with the standard query field, so that the query type corresponding to the query request sent by the target object is determined according to the matching result.
The matching process may include: and determining the similarity of the query field and the standard field, and determining that the matching is successful under the condition that the similarity is larger than a threshold value. Wherein the similarity comprises: the location similarity of each byte in the query field, and the number similarity of each byte in the query field.
And obtaining accurate values of the similarity according to the weights respectively corresponding to the position similarity and the number similarity.
Wherein: position similarity= (the same number of bytes as the byte position in the standard field/the total number of bytes in the standard field) ×100%; number similarity= (number of bytes as many as the number of bytes in the standard field/total number of bytes in the standard field) ×100%
For example: the query field is abcdef, the standard field is a0c00e0, and it can be seen that there are 3 in the query field, which are consistent with the number of bytes in the standard field, respectively: a. c, e; there are 2 identical positions: the method comprises the following steps: a. c. Then in the above example, position similarity= (2/7) ×100% = 29%; number similarity= (3/7) ×100% =43%. Taking the example that the weight of the number similarity is 80% and the weight of the position similarity is 20%, there is a similarity accuracy value= (43% ×0.8) + (29% ×0.2) =34.4% +5.8% =40.2%. If the threshold is 60%, the query field does not match the standard field.
In an exemplary embodiment, determining, from a preset instruction library, a target instruction corresponding to the query type includes: determining rule information corresponding to the query type; inputting the rule information and the query type into the preset instruction library to obtain a target instruction, wherein the preset instruction library at least comprises: the method comprises the steps of obtaining first content corresponding to rule information, second content corresponding to query type, third content corresponding to instructions and corresponding relation among the first content, the second content and the third content.
That is, different query types correspond to different rule information, and in order to determine the target instruction corresponding to the query type, the target instruction may be determined by a preset instruction library, where the preset instruction library is a database including query rules corresponding to different query types, query instructions corresponding to different query types, and query instructions corresponding to different query rules. Namely, inputting the query type, searching through a preset instruction library, and finding rule information and a target instruction corresponding to the query type.
Alternatively, the query types may include: explicit query types, fuzzy queries, range queries, matching queries, etc.
Optionally, if a query type is not recorded in the preset instruction library, the query type is analyzed. An implementation way of implementing the query request of the query type is determined, wherein the implementation way refers to which query rules are used.
That is, if the preset instruction library does not have the current query type, the query process of the query type is disassembled, and the query rules corresponding to the query types which are not recorded are obtained by combining the query rules recorded in the preset instruction library. The new query types and query rules are then recorded in a pre-set database.
In an exemplary embodiment, before sending the target instruction to the data server, the method further includes: configuring a corresponding target analyzer for the target instruction; the target analyzer is used for analyzing and executing the target instruction at a non-client; and sending the target analyzer to the data server.
It should be noted that, different instructions need to be parsed by different parsers to be executed, so before the target instruction is sent to the server, the parsers corresponding to the instructions need to be sent to the server.
Optionally, the method for configuring the corresponding target resolver for the target instruction includes: and determining the analysis duration of the instruction by the analyzer after the server receives the analyzer, and if the analysis duration is longer than the preset duration, considering that the analysis is failed. Determining the reason of the analysis failure, and restarting the analysis flow if the analysis failure is caused by poor network conditions; if the analysis failure is caused by mismatching of the analyzer and the instruction, the analyzer is reconfigured for the instruction, if the reconfigured analyzer still cannot complete the analysis of the instruction, a prompt is sent to the target object, and then whether the analyzer is to be upgraded is confirmed by the target object.
Optionally, the method for determining the reason of the parsing failure includes: a node is established for each step in the parsing process, and when a step is completed, the corresponding node is displayed as "completed". If a step fails to complete successfully, a "failure" is displayed. And further, according to the display state corresponding to the node, the analysis failure reason can be confirmed.
The above "completion" or "failure" is used as an example, and other marks, sounds, patterns, etc. that can be recognized and express similar intentions are also possible, and the present invention is not limited thereto.
In an exemplary embodiment, obtaining the execution result of the target instruction by the data service end to determine whether the query request is effectively responded to includes: extracting a candidate set in the execution result, wherein the candidate set comprises a plurality of groups of query response data; displaying the candidate set on a target display interface corresponding to the client; in the event that the target object is determined to consult the candidate set from the target display interface, it is determined that the query request is effectively responded to.
That is, after the target instruction is executed, one instruction corresponds to a plurality of pieces of alternative response data, the plurality of pieces of alternative response data are pushed to the target object, and if the target object makes a selection from the plurality of pieces of alternative response data, it is indicated that the query request corresponding to the instruction is valid.
And in a preset time period after pushing the plurality of candidate response data to the target object, if the target object does not make a selection, the query request is considered invalid. There are two possibilities, one is that no alternative response data is displayed on the target display interface; one is that the alternative response data is displayed on the target interface, but is not intended by the target object. At this time, a prompt message is sent to the target object, and whether the alternative response data needs to be reacquired is inquired. And displaying the corresponding data which are not displayed on the target display interface in the case that the user confirms to re-acquire the corresponding data.
In an exemplary embodiment, after determining that the query request is effectively responded to, the method further comprises: determining the consulting frequency of the target object to a plurality of groups of inquiry response data in the candidate set; and carrying out association binding on the target query response data with highest reference frequency and the query request.
That is, in order to determine the response data corresponding to the query request of the target object more quickly, the response data with the highest historical query frequency of the target object is directly associated with the query request, and then the associated response data can be directly called when the same query request is issued next time.
In an exemplary embodiment, after determining the target instruction corresponding to the query type from the preset instruction library, the method further includes determining rule information corresponding to the target instruction; determining a target function corresponding to the target instruction; and encapsulating the target instructions with the same rule information or the same target function, and naming the target instructions according to the corresponding rule information or the target function.
That is, all the usage scenarios related to the current system screening query component, including the presentation mode of the common screening query component, are extracted, the interface layer packaging is realized, the data transmission rule of the common screening query instruction at the front end and the rear end is defined, the naming mode which is common or beneficial to reducing the working cost is searched for packaging, namely, naming is carried out according to the actual function, and the actual service scenario is included for verification, so that the service closed loop is realized.
In order to better understand the process of the data query method, the following description is provided with reference to an optional embodiment to describe the flow of the data query implementation method, but the method is not limited to the technical solution of the embodiment of the present application.
As an optional implementation manner, an optional embodiment of the invention provides a front-end and back-end system screening query component standardization method, through standardized processing of query rules of the screening query component, a back-end receives a front-end query instruction, and then does not need to write codes, but can automatically generate query conditions; and the rear end is provided with the analyzer for analyzing the front-end query instruction, so that the front-end and the rear end are facilitated to realize the opening problem of the screening query component, and the situation that the matching rule of the screening query mechanism is renamed each time the front-end and the rear-end develop similar use scenes of a new project are received is avoided, thereby improving the development efficiency.
Optionally, fig. 3 is a timing diagram of an alternative information verification method according to an embodiment of the present application:
step S301: after the service side (operation) inputs the query condition and clicks the query button, the front end receives the query request.
Step S302: the front end analyzes the query request type, determines the query type, and judges whether the query is a fuzzy query, a range query, a matching query or a non-matching query; and calling a corresponding query rule according to the query type, and pushing a query instruction to the rear end.
Optionally, the extraction plan for the screening query component is as follows:
the first step: all use cases related to the current system screening query component are extracted, including the common presentation mode of the screening query component.
And a second step of: the interface layer packaging is realized, the data transmission rule of the front end and the back end common screening query instruction is definitely determined, and the naming mode which is common or beneficial to reducing the working cost is searched for packaging.
And a third step of: and incorporating the actual service scene for verification to realize service closed loop.
Step S303: after the rear end receives the query instruction, the analyzer matched with the front end query rule is used for analyzing the instruction sent by the front end, and query is carried out on the database according to SQL after analysis, namely the retrieval stage of the search source.
Step S304: after the search source is called, the database returns a candidate set of query terms.
Step S305: the back end generates a query term result set and returns the query term result set to the front end.
Step S306: front end page refreshing, and query results are displayed to a service party (operation).
It should be noted that, the use scenario set by the current screening query component is to input a query request for a service party (operation), and the front end judges query types such as fuzzy query, range query, matching query, non-matching query, and the like, and then transmits the logic after judgment to the back end; then, in order to solve the query problem of the business party (operation) more closely and efficiently, the query problem type can be selected on the page by themselves, so that the query efficiency is improved.
In summary, through the implementation manner, the front-end interface layer can achieve standardization of the screening query instruction pushed to the back-end server; the back end can be provided with a set of resolvers matched with the front end screening query instruction; the back end can quickly and accurately match the capability of the search source according to the analysis result; the back end can provide a bottom layer function entry of a service side (operation) configuration screening condition option; the operation background configuration interface is provided with an input mechanism of screening conditions under different use requirements; the operation background configuration interface is provided with a trigger mechanism for inquiring and resetting function operation; the operation background configuration interface is provided with corresponding query result display matched with the query conditions; and the visual presentation layer of the operation background configuration interface keeps consistency.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
The embodiment also provides a data query device, which is used for implementing the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware, are also possible and contemplated.
FIG. 4 is a diagram of an alternative data query device (one) according to an embodiment of the present invention, the device comprising:
the obtaining module 42 is configured to obtain a query request input by a target object at a client, where the query request carries a data requirement to be queried;
a determining module 44, configured to determine a query type corresponding to the target object based on the query request;
the sending module 46 is configured to determine a target instruction corresponding to the query type from a preset instruction library, and send the target instruction to a data server;
and a response module 48, configured to obtain an execution result of the target instruction by the data server, so as to determine whether the query request is effectively responded to.
Through the device, the query request input by the target object at the client is obtained, wherein the query request carries the data requirement to be queried; determining a query type corresponding to the target object based on the query request; determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server; and acquiring an execution result of the target instruction by the data service end to determine whether the query request is effectively responded, thereby solving the problems of low data query efficiency and the like between different end sides.
Optionally, the determining module 44 is further configured to parse the query request and identify a query field corresponding to the data requirement; matching the query field with a standard query field in the client, wherein the standard query field is field content corresponding to a target query request with a query frequency greater than a preset frequency; and determining the query type corresponding to the target object according to the query request determined by the matching result.
That is, the query field carried in the query request is matched with the standard query field, so that the query type corresponding to the query request sent by the target object is determined according to the matching result.
The matching process may include: and determining the similarity of the query field and the standard field, and determining that the matching is successful under the condition that the similarity is larger than a threshold value. Wherein the similarity comprises: the location similarity of each byte in the query field, and the number similarity of each byte in the query field.
And obtaining accurate values of the similarity according to the weights respectively corresponding to the position similarity and the number similarity.
Wherein: position similarity= (the same number of bytes as the byte position in the standard field/the total number of bytes in the standard field) ×100%; number similarity= (number of bytes as many as the number of bytes in the standard field/total number of bytes in the standard field) ×100%
For example: the query field is abcdef, the standard field is a0c00e0, and it can be seen that there are 3 in the query field, which are consistent with the number of bytes in the standard field, respectively: a. c, e; there are 2 identical positions: the method comprises the following steps: a. c. Then in the above example, position similarity= (2/7) ×100% = 29%; number similarity= (3/7) ×100% =43%. Taking the example that the weight of the number similarity is 80% and the weight of the position similarity is 20%, there is a similarity accuracy value= (43% ×0.8) + (29% ×0.2) =34.4% +5.8% =40.2%. If the threshold is 60%, the query field does not match the standard field.
Optionally, the sending module 46 is further configured to determine rule information corresponding to the query type; inputting the rule information and the query type into the preset instruction library to obtain a target instruction, wherein the preset instruction library at least comprises: the method comprises the steps of obtaining first content corresponding to rule information, second content corresponding to query type, third content corresponding to instructions and corresponding relation among the first content, the second content and the third content.
That is, different query types correspond to different rule information, and in order to determine the target instruction corresponding to the query type, the target instruction may be determined by a preset instruction library, where the preset instruction library is a database including query rules corresponding to different query types, query instructions corresponding to different query types, and query instructions corresponding to different query rules. Namely, inputting the query type, searching through a preset instruction library, and finding rule information and a target instruction corresponding to the query type.
Alternatively, the query types may include: explicit query types, fuzzy queries, range queries, matching queries, etc.
Optionally, if a query type is not recorded in the preset instruction library, the query type is analyzed. An implementation way of implementing the query request of the query type is determined, wherein the implementation way refers to which query rules are used.
That is, if the preset instruction library does not have the current query type, the query process of the query type is disassembled, and the query rules corresponding to the query types which are not recorded are obtained by combining the query rules recorded in the preset instruction library. The new query types and query rules are then recorded in a pre-set database.
Optionally, the response module 48 is further configured to extract a candidate set from the execution result, where the candidate set includes multiple sets of query response data; displaying the candidate set on a target display interface corresponding to the client; in the event that the target object is determined to consult the candidate set from the target display interface, it is determined that the query request is effectively responded to.
That is, after the target instruction is executed, one instruction corresponds to a plurality of pieces of alternative response data, the plurality of pieces of alternative response data are pushed to the target object, and if the target object makes a selection from the plurality of pieces of alternative response data, it is indicated that the query request corresponding to the instruction is valid.
And in a preset time period after pushing the plurality of candidate response data to the target object, if the target object does not make a selection, the query request is considered invalid. There are two possibilities, one is that no alternative response data is displayed on the target display interface; one is that the alternative response data is displayed on the target interface, but is not intended by the target object. At this time, a prompt message is sent to the target object, and whether the alternative response data needs to be reacquired is inquired. And displaying the corresponding data which are not displayed on the target display interface in the case that the user confirms to re-acquire the corresponding data.
Optionally, the sending module 46 is configured to determine rule information and a target function corresponding to the target instruction; and packaging the target instructions with the same rule information and/or the same target function to obtain a target instruction component, and naming the target instruction component through a preset command rule.
That is, all the usage scenarios related to the current system screening query component, including the presentation mode of the common screening query component, are extracted, the interface layer packaging is realized, the data transmission rule of the common screening query instruction at the front end and the rear end is defined, the naming mode which is common or beneficial to reducing the working cost is searched for packaging, namely, naming is carried out according to the actual function, and the actual service scenario is included for verification, so that the service closed loop is realized.
FIG. 5 is a diagram of an alternative data query device (II) according to an embodiment of the invention, the device comprising:
a configuration module 52, configured to configure a corresponding target resolver for the target instruction; the target analyzer is used for analyzing and executing the target instruction at a non-client; the target analyzer is sent to the data server;
it should be noted that, different instructions need to be parsed by different parsers to be executed, so before the target instruction is sent to the server, the parsers corresponding to the instructions need to be sent to the server.
Optionally, the method for configuring the corresponding target resolver for the target instruction includes: and determining the analysis duration of the instruction by the analyzer after the server receives the analyzer, and if the analysis duration is longer than the preset duration, considering that the analysis is failed. Determining the reason of the analysis failure, and restarting the analysis flow if the analysis failure is caused by poor network conditions; if the analysis failure is caused by mismatching of the analyzer and the instruction, the analyzer is reconfigured for the instruction, if the reconfigured analyzer still cannot complete the analysis of the instruction, a prompt is sent to the target object, and then whether the analyzer is to be upgraded is confirmed by the target object.
Optionally, the method for determining the reason of the parsing failure includes: a node is established for each step in the parsing process, and when a step is completed, the corresponding node is displayed as "completed". If a step fails to complete successfully, a "failure" is displayed. And further, according to the display state corresponding to the node, the analysis failure reason can be confirmed.
The above "completion" or "failure" is used as an example, and other marks, sounds, patterns, etc. that can be recognized and express similar intentions are also possible, and the present invention is not limited thereto.
A binding module 54, configured to determine a frequency of reference of the target object to the multiple sets of query response data in the candidate set; and carrying out association binding on the target query response data with highest reference frequency and the query request.
That is, in order to determine the response data corresponding to the query request of the target object more quickly, the response data with the highest historical query frequency of the target object is directly associated with the query request, and then the associated response data can be directly called when the same query request is issued next time.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store a computer program for performing the steps of:
s1, acquiring a query request input by a target object at a client, wherein the query request carries data requirements to be queried;
s2, determining a query type corresponding to the target object based on the query request;
s3, determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server;
s4, acquiring an execution result of the target instruction by the data server side to determine whether the query request is effectively responded.
In one exemplary embodiment, the computer readable storage medium may include, but is not limited to: a usb disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing a computer program.
Specific examples in this embodiment may refer to the examples described in the foregoing embodiments and the exemplary implementation, and this embodiment is not described herein.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, acquiring a query request input by a target object at a client, wherein the query request carries data requirements to be queried;
s2, determining a query type corresponding to the target object based on the query request;
s3, determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server;
s4, acquiring an execution result of the target instruction by the data server side to determine whether the query request is effectively responded.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (10)

1. A method of querying data, comprising:
acquiring a query request input by a target object at a client, wherein the query request carries a data requirement to be queried;
determining a query type corresponding to the target object based on the query request;
determining a target instruction corresponding to the query type from a preset instruction library, and sending the target instruction to a data server;
and acquiring an execution result of the target instruction by the data service end to determine whether the query request is effectively responded.
2. The method of claim 1, wherein determining the query type corresponding to the target object based on the query request comprises:
analyzing the query request and identifying a query field corresponding to the data requirement;
matching the query field with a standard query field in the client, wherein the standard query field is field content corresponding to a target query request with a query frequency greater than a preset frequency;
and determining the query type corresponding to the query request according to the matching result.
3. The method of claim 1, wherein determining the target instruction corresponding to the query type from a preset instruction library comprises:
determining rule information corresponding to the query type;
inputting the rule information and the query type into the preset instruction library to obtain a target instruction, wherein the preset instruction library at least comprises: the method comprises the steps of obtaining first content corresponding to rule information, second content corresponding to query type, third content corresponding to instructions and corresponding relation among the first content, the second content and the third content.
4. The method of claim 1, wherein prior to sending the target instruction to a data server, the method further comprises:
configuring a corresponding target analyzer for the target instruction; the target analyzer is used for analyzing and executing the target instruction at a non-client;
and sending the target analyzer to the data server.
5. The method of claim 1, wherein obtaining the execution result of the target instruction by the data server to determine whether the query request is effectively responded to comprises:
extracting a candidate set in the execution result, wherein the candidate set comprises a plurality of groups of query response data;
displaying the candidate set on a target display interface corresponding to the client;
in the event that the target object is determined to consult the candidate set from the target display interface, it is determined that the query request is effectively responded to.
6. The method of claim 5, wherein after determining that the query request is effectively responded to, the method further comprises:
determining the consulting frequency of the target object to a plurality of groups of inquiry response data in the candidate set;
and carrying out association binding on the target query response data with highest reference frequency and the query request.
7. The method of claim 1, wherein after determining the target instruction corresponding to the query type from a preset instruction library, the method further comprises:
determining rule information corresponding to the target instruction and a target function;
and packaging the target instructions with the same rule information and/or the same target function to obtain a target instruction component, and naming the target instruction component through a preset command rule.
8. A data query device, comprising:
the acquisition module is used for acquiring a query request input by a target object at a client, wherein the query request carries data requirements to be queried;
the determining module is used for determining the query type corresponding to the target object based on the query request;
the sending module is used for determining a target instruction corresponding to the query type from a preset instruction library and sending the target instruction to a data server;
and the response module is used for acquiring an execution result of the target instruction by the data server side so as to determine whether the query request is effectively responded.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program when run performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of claims 1 to 7 by means of the computer program.
CN202310226472.8A 2023-03-09 2023-03-09 Data query method and device, storage medium and electronic device Pending CN116303535A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310226472.8A CN116303535A (en) 2023-03-09 2023-03-09 Data query method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310226472.8A CN116303535A (en) 2023-03-09 2023-03-09 Data query method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN116303535A true CN116303535A (en) 2023-06-23

Family

ID=86835485

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310226472.8A Pending CN116303535A (en) 2023-03-09 2023-03-09 Data query method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN116303535A (en)

Similar Documents

Publication Publication Date Title
US20160239661A1 (en) Information processing apparatus, information processing method, and program
CN111611207A (en) State data processing method and device and computer equipment
CN115047778A (en) Control method and device for intelligent equipment, storage medium and electronic device
CN117573320A (en) Task node execution method and device, storage medium and electronic device
CN114911535B (en) Application program component configuration method, storage medium and electronic device
CN116303535A (en) Data query method and device, storage medium and electronic device
CN115048392A (en) Data deletion method and device, storage medium and electronic device
CN105188154B (en) A kind of method, apparatus and system being automatically brought into operation smart machine
CN116980866A (en) Binding method and device of data tag, storage medium and electronic device
CN112135162B (en) Service execution method, device and server
CN110575668A (en) Attribute information updating method and device in user interface
CN109524002A (en) Intelligent voice recognition method and device
CN109800099A (en) A kind of restoring method, storage medium and the terminal device of user's operation behavior
US20070022108A1 (en) Predicate-logic retrieval system
CN117749548A (en) Method and device for controlling initiation of interactive service, storage medium and electronic device
CN117376042A (en) Functional platform configuration method and device of intelligent equipment and electronic device
CN116521673A (en) Database operation method and device, storage medium and electronic device
CN116541012A (en) Basic parameter modification method and device, storage medium and electronic device
CN117014245A (en) Method and device for selecting instruction execution equipment, storage medium and electronic device
CN117520292A (en) Rule matching method, storage medium and electronic device
CN111176871B (en) Target application processing method and device, storage medium and electronic device
CN116521157A (en) Project integration method and device, storage medium and electronic device
CN115269926A (en) Family map determination method and device, storage medium and electronic device
CN117095677A (en) Semantic understanding template generation method and device, storage medium and electronic device
CN115481167A (en) Log processing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination