Data query method and device and storage medium

By obtaining the scenario and time period of the data query request, determining the query information and storing it in the task queue, and using worker threads to execute the query task, the problem of high IO resource consumption and low efficiency in data query is solved, and more efficient data query is achieved.

CN115168760BActive Publication Date: 2026-01-02RUN TECH CO LTD BEIJING
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210749247.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2026-01-02
Estimated Expiration
2042-06-28

AI Technical Summary

Technical Problem

In existing technologies, data query methods require frequent interactions between search engine servers and databases, resulting in high IO resource consumption and low query efficiency.

Method used

By obtaining the scenario and time period of the data query request, the corresponding query information is determined and stored as a query task in a pre-created task queue. The query task is then executed asynchronously by worker threads, reducing IO resource consumption and improving query efficiency.

Benefits of technology

This reduces the consumption of IO resources during data querying, thereby improving the efficiency and response speed of data queries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115168760B_ABST
    Figure CN115168760B_ABST
Patent Text Reader

Abstract

Embodiments of the present application disclose a data query method and device and a storage medium. The method comprises: upon receiving a data query request, obtaining a data query scenario and a data query time period of the data query request; determining query information corresponding to the data query scenario and the data query time period; storing the query information as a query task in a task queue created in advance, and executing the query task in the task queue. The technical solution of the embodiments of the present application not only reduces the occupation of input and output resources in the data query process, but also improves the efficiency of data query.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of computer, in particular to a data query method and device and storage medium. BACKGROUND

[0002] At present, the method of data query is usually based on the database (such as HBase) of the search engine server (such as solr) to query data. In the query process, the search engine server and the database need to be frequently interacted, and there is a technical problem of more IO resource occupation. Moreover, all the information to be queried needs to be transmitted every time, that is, all the fields to be queried need to be transmitted every time, so as to cause the low efficiency of data query. SUMMARY

[0003] The present application provides a data query method, device and storage medium, so as to not only reduce the occupation of IO resources in the data query process, but also improve the efficiency of data query.

[0004] According to an aspect of the present application, a data query method is provided, which comprises:

[0005] When receiving a data query request, obtaining the data query scene and the data query period of the data query request;

[0006] Determining the query information corresponding to the data query scene and the data query period;

[0007] Storing the query information as a query task into a pre-created task queue, and executing the query task in the task queue.

[0008] Optionally, the obtaining of the data query scene and the data query period of the data query request comprises:

[0009] Obtaining the data query scene and the data query period of the data query request by calling a pre-defined data query interface; wherein the data query interface is obtained after encapsulating the data query method.

[0010] Optionally, the determining of the query information corresponding to the data query scene and the data query period comprises:

[0011] Determining the data query configuration file corresponding to the data query scene, and analyzing the data query configuration file to obtain the query information corresponding to the data query scene and the data query period.

[0012] Optionally, the executing of the query task in the task queue comprises:

[0013] starting at least one worker thread to execute a query task in the task queue.

[0014] Optionally, the starting at least one worker thread to execute a query task in the task queue comprises:

[0015] starting at least one worker thread to asynchronously execute a query task in the task queue.

[0016] Optionally, the method further comprises:

[0017] based on a preset thread daemon time interval, calling a predefined daemon thread method to determine whether the worker thread is working normally;

[0018] if not, destroying the worker thread and creating a new worker thread.

[0019] Optionally, before the starting at least one worker thread to execute a query task in the task queue, the method further comprises:

[0020] based on the complexity of the query information, creating worker threads corresponding to the number of threads corresponding to the complexity.

[0021] Optionally, the method further comprises:

[0022] when the query task in the task queue is executed, determining the query result of the query task and displaying the query result.

[0023] According to another aspect of the present application, a data query device is provided. The device comprises:

[0024] a query condition acquisition module, configured to acquire a data query scene and a data query time period of a data query request when the data query request is received;

[0025] a query information determination module, configured to determine query information corresponding to the data query scene and the data query time period;

[0026] a query task execution module, configured to store the query information as a query task into a pre-created task queue, and execute a query task in the task queue.

[0027] According to another aspect of the present application, an electronic device is provided, which comprises:

[0028] at least one processor; and

[0029] a memory in communication connection with the at least one processor; wherein,

[0030] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor to enable the at least one processor to perform the data query method according to any one of the embodiments of the application.

