CN115827240A - Data query method, device, equipment, system and storage medium - Google Patents

Data query method, device, equipment, system and storage medium Download PDF

Info

Publication number
CN115827240A
CN115827240A CN202211611724.0A CN202211611724A CN115827240A CN 115827240 A CN115827240 A CN 115827240A CN 202211611724 A CN202211611724 A CN 202211611724A CN 115827240 A CN115827240 A CN 115827240A
Authority
CN
China
Prior art keywords
target
server
service data
query
service
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
CN202211611724.0A
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 SoundAI Technology Co Ltd
Original Assignee
Beijing SoundAI 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 SoundAI Technology Co Ltd filed Critical Beijing SoundAI Technology Co Ltd
Priority to CN202211611724.0A priority Critical patent/CN115827240A/en
Publication of CN115827240A publication Critical patent/CN115827240A/en
Pending legal-status Critical Current

Links

Images

Abstract

The application discloses a data query method, a data query device, data query equipment, a data query system and a storage medium, and belongs to the technical field of computers. According to the method, after the quantity of target service data required by a terminal is determined based on a service data query request of the terminal to a target service, if the quantity is larger than or equal to the target quantity, a main server of the target service submits a target query task to another server, and the other server executes the target query task to replace the main server to finish the service data query request, so that asynchronous decoupling processing of the service data query request is realized, the main server does not need to process the service data query request, occupation of hardware resources of the main server is reduced, the main server can have sufficient hardware resources to provide services for a main process of the target service, and further performance of the main process of the target service can be improved.

Description

