CN117539897A - Data query method, device, equipment and computer readable storage medium - Google Patents

Data query method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN117539897A
CN117539897A CN202311551120.6A CN202311551120A CN117539897A CN 117539897 A CN117539897 A CN 117539897A CN 202311551120 A CN202311551120 A CN 202311551120A CN 117539897 A CN117539897 A CN 117539897A
Authority
CN
China
Prior art keywords
query
application
statement
dynamic
data
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
CN202311551120.6A
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.)
China Merchants Bank Co Ltd
Original Assignee
China Merchants Bank 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 China Merchants Bank Co Ltd filed Critical China Merchants Bank Co Ltd
Priority to CN202311551120.6A priority Critical patent/CN117539897A/en
Publication of CN117539897A publication Critical patent/CN117539897A/en
Pending legal-status Critical Current

Links

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
    • 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

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 present disclosure relates to the field of database technologies, and in particular, to a data query method, apparatus, device, and computer readable storage medium, where the method includes: creating a dynamic query statement, and issuing a query application based on the dynamic query statement, wherein dynamic query conditions are defined in the dynamic query statement by XML labels; when a query request is received, the query application inserts the request parameter value carried by the query request into the dynamic query condition to obtain a target query statement, and the target query statement is executed in a database to perform data query. The application query method and the application query device improve flexibility of query applications, and therefore flexibility of data query based on application release is improved.

Description