[0031] According to another aspect of the application, a computer readable storage medium is provided, which stores computer instructions for enabling a processor to implement the data query method according to any one of the embodiments of the application when executed by the processor.

[0032] The technical solution of the embodiments of the application, when receiving a data query request, obtains a data query scenario and a data query period of the data query request. After determining the data query scenario and the data query period, the query information corresponding to the data query scenario and the data query period can be determined. In the embodiments of the application, the corresponding query information can be configured for different query scenarios, and the data query request can be responded more quickly. After determining the query information, the query information can be stored as a query task in a task queue created in advance, and the query task in the task queue can be executed. Compared with the prior art, the technical solution of the embodiments of the application not only reduces the occupation of input and output resources in the data query process, but also improves the efficiency of data query.

[0033] It should be understood that the content described in this part is not intended to identify key or important features of the embodiments of the application, nor is it used to limit the scope of the application. Other features of the application will become apparent from the following description. BRIEF DESCRIPTION OF DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed in the embodiment description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative effort.

[0035] Figure 1 A flowchart of a data query method is provided for the first embodiment of the application;

[0036] Figure 2 A flowchart of a data query method is provided for the second embodiment of the application;

[0037] Figure 3 A structural diagram of a data query device is provided for the third embodiment of the application;

[0038] Figure 4 A structural diagram of an electronic device is provided for the fourth embodiment of the application. DETAILED DESCRIPTION

[0039] In order to better understand the technical scheme of the present application, the technical scheme of the embodiments of the present application will be described clearly and completely below in conjunction with the drawings of the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work should fall within the scope of protection of the present application.

[0040] It should be noted that the terms "comprising" and "having" and any variations thereof are intended to cover not exclusively containing, for example, a process, method, system, product or device containing a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0041] It can be understood that, before using the technical scheme disclosed in the embodiments of the present disclosure, the type, use range, use scenario, etc. of the personal information involved in the present disclosure should be informed to the user and the authorization of the user should be obtained in a proper manner according to relevant laws and regulations.

[0042] For example, in response to receiving the active request of the user, prompt information is sent to the user to explicitly prompt the user that the operation requested to be performed will require obtaining and using the personal information of the user. Thus, the user can voluntarily choose whether to provide personal information to the software or hardware such as electronic device, application program, server or storage medium that performs the operation of the technical scheme of the present disclosure according to the prompt information.

[0043] As an optional but non-limiting implementation manner, in response to receiving the active request of the user, the manner of sending prompt information to the user may, for example, be a pop-up window manner, and the prompt information may, for example, be presented in the form of text in the pop-up window. In addition, the pop-up window may, for example, carry a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.

[0044] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present disclosure, and other manners meeting the relevant laws and regulations can also be applied to the implementation manner of the present disclosure.

