CN109241050B - Data query method, device and system and electronic equipment - Google Patents

Data query method, device and system and electronic equipment Download PDF

Info

Publication number
CN109241050B
CN109241050B CN201810752746.6A CN201810752746A CN109241050B CN 109241050 B CN109241050 B CN 109241050B CN 201810752746 A CN201810752746 A CN 201810752746A CN 109241050 B CN109241050 B CN 109241050B
Authority
CN
China
Prior art keywords
query
total number
data
client
request
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.)
Active
Application number
CN201810752746.6A
Other languages
Chinese (zh)
Other versions
CN109241050A (en
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.)
Ant Fortune Shanghai Financial Information Service Co ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201810752746.6A priority Critical patent/CN109241050B/en
Publication of CN109241050A publication Critical patent/CN109241050A/en
Application granted granted Critical
Publication of CN109241050B publication Critical patent/CN109241050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the specification relates to a data query method, a data query device, a data query system and electronic equipment, and the data query method comprises the following steps: receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number; constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number; and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.

Description

Data query method, device and system and electronic equipment
Technical Field
The embodiment of the specification relates to the technical field of networks, in particular to a data query method, a data query device, a data query system and electronic equipment.
Background
With the popularization of current big data technology, the demand for query processing of data in a database is increased.
Taking data query of content displayed by an infinite drop-down page as an example, in a query process, data requested currently and the total number of data in a corresponding data table are often required to be queried, so that a server is required to traverse all data in the data table at least once in a search process, thereby affecting query efficiency, and the query processing pressure of the server is high.
Therefore, it is desirable to find a solution that can improve or solve the above problems.
Disclosure of Invention
The embodiment of the specification provides a data query method, a data query device, a data query system and electronic equipment, which are used for solving the problems of low query efficiency and high query processing pressure in the prior art.
In order to solve the above technical problem, the embodiments of the present specification adopt the following technical solutions:
in a first aspect, a data query method is provided, including:
receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
In a second aspect, there is provided a data query apparatus, including:
the receiving module is used for receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number;
the query module is used for constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is larger than the first query total number;
and the sending module feeds back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
In a third aspect, a data query system is provided, including: the system comprises a server, a client and a database;
the server receives a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number; constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is larger than the first query total number; feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether data which is not queried exists in a data table corresponding to the query request after a first query total number of records;
the client sends a query request to the server and receives a query result and a query identifier corresponding to the query request fed back by the server;
and the database stores data and receives the access query operation of the server.
In a fourth aspect, an electronic device is provided, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
In a fifth aspect, a computer-readable storage medium is provided that stores one or more programs which, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform operations comprising:
receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects:
according to the technical scheme, when the database is subjected to data query based on the query request sent by the client, the second query total number can be determined based on the first query total number requested by the client, and the query statement is constructed by the second query total number and the initial number for query, so that the query result can be obtained through one-time query to determine whether the data which is not queried still exists, the query time is saved, the query pressure is reduced, the processing pressure of the server is relieved, and the query performance is improved.
Drawings
In order to more clearly illustrate the embodiments of the present specification or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present specification, and for those skilled in the art, other drawings can be obtained according to the drawings without any creative efforts.
FIG. 1 is a system architecture diagram of a data query scheme provided by an embodiment of the present disclosure;
FIG. 2a is a schematic diagram illustrating one of the steps of a data query method according to an embodiment of the present disclosure;
FIG. 2b is a diagram illustrating a specific step of step 204 provided in an embodiment of the present disclosure;
FIG. 2c is a second schematic diagram illustrating steps of a data query method according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of a data query method provided in an embodiment of the present specification;
fig. 4 is a schematic hardware structure diagram of an electronic device provided in an embodiment of the present specification;
fig. 5a is a schematic structural diagram of a data query device according to an embodiment of the present disclosure;
fig. 5b is a second schematic structural diagram of a data query device according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a data query system provided for an embodiment of this specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the embodiments in the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
It should be noted that, in this embodiment of the present specification, the data query scheme may be applied to a rendering query scenario of an unlimited drop-down page (i.e., a page that can be dropped infinitely), for example, for a page that can be dropped infinitely, whether there is a next page is queried. In fact, the method can also be applied to a data query scenario except for an infinite drop-down page, for example, when querying data, whether data which is not queried still exists is queried.
Referring to fig. 1, a system architecture suitable for data query provided in the embodiment of the present disclosure mainly includes: the client 102 and the server 104, the client 102 initiates a data query request to the server 104 under the operation of a user, and the server 104 constructs a query statement carrying a second query total number based on a starting number in the query request and the first query total number, so as to query data from a database 106 accessible to the server 104. The server 104 feeds back the query results to the client 102 along with a query identification that may be used to characterize whether there is data in the database 106 that has not been queried.
The client 102 may be any application installed on a terminal device and capable of implementing a data query function, and the server 104 is a device that establishes a data communication connection with the client 102 and has a computing processing capability, and may be a local server or a cloud server, for example. The database 106 may be any database that the server 104 can access, and the description does not limit the type of database.
Example one
Referring to fig. 2a, a schematic step diagram of a data query method provided in an embodiment of this specification is provided, where an execution subject of the data query method may be a server or an integration of multiple sub-servers that undertake a server function, and this is not limited in this specification.
The data query method mainly comprises the following steps:
step 202: and receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number.
In this embodiment, after receiving an inquiry request sent by a client, a server responds to the inquiry request and starts an inquiry operation.
The query request carries information representing an initial number and a first query total number; in addition, the method also carries a client identifier; wherein the start number is used for determining which data in the database to start querying each time of querying operation, and the first total querying number is the total querying number requested by the client. It should be understood that the start number and the first query total number are carried in the query request, and in general, the start number and the first query total number are set and updated by the client, the initial value of the start number may be set to 1, and the subsequent update may be based on a preset step size, for example, the start number of the first query is 1, the start number of the second query is 1+ n, and the start number of the third query is 1+ m; the first total query number may be a default setting of the client or a user setting, and the first total query number in each query may be different or the same, which is not limited in this specification.
It should be understood that the query request carries information characterizing the start number and the first query total, which may be directly the start number and the first query total; the query request may also include information capable of calculating a start number and a first total query number, for example, the query request may carry a page number P and a total number PCount in the page, where the total number PCount in the page is the first total query number, and the start number is PCount (P-1) + 1.
Step 204: and constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number.
It should be understood that, in this embodiment of the present specification, after the server responds to the query request sent by the client and starts a query operation, the start number and the first total query number requested by the client are analyzed from information carried in the query request. In order to alleviate the processing pressure caused by querying all data in the corresponding data table of the database once during querying, in this embodiment of the present specification, a query statement is not constructed based on a first total query number requested by the client, but constructed based on a second total query number, and since the second total query number is greater than the first total query number, a query result of the server, that is, a total number of data actually queried, is not necessarily a total number of data requested to be queried by the client.
In this embodiment of the present specification, the server queries, in response to a query statement constructed based on the start number and the second query total number, data from a data table corresponding to the query request in a corresponding database accessible by the server.
Optionally, in this embodiment of the present specification, the second total number of queries is equal to the sum of the first total number of queries and 1. That is, the server, when performing the query operation, builds the query statement based on the second query total number that is 1 more than the first query total number requested by the client. Therefore, one more data is inquired during each inquiry, whether the data which is not inquired exists is judged according to the actual inquiry result, the total amount of all data in the corresponding data table of the database does not need to be inquired, the inquiry quantity is reduced, and the inquiry processing pressure of the server is relieved.
It should be understood that the difference between the second query total and the first query total is not limited to 1, but may be other differences. In order to ensure the query accuracy and query efficiency, it is preferable that the second query total is equal to the sum of the first query total and 1.
Step 206: and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
And the server inquires data from a corresponding data table of the database based on the inquiry statement and sends the inquiry result corresponding to the inquiry request and the inquiry identification in the inquiry result to the client.
It should be understood that whether data which is not queried exists after the first query total number of records in the data table corresponding to the query request refers to whether records which are not queried exist after the first query total number of records queried after the data table is sorted according to the sorting rule of the query request.
For example, after the query request requests that the query table a is sorted according to the field 1, 10 records are started from the 11 th record, the query identifier is used to characterize that after the query table a is sorted according to the field 1, no record exists after 10 records are started from the 11 th record, that is, the query identifier is used to characterize whether the table a has the 21 st record.
Optionally, the step 206 is specifically executed as:
if the record number of the query result is greater than the first query total number, returning the first N pieces of queried data and a first query identifier to the client, wherein N is the first query total number, and the first query identifier is used for indicating the client to continue querying;
and if the record number of the query result is not greater than the first query total number, returning the queried data and a second query identifier to the client, wherein the second query identifier is used for indicating the client to stop querying.
For example, taking the first total query number as 10 and the second total query number as 11 as an example, if the number of records of the query result is 11, the query result indicates that 11 pieces of data are queried from the corresponding data table of the database, which is 1 more than the first total query number of the query request by the client, at this time, the server returns the first 10 pieces of data to the client, and a first query identifier, such as an identifier of "True" or "YES", is used to indicate that there is no data to be queried after the 10 th piece of data in the data table corresponding to the query request by the client, and the query may be continued. If the record number of the query result is 10 or less than 10, it indicates that at most 10 data are queried from the corresponding data table of the database, and is not more than the first query total number requested by the client to query, at this time, the server will return all queried data to the client, and a second query identifier, such as an identifier of "False" or "NO", is used to indicate that there is NO data that is not queried in the data table corresponding to the query request of the client, and the query may be stopped.
Optionally, the query identifier is determined based on a size relationship between the number of records of the query result and the total number of the first queries.
Specifically, determining the query identifier based on the size relationship between the record number of the query result and the total number of the first queries includes:
if the record number of the query result is greater than the first query total number, determining that the query identifier is used for representing that data which is not queried exists in a data table corresponding to the query request;
and if the record number of the query result is not greater than the first query total number, determining that the query identifier is used for representing that the data which is not queried does not exist in the data table corresponding to the query request.
It should be understood that, in the embodiments of the present specification, the start number is not limited, and may be a query page number, or may be a start data number of data queried by a query request in a corresponding data table.
In an implementation example, as shown in fig. 2b, the start number is a query page number; accordingly, when constructing and querying the query statement based on the start number and the second query total number, step 204 includes:
step 2042: and determining the initial data number of the data inquired by the inquiry request in the corresponding data table based on the inquiry page number and the first inquiry total number.
Step 2044: and constructing a query statement based on the initial data number and the second query total number and querying.
For example, the start number is a query page number, and it is assumed that starting from page 1, the start number in the information carried in the query request of this time is 1, and the first query total number is 10, which indicates that query needs to be started from page 1, and the number of query data is 10. First, based on the query page number being 1 and the first query total number being 10, using the formula: and (1) determining the initial data number of the data inquired by the inquiry request in a corresponding data table, substituting the inquiry page number of 1 and the first inquiry total number of 10 into a formula to obtain the initial data number of 1, and further constructing an inquiry statement and inquiring according to the initial data number and the second inquiry total number of 11.
It should be understood that, in the above embodiment with the starting number being a page number, the first query total number and the second query total number may be fixed values, and the first query total number and the second query total number may be reset until all data in the data table corresponding to the query request is queried.
In another practical embodiment, the start number is a start data number of the data queried by the query request in a corresponding data table;
referring to fig. 2c, after performing step 204, the method further comprises:
step 208: and determining the initial data number used in the next query based on the record number of the query result and the initial data number used in the current query, and returning the initial data number to the client.
It should be understood that the execution order of the step 208 and the step 206 is not limited, and may be executed simultaneously or in a certain order. In FIG. 2c, step 206 is performed first, and then step 208 is performed.
For example, the initial number is the initial data number of the data queried by the query request in the corresponding data table, and if the initial data number of the query this time is 1 and the number of records 11 of the query result is greater than the first total query number 10, the following formula may be referred to: the total number of the first query + the initial data number used in the present query is equal to the initial data number used in the next query. Substituting the formula, it can be found that the starting data number used in the next query is 10+1 — 11. I.e., the next query, the query may be started from the 11 th piece of data. And sending the initial data number used in the next query to the client so that the client can carry the information of the query request to return to the server when sending the query request next time. Through the scheme, even if the first query total number and the corresponding second query total number are changed, the query accuracy is not influenced, and the scheme is more universal and more flexible.
It should be noted that the query request referred to above in the embodiments of the present specification may be understood as one of multiple query requests implemented for one infinite pull-down page, that is, the above scheme is directed to one infinite pull-down page data request scheme.
The following describes the details of the solution according to the present specification by taking an example of the order data displayed by querying the infinite drop-down page.
Referring to fig. 3, assuming that the client is an electronic shopping APP, historical order data is presented to the user under the control of the user's operation. The method mainly comprises the following steps:
step 302: the client responds to the control operation of the user and sends an order data query request to the server.
The control operation may be a touch operation or a voice control operation of a user on a client interface, which is not limited in the embodiments of the present specification.
The server receives an order data query request sent by a client, wherein the order data query request carries an initial number 1 and a first query total number 10.
The query request represents 10 pieces of order data after the client requests the first piece of order data according to the user requirement.
Step 304: and the server constructs a query statement according to the starting number 1 and the second query total number 11, and queries from a corresponding data table of the database.
And if only 10 pieces of order data exist in the corresponding data table, the number of records of the query result obtained by the server is 10, and the number of records is less than the second query total number, which indicates that no unrequired order data exists in the corresponding data table of the database.
If there are more than 10 order data in the corresponding data table, the number of records of the query result obtained by the server is 11, and the number of records is equal to the second query total number, which indicates that there is unrequired order data after 10 records in the corresponding data table of the database.
Step 306: and if the corresponding data table of the database does not have the unrequired order data, determining that the initial data number is 0.
The initial data number is 0, and the client recognizes the wrong initial data number and regards the result as the end.
Step 308: if the non-inquired order data exists after 10 records in the corresponding data table of the database, the initial data number used in the next inquiry is calculated to be 11.
Step 310: and if the record number of the query result is greater than the first total query number 10, determining that the query result corresponding to the query request is the first 10 pieces of order data and the query identifier is "YES".
Wherein the "YES" flag is used to instruct the client to continue querying.
Step 312: and if the record number of the query result is not more than the first total query number 10, determining that the query result corresponding to the query request is the queried data and the query identifier is 'NO'.
Wherein the "NO" identification is used to instruct the client to stop querying.
Step 314: and the server returns the initial data number, the query result corresponding to the query request and the query identifier to the client.
According to the technical scheme, when the database is subjected to data query based on the query request sent by the client, the second query total number can be determined based on the first query total number requested by the client, and the query statement is constructed by the second query total number and the initial number for query, so that the query result can be obtained through one-time query, whether the data which is not queried still exists is determined, the query time is saved, the query pressure is reduced, the processing pressure of the server is relieved, and the query performance is improved.
EXAMPLE III
The electronic apparatus of the embodiment of the present specification is described in detail below with reference to fig. 4. Referring to fig. 4, at a hardware level, the electronic device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a Non-Volatile Memory (Non-Volatile Memory), such as at least 1 disk Memory. Of course, the electronic device may also include hardware required for other services.
The processor, the network interface, and the memory may be interconnected by an internal bus, which may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one double-headed arrow is used in FIG. 4, but not only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code comprising computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads the corresponding computer program from the nonvolatile memory into the memory and then runs the computer program to form the content recommendation device on a logic level. The processor executes the program stored in the memory, and is specifically used for executing:
receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists in a data table corresponding to the query request.
The methods disclosed in the embodiments of fig. 2 a-3 in the present specification can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps and logic blocks disclosed in the embodiments of the present specification may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present specification may be embodied directly in a hardware decoding processor, or in a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The electronic device may further execute the method shown in fig. 2a to fig. 3, and implement the functions of the content recommendation device in the embodiments shown in fig. 2a to fig. 3, which are not described herein again in this specification.
Of course, besides the software implementation, the electronic device of the embodiment of the present disclosure does not exclude other implementations, such as a logic device or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or a logic device.
Example four
The present specification embodiments also provide a computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to perform operations comprising:
receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists in a data table corresponding to the query request.
According to the technical scheme, when the database is subjected to data query based on the query request sent by the client, the second query total number can be determined based on the first query total number requested by the client, and the query statement is constructed by the second query total number and the initial number for query, so that the query result can be obtained through one-time query, whether the data which is not queried still exists is determined, the query time is saved, the query pressure is reduced, the processing pressure of the server is relieved, and the query performance is improved.
The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
EXAMPLE five
Referring to fig. 5a, a schematic structural diagram of a data query apparatus 500 provided in this specification is shown, the apparatus mainly includes:
a receiving module 502, configured to receive a query request sent by a client, where the query request carries information indicating a start number and a first query total;
the query module 504 is configured to construct a query statement and query the query statement based on the start number and a second total query number, where the second total query number is greater than the first total query number;
the sending module 506 feeds back a query result and a query identifier corresponding to the query request to the client, where the query identifier is used to represent whether data that is not queried exists in a data table corresponding to the query request.
Optionally, the second total number of queries is equal to the sum of the first total number of queries and 1.
Optionally, the query identifier is determined based on a size relationship between the number of records of the query result and the total number of the first queries.
Optionally, as shown in fig. 5b, the data query apparatus further includes: a determining module 508, configured to determine, if the number of records of the query result is greater than the first total query number, that the query identifier is used to represent that data that is not queried exists in the data table corresponding to the query request; and if the record number of the query result is not greater than the first query total number, determining that the query identifier is used for representing that the data which is not queried does not exist in the data table corresponding to the query request.
Optionally, the starting number is a query page number; accordingly, the number of the first and second electrodes,
when the query module 504 constructs a query statement based on the start number and the second query total number and queries, it is specifically configured to:
determining the initial data number of the data inquired by the inquiry request in a corresponding data table based on the inquiry page number and the first inquiry total number;
and constructing a query statement based on the initial data number and the second query total number and querying.
Optionally, the starting number is a starting data number of the data queried by the query request in a corresponding data table; accordingly, the number of the first and second electrodes,
the determining module 508 is further configured to:
based on the record number of the query result and the initial data number used in the current query, the initial data number used in the next query is determined, and is returned to the client through the sending module 506.
Optionally, when the query result and the query identifier corresponding to the query request are fed back to the client, the sending module 506 is specifically configured to:
if the record number of the query result is greater than the first query total number, returning the first N pieces of queried data and a first query identifier to the client, wherein N is the first query total number, and the first query identifier is used for indicating the client to continue querying;
and if the record number of the query result is not greater than the first query total number, returning the queried data and a second query identifier to the client, wherein the second query identifier is used for indicating the client to stop querying.
In addition, referring to fig. 6, a schematic structural diagram of a data query system 600 provided in an embodiment of the present specification is shown, where the system includes: a server 602, a client 604, and a database 606;
the server 602 receives a query request from a client 604, where the query request carries information representing an initial number and a first query total number; constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is larger than the first query total number; feeding back a query result and a query identifier corresponding to the query request to the client 604, wherein the query identifier is used for representing whether data which is not queried exists in a data table corresponding to the query request in the database 606;
the client 604 sends a query request to the server 602, and receives a query result and a query identifier corresponding to the query request fed back by the server 602;
the database 606 stores data and accepts access query operations of the server 602.
According to the technical scheme, when the database is subjected to data query based on the query request sent by the client, the second query total number can be determined based on the first query total number requested by the client, and the query statement is constructed by the second query total number and the initial number for query, so that the query result can be obtained through one-time query, whether the data which is not queried still exists is determined, the query time is saved, the query pressure is reduced, the processing pressure of the server is relieved, and the query performance is improved.
In short, the above description is only a preferred embodiment of the present disclosure, and is not intended to limit the scope of the present disclosure. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the embodiments of the present disclosure should be included in the protection scope of the embodiments of the present disclosure.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include transitory computer readable media (transmyedia) such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The embodiments in the present specification are all described in a progressive manner, and the same and similar parts among the embodiments can be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.

