CN107045499A - A kind of method and server for realizing data query - Google Patents

A kind of method and server for realizing data query Download PDF

Info

Publication number
CN107045499A
CN107045499A CN201610079493.1A CN201610079493A CN107045499A CN 107045499 A CN107045499 A CN 107045499A CN 201610079493 A CN201610079493 A CN 201610079493A CN 107045499 A CN107045499 A CN 107045499A
Authority
CN
China
Prior art keywords
query
inquiry
paging
sentence
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201610079493.1A
Other languages
Chinese (zh)
Inventor
景小卫
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201610079493.1A priority Critical patent/CN107045499A/en
Priority to PCT/CN2017/072178 priority patent/WO2017133538A1/en
Publication of CN107045499A publication Critical patent/CN107045499A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24564Applying rules; Deductive queries
    • G06F16/24565Triggers; Constraints
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

A kind of method and server for realizing data query, including:Server is received after query statement, and paging query sentence is generated according to query statement;Server performs each paging query sentence of generation, returns to corresponding inquiry data.Present invention method, by the paging query sentence that generates inquire about the feedback quantity of data according to query statement when paging query reduces and carries out big table data access, it is to avoid the waste of network communication and server resource, improves user experience.

Description

A kind of method and server for realizing data query
Technical field
The present invention relates to data processing technique, espespecially a kind of method and server for realizing data query.
Background technology
Network management, electric power supervisory control, Online Store of telecommunications etc. will often maintain mass data, this The data maintained a bit are typically stored in the table of Database Systems;Such as telecommunication network management and power system Monitoring needs the data such as daily performance, the warning information of maintenance system, and Online Store needs to maintain a large amount of business Product information data etc., the usual enormous amount of data of maintenance, store these data used in table be referred to as For big table;Such as, the big table of the daily performance data of telecommunication network management is deposited, by network element, veneer, list Various test points produce a performance data in every 15 minutes in plate, couple large-scale communication network and pass through for 1 month The daily performance data of big table storage is up to surprising scale.User is by client to being stored in big table In data inquired about and browsed, to obtain required content (interested, valuable content). The purpose that user inquires about big table is very wide in range, may relate to substantial amounts of data.
At present, the access of data is mainly carried out in big table in the following ways:The first, according to progress During data query, server is obtained according to querying command and met after all data of querying command, will be all Data are sent to client;Secondth, server according to querying command by fixed strip number or set time Query Result is sent to client in batches.
When carrying out the access of data in big table using above two method, no matter user sees or not seen, largely Inquiry data all will endlessly issue client, cause network communication and the waste of server resource, together Shi Zaocheng client end responses speed declines, and influences user experience.
The content of the invention
In order to solve the above-mentioned technical problem, the present invention provides a kind of method and server for realizing data query, When can avoid accessing big table, substantial amounts of feedback query data.
In order to reach the object of the invention, the invention provides a kind of method for realizing data query, including:
Server is received after query statement, and paging query sentence is generated according to query statement;
Server performs each paging query sentence of generation, is returned and looked into accordingly according to each paging query sentence Ask data.
Optionally, generation paging query sentence includes:
The paging query sentence is generated according to fixed inquiry scale according to the query statement;Or,
Generated according to fixed inquiry scale after first paging query sentence, according to preceding paging The posterior paging query sentence of inquiry record generation of query statement;
The inquiry scale is query window number and the product of query window display data amount;
The inquiry record includes:With each paging query sentence into performing each paging query language correspondingly Query window number, inquiry duration, the transmission duration of inquiry data, the insertion duration for inquiring about data during sentence.
Optionally, posterior paging query sentence is generated according to the inquiry of preceding paging query sentence record Including:
What the inquiry duration and default response lag for calculating a preceding paging query sentence were divided by Business, is used as easy-to-use coefficient;
If easy-to-use coefficient does not adjust inquiry scale in pre-set interval;
It is uncomfortable when the bar number of inquiry record is less than default value if easy-to-use coefficient exceeds pre-set interval Whole next inquiry scale in rear paging query sentence, generates next posterior paging query sentence;
If easy-to-use coefficient exceeds pre-set interval, when the bar number of inquiry record is more than default value, according to The inquiry scale of the posterior paging query sentence of inquiry record adjustment, gives birth to according to the inquiry scale of adjustment Into next posterior paging query sentence.
Optionally, posterior paging query sentence is generated according to the inquiry duration of preceding paging query sentence Before, this method also includes:
Inquiry timing is carried out respectively to each paging query sentence, to obtain preceding paging query sentence The inquiry duration.
Optionally, this method also includes:
During the paging query sentence inquiry failure, feedback query failure information;
The query failure message includes inquiry failure cause and/or inquiry set in advance is unsuccessfully encoded.
Optionally, this method also includes:
It is determined that return the inquiry data whether be last paging query sentence last subpackage Data;
If last packetized data of last paging query sentence, in browse queries data Query window performs the insertion process of last packetized data:If not last paging query language Last packetized data of sentence, the insert division of intermediate data is performed in the query window of browse queries data Reason.
Optionally, this method also includes:
When detecting the query window page turning of browse queries data, the display inquiry data of current residual are determined Query window number whether reach it is default triggering in rear threshold value;
If the query window number of the display inquiry data of current residual is not up to default triggering in rear threshold Value, continues the display that current paging query sentence inquires about data;If the display inquiry data of current residual Query window number reach it is default triggering in rear threshold value, then perform next posterior paging query sentence.
Optionally, this method also includes:
When being not detected by query window page turning or receiving the operation for closing query window, stop performing and divide Page query statement.
Optionally, this method also includes:
Count the display time of the query window of preceding predetermined number;
The display duration of remaining query window is determined according to the average display duration of query window;
When the display duration of remaining query window reaches default activation threshold value, perform posterior paging and look into Ask sentence.
On the other hand, the embodiment of the present invention also proposes a kind of server for realizing data query, including:It is raw Into unit and returning unit;Wherein,
Generation unit is used for, and receives after query statement, and paging query sentence is generated according to query statement;
Returning unit is used for, and performs each paging query sentence of generation, is returned according to each paging query sentence Corresponding inquiry data.
Optionally, generation unit specifically for,
Receive after the query statement,
The paging query sentence is generated according to fixed inquiry scale according to the query statement;Or,
Generated according to fixed inquiry scale after first paging query sentence, according to preceding paging The posterior paging query sentence of inquiry record generation of query statement;
The inquiry scale is query window number and the product of query window display data amount;
The inquiry record includes:With each paging query sentence into performing each paging query language correspondingly Query window number, inquiry duration, the transmission duration of inquiry data, the insertion duration for inquiring about data during sentence.
Optionally, generation unit specifically for,
Receive after the query statement,
The paging query sentence is generated according to fixed inquiry scale according to the query statement;Or,
What the inquiry duration and default response lag for calculating a preceding paging query sentence were divided by Business, is used as easy-to-use coefficient;
If easy-to-use coefficient does not adjust inquiry scale in pre-set interval;
It is uncomfortable when the bar number of inquiry record is less than default value if easy-to-use coefficient exceeds pre-set interval Whole next inquiry scale in rear paging query sentence, generates next posterior paging query sentence;
If easy-to-use coefficient exceeds pre-set interval, when the bar number of inquiry record is more than default value, according to Query time adjusts the inquiry scale of a posterior paging query sentence, is given birth to according to the inquiry scale of adjustment Into next posterior paging query sentence.
Optionally, the server also includes timing unit, for described according to preceding paging query sentence Inquiry duration generate posterior paging query sentence before,
Inquiry timing is carried out respectively to each paging query sentence, to obtain preceding paging query sentence The inquiry duration.
Optionally, the server also includes query feedback unit, inquires about and loses for the paging query sentence When losing, feedback query failure information;
The query failure message includes inquiry failure cause and/or inquiry set in advance is unsuccessfully encoded.
Optionally, the server also includes subpackage processing unit, for the inquiry data for determining to return Whether be last paging query sentence last packetized data;
If last packetized data of last paging query sentence, in browse queries data Query window performs the insertion process of last packetized data:If not last paging query language Last packetized data of sentence, the insert division of intermediate data is performed in the query window of browse queries data Reason.
Optionally, the server also includes page processing unit:
When detecting the query window page turning of browse queries data, the display inquiry data of current residual are determined Query window number whether reach it is default triggering in rear threshold value;
If the query window number of the display inquiry data of current residual is not up to default triggering in rear threshold Value, continues the display that current paging query sentence inquires about data;If the display inquiry data of current residual Query window number reach it is default triggering in rear threshold value, then perform next posterior paging query sentence.
Optionally, the server also includes stop element, for being not detected by query window page turning or reception To during the operation for closing query window, stop performing paging query sentence.
Optionally, the server also includes trigger element, the inquiry window for counting preceding predetermined number The display time of mouth;
The display duration of remaining query window is determined according to the average display duration of query window;
When the display duration of remaining query window reaches default activation threshold value, perform posterior paging and look into Ask sentence.
Compared with correlation technique, technical scheme includes:Server is received after query statement, according to Query statement generates paging query sentence;Server performs each paging query sentence of generation, according to each point Page query statement returns to corresponding inquiry data.Present invention method, by being given birth to according to query statement Into paging query sentence carry out paging query reduce carry out big table data access when inquire about data feedback Amount, it is to avoid the waste of network communication and server resource, improves user experience.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, constitutes one of the application Point, schematic description and description of the invention is used to explain the present invention, does not constitute to the present invention's It is improper to limit.In the accompanying drawings:
Fig. 1 is the flow chart for the method that the embodiment of the present invention realizes data query;
Fig. 2 is the structured flowchart for the server that the embodiment of the present invention realizes data query;
Fig. 3 applies the method flow diagram of example for the present invention.
Embodiment
For the object, technical solutions and advantages of the present invention are more clearly understood, below in conjunction with accompanying drawing Embodiments of the invention are described in detail.It should be noted that in the case where not conflicting, this Shen Please in embodiment and the feature in embodiment can mutually be combined.
Fig. 1 is the flow chart for the method that the embodiment of the present invention realizes data query, as shown in figure 1, including:
Step 100, server are received after query statement, and paging query sentence is generated according to query statement;
Optionally, generation paging query sentence includes:
Paging query sentence is generated according to fixed inquiry scale according to query statement;Or,
Generated according to fixed inquiry scale after first paging query sentence, according to preceding paging query The posterior paging query sentence of inquiry record generation of sentence;
Inquiry scale is query window number and the product of query window display data amount;Here, query window Display data amount can be understood as query window size;
Inquiry record includes:With each paging query sentence into when performing each paging query sentence correspondingly Query window number, inquiry duration, inquiry data transmission duration, inquire about data insertion duration.Often One paging query sentence all includes one-to-one inquiry record.
Optionally, posterior paging query sentence is generated according to the inquiry of preceding paging query sentence record Including:
The business that the inquiry duration and default response lag for calculating a preceding paging query sentence are divided by, It is used as easy-to-use coefficient;
If easy-to-use coefficient does not adjust inquiry scale in pre-set interval;
It should be noted that pre-set interval of the embodiment of the present invention can be (0.8,1.05).Pre-set interval Can be the empirical value of those skilled in the art, using can be smoothly progress inquiry browsing for data be used as mark Standard, bottom line is used as using the feedback time of acceptable most slow inquiry data.
It is uncomfortable when the bar number of inquiry record is less than default value if easy-to-use coefficient exceeds pre-set interval Whole next inquiry scale in rear paging query sentence;
If easy-to-use coefficient exceeds pre-set interval, when the bar number of inquiry record is more than default value, according to The inquiry scale of the posterior paging query sentence of inquiry record adjustment.
It should be noted that this application sample query duration can be recorded by server;Can be with Inquiry is inserted into inquiry data by the initial time of client timer record execution paging query sentence Window time, performs the initial time of paging query sentence and subtracts to inquiring about data and be inserted into the query window time Go to inquire about the transmission duration that duration obtains inquiring about data.In addition, when inquiry duration, the transmission of inquiry data Long, inquiry data insertion durations can stored by way of queue.
The embodiment of the present invention, it is assumed that query window number is w, the transmission duration for inquiring about data and inquiry data Insertion duration be added and for T1, the first fitting function T of acquisition can be fitted1=a*w+b, by pre- If the content of numerical value inquiry record, can obtain a and b in the first fitting function;Assuming that during inquiry A length of T2, the second fitting function T of acquisition can be fitted2=c*w+d, is inquired about by default value and recorded Content, the c and d in the second fitting function can be obtained;The sets target response time, rung with target It is equal to (a*w+c)+(b*w+d) between seasonable and calculates the inquiry for obtaining a posterior paging query sentence Window number w numerical value, if calculate obtain numerical value be not integer, if can be taken up or down It is whole.This application example, target response time can set identical with default response lag numerical value, also may be used To be adjusted according to the requirement of actual queries data feedback speed.
Optionally, the inquiry scale of a posterior paging query sentence can be calculated in client, For example, the inquiry duration of record is sent to client, the inquiry of client combination self record by server The transmission duration of data, the insertion duration of inquiry data are using above-mentioned first fitting function, the second fitting letter Number and target response time calculate the inquiry scale for obtaining a posterior paging query sentence;Posterior one The inquiry scale of individual paging query sentence can be calculated in service end, and for example, client is by record The transmission duration for inquiring about data, the insertion duration for inquiring about data are sent to server, and server is remembered with reference to itself The inquiry duration of record is calculated using above-mentioned first fitting function, the second fitting function and target response time and obtained Obtain the inquiry scale of a posterior paging query sentence;
The embodiment of the present invention, the inquiry scale of posterior paging query sentence is adjusted in fact according to inquiry record During matter, if inquiry scale is excessive, now easy-to-use coefficient is more than the maximum of pre-set interval in theory, leads to The query window number for reducing a posterior paging query sentence is crossed, can accelerate to inquire about the feedback of data, Easy-to-use coefficient is reduced in theory;If the scale of inquiry is too small, now easy-to-use coefficient is theoretically smaller than preset areas Between minimum value, by increasing the query window number of a posterior paging query sentence, can increase and look into Ask the data volume of data;Make user when performing a paging query sentence, obtain enough information; That is, when easy-to-use coefficient is more than the maximum of pre-set interval, the inquiry in latter paging query sentence is reduced Window number;When easy-to-use coefficient is less than the maximum of pre-set interval, increase in latter paging query sentence Query window number.The decrement and incrementss of specific query window number are referred to fitting function and calculated Obtain, can also be adjusted according to default step-length or Tuning function.
Step 101, server perform each paging query sentence of generation, are returned according to each paging query sentence Return corresponding inquiry data.
Before the posterior paging query sentence of the inquiry duration of preceding paging query sentence generation, this Inventive embodiments method also includes:
Inquiry timing is carried out respectively to each paging query sentence, to obtain looking into for preceding paging query sentence Ask duration.
Optionally, present invention method also includes:
During the inquiry failure of paging query sentence, feedback query failure information;
Query failure message includes inquiry failure cause and/or inquiry set in advance is unsuccessfully encoded.
Optionally, present invention method also includes:
It is determined that return inquiry data whether be last paging query sentence last subpackage number According to;
If last packetized data of last paging query sentence, in browse queries data Query window performs the insertion process of last packetized data:If not last paging query language Last packetized data of sentence, the insert division of intermediate data is performed in the query window of browse queries data Reason.
Optionally, present invention method also includes:
When detecting the query window page turning of browse queries data, the display inquiry data of current residual are determined Query window number whether reach it is default triggering in rear threshold value;Here, triggering may be set in rear threshold values Fixed number, for example, is set to rounding up or down for 1/3 query window number;
If the query window number of the display inquiry data of current residual is not up to default triggering in rear threshold Value, continues the display that current paging query sentence inquires about data;If the display inquiry data of current residual Query window number reach it is default triggering in rear threshold value, then perform next posterior paging query sentence.
It should be noted that whether the query window number that data are inquired about in the display by determining current residual reaches To default triggering in rear threshold value, it may then determine whether to perform next posterior paging query sentence, in advance The data query in rear paging query sentence is carried out, the feedback efficiency of inquiry data is improved.
Optionally, present invention method also includes:
When being not detected by query window page turning or receiving the operation for closing query window, stop performing and divide Page query statement.
Optionally, present invention method also includes:
Count the display time of the query window of preceding predetermined number;
The display duration of remaining query window is determined according to the average display duration of query window;
When the display duration of remaining query window reaches default activation threshold value, perform posterior paging and look into Ask sentence.
It should be noted that determined whether according to the display time of query window when activation threshold value is met, The execution in rear paging query sentence is carried out in advance, is improved user and is obtained in rear paging query sentence correspondence Inquiry data speed, improve Consumer's Experience.The processing of the above method of the embodiment of the present invention can lead to Cross central processing unit realization;The execution content being related in embodiment method can be performed by the way that generation is corresponding After instruction, it is added in central processing unit.
Present invention method, is inquired about when reducing the big table data access of progress by paging query sentence The feedback quantity of data, it is to avoid the waste of network communication and server resource, improves user experience.
Fig. 2 is the structured flowchart for the server that the embodiment of the present invention realizes data query, as shown in Fig. 2 Including:Generation unit and returning unit;Wherein,
Generation unit is used for, and receives after query statement, and paging query sentence is generated according to query statement;
Returning unit is used for, and performs each paging query sentence of generation, is returned according to each paging query sentence Corresponding inquiry data.
Optionally, generation unit specifically for,
Receive after query statement,
Paging query sentence is generated according to fixed inquiry scale according to query statement;Or,
Generated according to fixed inquiry scale after first paging query sentence, according to preceding paging query The posterior paging query sentence of inquiry record generation of sentence;
Inquiry scale is query window number and the product of query window display data amount;
Inquiry record includes:With each paging query sentence into when performing each paging query sentence correspondingly Query window number, inquiry duration, inquiry data transmission duration, inquire about data insertion duration.
Optionally, generation unit specifically for,
Paging query sentence is generated according to fixed inquiry scale according to query statement;Or,
The business that the inquiry duration and default response lag for calculating a preceding paging query sentence are divided by, It is used as easy-to-use coefficient;
If easy-to-use coefficient does not adjust inquiry scale in pre-set interval;
It is uncomfortable when the bar number of inquiry record is less than default value if easy-to-use coefficient exceeds pre-set interval Whole next inquiry scale in rear paging query sentence, generates next posterior paging query sentence;
If easy-to-use coefficient exceeds pre-set interval, when the bar number of inquiry record is more than default value, according to The inquiry scale of the posterior paging query sentence of inquiry record adjustment, gives birth to according to the inquiry scale of adjustment Into next posterior paging query sentence.
Optionally, server of the embodiment of the present invention also includes timing unit, for being looked into according to preceding paging Before the posterior paging query sentence of inquiry duration generation for asking sentence,
Inquiry timing is carried out respectively to each paging query sentence, to obtain looking into for preceding paging query sentence Ask duration.
Optionally, server of the embodiment of the present invention also includes query feedback unit, for paging query sentence During inquiry failure, feedback query failure information;
Query failure message includes inquiry failure cause and/or inquiry set in advance is unsuccessfully encoded.
Optionally, server of the embodiment of the present invention also includes subpackage processing unit, for determining that what is returned looks into Ask data whether be last paging query sentence last packetized data;
If last packetized data of last paging query sentence, in browse queries data Query window performs the insertion process of last packetized data:If not last paging query language Last packetized data of sentence, the insert division of intermediate data is performed in the query window of browse queries data Reason.
Optionally, server of the embodiment of the present invention also includes page processing unit:
When detecting the query window page turning of browse queries data, the display inquiry data of current residual are determined Query window number whether reach it is default triggering in rear threshold value;
If the query window number of the display inquiry data of current residual is not up to default triggering in rear threshold Value, continues the display that current paging query sentence inquires about data;If the display inquiry data of current residual Query window number reach it is default triggering in rear threshold value, then perform next posterior paging query sentence.
Optionally, server of the embodiment of the present invention also includes stop element, for being not detected by query window Page turning or receive close query window operation when, stop perform paging query sentence.
Optionally, server of the embodiment of the present invention also includes trigger element, for counting preceding default The display time of several query windows;
The display duration of remaining query window is determined according to the average display duration of query window;
When the display duration of remaining query window reaches default activation threshold value, perform posterior paging and look into Ask sentence.
Present invention method is clearly described in detail below by way of concrete application example, applied Example is only used for the statement present invention, the protection domain being not intended to limit the present invention.
Using example
This application example system includes client and server, and client deployment is visited in the data of application system Interface is asked, Fig. 3 applies the method flow diagram of example for the present invention, as shown in figure 3, including:
The inquiry thread of step 300, startup of server data access;
It should be noted that present invention application sample data inquiry thread can also be opened in user and browse window Resettled during mouth, belong to the conventional techniques of those skilled in the art, will not be repeated here.Here look into Ask thread and refer to the inquiry thread for accessing big table data.
Step 301, client receive user instruction and determine to access the data area of data, are sent out to server Send query statement;
This step triggering client enters browsing data process, can include following processing:By determining number Client is set to enter inquiry state according to scope, that is, it is false to put client query done state;Inquiry is sent to refer to Server is made, server enters inquiry state.The query statement that this application example is sent to server can With comprising:Condition query sentence, browser window page-size, query window number;Wherein, query window Several initial values can use preset value, and such as preset value can be set as the access page of statistical analysis determination Face number average value, for example, set the initial value of query window number as 5.
Step 302, server are received after query statement, and paging query sentence is generated according to query statement;
In this step, generation paging query sentence includes:
Paging query sentence is generated according to fixed inquiry scale according to query statement;Or,
Generated according to fixed inquiry scale after first paging query sentence, according to preceding paging query The posterior paging query sentence of inquiry record generation of sentence;
Inquiry scale is query window number and the product of query window display data amount;
Inquiry record includes:With each paging query sentence into when performing each paging query sentence correspondingly Query window number, inquiry duration, inquiry data transmission duration, inquire about data insertion duration.
Optionally, when generating paging query sentence according to fixed inquiry scale according to query statement, generation The inquiry scale of each paging query sentence can be with identical;For example, the query window in inquiry scale Be set in 5~7 several fixed value, now according to all satisfactory points of query statement generation Page query statement, when present invention application example is using fixed inquiry scale generation paging query sentence, is looked into Inquiry scale can be preserved as fixed parameter.
Generating posterior paging query sentence according to the inquiry of preceding paging query sentence record includes:
Calculate after the inquiry duration of previous paging query sentence is divided by with default response lag, as Easy-to-use coefficient;
It should be noted that response lag can be based on professional standard, customer requirement or technical staff's design Index determination, the response time of response lag Primary Reference paging query sentence;General, big table data During inquiry, the small operation response time, for example, 3 to 5 seconds, now response lag can be set in second level It is set to 3 to 5 seconds, if response lag sets excessive, in the case where pre-set interval is constant, will influences User carries out the usage experience of data query.
If easy-to-use coefficient does not adjust inquiry scale in pre-set interval;This application example pre-set interval can To be (0.8,1.05).Pre-set interval can be the empirical value of those skilled in the art, with can be smooth Progress inquiry data browse as standard, with the feedback time of acceptable most slow inquiry data It is used as bottom line.
It is uncomfortable when the bar number of inquiry record is less than default value if easy-to-use coefficient exceeds pre-set interval Whole inquiry scale;Here, inquiry scale is not adjusted includes:According to the inquiry of preceding paging query sentence Scale is generated in rear query statement;Default value could be arranged to the integer more than or equal to 2.
Inquiry record includes:When performing each paging query sentence, with each paging query sentence into one-to-one corresponding Query window number, query responding time;Wherein, query responding time is included:Inquire about duration, inquiry The transmission duration of data, the insertion duration for inquiring about data;
This application sample query duration is recorded by server;This application example can also pass through client End timer record perform paging query sentence initial time to inquire about data be inserted into query window when Between, the initial time of paging query sentence, which is performed, to inquiring about data and be inserted into the query window time subtracts inquiry Duration obtains inquiring about the transmission duration of data.
It should be noted that adjustment record can in the server be handled by way of queue.
If easy-to-use coefficient exceeds pre-set interval, when the bar number of inquiry record is more than default value, according to The inquiry scale of the posterior paging query sentence of inquiry record adjustment.
This application example, it is assumed that query window number is w, the transmission duration of inquiry data and inquiry data Insert that duration is added and for T1, the first fitting function T of acquisition can be fitted1=a*w+b, by default The content of numerical value inquiry record, can obtain a and b in the first fitting function;Assuming that inquiry duration For T2, the second fitting function T of acquisition can be fitted2=c*w+d, record is inquired about by default value Content, can obtain the c and d in the second fitting function;The sets target response time, with target response Time is equal to (a*w+c)+(b*w+d) and calculates the inquiry window for obtaining a posterior paging query sentence Mouthful number w numerical value, if calculate the numerical value obtained be not integer, if can be rounded up or down. This application example, target response time can set identical with default response lag numerical value, can also root It is adjusted according to the requirement of actual queries data feedback speed.
In this application example, the inquiry scale of a posterior paging query sentence can be carried out in client Calculate, for example, server the inquiry duration of record is sent to client, client combination self record Inquiry data transmission duration, inquire about data insertion duration use above-mentioned first fitting function, second Fitting function and target response time calculate the inquiry scale for obtaining a posterior paging query sentence; The inquiry scale of a paging query sentence afterwards can be calculated in service end, for example, client will Transmission duration, the insertion duration of inquiry data of the inquiry data of record are sent to server, and server is combined The inquiry duration of self record uses above-mentioned first fitting function, the second fitting function and target response time Calculate the inquiry scale for obtaining a posterior paging query sentence;
Here, easy-to-use coefficient is less than the minimum of pre-set interval beyond the numerical value that pre-set interval includes easy-to-use coefficient The numerical value of value and easy-to-use coefficient is more than two kinds of situations of maximum of pre-set interval;The numerical value of easy-to-use coefficient is less than During the minimum value of pre-set interval, this application example obtains the first fitting function and the according to inquiry record fitting Two fitting functions, can calculate acquisition next in rear paging query sentence by the target response time of setting Query window number be more than preceding paging query sentence query window number;The numerical value of easy-to-use coefficient is more than pre- If during the maximum in interval, this application example obtains the first fitting function and second according to inquiry record fitting Fitting function, can be calculated by the target response time of setting and to obtain next in rear paging query sentence Query window number is less than the query window number in preceding paging query sentence;Pass through adjustment, each paging query language The inquiry data of sentence feedback are integrated in data volume and feedback velocity, are improved user and are carried out in big table The usage experience of data query.
Looked into it should be noted that generating posterior paging according to the inquiry duration of preceding paging query sentence When asking sentence, default value set in advance can be used as the inquiry scale of first paging query sentence, Inquiry scale is equal to query window number and the product of client window display data amount;General query window Several initial values can be 5~7, when specific value can be performed according to paging query sentence, inquire about data Return speed and user experience are adjusted.
Present invention application exemplary method also includes:Inquiry timing is carried out respectively to each paging query sentence, with Obtain the inquiry duration of preceding paging query sentence.
It should be noted that present invention application sample query timing can be carried out by timer, during inquiry Length can be obtained by the inquiry starting time and end time for recording each paging query sentence, if It is continuous inquiry, then the end time of upper paging query sentence is the starting point of current paging query sentence Time;If paging query sentence is discrete inquiry, inquiry duration can be looked into by reading paging System time when asking sentence start to finish is obtained.
Step 303, server perform each paging query sentence of generation, are returned according to each paging query sentence Return corresponding inquiry data;
When paging query sentence is inquired about, general starting time and inquiry scale can be pressed into query stacking It is interior, when completing the execution of paging query sentence, empty paging query sentence in query stacking.
It should be noted that perform query statement according to existing connected reference need access database or Big table, for example, being connected by the big table access interface of database with Database;Access connection database Or the content of big table is the conventional techniques of those skilled in the art in database, be will not be repeated here.
Present invention application example also includes:
During the inquiry failure of paging query sentence, feedback query failure information;
Optionally, query failure message can be inquiry failure cause, and/or inquiry set in advance failure Coding.
Present invention application example also includes:It is determined that whether the inquiry data returned are last paging queries Last packetized data of sentence:
If last packetized data of last paging query sentence, in browse queries data Query window performs the insertion process of last packetized data:Optionally,
To each data of the packetized data of extraction, it is determined whether be the inquiry data of paging query sentence, Shown if it is, the data of extraction are inserted into client access window, until being in packetized data During the last item data of the inquiry data of paging query sentence, data insertion is completed;
It should be noted that when carrying out insertion process, it is true to put insert state;When stopping insertion, put slotting Enter that state is false, poll-final is true, paging query Statement Completion.
If not last packetized data of last paging query sentence, in browse queries data Query window perform intermediate data insertion process.
It should be noted that the insertion process of intermediate data is prior art, by extracting subpackage number one by one According to each data be inserted into client access window, when carrying out data insertion, put insert state of crossing the border It is false;When present invention application example carries out timing to the inquiry duration of paging query sentence, intermediate data In insertion process, when the last item data complete the insertion of client access port, the paging query sentence Inquiry duration cut-off.
This application exemplary method also includes:When detecting the query window page turning of browse queries data, it is determined that Whether the query window number of the display inquiry data of current residual reaches default triggering in rear threshold value;
If the query window number of the display inquiry data of current residual is not up to default triggering in rear threshold Value, continues the display that current paging query sentence inquires about data;If the display inquiry data of current residual Query window number reach it is default triggering in rear threshold value, then perform next posterior paging query sentence.
This application exemplary method also includes:
When being not detected by page turning or receiving the operation for closing query window, stop performing paging query language Sentence.
Present invention application example also includes:
Count the display time of the query window of preceding predetermined number;
The display duration of remaining query window is determined according to the average display duration of query window;
When the display duration of remaining query window reaches default activation threshold value, perform posterior paging and look into Ask sentence.
It should be noted that predetermined number is set according to actual use situation, for example two or three, Inquiry scale is bigger, and the numerical value of predetermined number is bigger.
Step 304, data query terminated according to query statement ending message;Here, when terminating inquiry, Inquiry scale, inquiry duration calendar scheduling will carry out emptying processing, disconnects or keeps being connected, tying with database Beam or reservation inquiry thread are set according to actual conditions.
Although disclosed herein embodiment as above, described content is only to readily appreciate the present invention And the embodiment used, it is not limited to the present invention.Technology people in any art of the present invention Member, do not depart from disclosed herein spirit and scope on the premise of, can be in the form of implementation and thin Any modification and change, but the scope of patent protection of the present invention are carried out on section, still must be with appended right The scope that claim is defined is defined.