[0045] It can be understood that the data involved in the technical scheme (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of the relevant laws and regulations and the relevant provisions.

[0046] Embodiment one

[0047] Figure 1A flowchart of a data query method is provided for the first embodiment of the present application. The embodiment can be applied to the case of data query. The method can be executed by a data query device, which can be implemented in the form of hardware and / or software, and can be configured in an electronic device such as a computer or a server.

[0048] As shown in Figure 1 , the method of the embodiment includes:

[0049] In S110, upon receiving a data query request, the data query scenario and the data query period of the data query request are obtained.

[0050] The data query request can be a request for data query generated based on the received data query condition. The data query condition can be a condition for data query input by a user. Specifically, it can be a condition for data query input by a user based on a data query interface. The data query interface can be understood as an interface for data query, which can be used to receive data query conditions input or uploaded by a user.

[0051] Optionally, the format of the data query condition can be JS object notation (JSON) format. The data query condition in JSON format can not only be stored in text format, but also be easy for relevant personnel to read and write, and easy for machines to parse and generate, further effectively improving the network transmission efficiency. The query condition can include but is not limited to the data query scenario and the data query period. The data query scenario can be understood as the scenario of data query. The data query period can be understood as the period of data query.

[0052] Specifically, the user uploads the data query condition based on the data query interface. Then, upon receiving the data query condition, the data query request can be generated based on the data query condition. After generating the data query request, the data query request can be parsed. Then, the data query condition in the data query request can be obtained, and the data query scenario and the data query period contained in the data query condition can be determined.

[0053] Optionally, obtaining the data query scenario and the data query period of the data query request includes: obtaining the data query scenario and the data query period of the data query request by calling a pre-defined data query interface.

[0054] The data query interface is obtained by encapsulating a data query method, can be used to intercept a data query request, and obtain a data query scene and a data query period in the data query request. Optionally, the data query interface can be an interface of a REST standard. The data query method can be understood as a method for data query. The data query method can include code logic for calling a search service (solr) and searching from a database (HBase). The data query interface can be an interface obtained by encapsulating the code logic for calling the search service (solr) and searching from the database (HBase). Compared with the prior art, the full query information needs to be transmitted every time the search engine server and the database interact, so that the IO resource waste can be reduced.

[0055] Specifically, the data query interface is defined in advance. The data query request is intercepted by calling the pre-defined data query interface. When the data query request is intercepted, the data query request can be parsed. Then the data query condition in the data query request can be obtained, and the data query scene and the data query period in the data query condition can be determined. This processing has the advantage of reducing the operation difficulty of data query.

[0056] S120, determine the query information corresponding to the data query scene and the data query period.

[0057] The query information can include a to-be-queried data set, a to-be-queried data table in the to-be-queried data set, and a to-be-queried field in the to-be-queried data table. The query information corresponding to the data query scene and the data query period can be a query data set, a to-be-queried data table, and a to-be-queried field that meet the data query scene and the data query period. The to-be-queried information can be information generated based on the to-be-queried data set, the to-be-queried data table, and the to-be-queried field that meet the data scene and the data query time.

[0058] Optionally, determining the query information corresponding to the data query scene and the data query period includes: determining a data query configuration file corresponding to the data query scene, and parsing the data query configuration file to obtain the query information corresponding to the data query scene and the data query period.

[0059] The data query configuration file can be a file preconfigured for each data query scene. The data query configuration file can be in JSON format. Optionally, each data query scene can include at least one business scene. For example, the data query scenes include a data query scene A and a data query scene B. The business scenes include a business scene one, a business scene two, and a business scene three. The data query scene A can include the business scene one and the business scene two. The data query scene B can include the business scene three. It should be noted that each business scene configured in each data query scene can be configured according to actual business requirements, which is not limited herein.

[0060] In actual applications, the number of business scenes included in a data query scene is usually multiple. In the embodiment of the present application, for each business scene in a data query scene, the query information corresponding to the business scene can be configured in the data query configuration file, such as configuring the to-be-queried data set, the to-be-queried data table, the generation time of the to-be-stored data table, and the to-be-queried field that meet the business scene in the data query configuration file.

[0061] S130, storing the query information as a query task in a pre-created task queue, and executing the query task in the task queue.

[0062] The task queue can be used to store at least one query task.

[0063] Specifically, after determining the query information, the query information can be stored as a query task. After obtaining the query task, the query task can be stored in a pre-created task queue. After storage is completed, the query task in the task queue can be executed to query data from a database or a data set based on the query task.

[0064] Based on the above embodiment, the method further includes: when the query task in the task queue is executed, determining a query result corresponding to the query task, and displaying the query result.

[0065] The query result can be data in the database or the data set that meets the query condition.

[0066] Specifically, when the query task in the task queue is executed, the query result corresponding to the query task can be obtained, that is, the data meeting the query condition can be obtained. Then, the data meeting the query condition can be displayed. It should be noted that after obtaining the data meeting the query condition, the data meeting the query condition can be displayed in a preset display mode. Optionally, the preset display mode can be a JSON format display. In order to improve the user experience, the technical solution of the embodiment of the present application further includes: displaying the data query condition.

[0067] On the basis of the above-mentioned embodiments, after obtaining the query result, or after obtaining the data meeting the query condition, the data meeting the query condition can be stored in JSON format and stored in a preset storage file.

[0068] The technical solution of the embodiment of the present application, when receiving a data query request, obtains the data query scene and the data query period of the data query request. After determining the data query scene and the data query period, the query information corresponding to the data query scene and the data query period can be determined. In the embodiment of the present application, the corresponding query information can be configured for different query scenes, and the data query request can be responded more quickly. After determining the query information, the query information can be stored as a query task in a task queue created in advance, and the query task in the task queue can be executed. Compared with the prior art, the technical solution of the embodiment of the present application not only reduces the occupation of input and output resources in the data query process, but also improves the efficiency of data query.

[0069] Embodiment two

[0070] Figure 2 The flowchart of a data query method provided by the second embodiment of the present application, on the basis of the foregoing embodiment, optionally, the execution of the query task in the task queue includes starting at least one working thread to execute the query task in the task queue. Wherein, the same or corresponding technical terms as the above-mentioned embodiments are not described here.

[0071] As Figure 2 shown, the method of the present embodiment specifically includes:

[0072] S210, when receiving a data query request, obtaining the data query scene and the data query period of the data query request.

[0073] S220, determining the query information corresponding to the data query scene and the data query period.

[0074] S230, storing the query information as a query task in a task queue created in advance.

[0075] S240, starting at least one working thread to execute the query task in the task queue.

[0076] Wherein, the working thread can be used to execute the query task in the task queue. The working thread can include the main thread of the search engine server for searching, the main thread of the database for searching, and the main thread of the query and output file.

[0077] Specifically, when the query task is stored to the task queue, 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 files can be started. Then the query task in the task queue can be executed by 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 files. It can be 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 files can be created in advance before 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 files are started.

[0078] Optionally, after 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 files are created, 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 files can be stored in the thread pool. Correspondingly, starting 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 files can be to obtain 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 files from the thread pool and start.

[0079] In one embodiment, at least one worker thread is started to synchronously execute the query task in the task queue, which can improve the efficiency of data query.

[0080] In another embodiment, at least one worker thread is started to asynchronously execute the query task in the task queue, which can timely feedback the query result of data query and further improve the response efficiency of data query.

[0081] Optionally, the query task includes a plurality of sub-query tasks, and the number of worker threads is a plurality, and each worker thread can execute one or more sub-query tasks. Starting at least one worker thread to asynchronously execute the query task in the task queue includes starting a plurality of worker threads. Then the sub-query tasks corresponding to each worker thread can be executed step by step according to the execution order of each sub-query task.

[0082] On this basis, after the sub-query tasks corresponding to each worker thread are executed in distribution, the sub-query result of each sub-query task can be obtained. Then each sub-query result can be merged and written into a preset database (Redis database).

[0083] It should be noted that before executing the query task in the task queue, it can be determined whether there is a resource available at present, that is, it can be determined whether there is a space resource at present. If there is a resource available at present, that is, if there is a free resource at present, each work thread can be called to execute the sub-query task corresponding to each work thread. In turn, each sub-query result can be obtained. Further merging processing each sub-query result, the query result can be obtained. The advantage of this is that in the data query process, when a large amount of data is queried, part of the result can be returned and displayed in priority.

[0084] In order to improve the efficiency of data query, before starting at least one work thread to execute 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, the number of work threads corresponding to the complexity can be created.

[0085] In the embodiment of the application, the complexity of the query information is determined by analyzing the query information to determine the number of data sets and / or the number of data tables in the query information. Then, the complexity of the query information can be determined according to the number of data sets and / or the number of data tables.

[0086] On the basis of the above-mentioned embodiment, the method further comprises: based on a preset thread daemon time interval, calling a pre-defined daemon thread method to determine whether the work thread is working normally; if not, destroying the work thread and creating a new work thread to ensure that the query task in the task queue can be executed by the work thread at any time, further improving the efficiency of data query.

[0087] The preset thread daemon time interval can be a time interval pre-configured according to actual needs, which can be used to represent the interval time of calling the daemon thread. For example, the thread daemon time interval can be configured by the following statement: @Scheduled(cron="0 0 / 5***?"), which can represent that the daemon thread method is called once every 5 seconds, that is, the daemon thread method is executed once every 5 seconds. The daemon thread method can be used to determine whether the work thread is working normally, destroy the work thread that is not working normally, and create a new work thread to ensure that the thread can work normally. It can be understood that if the work thread is working normally, the query task in the task queue can be executed based on the work thread.

[0088] The technical scheme of the embodiment of the application starts at least one work thread to execute the query task in the task queue. 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.

[0089] Embodiment three

[0090] Figure 3 Figure 1 is a structural schematic diagram of a data query device according to an embodiment of the present application. Figure 3 As shown in the figure, the device comprises a query condition acquisition module 310, a query information determination module 320 and a query task execution module 330.

[0091] The query condition acquisition module 310 is configured to acquire a data query scene and a data query time period of a data query request when the data query request is received.

[0092] The query information determination module 320 is configured to determine query information corresponding to the data query scene and the data query time period.

[0093] 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.

[0094] The technical solution of the embodiment of the present application acquires a data query scene and a data query time period of a data query request through a query condition acquisition module when the data query request is received. After the data query scene and the data query time period are determined, the query information determination module can be used to determine query information corresponding to the data query scene and the data query time period. In the embodiment of the present application, the 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 task execution module can be used to store the query information as a query task in a pre-created task queue and execute the query task in the task queue. Compared with the prior art, the technical solution of the embodiment of the present application not only reduces the occupation of input and output resources in the data query process, but also improves the efficiency of data query.

[0095] Optionally, the query condition acquisition module 310 is configured to:

[0096] acquire the data query scene and the data query time period of the data query request by calling a pre-defined data query interface, wherein the data query interface is obtained by encapsulating a data query method.

[0097] Optionally, the query information determination module 320 is configured to:

[0098] determine a data query configuration file corresponding to the data query scene, and parse the data query configuration file to obtain the query information corresponding to the data query scene and the data query time period.

[0099] The query task execution module 330 is configured to:

[0100] start at least one worker thread to execute the query task in the task queue.

[0101] The query task execution module 330 is configured to:

[0102] start at least one worker thread to execute the query task in the task queue.

[0103] Optionally, the apparatus further comprises a worker thread daemon module configured to:

[0104] based on a preset thread daemon time interval, call a predefined daemon thread method to determine whether the worker thread is working normally;

[0105] if not, destroy the worker thread and create a new worker thread.

[0106] Optionally, before the step of starting at least one worker thread to execute the query task in the task queue, the apparatus further comprises a worker thread creation module configured to:

[0107] based on the complexity of the query information, create worker threads corresponding to the number of threads.

[0108] Optionally, the apparatus further comprises a query result display module configured to:

[0109] when the query task in the task queue is executed, determine the query result of the query task and display the query result.

[0110] The data query apparatus provided by the embodiments of the present application can execute the data query method provided by any of the embodiments of the present application, and has the corresponding functional modules and beneficial effects of the execution method.

[0111] It should be noted that each unit and module included in the above data query apparatus is only divided according to the function logic, but is not limited to the above division, as long as the corresponding function can be realized; in addition, the specific name of each functional unit is only for convenient mutual distinction, and is not used to limit the protection scope of the embodiments of the present application.

[0112] Embodiment Four

[0113] Figure 4A structural diagram of an electronic device 10 that can be used to implement embodiments of the present application is shown. The electronic device is intended to represent various forms of digital computers, such as laptops, desktops, tablets, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular telephones, smartphones, wearable devices (e.g., headsets, glasses, watches, etc.), and other similar computing devices. The components shown here, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the present application described and / or claimed in this document.

[0114] As shown in Figure 4 The electronic device 10 includes at least one processor 11, and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., communicatively connected to the at least one processor 11, where the memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer programs stored in the read-only memory (ROM) 12 or loaded from the storage unit 18 into the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0115] Various 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, etc., an output unit 17, such as various types of displays, speakers, etc., a storage unit 18, such as a magnetic disk, an optical disk, etc., and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network, such as the Internet, and / or various telecommunication networks.