Data query method, device, equipment and computer readable storage medium
Technical Field
The present disclosure relates to the field of database technologies, and in particular, to a data query method, apparatus, device, and computer readable storage medium.
Background
Providing access to data within the system itself in the form of a data API (Application Programming Interface ) is a more common data query method, which mainly creates a query application in a database and issues the query application, and provides a query interface to the outside through the query application.
However, because the application provider cannot customize the query, the data query mode based on the query application cannot adapt to the requirement of the user for query scene diversification, so that the flexibility of the query application is limited, and the data query mode based on application release is limited.
Disclosure of Invention
The main objective of the present application is to provide a data query method, apparatus, device and computer readable storage medium, which aim to improve flexibility of querying applications, thereby improving flexibility of data query issued based on the applications.
In order to achieve the above object, the present application provides a data query method, which includes the following steps:
creating a dynamic query statement, and issuing a query application based on the dynamic query statement, wherein dynamic query conditions are defined in the dynamic query statement by XML labels;
when a query request is received, the query application inserts the request parameter value carried by the query request into the dynamic query condition to obtain a target query statement, and the target query statement is executed in a database to perform data query.
Optionally, the step of issuing the query application based on the dynamic query statement includes:
creating a query application using the dynamic query statement;
and deploying the containers of the query application into a container cluster, and publishing the containers of the query application based on the container cluster.
Optionally, the step of inserting, by the query application, the request parameter value carried by the query request into the dynamic query condition to obtain a target query statement includes:
analyzing the dynamic query statement into a standard query statement through the query application;
and inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
Optionally, the step of parsing, by the query application, the dynamic query statement into a standard query statement includes:
converting the dynamic query statement into a standard database statement by the query application;
in the standard database statement, using a parameter placeholder to represent parameter bits of the dynamic query condition to obtain a standard query statement;
the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement comprises the following steps:
binding the request parameter value carried by the query request to the parameter placeholder of the standard query statement to obtain a target query statement.
Optionally, after the step of parsing the dynamic query statement into the standard query statement by the query application, the method further includes:
detecting whether the format of the standard query statement is correct;
and if the format of the standard query statement is correct, executing the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
Optionally, the data query method further includes:
monitoring the access times of each inquiry application;
and if the cold access application with the access times smaller than the preset threshold value exists in each inquiry application, stopping the cold access application.
Optionally, after the step of stopping the cold access application if the cold access application with the access frequency smaller than the preset threshold exists in each query application, the method further includes:
and if the cold access application has access, converting the cold access application into a hot spot application, and providing a data query service through the hot spot application.
To achieve the above object, the present application further provides a data query device, including:
the creation module is used for creating a dynamic query statement and issuing a query application based on the dynamic query statement, wherein the dynamic query statement defines a dynamic query condition by using an XML tag;
and the query module is used for inserting the request parameter value carried by the query request into the dynamic query condition through the query application to obtain a target query statement when the query request is received, and executing the target query statement in the database to perform data query.
To achieve the above object, the present application further provides a data query device, including: the data query system comprises a memory, a processor and a data query program stored on the memory and capable of running on the processor, wherein the data query program realizes the steps of the data query method when being executed by the processor.
In addition, in order to achieve the above object, the present application also proposes a computer-readable storage medium having stored thereon a data query program which, when executed by a processor, implements the steps of the data query method as described above.
In the application, a dynamic query statement is created, and a query application is issued based on the dynamic query statement, wherein the dynamic query statement defines a dynamic query condition by using an XML tag; when a query request is received, the query application inserts the request parameter value carried by the query request into the dynamic query condition to obtain a target query statement, and the target query statement is executed in a database to perform data query. The method and the device realize the dynamic generation of the query conditions controlled by the XML tag, provide flexible query conditions for the query application, and improve the flexibility of the query application, thereby improving the flexibility of the data query based on the application release.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present application;
FIG. 2 is a flowchart of a first embodiment of a data query method according to the present application;
FIG. 3 is a flowchart of a second embodiment of a data query method according to the present application;
FIG. 4 is a flowchart of a third embodiment of a data query method according to the present application;
FIG. 5 is a schematic diagram of an application flow according to an embodiment of the present application;
fig. 6 is a schematic functional block diagram of a data query device according to a preferred embodiment of the present application.
The realization, functional characteristics and advantages of the present application will be further described with reference to the embodiments, referring to the attached drawings.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware running environment according to an embodiment of the present application.
It should be noted that, in the data query device of the embodiment of the present application, the data query device may be a smart phone, a personal computer, a server, etc., which is not limited herein.
As shown in fig. 1, the data query device may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the device structure shown in fig. 1 does not constitute a limitation on the data interrogation device and may include more or fewer components than shown, or may combine certain components, or may be arranged in a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a data query program may be included in a memory 1005, which is a type of computer storage medium. An operating system is a program that manages and controls the hardware and software resources of a device, supporting the execution of data querying programs, as well as other software or programs. In the device shown in fig. 1, the user interface 1003 is mainly used for data communication with the client; the network interface 1004 is mainly used for establishing communication connection with a server; and the processor 1001 may be configured to call a data query program stored in the memory 1005 and perform the following operations:
creating a dynamic query statement, and issuing a query application based on the dynamic query statement, wherein dynamic query conditions are defined in the dynamic query statement by XML labels;
when a query request is received, the query application inserts the request parameter value carried by the query request into the dynamic query condition to obtain a target query statement, and the target query statement is executed in a database to perform data query.
Further, the step of issuing the query application based on the dynamic query statement includes:
creating a query application using the dynamic query statement;
and deploying the containers of the query application into a container cluster, and publishing the containers of the query application based on the container cluster.
Further, the step of inserting, by the query application, the request parameter value carried by the query request into the dynamic query condition to obtain a target query statement includes:
analyzing the dynamic query statement into a standard query statement through the query application;
and inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
Further, the step of parsing, by the query application, the dynamic query statement into a standard query statement includes:
converting the dynamic query statement into a standard database statement by the query application;
in the standard database statement, using a parameter placeholder to represent parameter bits of the dynamic query condition to obtain a standard query statement;
the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement comprises the following steps:
binding the request parameter value carried by the query request to the parameter placeholder of the standard query statement to obtain a target query statement.
Further, after the step of parsing the dynamic query term into a standard query term by the query application, the method further includes:
detecting whether the format of the standard query statement is correct;
and if the format of the standard query statement is correct, executing the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
Further, the data query method further comprises the following steps:
monitoring the access times of each inquiry application;
and if the cold access application with the access times smaller than the preset threshold value exists in each inquiry application, stopping the cold access application.
Further, after the step of stopping the cold access application if the cold access application with the access frequency smaller than the preset threshold exists in each query application, the method further includes:
and if the cold access application has access, converting the cold access application into a hot spot application, and providing a data query service through the hot spot application.
Based on the above structure, various embodiments of a data query method are presented.
Referring to fig. 2, fig. 2 is a flowchart of a first embodiment of a data query method of the present application.
The embodiments of the present application provide embodiments of data query methods, it being noted that although a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in a different order than that illustrated herein. In this embodiment, the execution body of the data query method may be a personal computer, a smart phone, a server, or other devices, but the present embodiment is not limited thereto, and for convenience of description, the execution body is omitted from description of each embodiment. In this embodiment, the data query method includes steps S10 to S20.
Step S10, creating a dynamic query statement, and issuing a query application based on the dynamic query statement, wherein the dynamic query statement defines a dynamic query condition by using XML labels.
At present, access to data in a system of the system is provided in a data API (application program interface) form, and a query interface can be provided for the outside by creating a single application so as to support all query requests; the method can also be based on a container release application, and a lightweight query interface is realized depending on the technical advantages of the container. However, because the application provider cannot customize the query, the data query mode based on the query application cannot adapt to the requirement of the user for query scene diversification, so that the flexibility of the query application is limited, and the data query mode based on application release is limited.
In this embodiment, before the query application is issued, a dynamic query statement is designed based on an XML (eXtensible Markup Language ) tag, so as to achieve the purpose of dynamically generating a database query statement according to the input parameters of the user, and specifically, the dynamic query condition is defined in the dynamic query statement by using the XML tag. XML is used as an extensible markup language, and allows developers to customize labels and data structures so as to realize expansion and modification of query conditions, so that dynamic query conditions are defined by using XML labels, and query references can adapt to various query scenes, so that the flexibility of query application is improved.
After creating the dynamic query statement, a query application is published based on the dynamic query statement. In a possible implementation manner, the query application can be issued by creating a single application, and the resource consumption of the data query system can be reduced in the implementation manner; in another possible implementation manner, query references can be issued based on containers, and this implementation manner can ensure that the running periods of the applications do not affect each other, so that the query applications are isolated from each other, the security of the query applications is improved, and the query applications are not limited in this embodiment, and can be set according to actual requirements.
And step S20, when a query request is received, inserting a request parameter value carried by the query request into the dynamic query condition through the query application to obtain a target query statement, and executing the target query statement in a database to perform data query.
In this embodiment, after the query application is issued, a query request of the data query may be received by the query application, and the data query may be performed according to the query request.
Specifically, when a query request is received, a request parameter value carried by the query request is inserted into a dynamic query condition through a query application to obtain a target query statement, and the target query statement is executed in a database to perform data query.
In a specific embodiment, because the dynamic query language does not conform to the standard SQL (Structured Query Language ) statement, in the process of inserting the request parameter value carried by the query request into the dynamic query condition to obtain the target query statement, the dynamic query basis needs to be parsed first to be parsed into the standard query statement, and then the parameter value is inserted.
Further, in a possible embodiment, step S10 includes steps S101-S102.
Step S101, creating a query application by using the dynamic query statement.
In this embodiment, query applications are issued based on the container clusters, so as to improve isolation between the query applications and improve security of each query application. Specifically, a query application is created using dynamic query statements.
Step S102, deploying the containers of the query application into a container cluster, and publishing the containers of the query application based on the container cluster.
And deploying the containers of the query application into the container cluster, and releasing the containers of the query application based on the container cluster to realize releasing the query application based on the container cluster.
In the embodiment, a dynamic query statement is created, and a query application is issued based on the dynamic query statement, wherein the dynamic query statement defines a dynamic query condition by using XML labels; when a query request is received, a request parameter value carried by the query request is inserted into a dynamic query condition through a query application to obtain a target query statement, and the target query statement is executed in a database to perform data query. The method and the device realize the dynamic generation of the query conditions controlled by the XML tag, provide flexible query conditions for the query application, and improve the flexibility of the query application, thereby improving the flexibility of the data query based on the application release.
The existing dynamic query technical frames generally have two types, one type is directly spliced with query conditions in codes, and the typical representative is SpringBootJPA, which has the defects of high complexity and high learning cost; another type is to write SQL statements in an XML file, decouple SQL scripts and code, typically MyBatis, which has the disadvantage of severely binding SQL and XML files. In contrast, the dynamic query framework provided in this embodiment uses XML tags to define dynamic query conditions, and the dynamic query statement is easy to expand and modify, and because the XML tags have good readability, the dynamic query statement is easy to understand and maintain, and simultaneously, XML is used as a general data exchange format, so that the dynamic query statement has cross-platform and cross-language characteristics, and can be easily parsed and processed by various programming languages and application programs of different platforms, therefore, compared with the above two dynamic query technical frameworks, the embodiment can improve flexibility, expandability and practicability of the dynamic query technical framework.
Further, based on the above-mentioned first embodiment, a second embodiment of the data query method of the present application is provided, in this embodiment, referring to fig. 3, step S20 includes steps S201 to S202.
Step S201, parsing the dynamic query statement into a standard query statement by the query application.
In this embodiment, because the dynamic query language does not conform to the standard SQL statement, in the process of inserting the request parameter value carried by the query request into the dynamic query condition to obtain the target query statement, the dynamic query basis needs to be parsed first into the standard query statement, and then the parameter value is inserted.
Specifically, the dynamic query statement is parsed by the query application into a standard query statement that meets the standard SQL statement.
Step S202, inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
And inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
Further, in an embodiment, step S201 includes steps S2011-S2012.
Step S2011, converting the dynamic query statement into a standard database statement through the query application.
In this embodiment, the process of parsing the dynamic query statement into the standard query statement by the query application may be: the dynamic query statement is converted into a standard database statement conforming to the SQL format by the query application.
In step S2012, in the standard database statement, the standard query statement is obtained by using the parameter bits of the parameter placeholder to represent the dynamic query condition.
In the standard database statement, the parameter placeholder is used for representing parameter bits of the dynamic query condition to obtain the standard query statement.
In the present embodiment, step S202 includes step S2022.
Step S2022, binding the request parameter value carried by the query request to the parameter placeholder of the standard query statement, to obtain the target query statement.
In this embodiment, the request parameter value carried by the query request is bound to the parameter placeholder of the standard query statement, so as to obtain the target query statement.
Further, in a possible implementation manner, since the standard query statement obtained by converting the dynamic query statement is fixed, in this implementation manner, the standard query statement may be saved after the standard query statement is obtained for the first time, and in the next data query process, the saved standard query statement is directly called, and then the request parameter value carried by the query request is bound to the parameter placeholder of the standard query statement to obtain the target query statement, so as to reduce the consumption of computational resources of query application in the data query process.
Further, in a possible embodiment, after step S201, the method further includes: steps S203 to S204.
Step S203, detecting whether the format of the standard query statement is correct.
In the embodiment, after the dynamic query statement is analyzed, whether the format of the standard query statement is correct is detected, and the parameter value is inserted into the target query statement under the condition that the standard query statement is correct.
Step S204, if the format of the standard query statement is correct, executing the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement;
and if the format of the standard query statement is correct, executing the step of inserting the request parameter value carried by the query request into the standard query statement to obtain the target query statement.
Further, in this embodiment, if the format of the standard query statement is incorrect, after the format of the standard query statement is adjusted, the request parameter value carried by the query request is inserted into the standard query statement to obtain the target query statement.
The embodiment can find potential errors before executing the query by detecting whether the format of the standard query statement is correct. If the format of the standard query statement is incorrect, errors can be captured in time and can be adjusted and repaired in a targeted manner, so that the problem caused by error execution is avoided, the robustness of the standard query statement is improved, and the subsequent debugging process is simplified.
In this embodiment, a query application is created by using dynamic query statements; the containers of the query application are deployed into a container cluster, and the containers of the query application are published based on the container cluster. The container clusters generally support redundancy and load balancing of the containers, so that in the use process of the query application, even if a certain container fails, the clusters can still continue to provide services, and high availability of the query application is ensured; and the containers provide resource isolation, each container can operate in an independent environment, so that the conflict between query applications is avoided, and the query applications are ensured to stably operate on a shared infrastructure.
Further, based on the above first and/or second embodiments, a third embodiment of the data query method of the present application is proposed. In this embodiment, referring to fig. 4, the data query method further includes steps S30 to S40:
and step S30, monitoring the access times of each query application.
In the actual use process of the query application, some query applications may have lower access frequency, but the query application still runs for a long time after being issued, so that the resources of the container cluster are not fully utilized, and the resources of the container cluster are wasted.
Therefore, in this embodiment, for the issued query application, a monitoring index is established, the access condition of each query application is collected through the index, and a monitoring threshold is set. Automatically analyzing the collected monitoring data, and when the flow access is higher than the monitoring threshold, inquiring the application as a hot spot application without processing; and when the traffic access is lower than the monitoring threshold, the query application is a cold access application and automatically stops.
Specifically, the access times of each query application are monitored, and the access condition of the query application is evaluated according to the access times. Further, in a possible implementation, the access condition may be further evaluated based on an index such as the access frequency, which is not limited herein.
And step S40, if the cold access application with the access times smaller than the preset threshold value exists in each inquiry application, stopping the cold access application.
And if the cold access application with the access times smaller than the preset threshold value exists in each inquiry application, stopping the cold access application.
Further, in a possible embodiment, after step S40, step S50 is further included:
and step S50, if the cold access application has access, converting the cold access application into a hot spot application, and providing a data query service through the hot spot application.
In this embodiment, if a new flow is accessed to the stopped cold application, the stopped cold application is converted into a hot spot application, and the automatic expansion and contraction is triggered, so that the service of the query application is automatically restored. That is, if the cold access application has access, the cold access application is converted into a hot spot application, and the data query service is provided through the hot spot application.
In this embodiment, the access times of each query application are monitored; and if the cold access application with the access times smaller than the preset threshold value exists in each inquiry application, stopping the cold access application. According to the embodiment, the resources can be released by stopping the cold access application, so that more resources are provided for the hot spot application, the utilization rate of the resources is improved, and the running cost is reduced. And by stopping the cold access application, the number of applications running in the system can be reduced, thereby reducing server load.
Illustratively, in one possible implementation, referring to fig. 5, the specific flow of the elastically telescopic query application may be:
the monitoring service obtains the flow of the client accessing the query application through the gateway, wherein the gateway and the query application are K8S nodes (Kubernetes, working nodes in the cluster), and the container on the K8S node and the log and monitoring data of the node can be integrated into the monitoring system of the cluster, so that the health condition of the node can be monitored in real time and corresponding response can be made.
The monitoring service takes the access flow as a monitoring index, and controls the elastic start and stop of the query applications according to the monitoring index (namely, if cold access applications with the access times smaller than a preset threshold value exist in each query application, the cold access applications are stopped).
Illustratively, in one possible implementation, the data query scheme mainly includes two technical modules, module 1 is an implementation of a dynamic query language, and module 2 is an implementation of providing an elastic query service.
The module 1, an implementation of dynamic query language, mainly comprises the following steps:
1) Dynamic query grammar is designed.
A standard SQL query statement format is: select < field > from < store name > < table name > where < query condition >. When the field name, the library name, the table name and the query condition are determined, the SQL statement is determined. However, in practical application, the same table uses different query conditions under different query scenes, and the query conditions cannot be determined when the application is issued, but are dynamically generated according to different query scenes of the user.
Therefore, the dynamic query grammar is designed based on the XML tag so as to achieve the purpose of dynamically generating SQL sentences according to the input parameters of the user. The dynamic query grammar is mainly embodied in the dynamic generation of query conditions. The role of the XML tag is to control whether query conditions are in effect and support collection type queries.
2) When a query request is received, a dynamic query grammar parser is implemented, which is responsible for parsing dynamic query sentences into standard SQL.
The dynamic query language does not conform to standard SQL, so that the dynamic query language needs to be parsed, translated into standard SQL statements and submitted for query. The analysis process is divided into the following links:
A. and analyzing the dynamic query statement and converting the dynamic query statement into a standard SQL statement.
The link mainly analyzes the XML tag and recognizes the content semantics of the XML tag. The process is implemented primarily based on MyBatis. Unlike native MyBatis, the parsing process of the present application relies solely on the dynamic query language designed above.
B. Preprocessing the standard SQL sentence, and inputting a request parameter value.
The standard SQL statement is preprocessed, the request parameter value to be given is set, and the query is submitted, so that SQL injection can be effectively prevented.
C. And submitting SQL execution and returning a query result.
The module 2, an implementation of providing elastic query service, mainly comprises the following steps:
1) Creating a container cluster and publishing an application.
A query application is created using a dynamic query language and published based on a cluster of containers, one query application being one container.
2) The application is monitored and the cold application is automatically stopped.
Aiming at the issued inquiry application, a monitoring index is established, the access condition of each application is acquired through the index, and a monitoring threshold is set. Automatically analyzing the collected monitoring data, and when the flow access is higher than the monitoring threshold, inquiring the application as a hot spot application without processing; and when the flow access is lower than the monitoring threshold, automatically stopping for the cold application.
3) The application is elastically started.
If the stopped cold application has new flow access, the stopped cold application is converted into a hot spot application, and the hot spot application triggers expansion and contraction to automatically restore service.
In addition, an embodiment of the present application further provides a data query device, referring to fig. 6, where the data query device includes:
the creation module 10 is configured to create a dynamic query statement, and issue a query application based on the dynamic query statement, where a dynamic query condition is defined in the dynamic query statement by an XML tag;
and the query module 20 is configured to insert, when a query request is received, a request parameter value carried by the query request into the dynamic query condition through the query application to obtain a target query statement, and execute the target query statement in a database to perform data query.
Further, the creation module 10 is further configured to:
creating a query application using the dynamic query statement;
and deploying the containers of the query application into a container cluster, and publishing the containers of the query application based on the container cluster.
Further, the query module 20 is further configured to:
analyzing the dynamic query statement into a standard query statement through the query application;
and inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
Further, the query module 20 is further configured to:
converting the dynamic query statement into a standard database statement by the query application;
in the standard database statement, using a parameter placeholder to represent parameter bits of the dynamic query condition to obtain a standard query statement;
the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement comprises the following steps:
binding the request parameter value carried by the query request to the parameter placeholder of the standard query statement to obtain a target query statement.
Further, the query module 20 is further configured to:
detecting whether the format of the standard query statement is correct;
and if the format of the standard query statement is correct, executing the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
Further, the data query device further comprises a monitoring module for:
measuring the access times of each inquiry application;
and if the cold access application with the access times smaller than the preset threshold value exists in each inquiry application, stopping the cold access application.
Further, the data query device further comprises a conversion module, configured to:
and if the cold access application has access, converting the cold access application into a hot spot application, and providing a data query service through the hot spot application.
All embodiments of the data query device of the present application may refer to all embodiments of the data query method of the present application, and are not described herein again.
In addition, the embodiment of the application also provides a computer readable storage medium, wherein the storage medium stores a data query program, and the data query program realizes the steps of a data query method as described below when being executed by a processor.
Embodiments of the data query device and the computer readable storage medium of the present application may refer to embodiments of the data query method of the present application, and are not described herein again.
It should be noted that, in this document, 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 one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing embodiment numbers of the present application are merely for describing, and do not represent advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in an area contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in the embodiments of the present application.
The foregoing description is only of the preferred embodiments of the present application, and is not intended to limit the scope of the claims, and all equivalent structures or equivalent processes using the descriptions and drawings of the present application, or direct or indirect application in other related technical fields are included in the scope of the claims of the present application.