Data query method, device, equipment, system and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data query method, apparatus, device, system, and storage medium.
Background
Most of the current service systems support the query of service data, for example, a terminal queries service data through a service main server in the service system.
However, the main server provides a background service for the main process of the service in addition to the query service of the service data, and when a large number of terminals query the service data through the main server or the terminals query the service data in a large batch, the query service of the service data occupies a large amount of hardware resources of the main server, which results in a reduction of the hardware resources allocated to the main process of the service by the main server, and further results in a reduction of the performance of the main process of the service.
Disclosure of Invention
The embodiment of the application provides a data query method, a data query device, data query equipment, a data query system and a storage medium, and can improve the performance of a main service flow in a main service server of a service. The technical scheme is as follows:
in a first aspect, a data query method is provided, where the method is performed by a first server, and the first server is a master server of a target service, and the method includes:
determining the quantity of target service data required by the terminal based on a service data query request of the terminal to the target service;
if the number is larger than or equal to the target number, submitting a target query task to a second server of the target service based on the service data query request, wherein the target query task indicates that the service data query request is completed;
acquiring the target service data inquired in the service data of the target service by the second server based on the target inquiry task;
and sending the target service data to a terminal.
In a second aspect, a data query method is provided, where the method is performed by a second server, and the method includes:
acquiring a target query task submitted by a first server, wherein the first server is a main server of a target service, and the target query task indicates that a service data query request of a terminal to the target service is completed;
inquiring target business data in the business data of the target business based on the target inquiry task;
and providing the inquired target business data to the first server.
In a third aspect, a service system is provided, where the system includes a first server and a second server, where the first server is a main server of a target service;
the first server is used for determining the quantity of the target service data required by the terminal based on a service data query request of the terminal to the target service; if the number is larger than or equal to the target number, submitting a target query task to a second server of the target service based on the service data query request, wherein the target query task indicates that the service data query request is completed;
the second server is used for inquiring target service data in the service data of the target service based on the target inquiry task; providing the inquired target business data to the first server;
the first server is further configured to obtain the target service data provided by the second server; and sending the target service data to a terminal.
In a possible implementation manner, the first server is further configured to record the target query task in a task table of the target service if the number is greater than or equal to a target number, and the task table is visible to the second server;
the second server is further configured to scan each query task recorded by the first server in the task table of the target service to obtain a query task that has not been executed yet.
In a possible implementation manner, the first server is associated with a first database of the target service, the first database is used for storing service data of the target service, the second server is associated with a second database of the target service, and the second database is used for storing a copy of the service data in the first database;
the second server is further configured to query the target service data in the second database based on the target query task.
In a possible implementation manner, the second server is further configured to store the target service data to a shared disk between the first server and the second server;
the first server is further configured to read the target service data from a shared disk between the first server and the second server when the second server completes the target query task.
In a possible implementation manner, the service data of the target service is medical detection data.
In a fourth aspect, there is provided a data query apparatus configured as a master server of a target service, the apparatus comprising:
the determining module is used for determining the quantity of the target service data required by the terminal based on a service data query request of the terminal to the target service;
a submitting module, configured to submit a target query task to a second server of the target service based on the service data query request if the number is greater than or equal to a target number, where the target query task indicates that the service data query request is completed;
an obtaining module, configured to obtain the target service data queried in the service data of the target service by the second server based on the target query task;
and the sending module is used for sending the target service data to the terminal.
In one possible implementation, the submission module is configured to:
and if the number is larger than or equal to the target number, recording the target query task in a task table of the target service, wherein the task table is visible to the second server.
In one possible implementation manner, the obtaining module is configured to:
and under the condition that the second server completes the target query task, reading the target service data from a shared disk between the first server and the second server.
In a possible implementation manner, the service data of the target service is medical detection data.
In a fifth aspect, a data query apparatus is provided, the apparatus including:
the system comprises an acquisition module, a service data query module and a service data query module, wherein the acquisition module is used for acquiring a target query task submitted by a first server, the first server is a main server of a target service, and the target query task indicates that a service data query request of a terminal to the target service is completed;
the query module is used for querying target service data in the service data of the target service based on the target query task;
and the providing module is used for providing the inquired target business data to the first server.
In one possible implementation manner, the obtaining module is configured to:
and scanning each query task recorded by the first server in the task table of the target service to obtain the query tasks which are not executed yet.
In a possible implementation manner, the first server is associated with a first database of the target service, the first database is used for storing service data of the target service, the second server is associated with a second database of the target service, and the second database is used for storing a copy of the service data in the first database; the query module is configured to:
and querying the target business data in the second database based on the target query task.
In one possible implementation, the providing module is configured to:
and storing the target service data to a shared disk between the first server and the second server, and reading the target service data from the shared disk by the first server.
In a possible implementation manner, the service data of the target service is medical detection data.
In a sixth aspect, a computer device is provided, the computer device comprising one or more processors and one or more memories, in which at least one computer program is stored, the at least one computer program being loaded and executed by the one or more processors to implement the data query method as provided in the first aspect or the various alternative implementations of the first aspect, or to implement the data query method as provided in the second aspect or the various alternative implementations of the second aspect.
In a seventh aspect, a computer-readable storage medium is provided, in which at least one computer program is stored, which is loaded and executed by a processor to implement the data query method as provided in the first aspect or the various alternative implementations of the first aspect, or to implement the data query method as provided in the second aspect or the various alternative implementations of the second aspect.
In an eighth aspect, a computer program product is provided, which includes at least one computer program, the at least one computer program being stored in a computer-readable storage medium, the at least one computer program being read by a processor of a computer device from the computer-readable storage medium, the processor executing the at least one computer program, so that the computer device executes the data query method provided in the first aspect or the various optional implementations of the first aspect, or so that the computer device executes the data query method provided in the second aspect or the various optional implementations of the second aspect.
The technical scheme provided by the embodiment of the application has the following beneficial effects:
after the quantity of target service data required by a terminal is determined based on a service data query request of the terminal to a target service, if the quantity is larger than or equal to the target quantity, a main server of the target service submits a target query task to another server, and the other server executes the target query task to replace the main server to finish the service data query request, so that asynchronous decoupling processing of the service data query request is realized, the main server does not need to process the service data query request, occupation of hardware resources of the main server is reduced, the main server can have sufficient hardware resources to provide service for a main process of the target service, and further performance of the main process of the target service can be improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings without creative efforts.
Fig. 1 is a schematic diagram of a service system of a target service provided in an embodiment of the present application;
FIG. 2 is a flowchart of a data query method provided by an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a data query device according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a data query device provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
The terms "first," "second," and the like, in this application, are used for distinguishing between similar items and items that have substantially the same function or similar functionality, and it should be understood that "first," "second," and "nth" do not have any logical or temporal dependency, nor do they define a quantity or order of execution. It will be further understood that, although the following description uses the terms first, second, etc. to describe various elements, these elements should not be limited by these terms.
These terms are only used to distinguish one element from another. For example, a first element can be termed a second element, and, similarly, a second element can also be termed a first element, without departing from the scope of various examples. The first element and the second element may both be elements, and in some cases, may be separate and distinct elements.
For example, at least one element may be an integer number of elements equal to or greater than one, such as one element, two elements, three elements, and the like. At least two means two or more, for example, at least two elements may be any integer number of two or more than two, such as two elements, three elements, etc.
Fig. 1 is a schematic diagram of a service system of a target service provided in an embodiment of the present application, where the target service is any kind of service, for example, the target service is a service related to medical detection or other services, and the embodiment of the present application specifically defines the target service.
Referring to fig. 1, the service system includes a terminal 101, a first server 102 and a second server 103, wherein the terminal 101 is connected to the first server 102 through a wired network or a wireless network, the first server 102 is directly or indirectly connected to the second server 103 through a wired network or a wireless network, and in other embodiments, the terminal 101 is further connected to the second server 103 through a wired network or a wireless network.
The terminal 101 in the service system is at least one, and the terminal 101 includes at least one of a smart phone, a tablet computer, a smart speaker, a smart watch, a notebook computer, a smart phone, a smart car device, a portable game device, or a desktop computer, where the type of the terminal 101 in the service system is not limited in this embodiment.
A target application for providing a service related to a target service is installed and executed in the terminal 101. Taking the target service as the service related to medical detection as an example, the service provided by the target application program includes a service data query service, a service data upload service, a user information entry service, and the like of the target service.
Each of the first server 102 and the second server 103 includes at least one of a server, a plurality of servers, a cloud computing platform, or a virtualization center. Optionally, each of the first server 102 and the second server 103 is an independent physical server, or a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing basic cloud computing services such as cloud service, cloud database, cloud computing, cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content Delivery Network (CDN), big data and artificial intelligence platform, and the like.
The first server 102 is a main server of the target service, and may also be understood as a main server of the target application program or a main server of the service system. The first server 102 is configured to provide a background service for the target application, for example, the first server 102 provides the background service for the target application by running a background main program of the target application, and the services that can be provided by the target application all depend on the background main program, which is understood to be a main program of the target service.
The background main program occupies hardware resources and network transmission resources of the first server 102 during the running process, wherein the hardware resources include Central Processing Units (CPU) resources, input/output (I/O) resources, and memory resources.
Considering that in the related art, the service data query service provided by the target application program is generally implemented by the main server of the target service, when a large number of terminals query the service data through the main server or query the service data by the terminals in large quantities, the service data query service may occupy a large amount of hardware resources of the main service, which results in a reduction of hardware resources of the main process (or background main program) allocated to the target service by the main server, and further results in a reduction of performance of the main process of the service
Based on this, in the embodiment of the present application, the second server 103 is additionally disposed in the service system, the second server 103 is configured to provide a service data query service for the first server 102, and when the first server 102 has a requirement for querying the service data, the second server 103 can replace the first server 102 to query the service data, so as to save hardware resources required by the first server 102 when querying the service data, and further enable the first server 102 to allocate more hardware resources to the background main program of the target application program, so as to improve performance of the main program of the target service.
Next, based on the service system described above, the following description is made on the query process of the service data in the service system and the query process of the second server replacing the first server for the service data.
Fig. 2 is a flowchart of a data query method provided in an embodiment of the present application, and referring to fig. 2, the embodiment includes the following steps:
201. the terminal sends a service data query request for the target service to the first server, wherein the service data query request indicates to query the service data of the target service.
The first server is a main service of the target service, and the terminal is any terminal provided with the target program. The target service is any kind of service, for example, the target service is a service related to medical detection or other services, and the target service is not specifically limited in the embodiments of the present application. In the case where the target service is a service related to medical examination, the service data of the target service is medical examination data.
The business data query request comprises query conditions of the business data to be queried and information of a query party, wherein the query conditions comprise at least one of acquisition time, acquisition area information, acquisition object information and business types of the business data to be queried. The acquisition region information indicates a region where the service data to be queried is acquired, and the acquisition object information indicates an object (i.e., an acquisition object) to which the service data to be queried belongs, for example, medical detection data obtained by a certain user performing medical detection is service data, and the user is the acquisition object to which the service data belongs. The acquisition object information is information related to an acquisition object of the service data to be queried, such as an identity, a contact way, an address and the like of the acquisition object. The target service comprises at least one sub-service, the service types of different sub-services are different, the service type of the service data to be queried is the service type of the sub-service to which the service data to be queried belongs, the service data to be queried may belong to one sub-service or may attribute multiple sub-services, and here, the number and the type of the sub-services in the target service are not limited in the embodiment of the application, and the sub-service to which the service data to be queried belongs is not limited in the embodiment of the application.
The inquiring party information includes terminal information of the terminal and an account number of the terminal for logging in a target application program, wherein the terminal information includes an identifier of the terminal and/or a network protocol address of the terminal.
The service data query request is generated based on a target application program, illustratively, the terminal displays a query interface of the target service in the process of running the target application program, a user inputs a query condition in the query interface, the user performs query operation on the query condition on the query interface, the terminal responds to the query operation to generate the service data query request, and sends the service data query request to the second server to request the second server to query service data meeting the query condition.
202. The first server determines the quantity of the target service data required by the terminal based on the service data query request of the terminal to the target service.
The target service data required by the terminal is data to be inquired of a service data inquiry request, at least one piece of target service data is provided, and the number of the target service data is the total number of the target service data in the service data of the target service.
In a possible implementation manner, the first server is associated with a first database of the target service, the first database is used for storing service data of the target service, and the first server queries the target service data in the first database based on the service data query request. For example, the first database records metadata of a plurality of pieces of service data of a target service, wherein the metadata of each piece of service data includes at least one of collection time, collection area information, collection object information, and a service type of the service data. After receiving the service data query request, the first server obtains a query condition from the service data query request, queries target metadata meeting the query condition from metadata of a plurality of pieces of service data of a target service, and takes the service data corresponding to each queried target metadata as target service data, namely the target service data meets the query condition.
After the target service data are inquired, the first server counts the number of the inquired target service data, and if the number of the inquired target service data is smaller than the target number, the first server acquires the inquired target service data from the first database and sends the acquired target service data to the terminal. The target number is, for example, 5000 or 10000, and the target number may be set according to a specific implementation scenario, performance of the first server, or performance of the first database, where the target number is not limited in this embodiment of the application.
In another possible implementation manner, after acquiring the target service data from the first database, the first server does not send the target service data to the terminal for the moment, but sends the target service data to the terminal after receiving a download request of the terminal for the target service data. For example, in the process of processing the service data query request, the first server also synchronizes the query progress of the target service data to the terminal, the terminal displays the query progress of the target service data, when the query of the target service data is completed (that is, the first server obtains the target service data meeting the query condition), the terminal displays the query progress of the target service data as the query completion, the user performs a download operation on the queried target service data in a query interface of the terminal, the terminal sends a download request for the target service data to the first server in response to the download operation, and after receiving the download request, the first server sends the queried target service data to the terminal according to the download request.
In a possible implementation manner, the first server imports the queried target service data into a table before sending the target service data to the terminal, packages the table including the target service data into a target file based on the information of the querying party in the service data query request, and sends the target file to the terminal. The target file may be a compressed file or an uncompressed file, and the file name of the target file is obtained based on the information of the querying party, for example, the file name includes the information of the querying party.
Based on the possible implementation manner, under the condition that the number of the inquired target service data is smaller than the target number, the inquired target service data is returned to the terminal by the first server, that is, the first server completely processes the service data inquiry request, and because the number of the target service data is smaller than the target number, even if the first server completely processes the service data inquiry request, the hardware resource of the first server is not greatly occupied in the process of processing the service data inquiry request, so that the influence of the service data inquiry request on the performance of the main flow of the target service is small at this time.
203. And if the quantity of the target service data is larger than or equal to the target quantity, the first server submits a target query task to the second server of the target service based on the service data query request, and the target query task indicates that the service data query request is completed.
The target query task comprises query conditions of the target business data and information of a query party.
If the number of the target service data is larger than or equal to the target number, the first server generates a target query task based on the query condition and the information of the query party in the service data query request, submits the target query task to the second server, and the second server completes the service data query request based on the target query task.
The first server submits the target query task to the second server in any one of the following modes A1 or A2.
In the method A1, if the number of the target service data is greater than or equal to the target number, the first server sends the target query task to the second server.
In the method A2, if the number of the target service data is greater than or equal to the target number, the first server records the target query task in the task table of the target service, and the task table is visible to the second server.
The task table is used for recording query tasks generated by the first server based on the service data query requests of the terminals. In addition, the state table is also used for recording the task state of each query task, so that the first server and the second server can learn the task state of each query task from the state table at any time. For example, when the first server records the target query task in the state table, the first server also records the task state of the target query task as unexecuted to instruct the second server to execute the target query task.
In a possible implementation manner, the task table is stored in a first database associated with the first server, and the second server has a data query right for the first database. For example, if the number of the queried target service data is greater than or equal to the target number, the first server records the target query task in the task table in the first database, and since the second server has a data query right for the first database, the second server can query the state table in the first database, so that the first server records the target query task in the task table in the first database, and can submit the target query task to the second server.
In another possible implementation manner, the second server does not have the data query authority for the first database, the second server is associated with the second database of the target service, and the second server has the data query authority for the second database. The second database is used for storing a copy of the service data of the target service in the first database, and the second database is also used for storing a copy of the task table in the first database, it can be understood that the second database is a copy database in the first database to serve as a hidden node of the first database, and the second database and the first database store data (such as service data or status table) and store data in the same manner.
For example, the first database has a function of synchronously storing data to the second database, if the number of the queried target service data is greater than or equal to the target number, the first server records the target query task in the task table in the first database, and then the second database synchronizes the target query task recorded newly in the task table to the task table in the second database.
204. The second server obtains the target query task submitted by the first server.
And if the first server submits the target query task to the first server in a sending mode, the second server receives the target query task sent by the first server to obtain the target query task submitted by the first server.
And if the first server submits the target query task to the first server in the task table, the second server scans all query tasks recorded by the first server in the task table to obtain query tasks which are not executed yet, and the query tasks which are not executed yet are used as the target query tasks. For example, the second server periodically scans the task state of each query task in the task table, and if the task state scanned to any query task is not executed, the query task is taken as the target query task. In addition, after scanning the target query task, the second server may further update the task status of the target query task to be in execution to indicate that the second server is executing the target query task, where the process of the second server executing the target query task includes the following steps 205 and 206.
205. And the second server inquires the target business data in the business data of the target business based on the target inquiry task.
And after the second server acquires the target query task, querying the target service data meeting the query condition in the service data of the target service according to the query condition in the target query task.
For example, the second server has data query authority for a first database associated with the first server, the second server queries the target business data in the first database based on the query condition, and the query process may refer to a process in which the first server queries the target business data in the first database based on the query condition.
For another example, the second server does not have the data query right on the first database associated with the first server, and the second server is associated with a second database of the target service, where the second database is used to store a copy of the service data of the target service in the first database, it can be understood that the second database is a copy database in the first database, and serves as a hidden node of the first database, and the service data and the stored service data stored in the second database and the first database are the same.
The second server has data query authority to the second database, and the second server queries target service data in the second database based on the target query task. Illustratively, the second server queries the target business data in the first database based on the query condition in the target query task, and the query process may refer to a process in which the first server queries the target business data in the first database based on the query condition.
When the second server queries the target service data from the second database, the target service data is acquired from the second database, and in the process that the second server acquires the target service data from the second database, the transmission bandwidth of the second database and the link in the second database are occupied, but the target service data is not acquired from the first database, so that the transmission bandwidth and the link occupied by the first database can be reduced, the first database can provide sufficient transmission bandwidth and more links for the main process of the target service in the first server, and the performance of the main process of the target service and the service performance of the first server can be further improved.
206. And the second server provides the inquired target service data to the first server.
The second server may provide the target service data for the first server in the following manner B1 or B2.
In the mode B1, the second server sends a task completion response of the target query task to the first server, and the task completion response carries the queried target service data.
For example, the second server imports a plurality of pieces of target service data which are inquired into a form, packages the form including the plurality of pieces of target service data into a target file based on inquirer information in a target inquiry task, generates a task completion response based on the target file, and sends the task completion response to the first server. Wherein the task completion response includes the target file.
In the method B2, the second server stores the queried target service data to the shared disk between the first server and the second server, and the first server reads the target service data from the shared disk.
And the first server and the second server have the authority of writing data, reading data, deleting data and modifying data on the shared disk. The shared disk may be a cloud disk, rather than a disk local to the first server or the second server, and even if the first server and the second server are restarted, the target service data stored in the shared disk is not lost.
For example, after the second server packages the queried target service data into a target file, the target file is stored in the shared disk, so as to complete the provision of the target service data to the first server.
In addition, after the second server provides the target service data to the first server, the task state of the target query task in the task table can be updated from execution to execution completion so as to indicate that the target query task is executed and completed. For example, in the case that the first database is not associated with the second database, the first server updates the task state of the target query task in the task table in the first database to completion of execution, so that the first server queries the current task state of the target query task. For another example, when the second database is associated with the first database, the first server updates the task state of the target query task in the task table in the first database to completion of execution, and the second database synchronizes the updated task state (i.e., completion of execution) of the target query task to the state table in the first database, so that the first server queries the current task state of the target query task.
207. And the first server acquires the target service data inquired in the service data of the target service by the second server based on the target inquiry task.
For example, the first server receives a task completion response of the target query task sent by the second server, and acquires the target service data from the task completion response.
For another example, the first server queries the task state of the target query task in the state table, and when the task state of the target query task is found to be execution completion (that is, the second server completes the target query task), the first server reads the target service data from the shared disk between the first server and the second server.
The process of reading the target data from the shared disk by the first server may be: the first server inquires a file name comprising the inquirer information in the file names of the files stored in the shared disk according to the inquirer information in the business data inquiry request indicated by the target inquiry task, and if the file name of any file includes the inquirer information, the any file is a target file comprising target data.
208. And the first server sends the target service data to the terminal.
For example, after acquiring the target file including the target service data by executing step 207, the first server sends the target file to the terminal.
It should be understood that the processes shown in the above steps 201-208 are processes in which the terminal requests the first server to export the target file, in the case that the terminal has a need to export the target file, the first server is requested to package the queried data into the target file by sending a service data query request to the first server, if the number of target service data queried by the first server based on the service data query request is not too large (e.g. the number is smaller than the target number), the first server packages the queried target service data into the target file, otherwise, the first server submits the query task of the service data query request (i.e. the target query task) to the second server, and the second server queries the target service data, packages the queried target service data into the target file, and provides the target file to the first server. Under the condition that a terminal-based service data query request is configured and queried service data can be directly returned, the first server returns the target file to the terminal after acquiring a self-packaged target file or a target file provided by the second server, and under the condition that the terminal-based service data query request is not configured and queried service data can be directly returned, the first server waits for a download request (namely a download request for the target file) of the terminal to the queried target service data, and sends the self-packaged target file or the target file provided by the second server to the terminal after receiving the download request.
According to the method provided by the embodiment of the application, after the quantity of the target service data required by the terminal is determined based on the service data query request of the terminal to the target service, if the quantity is larger than or equal to the target quantity, the main server (namely, a first server) of the target service submits the target query task to another server (namely, a second server), and the other server executes the target query task to replace the main server to complete the service data query request, so that asynchronous decoupling processing of the service data query request is realized, the main server is not required to process the service data query request, the occupation of hardware resources of the main server is reduced, the main server can have sufficient hardware resources to provide services for the main process of the target service, and the performance of the main process of the target service can be improved.
In another possible implementation manner, the target service includes multiple sub-services, a part of the sub-services in the multiple sub-services may also be provided with a background service by at least one third server outside the first server and the second server, the shared disk between the second server and the third server can also open an authority for the at least one third server, and then the at least one third server can also write the service data of the sub-service of the local terminal to the shared disk, or read the service data of other sub-services from the shared disk, thereby implementing cross-task file interaction, and a file in the shared disk will not be lost with the restart of a server in the service system or the restart of a local POD (POD) of the server, and the file in the shared disk will be safer. The POD is a minimum management unit of a container cluster management system Kubernetes, and comprises at least one container, and the containers in the POD can share storage resources and network resources.
Fig. 3 is a schematic structural diagram of a data query apparatus provided in an embodiment of the present application, and as shown in fig. 3, an apparatus 300 is configured as a master server of a target service, where the apparatus 300 includes:
a determining module 301, configured to determine, based on a service data query request of a terminal to the target service, the number of target service data required by the terminal;
a submitting module 302, configured to submit a target query task to a second server of the target service based on the service data query request if the number is greater than or equal to a target number, where the target query task indicates that the service data query request is completed;
an obtaining module 303, configured to obtain the target service data queried in the service data of the target service by the second server based on the target query task;
a sending module 304, configured to send the target service data to the terminal.
In one possible implementation, the submission module 302 is configured to:
and if the number is larger than or equal to the target number, recording the target query task in a task table of the target service, wherein the task table is visible to the second server.
In a possible implementation manner, the obtaining module 303 is configured to:
and under the condition that the second server completes the target query task, reading the target service data from a shared disk between the first server and the second server.
In a possible implementation manner, the service data of the target service is medical detection data.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 4 is a schematic structural diagram of a data query apparatus provided in an embodiment of the present application, and as shown in fig. 4, the apparatus 400 may be configured as a second server of a target service, where the apparatus 400 includes:
an obtaining module 401, configured to obtain a target query task submitted by a first server, where the first server is a main server of a target service, and the target query task indicates that a service data query request to the target service is completed by a terminal;
a query module 402, configured to query, based on the target query task, target service data in the service data of the target service;
a providing module 403, configured to provide the queried target service data to the first server.
In a possible implementation manner, the obtaining module 401 is configured to:
and scanning each query task recorded by the first server in the task table of the target service to obtain the query tasks which are not executed yet.
In a possible implementation manner, the first server is associated with a first database of the target service, the first database is used for storing service data of the target service, the second server is associated with a second database of the target service, and the second database is used for storing a copy of the service data in the first database; the query module 402 is configured to:
and querying the target business data in the second database based on the target query task.
In one possible implementation manner, the providing module 403 is configured to:
and storing the target service data to a shared disk between the first server and the second server, and reading the target service data from the shared disk by the first server.
In a possible implementation manner, the service data of the target service is medical detection data.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
It should be noted that: in the above embodiment, the device 300 and the device 400 are only illustrated by dividing the functional modules when performing data query, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the process executed by the apparatus 300 and the process executed by the first server in the foregoing data query method embodiment belong to the same concept, and the process executed by the apparatus 400 and the process executed by the second server in the foregoing data query method embodiment belong to the same concept, and the specific implementation process thereof is described in the method embodiment and is not described herein again.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application, and as shown in fig. 5, the computer device 500 may be configured as the first server or the second server in the foregoing method embodiment, and the computer device 500 may have a relatively large difference due to different configurations or performances. The computer device 500 includes one or more processors (CPUs) 501 and one or more memories 502, wherein at least one computer program is stored in the memory 502, and is loaded and executed by the processor 501 to implement the data query method executed by the first server or the second server in the above embodiments. Of course, the computer device 500 may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the computer device 500 may also include other components for implementing device functions, which are not described herein again.
In an exemplary embodiment, a computer readable storage medium, such as a memory including at least one computer program, is also provided, the at least one computer program being executable by a processor in a computer device to perform the data query method performed by the first server or the second server in the above embodiments. For example, the computer-readable storage medium may be a read-only memory (ROM), a Random Access Memory (RAM), a compact disc-read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided, comprising at least one computer program stored in a computer readable storage medium. The at least one computer program can be read by one or more processors of the computer device from a computer-readable storage medium, and the at least one computer program can be executed by the one or more processors to enable the computer device to execute the data query method executed by the first server or the second server in the above embodiments.
It should be noted that information (including but not limited to user equipment information, user personal information, etc.), data (including but not limited to data for analysis, stored data, presented data, etc.), and signals referred to in this application are authorized by the user or sufficiently authorized by various parties, and the collection, use, and processing of the relevant data is required to comply with relevant laws and regulations and standards in relevant countries and regions. For example, the service data, the target service data and the service data query request referred to in the present application are all obtained under sufficient authorization.
It will be understood by those skilled in the art that all or part of the steps in implementing the above embodiments may be implemented by hardware, or may be implemented by hardware associated with program instructions, and that the program may be stored in a computer-readable storage medium, such as a read-only memory, a magnetic or optical disk, and the like.
The above description is intended only to illustrate the alternative embodiments of the present application, and should not be construed as limiting the present application, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (13)