[0116] The processor 11 can be various general and / or special purpose processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 performs various methods and processes described above, such as the data query method.

[0117] In some embodiments, the data query method can be implemented as a computer program tangibly embodied in a computer readable storage medium, e.g., storage unit 18. In some embodiments, parts or all of the computer program can be loaded and / or installed onto electronic device 10 via, e.g., ROM 12 and / or communication unit 19. When the computer program is loaded onto RAM 13 and executed by processor 11, one or more steps of the data query method described above can be performed. Alternatively, in other embodiments, processor 11 can be configured to perform the data query method by way of other means, e.g., with the aid of firmware.

[0118] Various implementations of the systems and techniques described above can be realized in digital electronic circuitry, integrated circuitry, a field programmable gate array (FPGA), an application specific integrated circuit (ASIC), a system on a chip (SOC), a programmable logic device (PLD), a computer hardware, firmware, software, and / or combinations thereof. These various implementations can include implementation in one or more computer programs that are executable and / or interpretable on a programmable system including at least one programmable processor, which can be special or general purpose, coupled to receive data and instructions from, and to transmit data and instructions to, a storage system, at least one input device, and at least one output device.

[0119] Computer programs used to implement the methods of the present application can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the computer program, when executed by the processor of the machine, implements the functions / acts specified in the flowcharts and / or block diagrams. The computer program can be executed entirely on a machine, partially on a machine, partially on a machine as part of a separate software package, or entirely on a remote machine or server.