Claims (10)

1. A data query method, the data query method comprising:
creating a dynamic query statement, and issuing a query application based on the dynamic query statement, wherein dynamic query conditions are defined in the dynamic query statement by XML labels;
when a query request is received, the query application inserts the request parameter value carried by the query request into the dynamic query condition to obtain a target query statement, and the target query statement is executed in a database to perform data query.
2. The data query method of claim 1, wherein the step of issuing a query application based on the dynamic query statement comprises:
creating a query application using the dynamic query statement;
and deploying the containers of the query application into a container cluster, and publishing the containers of the query application based on the container cluster.
3. The data query method as claimed in claim 1, wherein said step of inserting, by said query application, a request parameter value carried by said query request into said dynamic query condition to obtain a target query statement comprises:
analyzing the dynamic query statement into a standard query statement through the query application;
and inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
4. The data query method of claim 3, wherein the step of parsing the dynamic query statement into standard query statements by the query application comprises:
converting the dynamic query statement into a standard database statement by the query application;
in the standard database statement, using a parameter placeholder to represent parameter bits of the dynamic query condition to obtain a standard query statement;
the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement comprises the following steps:
binding the request parameter value carried by the query request to the parameter placeholder of the standard query statement to obtain a target query statement.
5. The data query method of claim 3, wherein after the step of parsing the dynamic query statement into standard query statements by the query application, further comprising:
detecting whether the format of the standard query statement is correct;
and if the format of the standard query statement is correct, executing the step of inserting the request parameter value carried by the query request into the standard query statement to obtain a target query statement.
6. The data query method of any one of claims 1 to 5, wherein the data query method further comprises:
monitoring the access times of each inquiry application;
and if the cold access application with the access times smaller than the preset threshold value exists in each inquiry application, stopping the cold access application.
7. The data query method as claimed in claim 6, wherein, if there is a cold access application with the number of accesses being less than a preset threshold in each of the query applications, the step of stopping the cold access application further comprises:
and if the cold access application has access, converting the cold access application into a hot spot application, and providing a data query service through the hot spot application.
8. A data query device, the data query device comprising:
the creation module is used for creating a dynamic query statement and issuing a query application based on the dynamic query statement, wherein the dynamic query statement defines a dynamic query condition by using an XML tag;
and the query module is used for inserting the request parameter value carried by the query request into the dynamic query condition through the query application to obtain a target query statement when the query request is received, and executing the target query statement in the database to perform data query.
9. A data query device, the data query device comprising: memory, a processor and a data query program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the data query method of any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a data query program which, when executed by a processor, implements the steps of the data query method according to any of claims 1 to 7.
CN202311551120.6A 2023-11-17 2023-11-17 Data query method, device, equipment and computer readable storage medium Pending CN117539897A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311551120.6A CN117539897A (en) 2023-11-17 2023-11-17 Data query method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311551120.6A CN117539897A (en) 2023-11-17 2023-11-17 Data query method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN117539897A true CN117539897A (en) 2024-02-09