Claims (18)

1. a kind of method for realizing data query, it is characterised in that including:
Server is received after query statement, and paging query sentence is generated according to query statement;
Server performs each paging query sentence of generation, is returned and looked into accordingly according to each paging query sentence Ask data.
2. according to the method described in claim 1, it is characterised in that the generation paging query sentence bag Include:
The paging query sentence is generated according to fixed inquiry scale according to the query statement;Or,
Generated according to fixed inquiry scale after first paging query sentence, according to preceding paging The posterior paging query sentence of inquiry record generation of query statement;
The inquiry scale is query window number and the product of query window display data amount;
The inquiry record includes:With each paging query sentence into performing each paging query language correspondingly Query window number, inquiry duration, the transmission duration of inquiry data, the insertion duration for inquiring about data during sentence.
3. method according to claim 2, it is characterised in that described according to preceding paging query The posterior paging query sentence of inquiry record generation of sentence includes:
What the inquiry duration and default response lag for calculating a preceding paging query sentence were divided by Business, is used as easy-to-use coefficient;
If easy-to-use coefficient does not adjust inquiry scale in pre-set interval;
It is uncomfortable when the bar number of inquiry record is less than default value if easy-to-use coefficient exceeds pre-set interval Whole next inquiry scale in rear paging query sentence, generates next posterior paging query sentence;
If easy-to-use coefficient exceeds pre-set interval, when the bar number of inquiry record is more than default value, according to The inquiry scale of the posterior paging query sentence of inquiry record adjustment, gives birth to according to the inquiry scale of adjustment Into next posterior paging query sentence.
4. according to the method in claim 2 or 3, it is characterised in that described according to preceding paging The inquiry duration of query statement is generated before posterior paging query sentence, and this method also includes:
Inquiry timing is carried out respectively to each paging query sentence, to obtain preceding paging query sentence The inquiry duration.
5. the method according to any one of claims 1 to 3, it is characterised in that this method also includes:
During the paging query sentence inquiry failure, feedback query failure information;
The query failure message includes inquiry failure cause and/or inquiry set in advance is unsuccessfully encoded.
6. the method according to any one of claims 1 to 3, it is characterised in that this method also includes:
It is determined that return the inquiry data whether be last paging query sentence last subpackage Data;
If last packetized data of last paging query sentence, in browse queries data Query window performs the insertion process of last packetized data:If not last paging query language Last packetized data of sentence, the insert division of intermediate data is performed in the query window of browse queries data Reason.
7. the method according to any one of claims 1 to 3, it is characterised in that this method also includes:
When detecting the query window page turning of browse queries data, the display inquiry data of current residual are determined Query window number whether reach it is default triggering in rear threshold value;
If the query window number of the display inquiry data of current residual is not up to default triggering in rear threshold Value, continues the display that current paging query sentence inquires about data;If the display inquiry data of current residual Query window number reach it is default triggering in rear threshold value, then perform next posterior paging query sentence.
8. the method according to any one of claims 1 to 3, it is characterised in that this method also includes:
When being not detected by query window page turning or receiving the operation for closing query window, stop performing and divide Page query statement.
9. the method according to any one of claims 1 to 3, it is characterised in that this method also includes:
Count the display time of the query window of preceding predetermined number;
The display duration of remaining query window is determined according to the average display duration of query window;
When the display duration of remaining query window reaches default activation threshold value, perform posterior paging and look into Ask sentence.
10. a kind of server for realizing data query, it is characterised in that including:Generation unit and return Unit;Wherein,
Generation unit is used for, and receives after query statement, and paging query sentence is generated according to query statement;
Returning unit is used for, and performs each paging query sentence of generation, is returned according to each paging query sentence Corresponding inquiry data.
11. server according to claim 10, it is characterised in that the generation unit is specifically used In,
Receive after the query statement,
The paging query sentence is generated according to fixed inquiry scale according to the query statement;Or,
Generated according to fixed inquiry scale after first paging query sentence, according to preceding paging The posterior paging query sentence of inquiry record generation of query statement;
The inquiry scale is query window number and the product of query window display data amount;
The inquiry record includes:With each paging query sentence into performing each paging query language correspondingly Query window number, inquiry duration, the transmission duration of inquiry data, the insertion duration for inquiring about data during sentence.
12. server according to claim 10, it is characterised in that the generation unit is specifically used In,
Receive after the query statement,
The paging query sentence is generated according to fixed inquiry scale according to the query statement;Or,
What the inquiry duration and default response lag for calculating a preceding paging query sentence were divided by Business, is used as easy-to-use coefficient;
If easy-to-use coefficient does not adjust inquiry scale in pre-set interval;
It is uncomfortable when the bar number of inquiry record is less than default value if easy-to-use coefficient exceeds pre-set interval Whole next inquiry scale in rear paging query sentence, generates next posterior paging query sentence;
If easy-to-use coefficient exceeds pre-set interval, when the bar number of inquiry record is more than default value, according to Query time adjusts the inquiry scale of a posterior paging query sentence, is given birth to according to the inquiry scale of adjustment Into next posterior paging query sentence.
13. the server according to claim 11 or 12, it is characterised in that the server is also wrapped Timing unit is included, for described according to the posterior paging of the inquiry duration of preceding paging query sentence generation Before query statement,
Inquiry timing is carried out respectively to each paging query sentence, to obtain preceding paging query sentence The inquiry duration.
14. the server according to any one of claim 10~12, it is characterised in that the server Also include query feedback unit, when inquiring about failure for the paging query sentence, feedback query is unsuccessfully believed Breath;
The query failure message includes inquiry failure cause and/or inquiry set in advance is unsuccessfully encoded.
15. the server according to any one of claim 10~12, it is characterised in that the server Also include subpackage processing unit, whether the inquiry data for determining to return are that last paging is looked into Ask last packetized data of sentence;
If last packetized data of last paging query sentence, in browse queries data Query window performs the insertion process of last packetized data:If not last paging query language Last packetized data of sentence, the insert division of intermediate data is performed in the query window of browse queries data Reason.
16. the server according to any one of claim 10~12, it is characterised in that the server Also include page processing unit:
When detecting the query window page turning of browse queries data, the display inquiry data of current residual are determined Query window number whether reach it is default triggering in rear threshold value;
If the query window number of the display inquiry data of current residual is not up to default triggering in rear threshold Value, continues the display that current paging query sentence inquires about data;If the display inquiry data of current residual Query window number reach it is default triggering in rear threshold value, then perform next posterior paging query sentence.
17. the server according to any one of claim 10~12, it is characterised in that the server Also include stop element, for being not detected by query window page turning or receiving the operation of closing query window When, stop performing paging query sentence.
18. the server according to any one of claim 10~12, it is characterised in that the server Also include trigger element, the display time of the query window for counting preceding predetermined number;
The display duration of remaining query window is determined according to the average display duration of query window;
When the display duration of remaining query window reaches default activation threshold value, perform posterior paging and look into Ask sentence.
CN201610079493.1A 2016-02-05 2016-02-05 A kind of method and server for realizing data query Pending CN107045499A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610079493.1A CN107045499A (en) 2016-02-05 2016-02-05 A kind of method and server for realizing data query
PCT/CN2017/072178 WO2017133538A1 (en) 2016-02-05 2017-01-23 Method for realizing data query and server

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610079493.1A CN107045499A (en) 2016-02-05 2016-02-05 A kind of method and server for realizing data query

