CN112818202A - Data query method and device - Google Patents

Data query method and device Download PDF

Info

Publication number
CN112818202A
CN112818202A CN201911127377.2A CN201911127377A CN112818202A CN 112818202 A CN112818202 A CN 112818202A CN 201911127377 A CN201911127377 A CN 201911127377A CN 112818202 A CN112818202 A CN 112818202A
Authority
CN
China
Prior art keywords
query
data
query request
request
carries
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
CN201911127377.2A
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 Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi Information 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 Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN201911127377.2A priority Critical patent/CN112818202A/en
Publication of CN112818202A publication Critical patent/CN112818202A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9538Presentation of query results

Abstract

The invention discloses a data query method and a data query device, and relates to the technical field of computers. One embodiment of the method comprises: receiving a data query request, wherein the data query request carries query conditions; storing the query conditions into a query request table, and generating a query request identifier; and returning a query response, wherein the query response carries the query request identifier. The implementation method can solve the technical problems of waste of background processing resources and poor user experience.

Description

Data query method and device
Technical Field
The invention relates to the technical field of computers, in particular to a data query method and a data query device.
Background
With the development of information technology, the service software management system can process and cover larger and more services, and is more and more complex, so that the generated service data is more and more refined, and the data volume is larger and more. Meanwhile, for a software management system applied to a specific service, along with service development, the service data volume is more and more precipitated along with time.
In a general business software management system, it is often necessary to grasp the real-time status of a certain business module (such as a financial module, a warehousing module, an inventory module, etc.) by querying a report. The business data meeting the conditions are inquired by inputting the inquiry condition combination, and then a report displaying the business data is formed by processing such as screening, merging, summarizing and the like. Real-time data query is very critical and essential in daily business operation management. For example, in a web service software management system, query of real-time report data is realized by sending a query request to a background, after the background processes the data, the report data is returned to a web front end, and then the web front end displays the obtained report data.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
with the service software management system becoming more and more complex and the service data volume becoming more and more large, more background resources are consumed by complex service report query, and more processing time is also needed. If the problems of unstable network, browser jamming, refreshing, overtime request and the like occur, the query request is interrupted, and even if the background finishes querying and processing data and obtains report data, the front-end page cannot display the report data. Therefore, not only can background processing resources be wasted, but also user experience can be poor.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data query method and apparatus, so as to solve the technical problems of waste of background processing resources and poor user experience.
In order to achieve the above object, according to an aspect of the embodiments of the present invention, there is provided a data query method applied to a server, including:
receiving a data query request, wherein the data query request carries query conditions;
storing the query conditions into a query request table, and generating a query request identifier;
and returning a query response, wherein the query response carries the query request identifier.
Optionally, the method further comprises:
acquiring corresponding query data from a database according to the query conditions, and storing the query data into a result table;
receiving a result query request, wherein the result query request carries the query request identifier;
and acquiring corresponding query data from the result table according to the query request identifier, and returning the query data.
Optionally, acquiring corresponding query data from a database according to the query condition, and storing the query data in a result table, including:
acquiring corresponding query data from at least one service table of a database according to the query conditions, and storing the query data in a data report in a row form;
and storing the query data in the data report into a result table in a column form.
Optionally, before acquiring the corresponding query data from the at least one service table of the database according to the query condition, the method further includes:
and matching the corresponding report name according to the query condition so as to generate a corresponding data report.
Optionally, acquiring corresponding query data from the result table according to the query request identifier, and returning the query data, including:
acquiring corresponding column data from the result table one by one according to the query request identification;
respectively converting the line data into row data, and assembling the row data into query data one by one;
and returning the query data.
Optionally, the result table stores the query request identifier, the row number of the data report, and the attribute and value of the query data; and/or the presence of a gas in the gas,
the inquiry request table also stores inquiry request identification, report name and processing state.
In addition, according to another aspect of the embodiments of the present invention, there is provided a data query method applied to a client, including:
sending a data query request, wherein the data query request carries query conditions;
and receiving a returned query response, wherein the query response carries the query request identifier.
Optionally, the method further comprises:
sending a result query request at intervals of a preset time interval, wherein the result query request carries the query request identifier;
the returned query data is received.
In addition, according to another aspect of the embodiments of the present invention, there is provided a data query apparatus, provided at a server, including:
the first receiving module is used for receiving a data query request, and the data query request carries query conditions;
the query module is used for storing the query conditions into a query request table and generating a query request identifier;
and the return module is used for returning a query response, and the query response carries the query request identifier.
Optionally, the query module is further configured to obtain corresponding query data from a database according to the query condition, and store the query data in a result table;
the first receiving module is further configured to receive a result query request, where the result query request carries the query request identifier;
and the return module is also used for acquiring corresponding query data from the result table according to the query request identifier and returning the query data.
Optionally, the query module is further configured to:
acquiring corresponding query data from at least one service table of a database according to the query conditions, and storing the query data in a data report in a row form;
and storing the query data in the data report into a result table in a column form.
Optionally, the query module is further configured to: before acquiring corresponding query data from at least one service table of a database according to the query conditions, matching corresponding report names according to the query conditions, thereby generating corresponding data reports.
Optionally, the return module is further configured to:
acquiring corresponding column data from the result table one by one according to the query request identification;
respectively converting the line data into row data, and assembling the row data into query data one by one;
and returning the query data.
Optionally, the result table stores the query request identifier, the row number of the data report, and the attribute and value of the query data; and/or the presence of a gas in the gas,
the inquiry request table also stores inquiry request identification, report name and processing state.
In addition, according to another aspect of the embodiments of the present invention, there is provided a data query apparatus, provided at a client, including:
the sending module is used for sending a data query request, and the data query request carries query conditions;
and the second receiving module is used for receiving the returned query response, and the query response carries the query request identifier.
Optionally, the sending module is further configured to send a result query request at preset time intervals, where the result query request carries the query request identifier;
the second receiving module is further used for receiving the returned query data.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any of the embodiments described above.
According to another aspect of the embodiments of the present invention, there is also provided a computer readable medium, on which a computer program is stored, which when executed by a processor implements the method of any of the above embodiments.
One embodiment of the above invention has the following advantages or benefits: the technical means that the query conditions are stored in the query request table, the query request identifiers are generated, and query processing is performed based on the query conditions after the query request identifiers are returned to the client is adopted, so that the technical problems of resource waste and poor user experience in background processing in the prior art are solved. The embodiment of the invention stores each query request in the server and returns the ID of the query request to the client, then the server allocates resources to perform report query processing, the result is stored in the result table after the query processing is finished, and the client acquires the query result in real time through the ID of the query request. The embodiment of the invention realizes data query in an asynchronous mode, thereby not only improving user experience, but also realizing effective utilization of background resources and avoiding waste of background computing resources. The embodiment of the invention can effectively avoid the problems of poor user experience, background computing resource waste and the like caused by request interruption caused by unstable network, browser jamming, refreshing, request overtime and the like, and particularly has obvious technical effect on data query of complex reports.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main flow of a data query method according to one embodiment of the invention;
FIG. 2 is a schematic view of a main flow of a data query method according to a referential embodiment of the present invention;
FIG. 3 is a schematic diagram of a main flow of a data query method according to another embodiment of the present invention;
FIG. 4 is a schematic view of a main flow of a data query method according to another referential embodiment of the present invention;
FIG. 5 is a schematic diagram of the main modules of a data query device according to one embodiment of the present invention;
FIG. 6 is a schematic diagram of the main blocks of a data query device according to another embodiment of the present invention;
FIG. 7 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 8 is a schematic structural diagram of a computer system suitable for implementing a terminal device or a server according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a data query method according to an embodiment of the present invention. As an embodiment of the present invention, as shown in fig. 1, when applied to a server, the data query method may include:
step 101, receiving a data query request, wherein the data query request carries query conditions.
The user can select the query condition at the client, and after the user clicks the query control, the client sends the data query request to the server, wherein the data query request carries the query condition. And the server receives the data query request sent by the client. Alternatively, the query conditions may be based on a combination of conditions generated by a single query element entered by the user. Generally speaking, the more complex the report data of the user query and the more complex the input query condition, the more complex the combination of multiple query elements is required.
And 102, storing the query conditions into a query request table, and generating a query request identifier.
And after receiving the data query request, the server analyzes the data query request to obtain query conditions carried in the data query request, then stores the query conditions in a query request table, and generates a query request Identifier (ID) for the data query request. Optionally, the generated query request ID may also be saved in the query request table, so as to facilitate query and management.
Optionally, the query request table may further store information such as a report name, a processing status, a request time, and a user ID. It should be noted that, the mapping relationship between the query condition and the report name may be preconfigured, and after the query condition is resolved by the server, the corresponding report name may be matched, and the report name is written into the query request table. Wherein the request time may be a time when the server receives the data query request. Optionally, in the query request table, the query condition may be stored in a json format.
For example, the basic data structure of the lookup request table is as follows:
Figure BDA0002277276970000071
and 103, returning a query response, wherein the query response carries the query request identifier.
And after the server generates a query request ID for the data query request, the server returns a query response to the client, wherein the query response carries the query request ID. And after the server returns the query request ID to the client, the service processing of report query based on the query condition is started.
According to the various embodiments, it can be seen that the technical means of storing the query condition in the query request table, generating the query request identifier, returning the query request identifier to the client, and then performing query processing based on the query condition in the present invention solves the technical problems of background processing resource waste and poor user experience in the prior art. The embodiment of the invention realizes data query in an asynchronous mode, effectively avoids the problems of poor user experience, background computing resource waste and the like caused by request interruption caused by unstable network, browser jamming, refreshing, request overtime and the like, can improve the user experience, and realizes more effective utilization of background computing resources.
Fig. 2 is a schematic diagram of a main flow of a data query method according to a referential embodiment of the present invention. After the server returns the query request identifier to the client, the server performs query processing based on query conditions, and the method mainly comprises the following steps:
step 201, obtaining corresponding query data from a database according to the query conditions, and storing the query data in a result table.
And the server side acquires the query conditions from the query request table, acquires query data meeting the query conditions from a database according to the query conditions, and stores the query data into a result table.
Optionally, step 201 may include: acquiring corresponding query data from at least one service table of a database according to the query conditions, and storing the query data in a data report in a row form; and storing the query data in the data report into a result table in a column form. The database stores a plurality of business tables, and the business data meeting the query condition may be stored in the plurality of business tables, so the server needs to obtain the query data meeting the query condition from at least one business table, and then store the obtained query data in a data report corresponding to the query condition in a row form. After the query processing is completed, the query data in the data report is stored in a result table in a column form, and the processing state in the query request table is updated to be the processing completion. In the embodiment of the invention, each query condition corresponds to one data report, and when data query is carried out, query data corresponding to different query conditions are stored in the corresponding data report, but after the query is completed, row data in all data reports are stored in a universal result table in a column form, so that a server can conveniently and quickly acquire column data corresponding to a query request ID through the data report.
Optionally, the result table stores the query request identifier, the row number of the data report, the attribute and the value of the query data, and may also store processing completion time.
For example, the basic data structure of the results table is shown in the following table:
Figure BDA0002277276970000091
optionally, before acquiring the corresponding query data from the at least one service table of the database according to the query condition, the method further includes: and matching the corresponding report name according to the query condition so as to generate a corresponding data report. Because the mapping relationship between the query condition and the report name is configured in advance, the server may match the corresponding report name after receiving the query condition and write the report name into the query request table, or may match the corresponding report name according to the query condition and write the report name into the query request table when performing query processing asynchronously. The report name represents the definition of the report, and the server can map a report business processing class for each data report and is specially used for generating the corresponding data report. The embodiment of the invention firstly correlates and summarizes the query data acquired from the database, stores the query data in the data report in a row form, and then converts the row data in each data report into column data in a row-column data conversion mode to store the column data in a universal result table. After the server receives the query request ID sent by the client, the corresponding column data can be quickly matched in the general result table through the query request ID.
Step 202, receiving a result query request, where the result query request carries the query request identifier.
After receiving the query request ID returned by the server, the client sends a result query request to the server at preset time intervals through the query request ID stored in the front-end page, and queries the processing result of the report. And the result query request carries the query request identifier. The size of the time interval may be set according to the user's needs.
Step 203, obtaining corresponding query data from the result table according to the query request identifier, and returning the query data.
After receiving a result query request sent by a client, a server acquires query data corresponding to a query request ID from a result table according to the query request ID carried in the result query request, and then returns the query data to the client.
Optionally, step 203 may comprise: acquiring corresponding column data from the result table one by one according to the query request identification; respectively converting the line data into row data, and assembling the row data into query data one by one; and returning the query data. And the server side inquires all the line data corresponding to the inquiry request ID from the result table, converts all the line data into row data again, assembles the row data into a report data structure displayed by the front-end web page and returns the report data structure to the client side.
The data in the query request table and the result table have high real-time effectiveness, the use is basically not large after a certain time, and if the storage resources of the database are limited, historical data can be deleted regularly, for example, only the data in the last week is reserved, and the data in more than one week is automatically deleted through a timing program.
According to the various embodiments, it can be seen that the technical problems of background processing resource waste and poor user experience in the prior art are solved by the technical means of acquiring the corresponding query data from the database according to the query conditions, storing the corresponding query data in the result table, and returning the query data to the client according to the query request identifier carried in the result query request. The embodiment of the invention stores each query request in the server and returns the ID of the query request to the client, then the server allocates resources to perform report query processing, the result is stored in the result table after the query processing is finished, and the client acquires the query result in real time through the ID of the query request. The embodiment of the invention realizes data query in an asynchronous mode, thereby not only improving user experience, but also realizing effective utilization of background resources and avoiding waste of background computing resources.
The embodiment of the invention can effectively avoid the problems of poor user experience, background computing resource waste and the like caused by request interruption caused by unstable network, browser jamming, refreshing, request overtime and the like, and particularly has obvious technical effect on data query of complex reports.
Fig. 3 is a schematic diagram of a main flow of a data query method according to another embodiment of the present invention. As another embodiment of the present invention, as shown in fig. 3, applied to a client, the data query method may include:
step 301, sending a data query request, where the data query request carries query conditions.
The user can select the query condition at the client, and after the user clicks the query control, the client sends the data query request to the server, wherein the data query request carries the query condition.
Step 302, receiving a returned query response, where the query response carries a query request identifier.
And after the server generates a query request ID for the data query request, the server returns a query response to the client, and the client receives the query response returned by the server. Wherein the query response carries the query request ID.
Step 303, sending a result query request at preset time intervals, where the result query request carries the query request identifier.
After receiving the query request ID returned by the server, the client sends a result query request to the server at preset time intervals through the query request ID stored in the front-end page, and queries the processing result of the report. The time interval can be set according to the requirement of the user.
Step 304, receiving the returned query data.
After receiving a result query request sent by a client, a server acquires query data corresponding to a query request ID from a result table according to the query request ID carried in the result query request, and then returns the query data to the client. And the client receives the query data returned by the server and displays the query data on a web page.
In addition, in another embodiment of the present invention, the detailed implementation of the data query method is already described in detail in the above data query method, so that repeated descriptions herein are not repeated.
Fig. 4 is a schematic diagram of a main flow of a data query method according to another referential embodiment of the present invention. As shown in fig. 4, the data query method may include the steps of:
step 401, a client sends a data query request to a server, where the data query request carries query conditions.
Step 402, the server receives and analyzes the data query request to obtain a query condition, and simultaneously generates a query request ID.
And 403, the server returns a query response to the client, the query response carries the query request ID, and the client stores the query request ID.
And step 404, the server acquires corresponding query data from the database according to the query conditions, and stores the query data in a result table.
Step 405, the client sends a result query request to the server at preset time intervals, wherein the result query request carries a query request ID.
Step 406, the server receives and analyzes the result query request to obtain a query request ID, and then obtains corresponding query data from the result table according to the query request ID.
Step 407, the server returns the query data to the client.
In step 408, the client receives the query data and presents the query data on a web page.
In addition, in another embodiment of the present invention, the detailed implementation of the data query method is described in detail above, so that the repeated content is not described again.
Fig. 5 is a schematic diagram of main blocks of a data query apparatus according to an embodiment of the present invention. As shown in fig. 5, the data query apparatus 500 is disposed at a server and includes a first receiving module 501, a query module 502, and a return module 503. The first receiving module 501 is configured to receive a data query request, where the data query request carries query conditions; the query module 502 is configured to store the query condition in a query request table, and generate a query request identifier; the returning module 503 is configured to return a query response, where the query response carries the query request identifier.
Optionally, the query module 502 is further configured to obtain corresponding query data from a database according to the query condition, and store the query data in a result table;
the first receiving module 501 is further configured to receive a result query request, where the result query request carries the query request identifier;
the returning module 503 is further configured to obtain corresponding query data from the result table according to the query request identifier, and return the query data.
Optionally, the query module 502 is further configured to:
acquiring corresponding query data from at least one service table of a database according to the query conditions, and storing the query data in a data report in a row form;
and storing the query data in the data report into a result table in a column form.
Optionally, the query module 502 is further configured to: before acquiring corresponding query data from at least one service table of a database according to the query conditions, matching corresponding report names according to the query conditions, thereby generating corresponding data reports.
Optionally, the returning module 503 is further configured to:
acquiring corresponding column data from the result table one by one according to the query request identification;
respectively converting the line data into row data, and assembling the row data into query data one by one;
and returning the query data.
Optionally, the result table stores the query request identifier, the row number of the data report, and the attribute and value of the query data; and/or the presence of a gas in the gas,
the inquiry request table also stores inquiry request identification, report name and processing state.
It should be noted that, in the implementation of the data query apparatus of the present invention, the details of the data query method are already described in detail, and therefore, the repeated details are not described herein.
Fig. 6 is a schematic diagram of main blocks of a data query apparatus according to another embodiment of the present invention. As shown in fig. 6, the data query apparatus 600 is disposed at a client and includes a sending module 601 and a second receiving module 602. The sending module 601 is configured to send a data query request, where the data query request carries query conditions; the second receiving module 602 is configured to receive a returned query response, where the query response carries a query request identifier.
Optionally, the sending module 601 is further configured to send a result query request at preset time intervals, where the result query request carries the query request identifier;
the second receiving module 602 is further configured to receive the returned query data.
Fig. 7 shows an exemplary system architecture 700 of a data query method or data query apparatus to which embodiments of the present invention may be applied.
As shown in fig. 7, the system architecture 700 may include terminal devices 701, 702, 703, a network 704, and a server 705. The network 704 serves to provide a medium for communication links between the terminal devices 701, 702, 703 and the server 705. Network 704 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use the terminal devices 701, 702, 703 to interact with a server 705 over a network 704, to receive or send messages or the like. The terminal devices 701, 702, 703 may have installed thereon various communication client applications, such as a shopping-like application, a web browser application, a search-like application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 701, 702, 703 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 705 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 701, 702, 703. The background management server may analyze and otherwise process the received data such as the item information query request, and feed back a processing result (for example, target push information, item information — just an example) to the terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 7 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 8, shown is a block diagram of a computer system 800 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 8, the computer system 800 includes a Central Processing Unit (CPU)801 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage section 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data necessary for the operation of the system 800 are also stored. The CPU 801, ROM 802, and RAM803 are connected to each other via a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
The following components are connected to the I/O interface 805: an input portion 806 including a keyboard, a mouse, and the like; an output section 807 including a signal such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 808 including a hard disk and the like; and a communication section 809 including a network interface card such as a LAN card, a modem, or the like. The communication section 809 performs communication processing via a network such as the internet. A drive 810 is also connected to the I/O interface 805 as necessary. A removable medium 811 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 810 as necessary, so that a computer program read out therefrom is mounted on the storage section 808 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program can be downloaded and installed from a network through the communication section 809 and/or installed from the removable medium 811. The computer program executes the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 801.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer programs according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a first receiving module, a querying module, and a returning module, where the names of the modules do not in some cases constitute a limitation on the module itself.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a sending module and a second receiving module, where the names of the modules do not in some cases constitute a limitation on the modules themselves.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving a data query request, wherein the data query request carries query conditions; storing the query conditions into a query request table, and generating a query request identifier; and returning a query response, wherein the query response carries the query request identifier.
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: sending a data query request, wherein the data query request carries query conditions; and receiving a returned query response, wherein the query response carries the query request identifier.
According to the technical scheme of the embodiment of the invention, the technical means of storing the query conditions in the query request table, generating the query request identifier, returning the query request identifier to the client and then performing query processing based on the query conditions is adopted, so that the technical problems of resource waste and poor user experience in background processing in the prior art are solved. The embodiment of the invention stores each query request in the server and returns the ID of the query request to the client, then the server allocates resources to perform report query processing, the result is stored in the result table after the query processing is finished, and the client acquires the query result in real time through the ID of the query request. The embodiment of the invention realizes data query in an asynchronous mode, thereby not only improving user experience, but also realizing effective utilization of background resources and avoiding waste of background computing resources. The embodiment of the invention can effectively avoid the problems of poor user experience, background computing resource waste and the like caused by request interruption caused by unstable network, browser jamming, refreshing, request overtime and the like, and particularly has obvious technical effect on data query of complex reports.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A data query method is applied to a server and comprises the following steps:
receiving a data query request, wherein the data query request carries query conditions;
storing the query conditions into a query request table, and generating a query request identifier;
and returning a query response, wherein the query response carries the query request identifier.
2. The method of claim 1, further comprising:
acquiring corresponding query data from a database according to the query conditions, and storing the query data into a result table;
receiving a result query request, wherein the result query request carries the query request identifier;
and acquiring corresponding query data from the result table according to the query request identifier, and returning the query data.
3. The method of claim 2, wherein obtaining the corresponding query data from the database according to the query condition and saving the query data in a result table comprises:
acquiring corresponding query data from at least one service table of a database according to the query conditions, and storing the query data in a data report in a row form;
and storing the query data in the data report into a result table in a column form.
4. The method of claim 3, before obtaining the corresponding query data from the at least one service table of the database according to the query condition, further comprising:
and matching the corresponding report name according to the query condition so as to generate a corresponding data report.
5. The method of claim 3, wherein obtaining corresponding query data from the result table according to the query request identifier and returning the query data comprises:
acquiring corresponding column data from the result table one by one according to the query request identification;
respectively converting the line data into row data, and assembling the row data into query data one by one;
and returning the query data.
6. The method of claim 3, wherein the query request identifier, the row number of the data report, and the attribute and value of the query data are stored in the result table; and/or the presence of a gas in the gas,
the inquiry request table also stores inquiry request identification, report name and processing state.
7. A data query method is applied to a client and comprises the following steps:
sending a data query request, wherein the data query request carries query conditions;
and receiving a returned query response, wherein the query response carries the query request identifier.
8. The method of claim 7, further comprising:
sending a result query request at intervals of a preset time interval, wherein the result query request carries the query request identifier;
the returned query data is received.
9. A data query device, provided at a server, comprising:
the first receiving module is used for receiving a data query request, and the data query request carries query conditions;
the query module is used for storing the query conditions into a query request table and generating a query request identifier;
and the return module is used for returning a query response, and the query response carries the query request identifier.
10. A data query device, provided at a client, comprising:
the sending module is used for sending a data query request, and the data query request carries query conditions;
and the second receiving module is used for receiving the returned query response, and the query response carries the query request identifier.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN201911127377.2A 2019-11-18 2019-11-18 Data query method and device Pending CN112818202A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911127377.2A CN112818202A (en) 2019-11-18 2019-11-18 Data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911127377.2A CN112818202A (en) 2019-11-18 2019-11-18 Data query method and device