Family

ID=89791387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311551120.6A Pending CN117539897A (en) 2023-11-17 2023-11-17 Data query method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117539897A (en)

Similar Documents

Publication Publication Date Title
CN110196888B (en) Hadoop-based data updating method, device, system and medium
US20200285528A1 (en) Application program interface lists
CN109492053B (en) Method and device for accessing data
JP5936118B2 (en) Code conversion method, program and system
CN108388454B (en) Method and device for dynamically providing JS (JavaScript) compatible script content and terminal equipment
US20070050707A1 (en) Enablement of multiple schema management and versioning for application-specific xml parsers
US20110202564A1 (en) Data store switching apparatus, data store switching method, and non-transitory computer readable storage medium
CN111324619B (en) Object updating method, device, equipment and storage medium in micro-service system
CN111625585B (en) Access method, device, host and storage medium of hardware acceleration database
CN110688096B (en) Method and device for constructing application program containing plug-in, medium and electronic equipment
CN103412754A (en) Dynamic language code execution method and device
CN112328219A (en) Service access processing method, device and system and computer equipment
US9207956B2 (en) Class loading device for a java runtime environment, cluster system and method of executing a function
CN102004639A (en) Embedded script generation module and method for generating embedded script
CN113297081B (en) Execution method and device of continuous integrated pipeline
CN110058849A (en) Generation method, device, computer equipment and the storage medium of flow chart
US20060282820A1 (en) COBOL syntax for native XML file parsing and file generation
CN114064601A (en) Storage process conversion method, device, equipment and storage medium
CN117539897A (en) Data query method, device, equipment and computer readable storage medium
CN113094429B (en) Data processing method, data query method, computer device and storage medium
US20070050706A1 (en) Method of xml transformation and presentation utilizing an application-specific parser
US20220050669A1 (en) Representing asynchronous state machine in intermediate code
CN114301970A (en) Service calling method and device, electronic equipment and storage medium
CN112650502A (en) Batch processing task processing method and device, computer equipment and storage medium
CN108595166B (en) Method and system for realizing application execution engine of distributed Internet of things

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