Publications (1)

Publication Number Publication Date
CN107045499A true CN107045499A (en) 2017-08-15

Family

ID=59500457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610079493.1A Pending CN107045499A (en) 2016-02-05 2016-02-05 A kind of method and server for realizing data query

Country Status (2)

Country Link
CN (1) CN107045499A (en)
WO (1) WO2017133538A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416967A (en) * 2020-12-11 2021-02-26 北京北信源软件股份有限公司 Data paging query method and device, electronic equipment and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109359060B (en) * 2018-10-24 2023-06-16 三六零科技集团有限公司 Data extraction method, device, computing equipment and computer storage medium
CN111125148B (en) * 2019-12-12 2023-07-07 中化石化销售有限公司 Paging query method and device for database
CN112667662B (en) * 2020-12-25 2022-11-08 银盛支付服务股份有限公司 Common method for analyzing sql and nosql based on json key values
CN114039970A (en) * 2021-11-11 2022-02-11 北京沃东天骏信息技术有限公司 Information downloading method and device, electronic equipment and computer readable medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102880685A (en) * 2012-09-13 2013-01-16 北京航空航天大学 Method for interval and paging query of time-intensive B/S (Browser/Server) with large data size
CN103853727A (en) * 2012-11-29 2014-06-11 深圳中兴力维技术有限公司 Method and system for improving large data volume query performance
US20150178399A1 (en) * 2004-12-15 2015-06-25 W. Daniel Hillis Data storage with lock-free stateless paging capability
CN104965873A (en) * 2015-06-10 2015-10-07 努比亚技术有限公司 Paging inquiring method and apparatus

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7146365B2 (en) * 2003-01-27 2006-12-05 International Business Machines Corporation Method, system, and program for optimizing database query execution
CN101216840A (en) * 2008-01-21 2008-07-09 金蝶软件(中国)有限公司 Data enquiry method and data enquiry system
CN102521405B (en) * 2011-12-26 2014-06-25 中国科学院计算技术研究所 Massive structured data storage and query methods and systems supporting high-speed loading

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150178399A1 (en) * 2004-12-15 2015-06-25 W. Daniel Hillis Data storage with lock-free stateless paging capability
CN102880685A (en) * 2012-09-13 2013-01-16 北京航空航天大学 Method for interval and paging query of time-intensive B/S (Browser/Server) with large data size
CN103853727A (en) * 2012-11-29 2014-06-11 深圳中兴力维技术有限公司 Method and system for improving large data volume query performance
CN104965873A (en) * 2015-06-10 2015-10-07 努比亚技术有限公司 Paging inquiring method and apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112416967A (en) * 2020-12-11 2021-02-26 北京北信源软件股份有限公司 Data paging query method and device, electronic equipment and storage medium
CN112416967B (en) * 2020-12-11 2024-05-14 北京北信源软件股份有限公司 Data paging query method and device, electronic equipment and storage medium

