CN115168760A - Data query method, device and storage medium - Google Patents

Data query method, device and storage medium Download PDF

Info

Publication number
CN115168760A
CN115168760A CN202210749247.8A CN202210749247A CN115168760A CN 115168760 A CN115168760 A CN 115168760A CN 202210749247 A CN202210749247 A CN 202210749247A CN 115168760 A CN115168760 A CN 115168760A
Authority
CN
China
Prior art keywords
query
data query
data
task
thread
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
CN202210749247.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.)
Beijing Ruian Technology Co Ltd
Original Assignee
Beijing Ruian Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Ruian Technology Co Ltd filed Critical Beijing Ruian Technology Co Ltd
Priority to CN202210749247.8A priority Critical patent/CN115168760A/en
Publication of CN115168760A publication Critical patent/CN115168760A/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • 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/2453Query optimisation
    • 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

Landscapes

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

Abstract

The embodiment of the invention discloses a data query method, a data query device and a storage medium. The method comprises the following steps: when a data query request is received, acquiring a data query scene and a data query time period of the data query request; determining query information corresponding to a data query scene and a data query time period; and storing the query information as a query task into a pre-established task queue, and executing the query task in the task queue. The technical scheme of the embodiment of the invention not only reduces the occupation of input and output resources, but also improves the efficiency of data query in the data query process.

Description