Claims (11)

1. A method of data query, comprising:
receiving a query request sent by a client, wherein the query request carries information representing an initial number and a first query total number, and the first query total number is the query total number requested by the client;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
2. The method of claim 1, wherein the second total number of queries is equal to the sum of the first total number of queries and 1.
3. The method of claim 1, wherein the query identification is determined based on a size relationship between a number of records of the query result and a total number of the first queries.
4. The method of claim 3, determining the query identification based on a magnitude relationship between the number of records of the query result and the first query total number, comprising:
if the number of records of the query result is greater than the first query total number, determining that the query identifier is used for representing that data which is not queried exists in the data table corresponding to the query request after the first query total number of records;
and if the record number of the query result is not greater than the first query total number, determining that the query identifier is used for representing that the data which is not queried does not exist in the data table corresponding to the query request.
5. The method of claim 1, wherein the starting number is a query page number;
constructing and querying a query statement based on the starting number and the second query total number, wherein the query statement comprises:
determining the initial data number of the data inquired by the inquiry request in a corresponding data table based on the inquiry page number and the first inquiry total number;
and constructing a query statement based on the initial data number and the second query total number and querying.
6. The method of claim 1, wherein the start number is a start data number of the data queried by the query request in a corresponding data table;
the method further comprises the following steps:
and determining the initial data number used in the next query based on the first query total number and the initial data number used in the current query, and returning the initial data number to the client.
7. The method of any one of claims 1-6, feeding back the query result and the query identifier corresponding to the query request to the client, comprising:
if the record number of the query result is greater than the first query total number, returning the first N pieces of queried data and a first query identifier to the client, wherein N is the first query total number, and the first query identifier is used for indicating the client to continue querying;
and if the record number of the query result is not more than the first query total number, returning the queried data and a second query identifier to the client, wherein the second query identifier is used for indicating the client to stop querying.
8. A data query apparatus, comprising:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is used for receiving a query request sent by a client, the query request carries information representing a starting number and a first query total number, and the first query total number is the query total number requested by the client;
the query module is used for constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is larger than the first query total number;
and the sending module feeds back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
9. A data query system, comprising: the system comprises a server, a client and a database;
the server receives a query request sent by a client, wherein the query request carries information representing a starting number and a first query total number, and the first query total number is the query total number requested by the client; constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is larger than the first query total number; feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether data which is not queried exists in a data table corresponding to the query request;
the client sends a query request to the server and receives a query result and a query identifier corresponding to the query request fed back by the server;
and the database stores data and receives the access query operation of the server.
10. An electronic device, comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being executed by the processor to:
receiving a query request sent by a client, wherein the query request carries information representing a starting number and a first query total number, and the first query total number is the query total number requested by the client;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
11. A computer-readable storage medium storing one or more programs that, when executed by an electronic device including a plurality of application programs, cause the electronic device to:
receiving a query request sent by a client, wherein the query request carries information representing a starting number and a first query total number, and the first query total number is the query total number requested by the client;
constructing a query statement and querying based on the starting number and a second query total number, wherein the second query total number is greater than the first query total number;
and feeding back a query result and a query identifier corresponding to the query request to the client, wherein the query identifier is used for representing whether the data which is not queried exists after the first query total number of records in the data table corresponding to the query request.
CN201810752746.6A 2018-07-10 2018-07-10 Data query method, device and system and electronic equipment Active CN109241050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810752746.6A CN109241050B (en) 2018-07-10 2018-07-10 Data query method, device and system and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810752746.6A CN109241050B (en) 2018-07-10 2018-07-10 Data query method, device and system and electronic equipment