[0120] In the context of the present application, a computer-readable storage medium can 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 can 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, a computer-readable storage medium can be a machine-readable signal medium. More specific examples of a machine-readable storage medium will include one or more lines of a program of instructions in a transitory signal, 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 portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0121] 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 the user and a keyboard and a pointing device (e.g., a mouse or a trackball) by which the user can provide input to the electronic device. Other kinds of devices can be used to provide for interaction with a user as well; 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 can be received in any form, including acoustic, speech, or tactile input.

[0122] 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 a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0123] The computing system can 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 known as a cloud computing server or cloud host, which is a host product in the cloud computing service system, to solve the defects of large management difficulty and weak business scalability in traditional physical host and VPS service.

[0124] It should be understood that the various forms of flow shown above can be reordered, added to, or have steps deleted. For example, the steps described in the present application can be performed in parallel, in series, or in a different order, as long as the desired results of the technical solutions of the present application can be achieved, and this is not limited herein.

[0125] The above detailed description does not constitute a limitation on the protection scope of the present application. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent replacements, and improvements made within the spirit and principles of the present application shall be included in the protection scope of the present application.

Claims

1. A data query method, characterized by, The method comprises the steps of: Upon receiving a data query request, obtaining a data query scenario and a data query period of the data query request; Determining query information corresponding to the data query scenario and the data query period; Storing the query information as a query task into a pre-created task queue, and executing the query task in the task queue; The method further comprises the steps of: Calling a pre-defined data query interface to obtain the data query scenario and the data query period of the data query request; wherein the data query interface is obtained by encapsulating a data query method; The method further comprises the steps of: Determining a data query configuration file corresponding to the data query scenario, and parsing the data query configuration file to obtain the query information corresponding to the data query scenario and the data query period; wherein the query information comprises a data set to be queried, a data table to be queried in the data set to be queried, and a field to be queried in the data table to be queried.