Data query method, device and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data query method, apparatus, and storage medium.
Background
At present, the data query method is usually based on a database (e.g., HBase) of a search engine server (e.g., solr) to perform data query. In the query process, frequent interaction between a search engine server and a database is required, and the technical problem that Input/Output (IO) resources occupy more exists. Moreover, each interaction needs to transmit all the information to be queried, that is, each interaction needs to transmit all the fields to be queried, which results in low efficiency of data query.
Disclosure of Invention
The invention provides a data query method, a data query device and a storage medium, which are used for reducing the occupation of IO (input/output) resources and improving the efficiency of data query in the data query process.
According to an aspect of the present invention, there is provided a data query method, including:
when a data query request is received, acquiring a data query scene and a data query time period of the data query request;
determining query information corresponding to a data query scene and a data query time period;
and storing the query information serving as a query task into a pre-established task queue, and executing the query task in the task queue.
Optionally, the acquiring a data query scenario and a data query period of the data query request includes:
acquiring a data query scene and a data query time period of the data query request by calling a predefined data query interface; the data query interface is obtained by packaging a data query method.
Optionally, the determining query information corresponding to a data query scenario and a data query period includes:
and determining a data query configuration file corresponding to the data query scene, and analyzing the data query configuration file to obtain query information corresponding to the data query scene and the data query time interval.
Optionally, the executing the query task in the task queue includes:
and starting at least one working thread and executing the query tasks in the task queue.
Optionally, the starting at least one work thread and executing the query task in the task queue includes:
and starting at least one working thread and asynchronously executing the query tasks in the task queue.
Optionally, the method further includes:
calling a predefined daemon thread method based on a preset thread daemon time interval to determine whether the working thread works normally or not;
if not, destroying the working thread and creating a new working thread.
Optionally, before the starting at least one work thread and executing the query task in the task queue, the method further includes:
and creating working threads with the number of threads corresponding to the complexity based on the complexity of the query information.
Optionally, the method further includes:
and after the query tasks in the task queue are executed, determining a query result of the query tasks, and displaying the query result.
According to another aspect of the present invention, a data query apparatus is provided. The device includes:
the query condition acquisition module is used for acquiring a data query scene and a data query time period of a data query request when the data query request is received;
the query information determining module is used for determining query information corresponding to a data query scene and a data query time period;
and the query task execution module is used for storing the query information as a query task into a pre-established task queue and executing the query task in the task queue.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the data query method of any of the embodiments of the invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement a data query method according to any one of the embodiments of the present invention when the computer instructions are executed.
According to the technical scheme of the embodiment of the invention, when the data query request is received, the data query scene and the data query time period of the data query request are obtained. After determining the data query scenario and the data query period, query information corresponding to the data query scenario and the data query period may be determined. In the embodiment of the invention, corresponding query information can be configured for different query scenes, and the data query request can be responded more quickly. After the query information is determined, the query information may be stored as a query task in a pre-created task queue, and the query task in the task queue is executed. Compared with the prior art, the technical scheme of the embodiment of the invention not only reduces the occupation of input and output resources, but also improves the efficiency of data query in the data query process.
It should be understood that the statements in this section are not intended to identify key or critical features of the embodiments of the present invention, nor are they intended to limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flow chart of a data query method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a data query method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data query device according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover non-exclusive inclusions, 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.
It is understood that before the technical solutions disclosed in the embodiments of the present disclosure are used, the type, the use range, the use scene, etc. of the personal information related to the present disclosure should be informed to the user and obtain the authorization of the user through a proper manner according to the relevant laws and regulations.
For example, in response to receiving a user's active request, prompt information is sent to the user to explicitly prompt the user that the requested operation to be performed would require acquisition and use of personal information to the user. Thus, the user can autonomously select whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the disclosed technical solution, according to the prompt information.
As an optional but non-limiting implementation manner, in response to receiving an active request from the user, the manner of sending the prompt information to the user may be, for example, a pop-up window, and the prompt information may be presented in a text manner in the pop-up window. In addition, a selection control for providing personal information to the electronic device by the user's selection of "agreeing" or "disagreeing" can be carried in the pop-up window.
It is understood that the above notification and user authorization process is only illustrative and not limiting, and other ways of satisfying relevant laws and regulations may be applied to the implementation of the present disclosure.
It will be appreciated that the data referred to in this disclosure, including but not limited to the data itself, the acquisition or use of the data, should comply with the requirements of the applicable laws and regulations and related regulations.
Example one
Fig. 1 is a schematic flow chart of a data query method according to an embodiment of the present invention, which is applicable to a data query case, and the method may be executed by a data query apparatus, which may be implemented in a form of hardware and/or software, and the data query apparatus may be configured in an electronic device, such as a computer or a server.
As shown in fig. 1, the method of the present embodiment includes:
s110, when a data query request is received, acquiring a data query scene and a data query time period of the data query request.
The data query request may be a request for data query generated based on the received data query condition. The receiving of the data query condition may be receiving a condition for performing a data query input by a user. Specifically, the condition for performing the data query, which is input by the user based on the data query interface, may be received. The data query interface can be understood as an interface for performing data query, and can be used for receiving data query conditions input or uploaded by a user.
Alternatively, the format of the data query condition may be a JSON Object Notation (JSON) format. The data query condition adopting the JSON format can be stored in a text format, is easy to read and write by related personnel, is easy to analyze and generate by a machine, and further effectively improves the network transmission efficiency. Query conditions may include, but are not limited to, a data query scenario and a data query period. A data query scenario may be understood as a scenario in which a data query is performed. The data query period may be understood as a period during which a data query is made.
Specifically, receiving a data query condition uploaded by a user based on a data query interface. And further, after receiving the data query condition, generating a data query request based on the data query condition. After generating the data query request, the data query request may be parsed. And further, the data query condition in the data query request can be obtained, and the data query scene and the data query time period contained in the data query condition are determined.
Optionally, the obtaining of the data query scenario and the data query period of the data query request includes: and acquiring a data query scene and a data query time period of the data query request by calling a predefined data query interface.
The data query interface is obtained by packaging a data query method, and can be used for intercepting a data query request and acquiring a data query scene and a data query time period in the data query request. Alternatively, the data query interface may be a REST standard interface. A data query method may be understood as a method for performing a data query. The data query method may include code logic that invokes a search service (solr) and searches from a database (HBase). The data query interface may be an interface obtained by encapsulating code logic that invokes a search service (solr) and searches from a database (HBase). Compared with the prior art, the method can avoid the need of transmitting all query information during each interaction between the search engine server and the database, thereby reducing the waste of IO resources.
Specifically, a data query interface is predefined. And intercepting a data query request by calling a predefined data query interface. When a data query request is intercepted, the data query request may be parsed. And further, the data query condition in the data query request can be obtained, and the data query scene and the data query time period in the data query condition are determined. This has the advantage of reducing the operational difficulty of data queries.
And S120, determining query information corresponding to the data query scene and the data query time interval.
The query information may include a data set to be queried, a data table to be queried in the data set to be queried, a field to be queried in the data table to be queried, and the like. The query information corresponding to the data query scenario and the data query period may be a query data set, a to-be-queried data table, and a to-be-queried field that conform to the data query scenario and the data query period. The information to be queried can be information generated based on the data set to be queried, the data table to be queried and the field to be queried, which are consistent with the data scene and the data query time.
Optionally, determining query information corresponding to the data query scenario and the data query period includes: and determining a data query configuration file corresponding to the data query scene, and analyzing the data query configuration file to obtain query information corresponding to the data query scene and the data query time interval.
The data query configuration file may be a file configured in advance for each data query scenario. The file format of the data query configuration file may be a JSON format. Optionally, each data query scenario may include at least one business scenario. Illustratively, the data query scenario includes a data query scenario A and a data query scenario B. The service scene comprises a first service scene, a second service scene and a third service scene. Data query scenario a may include business scenario one and business scenario two. Data query scenario B may include business scenario three. It should be noted that each service scenario configured in each data query scenario may be configured according to an actual service requirement, and is not specifically limited herein.
In practical applications, the number of service scenarios included in a data query scenario is usually multiple. In the embodiment of the present invention, for each service scenario in the data query scenario, query information corresponding to the service scenario may be configured in the data query configuration file, for example, a data set to be queried, a data table to be queried, generation time of the data table to be stored, a field to be queried, and the like, which are in accordance with the service scenario, are configured in the data query configuration file.
S130, storing the query information as a query task into a pre-established task queue, and executing the query task in the task queue.
Wherein the task queue may be configured to store at least one query task.
Specifically, after determining the query information, the query information may be used as a query task. After the query task is obtained, the query task may be stored in a pre-created task queue. After storage is complete, a query task in a task queue may be executed to query data from a database or data set based on the query task.
On the basis of the above embodiment, the method further includes: and after the query tasks in the task queue are executed, determining a query result of the query tasks, and displaying the query result.
The query result may be data in the database or the data set that meets the query condition.
Specifically, after the query task in the task queue is executed, a query result corresponding to the query task may be obtained, that is, data meeting the query condition may be obtained. And then the data meeting the query conditions can be displayed. It should be noted that, after the data meeting the query condition is obtained, the data meeting the query condition may be displayed in a preset display manner. Optionally, the preset display mode may be JSON format display. In order to improve the experience of the user, the technical scheme of the embodiment of the invention further comprises the following steps: and displaying the data query conditions.
On the basis of the above embodiment, after the query result is obtained, or after the data meeting the query condition is obtained, the data meeting the query condition may be stored in the JSON format and stored in the preset storage file.
According to the technical scheme of the embodiment of the invention, when the data query request is received, the data query scene and the data query time period of the data query request are obtained. After determining the data query scenario and the data query period, query information corresponding to the data query scenario and the data query period may be determined. In the embodiment of the invention, corresponding query information can be configured for different query scenes, and the data query request can be responded more quickly. After the query information is determined, the query information may be stored as a query task in a pre-created task queue, and the query task in the task queue is executed. Compared with the prior art, the technical scheme of the embodiment of the invention not only reduces the occupation of input and output resources, but also improves the efficiency of data query in the data query process.
Example two
Fig. 2 is a schematic flow chart of a data query method according to a second embodiment of the present invention, where on the basis of the foregoing embodiment, optionally, the executing a query task in the task queue includes: and starting at least one working thread and executing the query task in the task queue. The technical terms that are the same as or corresponding to the above embodiments are not repeated herein.
As shown in fig. 2, the method of this embodiment specifically includes:
s210, when a data query request is received, acquiring a data query scene and a data query time period of the data query request.
And S220, determining query information corresponding to the data query scene and the data query time interval.
And S230, storing the query information as a query task into a pre-established task queue.
S240, starting at least one working thread and executing the query task in the task queue.
Wherein the worker thread may be used to execute a query task in the task queue. The worker threads may include a main thread that searches at a search engine server, a main thread that searches in a database, and a main thread that queries and outputs a file.
Specifically, after the query task is stored in the task queue, a main thread for searching in the search engine server, a main thread for searching in the database, and a main thread for querying and outputting the file may be started. And then the main thread for searching in the search engine server, the main thread for searching in the database and the main thread for inquiring and outputting the file can execute the inquiry task in the task queue. It is understood that the main thread for searching in the search engine server, the main thread for searching in the database, and the main thread for querying and outputting the file may be created in advance before starting the main thread for searching in the search engine server, the main thread for querying and outputting the file.
Optionally, after the main thread for performing search in the search engine server, the main thread for performing search in the database, and the main thread for querying and outputting the file are created, the main thread for performing search in the search engine server, the main thread for performing search in the database, and the main thread for querying and outputting the file may be stored in the thread pool. Correspondingly, the main thread started for searching in the search engine server, the main thread started for searching in the database, and the main thread for inquiring and outputting the file may be the main thread obtained from the thread pool for searching in the search engine server, the main thread started for searching in the database, and the main thread started for inquiring and outputting the file.
In one embodiment, the efficiency of data query can be improved by starting at least one working thread and synchronously executing the query tasks in the task queue.
In another embodiment, at least one working thread is started, the query tasks in the task queue are asynchronously executed, the query result of the data query can be fed back in time, and the response efficiency of the data query is further improved.
Optionally, the query task includes a plurality of sub-query tasks, the number of the worker threads is multiple, and each worker thread can execute one or more sub-query tasks. Starting at least one work thread, and asynchronously executing the query task in the task queue, wherein the method comprises the following steps: a plurality of worker threads are initiated. And then, the sub-query tasks corresponding to the working threads can be executed step by step according to the execution sequence of the sub-query tasks.
On the basis, after the sub-query tasks corresponding to the working threads are distributed and executed, the sub-query results of the sub-query tasks can be obtained. And then, merging each sub-query result, and writing the merged result into a preset database (Redis database).
It should be noted that, before executing the query task in the task queue, it may be determined whether there is currently available resource, that is, whether there is currently space resource. If available resources currently exist, namely, if idle resources currently exist, each working thread can be called, and the sub-query task corresponding to each working thread is executed. And then each sub-query result can be obtained. And further merging the sub-query results, thereby obtaining the query result. This has the advantage that in the data query process, when a large amount of data is queried, partial results can be preferentially returned and preferentially displayed.
In order to improve the efficiency of data query, before the starting at least one work thread and executing the query task in the task queue, the method further comprises: determining the complexity of the query information; and then based on the complexity of the query information, creating the working threads with the number of threads corresponding to the complexity.
In an embodiment of the present invention, determining the complexity of query information includes: and analyzing the query information to determine the number of data sets and/or the number of data tables in the query information. The complexity of the query information may then be determined based on the number of data sets and/or the number of data tables.
On the basis of the above embodiment, the method further comprises: calling a predefined daemon thread method based on a preset thread daemon time interval to determine whether the working thread works normally or not; if not, destroying the working thread and creating a new working thread so as to ensure that the query task of the task queue can be executed through the working thread at any time and further improve the efficiency of data query.
The preset thread daemon time interval can be a time interval configured in advance according to actual requirements, and can be used for representing interval time for calling daemon threads. Illustratively, the thread daemon interval is configured by the following statements: @ Scheduled (cron = "0/5 ×). The daemon thread method can be used for determining whether the working thread works normally, destroying the working thread which does not work normally, and creating a new working thread to ensure that the thread can work normally. It will be appreciated that if the worker thread is working properly, the query task in the task queue is executed based on the worker thread.
According to the technical scheme of the embodiment of the invention, the query task in the task queue is executed by starting at least one working thread. Compared with the prior art, the problem of unstable waiting time in data query is solved, and the technical effect of improving the efficiency of data query is further achieved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a data query device according to a third embodiment of the present invention. As shown in fig. 3, the apparatus includes: a query condition acquisition module 310, a query information determination module 320, and a query task execution module 330.
The query condition obtaining module 310 is configured to, when receiving a data query request, obtain a data query scenario and a data query time period of the data query request;
a query information determining module 320, configured to determine query information corresponding to a data query scenario and a data query period;
the query task execution module 330 is configured to store the query information as a query task in a pre-created task queue, and execute the query task in the task queue.
According to the technical scheme of the embodiment of the invention, when a data query request is received, a query condition acquisition module is used for acquiring a data query scene and a data query time period of the data query request. After the data query scene and the data query period are determined, query information corresponding to the data query scene and the data query period may be determined by the query information determination module. In the embodiment of the invention, corresponding query information can be configured for different query scenes, and the data query request can be responded more quickly. After the query information is determined, the query information can be stored as a query task in a pre-established task queue through a query task execution module, and the query task in the task queue is executed. Compared with the prior art, the technical scheme of the embodiment of the invention not only reduces the occupation of input and output resources, but also improves the efficiency of data query in the data query process.
Optionally, the query condition obtaining module 310 is configured to:
acquiring a data query scene and a data query time period of the data query request by calling a predefined data query interface; the data query interface is obtained by packaging the data query method.
Optionally, the query information determining module 320 is configured to:
and determining a data query configuration file corresponding to the data query scene, and analyzing the data query configuration file to obtain query information corresponding to the data query scene and the data query time interval.
A query task execution module 330 configured to:
and starting at least one working thread and executing the query task in the task queue.
A query task execution module 330 configured to:
and starting at least one working thread, and asynchronously executing the query tasks in the task queue.
Optionally, the apparatus further comprises: a worker thread daemon module for:
calling a predefined daemon thread method based on a preset thread daemon time interval to determine whether the working thread works normally or not;
if not, destroying the working thread and creating a new working thread.
Optionally, before the starting at least one work thread and executing the query task in the task queue, the apparatus further includes: a thread of work creation module to:
and creating working threads with the number of threads corresponding to the complexity based on the complexity of the query information.
Optionally, the apparatus further comprises: a query result display module for:
and after the query tasks in the task queue are executed, determining a query result of the query tasks, and displaying the query result.
The data query device provided by the embodiment of the invention can execute the data query method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the data query apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
Example four
FIG. 4 shows a schematic block diagram of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 4, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the data query method.
In some embodiments, the data query method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the data query method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the data query method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Computer programs for implementing the methods of the present invention can be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user may provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired result of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method for querying data, comprising:
when a data query request is received, acquiring a data query scene and a data query time period of the data query request;
determining query information corresponding to a data query scene and a data query time period;
and storing the query information as a query task into a pre-established task queue, and executing the query task in the task queue.
2. The method of claim 1, wherein obtaining the data query scenario and the data query period of the data query request comprises:
acquiring a data query scene and a data query time period of the data query request by calling a predefined data query interface; the data query interface is obtained by packaging a data query method.
3. The method of claim 1, wherein determining query information corresponding to a data query scenario and a data query period comprises:
and determining a data query configuration file corresponding to the data query scene, and analyzing the data query configuration file to obtain query information corresponding to the data query scene and the data query time interval.
4. The method of claim 1, wherein the executing the query task in the task queue comprises:
and starting at least one working thread and executing the query task in the task queue.
5. The method of claim 4, wherein the initiating at least one worker thread to execute a query task in the task queue comprises:
and starting at least one working thread and asynchronously executing the query tasks in the task queue.
6. The method of claim 4, further comprising:
calling a predefined daemon thread method based on a preset thread daemon time interval to determine whether the working thread works normally or not;
if not, destroying the working thread and creating a new working thread.
7. The method of claim 4, wherein prior to said initiating at least one worker thread to execute a query task in the task queue, the method further comprises:
and creating working threads with the number of threads corresponding to the complexity based on the complexity of the query information.
8. The method of claim 1, further comprising:
and after the query tasks in the task queue are executed, determining a query result of the query tasks, and displaying the query result.
9. A data query apparatus, comprising:
the query condition acquisition module is used for acquiring a data query scene and a data query time period of a data query request when the data query request is received;
the query information determining module is used for determining query information corresponding to a data query scene and a data query time period;
and the query task execution module is used for storing the query information as a query task into a pre-established task queue and executing the query task in the task queue.
10. A computer-readable storage medium storing computer instructions for causing a processor to implement the data query method of any one of claims 1-8 when executed.
CN202210749247.8A 2022-06-28 2022-06-28 Data query method, device and storage medium Pending CN115168760A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210749247.8A CN115168760A (en) 2022-06-28 2022-06-28 Data query method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210749247.8A CN115168760A (en) 2022-06-28 2022-06-28 Data query method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115168760A true CN115168760A (en) 2022-10-11

Family

ID=83489084

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210749247.8A Pending CN115168760A (en) 2022-06-28 2022-06-28 Data query method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115168760A (en)

Similar Documents

Publication Publication Date Title
US20210248469A1 (en) Method and apparatus for scheduling deep learning reasoning engines, device, and medium
US20230020324A1 (en) Task Processing Method and Device, and Electronic Device
CN114428674A (en) Task scheduling method, device, equipment and storage medium
CN116611411A (en) Business system report generation method, device, equipment and storage medium
CN113760638A (en) Log service method and device based on kubernets cluster
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN116383207A (en) Data tag management method and device, electronic equipment and storage medium
CN114610719B (en) Cross-cluster data processing method and device, electronic equipment and storage medium
CN116126719A (en) Interface testing method and device, electronic equipment and storage medium
CN115982273A (en) Data synchronization method, system, electronic equipment and storage medium
CN115168760A (en) Data query method, device and storage medium
CN115658248A (en) Task scheduling method and device, electronic equipment and storage medium
CN115081413A (en) Report generation method, device, system, equipment and medium
CN114356713A (en) Thread pool monitoring method and device, electronic equipment and storage medium
CN114297238A (en) Data query method, device and system based on distributed database system
CN115129438A (en) Method and device for task distributed scheduling
CN112214497A (en) Label processing method and device and computer system
CN114268558B (en) Method, device, equipment and medium for generating monitoring graph
CN114780022B (en) Method and device for realizing additional writing operation, electronic equipment and storage medium
CN116821217A (en) Data distribution conversion method, device, equipment and storage medium
CN115168896A (en) Data processing method and device, electronic equipment and storage medium
CN117806619A (en) Data processing method, device, electronic equipment and medium
CN115794555A (en) Service log processing method, device, equipment and storage medium
CN116225437A (en) Page generation method and device, electronic equipment and storage medium
CN115794860A (en) Data query method, device, equipment and storage medium

Legal Events

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