Publications (1)

Publication Number Publication Date
CN112818202A true CN112818202A (en) 2021-05-18

Family

ID=75852531

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911127377.2A Pending CN112818202A (en) 2019-11-18 2019-11-18 Data query method and device

Country Status (1)

Country Link
CN (1) CN112818202A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408065A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Trade information on-line inquiry method and device
CN106339440A (en) * 2016-08-22 2017-01-18 东软集团股份有限公司 Asynchronous task checking method and equipment
CN106649304A (en) * 2015-10-28 2017-05-10 北京国双科技有限公司 Method, device and system for data query
CN109325056A (en) * 2018-08-21 2019-02-12 中国平安财产保险股份有限公司 A kind of big data processing method and processing device, communication equipment
CN110019350A (en) * 2017-07-28 2019-07-16 北京京东尚科信息技术有限公司 Data query method and apparatus based on configuration information

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104408065A (en) * 2014-10-29 2015-03-11 中国建设银行股份有限公司 Trade information on-line inquiry method and device
CN106649304A (en) * 2015-10-28 2017-05-10 北京国双科技有限公司 Method, device and system for data query
CN106339440A (en) * 2016-08-22 2017-01-18 东软集团股份有限公司 Asynchronous task checking method and equipment
CN110019350A (en) * 2017-07-28 2019-07-16 北京京东尚科信息技术有限公司 Data query method and apparatus based on configuration information
CN109325056A (en) * 2018-08-21 2019-02-12 中国平安财产保险股份有限公司 A kind of big data processing method and processing device, communication equipment