Also Published As

Publication number Publication date
WO2017133538A1 (en) 2017-08-10

Similar Documents

Publication Publication Date Title
CN107045499A (en) A kind of method and server for realizing data query
CN109962856B (en) Resource allocation method, device and computer readable storage medium
US20170242731A1 (en) User behavior-based dynamic resource adjustment
CN103179589A (en) Method and system for alerting data usage of user terminal
CN111177201B (en) Data stream processing method and related device
CN110896357B (en) Flow prediction method, device and computer readable storage medium
US20160358208A1 (en) Method, device, system for displaying media data
CN111984495A (en) Big data monitoring method and device and storage medium
CN106549786B (en) Configuration method and device for service provisioning resources
CN106603695B (en) Method and device for adjusting query rate per second
EP1684458B1 (en) A method of calculating broadband access server dhcp user's on-line time
CN103312540B (en) Customer service demand parameter is determined method and apparatus
CN103957230B (en) A kind of client user's number determines method, server, client and system
CN113848747A (en) Intelligent household equipment control method and device
CN103916463B (en) Network access statistical analysis method and system
CN111538881B (en) Activity analysis method, equipment and storage medium based on behavior data
CN104050100B (en) A kind of data flow memory management method and system suitable for big data environment
CN106534231A (en) Method, device and system for controlling use limit of network resources
CN111818473B (en) Method and system for realizing accurate slicing of flow call bill
CN109358942A (en) A kind of method, device and equipment of the monitoring page of adjustment management equipment software
CN106407143A (en) Method and device for controlling hot plug operation of CPU in mobile terminal
CN112019445A (en) Method and device for intelligent device flow control and intelligent device
CN106209737A (en) Control the method and apparatus that remote service calls frequency
CN110515817A (en) A kind of equipment availability detection method, device, computer equipment and storage medium
CN104834453B (en) Interactive method and system are carried out by input unit and network

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170815

WD01 Invention patent application deemed withdrawn after publication