A kind of data query method, apparatus and system, electronic equipment
Technical field
This specification embodiment is related to network technique field more particularly to a kind of data query method, apparatus and system, electricity
Sub- equipment.
Background technique
With popularizing for current big data technology, the demand of the query processing of data in database is promoted.
For infinitely pulling down the data query of content of page displaying, in query process, generally requires inquiry and currently ask
Data count in the data and corresponding tables of data asked, in this way, it is necessary to which server at least traverses one during lookup
Total data in secondary tables of data influences search efficiency as a result, and server query processing pressure is big.
Therefore, it needs to find a kind of scheme that can improve or solve the above problems.
Summary of the invention
This specification embodiment provides a kind of data query method, apparatus and system, electronic equipment, to solve existing skill
The problem that search efficiency present in art is low and query processing pressure is big.
In order to solve the above-mentioned technical problem, this specification embodiment adopts the following technical solutions:
In a first aspect, providing a kind of data query method, comprising:
Receive the inquiry request that client is sent, wherein the inquiry request carries characterization Base Serial Number and first and looks into
Ask the information of sum;
It based on the Base Serial Number and the second inquiry sum building query statement and inquires, wherein second inquiry
Sum is greater than the first inquiry sum;
To the corresponding query result of inquiry request described in the client feedback and inquiry mark, wherein the inquiry mark
Know and whether there is the number that do not inquire after several total records of the first inquiry for characterizing in the corresponding tables of data of the inquiry request
According to.
Second aspect provides a kind of data query device, comprising:
Receiving module receives the inquiry request that client is sent, wherein the inquiry request carries characterization Base Serial Number
With the information of the first inquiry sum;
Enquiry module based on the Base Serial Number and the second inquiry sum building query statement and is inquired, wherein described
Second inquiry sum is greater than the first inquiry sum;
Sending module, to the corresponding query result of inquiry request described in the client feedback and inquiry mark, wherein institute
Inquiry mark is stated to inquire after total several record first with the presence or absence of not for characterizing in the corresponding tables of data of the inquiry request
The data of inquiry.
The third aspect provides a kind of data query system, comprising: server, client and database;
Wherein, the server receives the inquiry request that client is sent, wherein the inquiry request carries characterization
The information of Base Serial Number and the first inquiry sum;And based on the Base Serial Number and the second inquiry sum building query statement
And inquire, wherein the second inquiry sum is greater than the first inquiry sum;And it is inquired to described in the client feedback
Request corresponding query result and inquiry mark, wherein the inquiry mark is for characterizing the corresponding data of the inquiry request
With the presence or absence of the data that do not inquire after several total records of the first inquiry in table;
The client sends inquiry request to the server, and the inquiry for receiving the server feedback is asked
Ask corresponding query result and inquiry mark;
The database is stored with data, and receives the access queries operation of the server.
Fourth aspect provides a kind of electronic equipment, comprising: memory, processor and is stored on the memory simultaneously
The computer program that can be run on the processor, the computer program are executed by the processor:
Receive the inquiry request that client is sent, wherein the inquiry request carries characterization Base Serial Number and first and looks into
Ask the information of sum;
It based on the Base Serial Number and the second inquiry sum building query statement and inquires, wherein second inquiry
Sum is greater than the first inquiry sum;
To the corresponding query result of inquiry request described in the client feedback and inquiry mark, wherein the inquiry mark
Know and whether there is the number that do not inquire after several total records of the first inquiry for characterizing in the corresponding tables of data of the inquiry request
According to.
5th aspect, provides a kind of computer readable storage medium, the computer-readable recording medium storage one
Or multiple programs, one or more of programs are when the electronic equipment for being included multiple application programs executes, so that the electricity
Sub- equipment executes following operation:
Receive the inquiry request that client is sent, wherein the inquiry request carries characterization Base Serial Number and first and looks into
Ask the information of sum;
It based on the Base Serial Number and the second inquiry sum building query statement and inquires, wherein second inquiry
Sum is greater than the first inquiry sum;
To the corresponding query result of inquiry request described in the client feedback and inquiry mark, wherein the inquiry mark
Know and whether there is the number that do not inquire after several total records of the first inquiry for characterizing in the corresponding tables of data of the inquiry request
According to.
This specification embodiment use at least one above-mentioned technical solution can reach it is following the utility model has the advantages that
Through the above technical solutions, when the inquiry request sent based on client carries out data query to database, it can
The second inquiry sum is determined with the first inquiry sum based on client request, and with the second inquiry sum and Base Serial Number structure
It builds query statement to be inquired, determine whether in this way, query result can be obtained by one query there are also the data that do not inquire,
Query time is saved, while alleviating inquiry pressure, alleviates the processing pressure of server, promotes query performance.
Detailed description of the invention
In order to illustrate more clearly of this specification embodiment or technical solution in the prior art, below will to embodiment or
Attached drawing needed to be used in the description of the prior art is briefly described, it should be apparent that, the accompanying drawings in the following description is only
The some embodiments recorded in this specification embodiment are not paying creative labor for those of ordinary skill in the art
Under the premise of dynamic property, it is also possible to obtain other drawings based on these drawings.
Fig. 1 is the system architecture schematic diagram for the data query scheme that this specification embodiment provides;
Fig. 2 a is one of the step schematic diagram of data query method that this specification embodiment provides;
Fig. 2 b is the specific steps schematic diagram for the step 204 that this specification embodiment provides;
Fig. 2 c is the two of the step schematic diagram for the data query method that this specification embodiment provides;
Fig. 3 is the flow diagram for the data query method that this specification embodiment provides;
Fig. 4 is the hardware structural diagram for the electronic equipment that this specification embodiment provides;
Fig. 5 a is one of the structural schematic diagram of data query device that this specification embodiment provides;
Fig. 5 b is the second structural representation for the data query device that this specification embodiment provides;
Fig. 6 is the structural schematic diagram for the data query system that this specification embodiment provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of this specification embodiment clearer, have below in conjunction with this specification
The technical solution of this specification embodiment is clearly and completely described in body embodiment and corresponding attached drawing.Obviously, described
Embodiment be only this specification a part of the embodiment, instead of all the embodiments.The embodiment of base in this manual, this
Field those of ordinary skill every other embodiment obtained without making creative work, belongs to this explanation
The range of book embodiment protection.
Below in conjunction with attached drawing, the technical solution that each embodiment of this specification provides is described in detail.
It should be noted that in this specification embodiment, under related data query scheme can be adapted for infinitely
It draws in the rendering inquiry scene of page (page that can infinitely pull down), for example, also whether inquiry for the page that can infinitely pull down
There is lower one page.In fact, it is readily applicable to infinitely pull down in the data query scene other than page, for example, looking into when inquiring data
Ask whether there are also the data that do not inquire.
System architecture shown referring to Fig.1, that the data query provided by this specification embodiment is applicable in, the system are main
It include: client 102 and server 104, client 102, which initiates data query to server 104 under the operation of user, asks
Ask, server 104 based in the inquiry request Base Serial Number and first inquiry sum building carry second inquiry sum
Query statement, to inquire data from the accessible database 106 of server 104.Server 104 is fed back to client 102
Query result and inquiry mark, inquiry mark can be used in characterization database 106 with the presence or absence of the data that do not inquire.
Wherein, the client 102 can be mounted on terminal device any one can realize data query function
Application program, the server 104 are to establish data communication with the client 102 to connect and have setting for calculation processing ability
It is standby, for example, it may be local server or cloud server.The database 106 can be the server 104 and can visit
Any one database asked, this specification are not defined the type of database.
Embodiment one
Referring to shown in Fig. 2 a, for a kind of step schematic diagram for data query method that this specification embodiment provides, the number
It can be the integrated of multiple child servers of server or reception server function, this theory according to the executing subject of querying method
Bright book embodiment is defined not to this.
The data query method mainly comprises the steps that
Step 202: receiving the inquiry request that client is sent, wherein the inquiry request carries characterization Base Serial Number
With the information of the first inquiry sum.
In this specification embodiment, server responds the inquiry and asks after the inquiry request for receiving client transmission
It asks, starts inquiry operation.
In the inquiry request, the information of characterization Base Serial Number and the first inquiry sum is carried;In addition, also carrying
Client identification;Wherein, which data starts to query from database when Base Serial Number is used to determine each inquiry operation, and first
Inquiry sum is the requested inquiry sum of client.It should be understood that the Base Serial Number and the first inquiry sum are to carry looking into
It askes in request, under normal circumstances, Base Serial Number and the first inquiry sum are arranged initial value by client and are updated, Base Serial Number
Initial value can be set to 1, it is subsequent to be updated based on preset step-length, for example, the Base Serial Number of inquiry is 1 for the first time, the
The Base Serial Number of secondary inquiry is 1+n, and the Base Serial Number of third time inquiry is 1+m;And the first inquiry sum can be client
Default setting or user setting, every time inquiry when first inquiry sum may be different or the same, this specification is simultaneously
It is defined not to this.
It should be understood that the inquiry request carries the information of characterization Base Serial Number and the first inquiry sum, can directly be
Base Serial Number and the first inquiry sum;It can also be the information that can calculate Base Serial Number and the first inquiry sum, for example, inquiry
Sum PCount in page number P and page can be carried in request, wherein sum PCount is the first inquiry sum in page, and starting is compiled
Number be PCount* (P-1)+1.
Step 204: based on the Base Serial Number and the second inquiry sum building query statement and inquiring, wherein described
Second inquiry sum is greater than the first inquiry sum.
It should be understood that in this specification embodiment, inquiry request that server is sent in response to client simultaneously starts inquiry
After operation, the first inquiry sum of Base Serial Number and client request can be parsed from the information that inquiry request carries.For
When slowing down inquiry to all data in the corresponding data table of database all inquire one time and caused by processing pressure, this specification
In embodiment, it is not based on the first inquiry sum building query statement of client request, but inquires total structure based on second
Query statement is built, since the second inquiry sum is greater than the first inquiry sum, the query result of server, i.e., in fact
The data count that border inquires is not necessarily the data count of client request inquiry.
In this specification embodiment, query statement of the server response based on Base Serial Number and the second inquiry sum building,
Data are inquired in tables of data corresponding with the inquiry request in the associated databases accessible from server.
Optionally, in this specification embodiment, the second inquiry sum is equal to the first inquiry sum and the sum of 1.That is,
For server when executing the inquiry operation, the second inquiry sum being based on when constructing query statement is than the first of client request
Inquiry sum more 1.In this way, inquiring a data in each inquiry, and according to actual queries result to determine whether also more
The data that do not inquire do not need all total amount of data in the corresponding data table of inquiry database, reduce inquiry quantity, alleviate clothes
The query processing pressure of business device.
It should be understood that the difference of the second inquiry sum and the first inquiry sum is not limited to 1, it can also be other differences.This theory
In order to guarantee inquiry accuracy and search efficiency in bright book, be equal to the first inquiry sum with the second inquiry sum is with the sum of 1
It is good.
Step 206: to the corresponding query result of inquiry request described in the client feedback and inquiry mark, wherein institute
Inquiry mark is stated to inquire after total several record first with the presence or absence of not for characterizing in the corresponding tables of data of the inquiry request
The data of inquiry.
Server is based on query statement, data is inquired from the corresponding data table of database, and will be corresponding in query result
The query result and inquiry mark of inquiry request are sent to client.
It should be understood that with the presence or absence of not inquiring after several total records of the first inquiry in the corresponding tables of data of the inquiry request
Data, refer to the tables of data after according to the sequence of the ordering rule of inquiry request, the first inquiry of inquiry is total to be after several
It is no that there is also the records that do not inquire.
For example, Sub_clause 11 has recorded 10 records, then inquires after requesting inquiry table A to sort according to field 1 in inquiry request
After mark is for characterizing Table A according to the sequence of field 1, Sub_clause 11 has record or not after having recorded 10 records, i.e. inquiry mark
For characterizing Table A, whether there are also the 21st article of records.
Optionally, which specifically executes are as follows:
If the record number of query result is greater than the first inquiry sum, before inquiring to client return
N data and the first inquiry mark, wherein the N is the first inquiry sum, and the first inquiry mark is used to indicate described
Client continues to inquire;
If the record number of query result is inquired no more than the first inquiry sum to client return
Data and the second inquiry mark, wherein the second inquiry mark is used to indicate the client and stops inquiry.
For example, be 10 with the first inquiry sum, the second inquiry sum is for 11, if the record number of query result
It is 11, then it represents that 11 datas are inquired from the corresponding data table of database, compared to the first inquiry of client request inquiry
Much more total 1, at this point, server can return to preceding 10 data to client and the first inquiry identifies, such as " True " or
The mark such as " YES " is used to indicate client query and requests not look into after the 10th data there are also data in corresponding tables of data
It askes, can continue to inquire.If the record number of query result is 10 or less than 10, then it represents that from the corresponding data table of database
At most 10 datas are inquired, it is more unlike the first inquiry sum of client request inquiry, at this point, server can be to client
All data inquired and the second inquiry mark, such as the mark such as " False " or " NO " are returned, client is used to indicate
There is no the data that do not inquire in the corresponding tables of data of inquiry request, can stop inquiring.
Optionally, the inquiry mark is determined based on the total size relation of the record number of query result and the first inquiry
's.
Specifically, inquiry mark is determined based on the size relation of the record number of query result and the first inquiry sum, comprising:
If the record number of query result is greater than the first inquiry sum, it is determined that inquiry mark is for characterizing described look into
It askes and requests the presence of the data that do not inquire in corresponding tables of data;
If the record number of query result is no more than the first inquiry sum, it is determined that inquiry mark is described for characterizing
There is no the data that do not inquire in the corresponding tables of data of inquiry request.
It should be understood that related Base Serial Number and without limitation can be the inquiry page number in this specification embodiment,
It can be the initial data number of data that inquiry request is inquired in corresponding tables of data.
A kind of achievable embodiment, according to shown in Fig. 2 b, the Base Serial Number is the inquiry page number;Correspondingly, step 204
When constructing query statement based on the Base Serial Number and the second inquiry sum and inquiring, comprising:
Step 2042: based on the inquiry page number and the first inquiry sum, determining the number that inquiry request is inquired
According to the initial data number in corresponding tables of data.
Step 2044: based on initial data number and the second inquiry sum building query statement and inquiring.
For example, Base Serial Number is the inquiry page number, it is assumed that started with page 1, in the information that this inquiry request carries
Base Serial Number is 1, and the first inquiry sum is 10, then, it indicates to need to start to query from page 1, and the quantity for inquiring data is
10.Firstly, being 1 based on the inquiry page number, the first inquiry sum is 10, and utilize formula: (the inquiry page number -1) * the first inquires sum
+ 1=initial data number determines the initial data number of data that inquiry request is inquired in corresponding tables of data, will look into
Ask the page number be 1 and first inquiry sum be 10 substitution formula, obtain initial data number be 1, in turn, according to initial data
Number and the second inquiry sum 11, construct query statement and inquire.
It should be understood that the first inquiry sum and the second inquiry sum can in the embodiment that above-mentioned Base Serial Number is the page number
To be fixed value, until having inquired in the corresponding tables of data of inquiry request until all data, the first inquiry can be reset
Sum and the second inquiry sum.
Another achievable embodiment, the data that the Base Serial Number is inquired by inquiry request are in corresponding tables of data
In initial data number;
Referring to shown in Fig. 2 c, after performing step 204, the method also includes:
Step 208: used initial data number when record number based on query result and this inquiry determines
Used initial data number when inquiring next time, and return to client.
It should be understood that the execution sequence of the step 208 and step 206 and being not construed as limiting, may be performed simultaneously also be can have
It is certain successively to execute sequence.This specification Fig. 2 c is to first carry out step 206, then for executing step 208.
For example, initial data of the data inquired by inquiry request of Base Serial Number in corresponding tables of data is compiled
Number, it is assumed that initial data number of this inquiry is 1, and the record number 11 of query result is greater than the first inquiry sum 10, then can be with
Referring to following formula: the first inquiry sum ,+used initial data number when this inquiry=is used when inquiring next time
Initial data number.Substitute into formula, available used initial data number when inquiring next time is 10+1=11.I.e.
When inquiring next time, it can be started to query from Sub_clause 11 data.Used initial data number hair this is inquired next time when
Client is given, in order to which client is when sending inquiry request next time, can carry and be returned in the information of inquiry request
To server.With this solution, it even if the first inquiry sum and corresponding second inquiry sum change, will not influence
Inquiry accuracy, the program is more generally applicable, more flexibly.
It should be noted that the inquiry request that this specification embodiment is referred to above, it can be understood as be for primary
Primary in the multiple inquiry request that unlimited drop-down page is implemented, i.e., above scheme is for a unlimited drop-down page data requesting party
Case.
Scheme involved in this specification is carried out for inquiring the order data that unlimited drop-down page is shown below detailed
It is thin to introduce.
Referring to shown in Fig. 3, it is assumed that client is electronic business transaction APP, under the operation control of user, shows history to user
Order data.This method specifically includes that
Step 302: the control operation of client end response user sends order data inquiry request to server.
Wherein, the control operation can be the touch control operation or voice-controlled operations at user customer interface, this
Specification embodiment is defined not to this.
Server receives the order data inquiry request that client is sent, and the order data inquiry request carries starting and compiles
Number 1 and the first inquiry sum 10.
After the inquiry request indicates that client starts according to the first data in user demand request order data
10 order datas.
Step 304: server constructs query statement according to Base Serial Number 1 and the second inquiry sum 11, and from database
Corresponding data table in inquire.
Only have 10 order datas in corresponding data table, then, the record number for the query result that server obtains is 10, should
Number is recorded less than the second inquiry sum, indicates do not have the order data that do not inquire in the corresponding data table of database.
There are 10 or more order datas in corresponding data table, then, the record number for the query result that server obtains is
11, which is equal to the second inquiry sum, indicates to exist after 10 records in the corresponding data table of database and not inquire
Order data.
Step 306: if there is no the order data that do not inquire in the corresponding data table of database, determining that initial data is numbered
It is 0.
Initial data number is 0, and client recognizes the initial data number of mistake, is considered as end.
Step 308: if there is the order data that do not inquire in the corresponding data table of database after 10 records, counting
Calculating the initial data number used when being inquired next time is 11.
Step 310: if the record number of query result is greater than the first inquiry sum 10, determining the inquiry request pair
The query result answered is preceding 10 order datas and inquiry mark is " YES ".
Wherein, " YES " mark is used to indicate the client and continues to inquire.
Step 312: if the record number of query result determines the inquiry request no more than the first inquiry sum 10
Corresponding query result is the data inquired and inquiry mark is " NO ".
Wherein, " NO " mark is used to indicate the client and stops inquiring.
Step 314: server numbers initial data, the corresponding query result of inquiry request and inquiry mark return to
Client.
Through the above technical solutions, when the inquiry request sent based on client carries out data query to database, it can
The second inquiry sum is determined with the first inquiry sum based on client request, and with the second inquiry sum and Base Serial Number structure
It builds query statement to be inquired, in this way, query result can be obtained by one query and determine whether that there are also the numbers that do not inquire
According to saving query time, while alleviating inquiry pressure, alleviate the processing pressure of server, promote query performance.
Embodiment three
The electronic equipment of this specification embodiment is discussed in detail referring to Fig. 4.Referring to FIG. 4, in hardware view, the electricity
Sub- equipment includes processor, optionally further comprising internal bus, network interface, memory.Wherein, memory may be comprising interior
It deposits, such as high-speed random access memory (Random-Access Memory, RAM), it is also possible to further include non-volatile memories
Device (Non-Volatile Memory), for example, at least 1 magnetic disk storage etc..Certainly, which is also possible that other
Hardware required for business.
Processor, network interface and memory can be connected with each other by internal bus, which can be industry
Standard architecture (Industry Standard Architecture, ISA) bus, Peripheral Component Interconnect standard
(Peripheral Component Interconnect, PCI) bus or expanding the industrial standard structure (Extended
Industry Standard Architecture, EISA) bus etc..The bus can be divided into address bus, data/address bus,
Control bus etc..Only to be characterized with a four-headed arrow in Fig. 4 convenient for characterizing, but characterization only has a bus or one kind
The bus of type.
Memory, for storing program.Specifically, program may include program code, and said program code includes calculating
Machine operational order.Memory may include memory and nonvolatile memory, and provide instruction and data to processor.
Processor is from the then operation into memory of corresponding computer program is read in nonvolatile memory, in logical layer
Content recommendation device is formed on face.Processor executes the program that memory is stored, and is specifically used for executing:
Receive the inquiry request that client is sent, wherein the inquiry request carries characterization Base Serial Number and first and looks into
Ask the information of sum;
It based on the Base Serial Number and the second inquiry sum building query statement and inquires, wherein second inquiry
Sum is greater than the first inquiry sum;
To the corresponding query result of inquiry request described in the client feedback and inquiry mark, wherein the inquiry mark
Know for characterizing in the corresponding tables of data of the inquiry request with the presence or absence of the data that do not inquire.
Method disclosed in the above-mentioned implementation example figure 2a- embodiment illustrated in fig. 3 such as this specification can be applied in processor, or
Person is realized by processor.Processor may be a kind of IC chip, the processing capacity with signal.During realization,
Each step of the above method can be completed by the integrated logic circuit of the hardware in processor or the instruction of software form.On
The processor stated can be at general processor, including central processing unit (Central Processing Unit, CPU), network
Manage device (Network Processor, NP) etc.;Can also be digital signal processor (Digital Signal Processor,
DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), field programmable gate
Array (Field-Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or crystalline substance
Body pipe logical device, discrete hardware components.It may be implemented or execute disclosed each method, the step in this specification embodiment
And logic diagram.General processor can be microprocessor or the processor is also possible to any conventional processor etc..Knot
The step of closing method disclosed in this specification embodiment can be embodied directly in hardware decoding processor and execute completion, Huo Zheyong
Hardware and software module combination in decoding processor execute completion.Software module can be located at random access memory, flash memory, read-only
The storage medium of this fields such as memory, programmable read only memory or electrically erasable programmable memory, register maturation
In.The storage medium is located at memory, and processor reads the information in memory, and the step of the above method is completed in conjunction with its hardware
Suddenly.
The method that the electronic equipment can also carry out Fig. 2 a- Fig. 3, and realize content recommendation device implementation shown in Fig. 2 a- Fig. 3
The function of example, details are not described herein for this specification embodiment.
Certainly, other than software realization mode, other realization sides are not precluded in the electronic equipment of this specification embodiment
Formula, such as logical device or the mode of software and hardware combining etc., that is to say, that the executing subject of following process flow is simultaneously unlimited
Due to each logic unit, it is also possible to hardware or logical device.
Example IV
This specification embodiment also provides a kind of computer readable storage medium, the computer-readable recording medium storage
One or more programs, one or more of programs are when the electronic equipment for being included multiple application programs executes, so that institute
It states electronic equipment and executes following operation:
Receive the inquiry request that client is sent, wherein the inquiry request carries characterization Base Serial Number and first and looks into
Ask the information of sum;
It based on the Base Serial Number and the second inquiry sum building query statement and inquires, wherein second inquiry
Sum is greater than the first inquiry sum;
To the corresponding query result of inquiry request described in the client feedback and inquiry mark, wherein the inquiry mark
Know for characterizing in the corresponding tables of data of the inquiry request with the presence or absence of the data that do not inquire.
Through the above technical solutions, when the inquiry request sent based on client carries out data query to database, it can
The second inquiry sum is determined with the first inquiry sum based on client request, and with the second inquiry sum and Base Serial Number structure
It builds query statement to be inquired, in this way, query result can be obtained by one query and determine whether that there are also the numbers that do not inquire
According to saving query time, while alleviating inquiry pressure, alleviate the processing pressure of server, promote query performance.
Wherein, the computer readable storage medium, such as read-only memory (Read-Only Memory, ROM), at random
Access memory (Random Access Memory, RAM), magnetic or disk etc..
Embodiment five
Referring to shown in Fig. 5 a, for the structural schematic diagram for the data query device 500 that this specification embodiment provides, the device
It specifically includes that
Receiving module 502 receives the inquiry request that client is sent, wherein the inquiry request carries expression starting
The information of number and the first inquiry sum;
Enquiry module 504 based on the Base Serial Number and the second inquiry sum building query statement and is inquired, wherein
The second inquiry sum is greater than the first inquiry sum;
Sending module 506 is identified to the corresponding query result of inquiry request described in the client feedback and inquiry,
In, the inquiry mark is for characterizing in the corresponding tables of data of the inquiry request with the presence or absence of the data that do not inquire.
Optionally, the second inquiry sum is equal to the first inquiry sum and the sum of 1.
Optionally, the inquiry mark is determined based on the total size relation of the record number of query result and the first inquiry
's.
Optionally, referring to shown in Fig. 5 b, the data query device further include: determining module 508, if for inquiring knot
The record number of fruit is greater than the first inquiry sum, it is determined that inquiry mark is deposited for characterizing in the corresponding tables of data of inquiry request
In the data that do not inquire;And if the record number for query result is total no more than first inquiry, it is determined that inquiry
It identifies for characterizing the data for being not present in the corresponding tables of data of inquiry request and not inquiring.
Optionally, the Base Serial Number is the inquiry page number;Correspondingly,
The enquiry module 504 is constructing query statement based on the Base Serial Number and the second inquiry sum and is inquiring
When, it is specifically used for:
Based on the inquiry page number and the first inquiry sum, determine data that inquiry request is inquired corresponding
Initial data number in tables of data;
Based on initial data number and the second inquiry sum building query statement and inquire.
Optionally, initial data of the data that the Base Serial Number is inquired by inquiry request in corresponding tables of data is compiled
Number;Correspondingly,
The determining module 508 is also used to:
Used initial data number, determination are looked into next time when record number based on query result and this inquiry
Used initial data number when inquiry, and client is returned to by the sending module 506.
Optionally, the sending module 506 to the corresponding query result of inquiry request described in the client feedback and
When inquiry mark, it is specifically used for:
If the record number of query result is greater than the first inquiry sum, before inquiring to client return
N data and the first inquiry mark, wherein the N is the first inquiry sum, and the first inquiry mark is used to indicate described
Client continues to inquire;
If the record number of query result is inquired no more than the first inquiry sum to client return
Data and the second inquiry mark, wherein the second inquiry mark is used to indicate the client and stops inquiry.
In addition, referring to shown in Fig. 6, it, should for the structural schematic diagram for the data query system 600 that this specification embodiment provides
System includes: server 602, client 604 and database 606;
Wherein, the server 602 receives the inquiry request of client 604, wherein the inquiry request carries table
Levy the information of Base Serial Number and the first inquiry sum;And based on the Base Serial Number and the second inquiry sum building inquiry language
Sentence is simultaneously inquired, wherein the second inquiry sum is greater than the first inquiry sum;And institute is fed back to the client 604
State the corresponding query result of inquiry request and inquiry mark, wherein the inquiry mark described in characterization database 606 for looking into
It askes and corresponding tables of data is requested to whether there is the data that do not inquire;
The client 604 sends inquiry request to the server 602, and receives the institute that the server 602 is fed back
State the corresponding query result of inquiry request and inquiry mark;
The database 606, is stored with data, and receives the access queries operation of the server 602.
Through the above technical solutions, when the inquiry request sent based on client carries out data query to database, it can
The second inquiry sum is determined with the first inquiry sum based on client request, and with the second inquiry sum and Base Serial Number structure
It builds query statement to be inquired, in this way, query result can be obtained by one query and determine whether that there are also the numbers that do not inquire
According to saving query time, while alleviating inquiry pressure, alleviate the processing pressure of server, promote query performance.
In short, being not intended to limit this specification the foregoing is merely the preferred embodiment of this specification embodiment
The protection scope of embodiment.It is all this specification embodiment spirit and principle within, made any modification, equivalent replacement,
Improve etc., it should be included within the protection scope of this specification embodiment.
System, device, module or the unit that above-described embodiment illustrates can specifically realize by computer chip or entity,
Or it is realized by the product with certain function.It is a kind of typically to realize that equipment is computer.Specifically, computer for example may be used
Think personal computer, laptop computer, cellular phone, camera phone, smart phone, personal digital assistant, media play
It is any in device, navigation equipment, electronic mail equipment, game console, tablet computer, wearable device or these equipment
The combination of equipment.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer readable instructions, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase change memory (PRAM), static random access memory (SRAM), moves
State random access memory (DRAM), other kinds of random access memory (RAM), read-only memory (ROM), electric erasable
Programmable read only memory (EEPROM), flash memory or other memory techniques, read-only disc read only memory (CD-ROM) (CD-ROM),
Digital versatile disc (DVD) or other optical storage, magnetic cassettes, tape magnetic disk storage or other magnetic storage devices
Or any other non-transmission medium, can be used for storage can be accessed by a computing device information.As defined in this article, it calculates
Machine readable medium does not include temporary computer readable media (transitorymedia), such as the data-signal and carrier wave of modulation.
It should also be noted that, the terms "include", "comprise" or its any other variant are intended to nonexcludability
It include so that the process, method, commodity or the equipment that include a series of elements not only include those elements, but also to wrap
Include other elements that are not explicitly listed, or further include for this process, method, commodity or equipment intrinsic want
Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including described want
There is also other identical elements in the process, method of element, commodity or equipment.
Various embodiments are described in a progressive manner in this specification embodiment, identical phase between each embodiment
As partially may refer to each other, each embodiment focuses on the differences from other embodiments.Especially for
For system embodiment, since it is substantially similar to the method embodiment, so being described relatively simple, related place is referring to method
The part of embodiment illustrates.