Publications (2)

Publication Number Publication Date
CN109241050A CN109241050A (en) 2019-01-18
CN109241050B true CN109241050B (en) 2021-08-27

Family

ID=65071888

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810752746.6A Active CN109241050B (en) 2018-07-10 2018-07-10 Data query method, device and system and electronic equipment

Country Status (1)

Country Link
CN (1) CN109241050B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109885729B (en) * 2019-02-20 2021-07-20 北京奇艺世纪科技有限公司 Method, device and system for displaying data

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530378A (en) * 2013-10-15 2014-01-22 福建榕基软件股份有限公司 Data paging query method and device and data base construction method and device
CN106528051A (en) * 2016-11-15 2017-03-22 国云科技股份有限公司 High-efficiency operation method for queuing and stacking big data based on MongoDB
CN106874326A (en) * 2016-07-05 2017-06-20 阿里巴巴集团控股有限公司 A kind of item list obtains request processing method and device
CN107480280A (en) * 2017-08-22 2017-12-15 金蝶软件(中国)有限公司 The method and relevant device of a kind of data processing
CN107577741A (en) * 2017-08-28 2018-01-12 深圳市华傲数据技术有限公司 A kind of processing method and processing device of data query

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9223838B2 (en) * 2010-04-19 2015-12-29 Facebook, Inc. Sponsored search queries on online social networks
CN102880685B (en) * 2012-09-13 2015-06-24 北京航空航天大学 Method for interval and paging query of time-intensive B/S (Browser/Server) with large data size
CN103617232B (en) * 2013-11-26 2018-03-30 北京京东尚科信息技术有限公司 A kind of paging query method for HBase table
CN107193822A (en) * 2016-03-14 2017-09-22 阿里巴巴集团控股有限公司 For the method for paging query, device and equipment
CN107784009A (en) * 2016-08-29 2018-03-09 中兴通讯股份有限公司 Data query, data query processing method and processing device
CN107977378B (en) * 2016-10-25 2021-11-02 南京途牛科技有限公司 Distributed data aggregation method and device
CN107016045A (en) * 2017-02-17 2017-08-04 阿里巴巴集团控股有限公司 A kind of method and device of paged data inquiry
CN106970958B (en) * 2017-03-17 2019-11-19 浙江大华技术股份有限公司 A kind of inquiry of stream file and storage method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103530378A (en) * 2013-10-15 2014-01-22 福建榕基软件股份有限公司 Data paging query method and device and data base construction method and device
CN106874326A (en) * 2016-07-05 2017-06-20 阿里巴巴集团控股有限公司 A kind of item list obtains request processing method and device
CN106528051A (en) * 2016-11-15 2017-03-22 国云科技股份有限公司 High-efficiency operation method for queuing and stacking big data based on MongoDB
CN107480280A (en) * 2017-08-22 2017-12-15 金蝶软件(中国)有限公司 The method and relevant device of a kind of data processing
CN107577741A (en) * 2017-08-28 2018-01-12 深圳市华傲数据技术有限公司 A kind of processing method and processing device of data query