Similar Documents

Publication Publication Date Title
CN109683998B (en) Internationalization realization method, device and system
US11561972B2 (en) Query conversion for querying disparate data sources
CN110706093A (en) Accounting processing method and device
CN111881329A (en) Account balance management method and system
CN110764770A (en) Method and device for conversion and assignment between objects
CN110555068A (en) Data export method and device
CN113190558A (en) Data processing method and system
CN110737676A (en) Data query method and device
CN113364664A (en) Instant messaging method and device
CN115858905A (en) Data processing method and device, electronic equipment and storage medium
CN112818202A (en) Data query method and device
CN112507017A (en) Data table conversion method and device
CN113779122A (en) Method and apparatus for exporting data
CN107886350B (en) Method and device for analyzing data
CN113779018A (en) Data processing method and device
CN113222680A (en) Method and device for generating order
CN112651536A (en) Method and device for determining delivery address
CN112131287A (en) Method and device for reading data
CN112784195A (en) Page data publishing method and system
CN112988857A (en) Service data processing method and device
CN113761405A (en) Task list processing method and system
CN113450170A (en) Information display method and device
CN112581247A (en) Financial report generation method and device
CN116071112A (en) Advertisement putting service processing method and device, electronic equipment and storage medium
CN111415262A (en) Service processing method and device

Legal Events

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