1. A data query method, wherein the method is performed by a first server, and the first server is a main server of a target service, and the method comprises:
determining the quantity of target service data required by the terminal based on a service data query request of the terminal to the target service;
if the number is larger than or equal to the target number, submitting a target query task to a second server of the target service based on the service data query request, wherein the target query task indicates that the service data query request is completed;
acquiring the target service data inquired in the service data of the target service by the second server based on the target inquiry task;
and sending the target service data to a terminal.
2. The method of claim 1, wherein if the number is greater than or equal to a target number, submitting a target query task to a second server of the target service based on the service data query request comprises:
and if the number is larger than or equal to the target number, recording the target query task in a task table of the target service, wherein the task table is visible to the second server.
3. The method of claim 1, wherein the obtaining the target service data queried by the second server in the service data of the target service based on the target query task comprises:
and under the condition that the second server completes the target query task, reading the target service data from a shared disk between the first server and the second server.
4. The method according to any of claims 1-3, wherein the business data of the target business is medical test data.
5. A data query method, wherein the method is performed by a second server, and wherein the method comprises:
acquiring a target query task submitted by a first server, wherein the first server is a main server of a target service, and the target query task indicates that a service data query request of a terminal to the target service is completed;
inquiring target business data in the business data of the target business based on the target inquiry task;
and providing the inquired target business data to the first server.
6. The method of claim 5, wherein the obtaining the target query task submitted by the first server comprises:
and scanning each query task recorded by the first server in the task table of the target service to obtain the query tasks which are not executed yet.
7. The method of claim 5, wherein the first server is associated with a first database of the target service, the first database being configured to store service data of the target service, and wherein the second server is associated with a second database of the target service, the second database being configured to store a copy of the service data in the first database;
the querying target service data in the service data of the target service based on the target query task comprises:
and querying the target business data in the second database based on the target query task.
8. The method according to any of claims 5-7, wherein the providing the target traffic data to the first server comprises:
and storing the target service data to a shared disk between the first server and the second server, and reading the target service data from the shared disk by the first server.
9. A service system is characterized by comprising a first server and a second server, wherein the first server is a main server of a target service;
the first server is used for determining the quantity of the target service data required by the terminal based on a service data query request of the terminal to the target service; if the number is larger than or equal to the target number, submitting a target query task to a second server of the target service based on the service data query request, wherein the target query task indicates that the service data query request is completed;
the second server is used for inquiring target service data in the service data of the target service based on the target inquiry task; providing the inquired target business data to the first server;
the first server is further configured to obtain the target service data provided by the second server; and sending the target service data to a terminal.
10. A data query apparatus, wherein the apparatus is configured as a master server of a target service, the apparatus comprising:
the determining module is used for determining the quantity of the target service data required by the terminal based on the service data query request of the terminal to the target service;
a submitting module, configured to submit a target query task to a second server of the target service based on the service data query request if the number is greater than or equal to a target number, where the target query task indicates that the service data query request is completed;
the acquisition module is used for acquiring the target service data inquired in the service data of the target service by the second server based on the target inquiry task;
and the sending module is used for sending the target service data to the terminal.
11. A data query apparatus, characterized in that the apparatus comprises:
the system comprises an acquisition module, a service data query module and a service data query module, wherein the acquisition module is used for acquiring a target query task submitted by a first server, the first server is a main server of a target service, and the target query task indicates that a service data query request of a terminal to the target service is completed;
the query module is used for querying target service data in the service data of the target service based on the target query task;
and the providing module is used for providing the inquired target service data to the first server.
12. A computer device comprising a processor and a memory, wherein at least one computer program is stored in the memory, and wherein the at least one computer program is loaded and executed by the processor to implement the data query method of any one of claims 1 to 4 or the data query method of any one of claims 5 to 8.
13. A computer-readable storage medium for storing at least one computer program, the at least one computer program being loaded and executed by a processor to implement the data query method of any one of claims 1 to 4 or the data query method of any one of claims 5 to 8.
CN202211611724.0A 2022-12-14 2022-12-14 Data query method, device, equipment, system and storage medium Pending CN115827240A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211611724.0A CN115827240A (en) 2022-12-14 2022-12-14 Data query method, device, equipment, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211611724.0A CN115827240A (en) 2022-12-14 2022-12-14 Data query method, device, equipment, system and storage medium