2. The method of claim 1, wherein, The method further comprises the steps of: Starting at least one working thread to execute the query task in the task queue.

3. The method of claim 2, wherein, The method further comprises the steps of: Starting at least one working thread to asynchronously execute the query task in the task queue.

4. The method of claim 2, wherein, The method further comprises the steps of: Based on a pre-set thread daemon time interval, calling a pre-defined daemon thread method to determine whether the working thread is working normally; If not, destroying the working thread and creating a new working thread.

5. The method of claim 2, wherein, The method further comprises the steps of: Before starting at least one working thread to execute the query task in the task queue, based on the complexity of the query information, creating working threads corresponding to the number of threads.

6. The method of claim 1, wherein, The method further comprises the steps of: After the query task in the task queue is executed, determining a query result of the query task and displaying the query result.

7. A data query apparatus, characterized by comprising: The method comprises the steps of: A query condition obtaining module is configured to, upon receiving a data query request, obtain a data query scenario and a data query period of the data query request; A query information determining module is configured to determine query information corresponding to the data query scenario and the data query period; A query task executing module is configured to store the query information as a query task into a pre-created task queue, and execute the query task in the task queue; The query condition obtaining module is specifically configured to call a pre-defined data query interface to obtain the data query scenario and the data query period of the data query request; wherein the data query interface is obtained by encapsulating a data query method; The query information determination module is specifically configured to determine a data query configuration file corresponding to the data query scenario, parse the data query configuration file, and obtain query information corresponding to the data query scenario and the data query time period. The query information includes a data set to be queried, a data table to be queried in the data set to be queried, and a field to be queried in the data table to be queried.

8. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to make the processor execute to implement the data query method in any one of claims 1-6.

Citation Information

Patent Citations

  • Service data inquiry method, device, electronic device and storage medium

    CN109508344A

  • Fuzzy query method and device for Kafka data, electronic equipment and storage medium

    CN112506992A

  • Distributed task scheduling method and system

    CN114035948A