Also Published As

Publication number Publication date
CN109241050A (en) 2019-01-18

Similar Documents

Publication Publication Date Title
CN109639636B (en) Service data forwarding method, service data processing method, service data forwarding device, service data processing device and electronic equipment
CN108846749B (en) Partitioned transaction execution system and method based on block chain technology
CN107528885B (en) Service request processing method and device
CN111225018A (en) Request message processing method and device and electronic equipment
CN111488371A (en) Data query method and device
CN110704423B (en) Excitation information acquisition method and device, storage medium and electronic equipment
CN109901991B (en) Method and device for analyzing abnormal call and electronic equipment
CN109241050B (en) Data query method, device and system and electronic equipment
CN109254904B (en) Database pressure measurement method and device and electronic equipment
CN111355765B (en) Network request processing and sending method and device
CN109271453B (en) Method and device for determining database capacity
CN108650150B (en) Data verification method and device
CN111709748A (en) Transaction execution method and device with service attribute and electronic equipment
CN114691175A (en) Application updating method, device and system
CN110750271B (en) Service aggregation, method and device for executing aggregated service and electronic equipment
CN114840762A (en) Recommended content determining method and device and electronic equipment
CN110535785B (en) Control method and device for sending frequency and distributed system
CN114637790A (en) List data query method and device, electronic equipment and storage medium
CN109309717B (en) Data transmission method and device, electronic equipment and storage medium
CN109615465B (en) Service order processing method and device and electronic equipment
CN108170821B (en) Method and device for determining one-code multiple access and electronic equipment
CN108829732B (en) Data processing method and device
CN109255077B (en) Account push method and device
CN111782323B (en) Bullet screen obtaining method, computing equipment and computer storage medium
CN114979674B (en) Content pushing method and device based on blockchain and electronic equipment

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
TA01 Transfer of patent application right

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220413

Address after: Room 602, No. 618, Wai Road, Huangpu District, Shanghai 200010

Patentee after: Ant fortune (Shanghai) Financial Information Service Co.,Ltd.

Address before: Ky1-9008 business centre, 27 Hospital Road, Georgetown, grand caiman, UK

Patentee before: Innovative advanced technology Co.,Ltd.

TR01 Transfer of patent right