Publications (1)

Publication Number Publication Date
CN115827240A true CN115827240A (en) 2023-03-21

Family

ID=85547420

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211611724.0A Pending CN115827240A (en) 2022-12-14 2022-12-14 Data query method, device, equipment, system and storage medium

Country Status (1)

Country Link
CN (1) CN115827240A (en)

Similar Documents

Publication Publication Date Title
WO2020258290A1 (en) Log data collection method, log data collection apparatus, storage medium and log data collection system
US10275347B2 (en) System, method and computer program product for managing caches
CN112800095B (en) Data processing method, device, equipment and storage medium
CN110737857A (en) back-end paging acceleration method, system, terminal and storage medium
CN103607424A (en) Server connection method and server system
CN112162846A (en) Transaction processing method, device and computer readable storage medium
CN109614270A (en) Data read-write method, device, equipment and storage medium based on Hbase
CN111723161A (en) Data processing method, device and equipment
CN115712660B (en) Data storage method, device, server and storage medium
CN113051102A (en) File backup method, device, system, storage medium and computer equipment
CN114070847B (en) Method, device, equipment and storage medium for limiting current of server
CN113377817A (en) Data processing method, system, device and storage medium
CN116701413A (en) Main data processing method and device
CN106919696A (en) SEO websites construction method and the response method of SEO requests
CN112491943A (en) Data request method, device, storage medium and electronic equipment
CN116028696A (en) Resource information acquisition method and device, electronic equipment and storage medium
CN116151631A (en) Service decision processing system, service decision processing method and device
CN115827240A (en) Data query method, device, equipment, system and storage medium
CN115599787A (en) Level sub-metering method and device, electronic equipment and storage medium
CN114116783A (en) Data table operation request processing method and device, server and storage medium
CN115794876A (en) Fragment processing method, device, equipment and storage medium for service data packet
CN113905252A (en) Data storage method and device for live broadcast room, electronic equipment and storage medium
CN115794806A (en) Gridding processing system, method and device for financial data and computing equipment
CN111221857B (en) Method and apparatus for reading data records from a distributed system
CN112527900A (en) Method, device, equipment and medium for database multi-copy reading consistency

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