The content of the invention
In order to solve when client is again introduced into the page or returns to the page from other pages, client is required for again
It is secondary to updating the data corresponding to the server lookup page inquiry times to be caused excessive, cause flow to waste and to service
Device brings larger pressure, the problem of taking Internet resources, and the embodiments of the invention provide a kind of data capture method and device.Institute
State technical scheme as follows:
First aspect is there is provided a kind of data capture method, in client, methods described to include:
At least one renewal time point corresponding with target data is obtained from server, the renewal time point is used to identify
The time that the target data is modified in the server;
If having obtained the target data in this described target data of acquisition, detection current point in time with
Whether the renewal time point is included between acquisition time point the last time, and the last acquisition time point is the last
Obtain the time of the target data;
If testing result is when including the renewal between the current point in time and the last acquisition time point
Between point, then to the server send for the target data acquisition ask.
Preferably, whether the renewal time is included between the detection current point in time and the last acquisition time point
After point, including:
If testing result is not include described update between the current point in time and the last acquisition time point
Time point, then calculate the current point in time and the last time difference obtained between time point;
Detect whether the time difference is more than scheduled update time interval;
If testing result is the time difference to be more than or equal to the scheduled update time interval, sent out to the server
The acquisition for the target data is sent to ask.
Preferably, it is described to obtain at least one renewal time point corresponding with target data from server, including:
When first time obtaining the target data, obtained to server transmission for the first time of the target data
Take request, the first time obtain request be used to triggering the server feedback it is corresponding with the target data at least one more
New time point;
Receive at least one renewal time point corresponding with the target data of the server feedback.
Preferably, it is described to be directed to server transmission after the acquisition request of the target data, in addition to:
Receive the target data of the server feedback;
Record this and obtain the time of the target data, and update the last acquisition time point.
Second aspect is there is provided a kind of data capture method, in server, methods described to include:
At least one renewal time point corresponding with target data is provided to client, the renewal time point is used to identify
The time that the target data is modified in the server;
Receive the acquisition request for coming from the client for the target data;
To the target data of the client feedback;
Wherein, the acquisition request is that the client had obtained the mesh in this described target data of acquisition
Data are marked, and detect to include what is sent after the renewal time point between current point in time and the last acquisition time point;
Or, the acquisition request is that the client had obtained the target data in this described target data of acquisition, and
Detect not include the renewal time point between current point in time and the last acquisition time point, but the current point in time
Sent when being more than scheduled update time interval with the last time difference obtained between time point.
Preferably, it is described to provide at least one renewal time point corresponding with target data to client, including:
Receive the client and obtain request for the first time of the target data, it is institute that the first time, which obtains request,
State client and obtain what is sent during the target data for the first time;
To the client feedback at least one renewal time point corresponding with the target data.
The third aspect is there is provided a kind of data acquisition facility, in client, described device to include:
Time point acquisition module, for obtaining corresponding with target data at least one renewal time point, institute from server
Stating renewal time point is used to identify the time that the target data is modified in the server;
Time point detection module, if for having obtained the number of targets in this described target data of acquisition
According to whether then detect includes the renewal time point, described nearest one between current point in time and the last acquisition time point
The secondary time for obtaining time point for the last acquisition target data;
First sending module, if for testing result be the current point in time with it is described it is the last obtain time point it
Between include the renewal time point, then to the server send for the target data acquisition ask.
Preferably, described device, in addition to:
Time difference computing module, if being the current point in time and the last acquisition time point for testing result
Between do not include the renewal time point, then calculate the current point in time and it is described it is the last obtain between time point when
Between it is poor;
Time difference detection module, for detecting whether the time difference is more than scheduled update time interval;
Second sending module, if being to be more than or equal between the scheduled update time time difference for testing result
Every then to acquisition request of the server transmission for the target data.
Preferably, the time point acquisition module, including:
Request transmitting unit, for when first time obtaining the target data, being sent to the server for described
The first time of target data obtains request, and the first time, which obtains request, to be used to trigger the server feedback and the number of targets
According at least one corresponding renewal time point;
Time point receiving unit, for receive the server feedback it is corresponding with the target data at least one more
New time point.
Preferably, described device, in addition to:
Data reception module, the target data for receiving the server feedback;
Time point update module, obtains the time of the target data, and update described the last time for recording this
Obtain time point.
Fourth aspect is there is provided a kind of data acquisition facility, in server, described device to include:
Time point provides module, for providing corresponding with target data at least one renewal time point, institute to client
Stating renewal time point is used to identify the time that the target data is modified in the server;
Request receiving module, for receiving the acquisition request for coming from the client for the target data;
Data feedback module, for the target data to the client feedback;
Wherein, the acquisition request is that the client had obtained the mesh in this described target data of acquisition
Data are marked, and detect to include what is sent after the renewal time point between current point in time and the last acquisition time point;
Or, the acquisition request is that the client had obtained the target data in this described target data of acquisition, and
Detect not include the renewal time point between current point in time and the last acquisition time point, but the current point in time
Sent when being more than scheduled update time interval with the last time difference obtained between time point.
Preferably, the time point provides module, including:
First receiving unit, it is described for receiving first time acquisition request of the client for the target data
Obtain when the request client obtains the target data for the first time and send for the first time;
Time point feedback unit, during at least one renewal corresponding with the target data to the client feedback
Between point.
The beneficial effect that technical scheme provided in an embodiment of the present invention is brought is:
By obtaining at least one renewal time point corresponding with target data from server;If in this acquisition target
Target data was obtained during data, then whether detect includes updating between current point in time and the last acquisition time point
Time point;If testing result is to include renewal time point between current point in time and the last acquisition time point, to service
Device sends the acquisition request for target data;Solve when client is again introduced into the page or returns to the page from other pages
During face, client is required for again to updating the data corresponding to the server lookup page, causes inquiry times excessively to clothes
Business device brings larger pressure, the problem of causing flow to waste and take Internet resources;Reach that reduction inquiry times alleviate service
The pressure of device, saves flow and reduces the effect of the occupancy of non-essential Internet resources.
Embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing to embodiment party of the present invention
Formula is described in further detail.
Fig. 1 is refer to, it illustrates a kind of implementation environment involved by data capture method provided in an embodiment of the present invention
Structural representation.The implementation environment includes server 120 and at least one client 140.
Server 120 can be a server, or by some server groups into server cluster, or one
Individual cloud computing service center.Server 120 is connected by network with client 140.
Client 140 can be that the electronics of tablet personal computer, desktop computer, notebook computer and intelligent appliance etc is set
It is standby.Client 140 has the ability of the information of the transmission of the reception server 120, the also ability with transmission information.
Fig. 2 is refer to, the method flow diagram of the data capture method provided it illustrates one embodiment of the invention.This reality
Apply example and mainly be applied in the client shown in Fig. 1 illustrate with the data capture method.The data capture method, bag
Include:
Step 202, at least one renewal time point corresponding with target data is obtained from server, renewal time point is used for
The time that mark target data is modified in the server;
Step 204, if having obtained target data in this acquisition target data, detection current point in time with
Whether renewal time point is included between acquisition time point the last time, and acquisition time point the last time obtains target for the last time
The time of data;
Step 206, if testing result is to include renewal time point between current point in time and the last acquisition time point,
Then the acquisition request for target data is sent to server.
In summary, data capture method provided in an embodiment of the present invention, by being obtained and target data pair from server
At least one the renewal time point answered;If having obtained target data in this acquisition target data, detection is current
Whether include renewal time point between time point and the last acquisition time point;If testing result is current point in time and nearest
Renewal time point once is included between acquisition time point, then sends the acquisition request for target data to server;Solve
When client is again introduced into the page or returns to the page from other pages, client is required for again should to server lookup
Updating the data corresponding to the page, causes inquiry times excessively to bring larger pressure to server, causes flow to waste and take
The problem of Internet resources;Reach that reduction inquiry times alleviate the pressure of server, saved flow and reduce non-essential network
The effect of the occupancy of resource.
Fig. 3 is refer to, the method flow diagram of the data capture method provided it illustrates another embodiment of the present invention.This
Embodiment is main to be applied in the server shown in Fig. 1 illustrate with the data capture method.The data capture method, bag
Include:
Step 302, at least one renewal time point corresponding with target data is provided to client, renewal time point is used for
The time that mark target data is modified in the server;
Step 304, the acquisition request for coming from client for target data is received;
Step 306, to the target data of client feedback;
Wherein, it is that client had obtained target data in this acquisition target data to obtain request, and is detected
Include what is sent after renewal time point between current point in time and the last acquisition time point;Or, it is client to obtain request
Target data had been obtained in this acquisition target data, and has detected that current point in time obtains time point with the last
Between do not include renewal time point, but current point in time and the last time difference obtained between time point are more than scheduled update
Sent during time interval.
In summary, data capture method provided in an embodiment of the present invention, by being provided and target data pair to client
At least one the renewal time point answered, renewal time point is used to identify the time that target data is modified in the server;Receive and
Asked from client for the acquisition of target data;To the target data of client feedback;Solve when client is entered again
Enter the page or from other pages return to the page when, client be required for again to corresponding to the server lookup page more
New data, causes inquiry times excessively to bring larger pressure to server, the problem of causing flow to waste and take Internet resources;
Reach that reduction inquiry times alleviate the pressure of server, saved flow and reduce the effect of the occupancy of non-essential Internet resources
Really.
Fig. 4 is refer to, the method flow diagram of the data capture method provided it illustrates another embodiment of the present invention.This
Embodiment is main to be applied in the implementation environment shown in Fig. 1 illustrate with the data capture method.The data capture method,
Including:
Step 401, when first time obtaining target data, user end to server sends the first time for target data
Obtain request;
Target data is obtained for the first time and refers to client for the first time to the server lookup target data, such as client the
Once open a certain page and obtain data message on the page for the first time.Obtaining request for the first time is used to trigger server feedback
At least one renewal time point corresponding with target data.At least one renewal time point refers to that the client needs to update the mesh
The time point of data is marked, such as, a renewal time point is set every half an hour.
Step 402, server receives client and obtains request for the first time of target data;
It is that client is sent when obtaining target data for the first time to obtain request for the first time.When server receives the first time
It can be first time to server identification acquisition request, so that server learns that acquisition request is client when obtaining request
End provides renewal time point when obtaining request for the first time that target data is sent to client.
Step 403, server provides at least one renewal time point corresponding with target data to client;
Server is to client feedback at least one renewal time point corresponding with target data, and renewal time point is used to mark
Know the time that target data is modified in the server.Renewal time can also be made at least one renewal time point by server
List, to client feedback renewal time list corresponding with target data, the renewal time list includes at least one more
New time point.Server can also feed back simultaneously obtains the corresponding target data of request with the first time.
Step 404, at least one renewal time point corresponding with target data of client the reception server feedback.
Client obtains at least one renewal time point corresponding with target data from server and cached, renewal time point
For identifying the time that target data is modified in the server.If server feedback is renewal time list, client
Receive the renewal time list and cache.
The target data that client can be fed back with the reception server, can also record time when receiving the target data
Point, to judge whether to need to inquire about target data again to server using the time point later.
The step of above-mentioned first time acquisition target data for user end to server, when user end to server is obtained again
The target data namely when updating the target data, has the following steps:
Step 405, if target data had been obtained in this acquisition target data, when client detection is current
Between point the last time obtain time point between whether include renewal time point;
This had obtained target data and referred to before this acquisition target data when obtaining target data, client
The target data was obtained from server, this obtains target data namely obtains target data again, for updating
The target data got.
Current point in time refers to the time point of this acquisition target data of client.Acquisition time point the last time is nearest
The time point of target data is once obtained, namely refers to the time point recorded during client last time reception target data.During renewal
Between point refer to that the first time that client is sent in first time to server for target data obtains the renewal that receives after request
Time point.If client-cache is renewal time list, whether client can also be detected has in the renewal time list
Renewal time point fell between current point in time and the last acquisition time point.
Such as, it is assumed that current point in time is 00:12:00, acquisition time point the last time is 23:56:00, client-cache
There is renewal time point 22:00:00, renewal time point 22:30:00, renewal time point 23:00:00, renewal time point 23:30:
00, renewal time point 24:00:00, renewal time point 00:30:00, client detection current point in time 00:12:00 and nearest one
Secondary acquisition time point 23:56:Whether any one in above-mentioned 6 renewal time point is included between 00.
Step 406, if testing result is to include renewal time point between current point in time and the last acquisition time point,
Then user end to server sends the acquisition request for target data;
That is, client detects current point in time 00:12:00 obtains time point 23 with the last:56:Wrapped between 00
Point containing renewal time 24:00:00, then user end to server transmission is asked for the acquisition of target data.
Step 407, if testing result is not include renewal time between current point in time and the last acquisition time point
Point, then client calculate current point in time and the last time difference obtained between time point;
Namely do not fall within current point in time and the last renewal time point obtained between time point, such as, it is assumed that
Current point in time is 23:59:00, acquisition time point the last time is 23:35:00, then do not fall in above-mentioned 6 renewal times point
In current point in time and the last renewal time point obtained between time point.
Therefore, client is in order to further determine whether to need to obtain target data to server, and client calculates current
Time point 23:59:00 obtains time point 23 with the last:35:Time difference between 00 is 24 minutes.
Step 408, whether client detection time difference is more than scheduled update time interval;
Scheduled update time interval is predetermined in advance, and the scheduled update time interval is according to the actual conditions of target data
Set, for when point screening is inaccurate between when updated, carrying out judging whether to need to update target data again.
Such as, it is assumed that scheduled update time interval is set as 20 minutes.
Step 409, if testing result is the time difference to be more than or equal to scheduled update time interval, user end to server
The acquisition sent for target data is asked.
Such as, above-mentioned current point in time 23:59:00 obtains time point 23 with the last:35:24 minutes 00 time differences
More than scheduled update time interval 20 minutes, then the acquisition that user end to server is sent for target data was asked.
Step 410, server receives the acquisition request for coming from client for target data;
Because client had obtained target data, acquisition that this server is received request no longer needs mark the
Once, server need not provide renewal time point to client again.It should be added that, although server this be not required to
Renewal time point is provided to client again, but when the renewal time point for the target data changes, server
Or renewal time point can be provided to client, so that client upgrades in time.
Step 411, target data from server to client feedback;
Acquisition request is that client had obtained target data in this acquisition target data, and is detected current
Include what is sent after renewal time point between time point and the last acquisition time point;Or, it is client at this to obtain request
Target data had been obtained during secondary acquisition target data, and had been detected between current point in time and the last acquisition time point
Do not include renewal time point, but current point in time and the last time difference obtained between time point are more than the scheduled update time
Sent during interval.
Step 412, the target data of client the reception server feedback;
The target data that client has been got using the updating target data, to show newest target to user
Data.
Step 413, the time of this acquisition target data of client records, and update the last acquisition time point.
Such as, the time that client obtains target data is 00:12:00, then client is with time point 00:12:00 goes more
New the last acquisition time point 23:56:00, then acquisition time point the last time has reformed into 00:12:00.Work as client
It whether there is renewal time point between detection current point in time and the last acquisition time point again or calculate the time of the two
When poor, used the last acquisition time point is 00:12:00.
In summary, data capture method provided in an embodiment of the present invention, by being obtained and target data pair from server
At least one the renewal time point answered;If having obtained target data in this acquisition target data, detection is current
Whether include renewal time point between time point and the last acquisition time point;If testing result is current point in time and nearest
Renewal time point once is included between acquisition time point, then sends the acquisition request for target data to server;Solve
When client is again introduced into the page or returns to the page from other pages, client is required for again should to server lookup
Updating the data corresponding to the page, causes inquiry times excessively to bring larger pressure to server, causes flow to waste and take
The problem of Internet resources;Reach that reduction inquiry times alleviate the pressure of server, saved flow and reduce non-essential network
The effect of the occupancy of resource.
It should be added that, what above-mentioned steps 401 were related into step 404 simply obtains number of targets in first time
According to when, the first time that user end to server is sent for target data obtains the situation of request, in addition, client is except the
Obtained when once obtaining target data to server outside at least one renewal time point, client is obtaining target in first time
Before data, after first time acquisition target data(Namely to server obtain target data during)Though or client
So warp-wise server obtained target data, but client, when locally not caching the target data, client can also
At least one renewal time point is obtained from server, therefore the acquisition time of at least one renewal time point does not limit.Furthermore,
When the renewal time point on server for target data changes, server can also update to server feedback at any time
Renewal time point afterwards, so that client obtains newest renewal time point.Supplementary notes are also needed to, server is according to extremely
The renewal time list that a few renewal time point is made can be set for target data or general, depending on tool
Depending on body situation.
It is below the device embodiment of the present invention, for the details of wherein not detailed description, may be referred to above-mentioned corresponding
Embodiment of the method.
Fig. 5 is refer to, the structural representation of the data acquisition facility provided it illustrates one embodiment of the invention.The number
The all or part as client can be implemented in combination with by software, hardware or both according to acquisition device.The number
Include according to acquisition device:Time point acquisition module 520, the sending module 560 of time point detection module 540 and first;
Time point acquisition module 520, for obtaining at least one renewal time point corresponding with target data from server,
Renewal time point is used to identify the time that target data is modified in the server;
Time point detection module 540, if for having obtained target data in this acquisition target data, examined
Whether survey includes the renewal time that time point acquisition module 520 is got between current point in time and the last acquisition time point
Point, the last time obtains time of the time point for the last acquisition target data;
First sending module 560, if the testing result detected for time point detection module 540 for current point in time with
Renewal time point is included between acquisition time point the last time, then is asked to acquisition of the server transmission for target data.
In summary, data acquisition facility provided in an embodiment of the present invention, by being obtained and target data pair from server
At least one the renewal time point answered;If having obtained target data in this acquisition target data, detection is current
Whether include renewal time point between time point and the last acquisition time point;If testing result is current point in time and nearest
Renewal time point once is included between acquisition time point, then sends the acquisition request for target data to server;Solve
When client is again introduced into the page or returns to the page from other pages, client is required for again should to server lookup
Updating the data corresponding to the page, causes inquiry times excessively to bring larger pressure to server, causes flow to waste and take
The problem of Internet resources;Reach that reduction inquiry times alleviate the pressure of server, saved flow and reduce non-essential network
The effect of the occupancy of resource.
Fig. 6 is refer to, the structural representation of the data acquisition facility provided it illustrates another embodiment of the present invention.Should
Data acquisition facility can be implemented in combination with all or part as server by software, hardware or both.Should
Data acquisition facility includes:Time point provides module 620, request receiving module 640 and data feedback module 660;
Time point provides module 620, for providing at least one renewal time point corresponding with target data to client,
Renewal time point is used to identify the time that target data is modified in the server;
Request receiving module 640, for receiving the acquisition request for coming from client for target data;
Data feedback module 660, for the target data to client feedback;
Wherein, it is that client had obtained target data in this acquisition target data to obtain request, and is detected
Include what is sent after renewal time point between current point in time and the last acquisition time point;Or, it is client to obtain request
Target data had been obtained in this acquisition target data, and has detected that current point in time obtains time point with the last
Between do not include renewal time point, but current point in time and the last time difference obtained between time point are more than scheduled update
Sent during time interval.
In summary, data acquisition facility provided in an embodiment of the present invention, by being provided and target data pair to client
At least one the renewal time point answered, renewal time point is used to identify the time that target data is modified in the server;Receive and
Asked from client for the acquisition of target data;To the target data of client feedback;Solve when client is entered again
Enter the page or from other pages return to the page when, client be required for again to corresponding to the server lookup page more
New data, causes inquiry times excessively to bring larger pressure to server, the problem of causing flow to waste and take Internet resources;
Reach that reduction inquiry times alleviate the pressure of server, saved flow and reduce the effect of the occupancy of non-essential Internet resources
Really.
Fig. 7 is refer to, the structural representation of the data-acquisition system provided it illustrates one embodiment of the invention.The number
Include client 500 and server 600 according to the system of acquisition, client 500 is connected with server 600 by network, specific as follows:
Client 500, including:Time point acquisition module 520, the sending module 560 of time point detection module 540 and first;
Time point acquisition module 520, for obtaining at least one renewal time point corresponding with target data from server,
Renewal time point is used to identify the time that target data is modified in the server;
Time point detection module 540, if for having obtained target data in this acquisition target data, examined
Whether survey includes the renewal time that time point acquisition module 520 is got between current point in time and the last acquisition time point
Point, the last time obtains time of the time point for the last acquisition target data;
First sending module 560, if the testing result detected for time point detection module 540 for current point in time with
Renewal time point is included between acquisition time point the last time, then is asked to acquisition of the server transmission for target data.
Preferably, client 500 also includes:Time difference computing module 550, time difference detection module 551 and second are sent
Module 552;
Time difference computing module 550, if being between current point in time and the last acquisition time point for testing result
Not comprising renewal time point, then current point in time and the last time difference obtained between time point are calculated;
Time difference detection module 551, it is predetermined whether the time difference calculated for the poor computing module 550 of detection time is more than
Renewal time interval;
Second sending module 552, if the testing result detected for time difference detection module 551 be more than for the time difference or
Equal to scheduled update time interval, then the acquisition request for target data is sent to server.
Preferably, time point acquisition module 520, including:Request transmitting unit 521 and time point receiving unit 522;
Request transmitting unit 521, for when first time obtaining target data, being sent to server for target data
For the first time obtain request, for the first time obtain request be used for trigger server feedback it is corresponding with target data at least one update when
Between point;
Time point receiving unit 522, for the reception server feed back it is corresponding with target data at least one renewal when
Between point.
Preferably, client 500 also includes:Data reception module 530 and time point update module 531;
Data reception module 530, the target data fed back for the reception server;
Time point update module 531, when obtaining the time of target data for recording this, and updating the last obtain
Between point.
Server 600, including:Time point provides module 620, request receiving module 640 and data feedback module 660;
Time point provides module 620, for providing at least one renewal time point corresponding with target data to client,
Renewal time point is used to identify the time that target data is modified in the server;
Request receiving module 640, for receiving the acquisition request for coming from client for target data;
Data feedback module 660, for the target data to client feedback;
Wherein, it is that client had obtained target data in this acquisition target data to obtain request, and is detected
Include what is sent after renewal time point between current point in time and the last acquisition time point;Or, it is client to obtain request
Target data had been obtained in this acquisition target data, and has detected that current point in time obtains time point with the last
Between do not include renewal time point, but current point in time and the last time difference obtained between time point are more than scheduled update
Sent during time interval.
Preferably, time point provides module 620, including:First receiving unit 621 and time point feedback unit 622;
First receiving unit 621, for receiving first time acquisition request of the client for target data, is obtained for the first time
Request is that client is sent when obtaining target data for the first time;
Time point feedback unit 622, for client feedback at least one renewal time point corresponding with target data.
In summary, data-acquisition system provided in an embodiment of the present invention, by being obtained and target data pair from server
At least one the renewal time point answered;If having obtained target data in this acquisition target data, detection is current
Whether include renewal time point between time point and the last acquisition time point;If testing result is current point in time and nearest
Renewal time point once is included between acquisition time point, then sends the acquisition request for target data to server;Solve
When client is again introduced into the page or returns to the page from other pages, client is required for again to server lookup
Updating the data corresponding to the page, causes inquiry times excessively to bring larger pressure to server, causes flow to waste and take
The problem of Internet resources;Reach that reduction inquiry times alleviate the pressure of server, saved flow and reduce non-essential network
The effect of the occupancy of resource.
The embodiments of the present invention are for illustration only, and the quality of embodiment is not represented.
One of ordinary skill in the art will appreciate that realizing that all or part of step of above-described embodiment can be by hardware
To complete, the hardware of correlation can also be instructed to complete by program, described program can be stored in a kind of computer-readable
In storage medium, storage medium mentioned above can be read-only storage, disk or CD etc..
The foregoing is only presently preferred embodiments of the present invention, be not intended to limit the invention, it is all the present invention spirit and
Within principle, any modification, equivalent substitution and improvements made etc. should be included in the scope of the protection.