Summary of the invention
In order to solve in the time that client again enters the page or returns to this page from other pages, client all needs again to the corresponding more new data of this page of server lookup, can cause inquiry times too much, cause flow waste and bring larger pressure to server, take the problem of Internet resources, the embodiment of the present invention provides a kind of data capture method and device.Described technical scheme is as follows:
First aspect, provides a kind of data capture method, and for client, described method comprises:
Obtain corresponding with target data at least one of point from server, described update time, point was for identifying the time that described target data is modified at described server update time;
If obtained described target data in the time that this obtains described target data, detect and between current point in time and the last acquisition time point, whether comprise described update time of point, described the last acquisition time point is the last time of obtaining described target data;
If testing result is to comprise described update time of point between described current point in time and described the last acquisition time point, send the request of obtaining for described target data to described server.
Preferably, after whether comprising described update time of point between described detection current point in time and the last acquisition time point, comprising:
If testing result is not comprise described update time of point between described current point in time and described the last acquisition time point, calculate the time difference between described current point in time and described the last acquisition time point;
Whether detect the described time difference is greater than the scheduled update time interval;
If testing result is to be more than or equal to the described scheduled update time interval the described time difference, send the request of obtaining for described target data to described server.
Preferably, describedly obtain corresponding with target data at least one of point from server update time, comprising:
In the time obtaining described target data for the first time, send the request of obtaining for the first time for described target data to described server, the described request of obtaining is for the first time for triggering described server feedback at least one the update time point corresponding with described target data;
Receive corresponding with described target data at least one of the point of described server feedback update time.
Preferably, described to described server send for described target data obtain request after, also comprise:
Receive the described target data of described server feedback;
Record the time that this obtains described target data, and upgrade described the last acquisition time point.
Second aspect, provides a kind of data capture method, and for server, described method comprises:
To client provide corresponding with target data at least one update time point, described update time, point was for identifying the time that described target data is modified at described server;
Reception comes from the obtain request of described client for described target data;
To the described target data of described client feedback;
Wherein, described in the request of obtaining be that described client had been obtained described target data in the time that this obtains described target data, and detect and between current point in time and the last acquisition time point, comprise the transmission afterwards of described update time of point; Or, the described request of obtaining is that described client had been obtained described target data in the time that this obtains described target data, and detect and between current point in time and the last acquisition time point, do not comprise described update time of point, but time difference between described current point in time and described the last acquisition time point sends while being greater than the scheduled update time interval.
Preferably, described to client provide corresponding with target data at least one update time point, comprising:
Receive for the first time the obtain request of described client for described target data, described obtaining for the first time when the described client of request is obtained described target data for the first time sends;
To described client feedback at least one the update time point corresponding with described target data.
The third aspect, provides a kind of data acquisition facility, and for client, described device comprises:
Time point acquisition module, for obtain corresponding with target data at least one of point from server, described update time, point was for identifying the time that described target data is modified at described server update time;
Time point detection module, if for obtained described target data in the time that this obtains described target data, detect and between current point in time and the last acquisition time point, whether comprise described update time of point, described the last acquisition time point is the last time of obtaining described target data;
The first sending module, if be to comprise described update time of point between described current point in time and described the last acquisition time point for testing result, sends the request of obtaining for described target data to described server.
Preferably, described device, also comprises:
Time difference computing module, if be not comprise described update time of point between described current point in time and described the last acquisition time point for testing result, calculates the time difference between described current point in time and described the last acquisition time point;
Whether time difference detection module, be greater than the scheduled update time interval for detection of the described time difference;
The second sending module, if be the described time difference to be more than or equal to the described scheduled update time interval for testing result, sends the request of obtaining for described target data to described server.
Preferably, described time point acquisition module, comprising:
Request transmitting unit, for in the time obtaining described target data for the first time, send the request of obtaining for the first time for described target data to described server, the described request of obtaining is for the first time for triggering described server feedback at least one the update time point corresponding with described target data;
Time point receiving element, for receiving corresponding with described target data at least one of the point of described server feedback update time.
Preferably, described device, also comprises:
Data reception module, for receiving the described target data of described server feedback;
Time point update module, the time of obtaining described target data for recording this, and upgrade described the last acquisition time point.
Fourth aspect, provides a kind of data acquisition facility, and for server, described device comprises:
Time point provides module, for provide to client corresponding with target data at least one update time point, described update time, point was for identifying the time that described target data is modified at described server;
Request receiving module, comes from the obtain request of described client for described target data for receiving;
Data feedback module, for the described target data to described client feedback;
Wherein, described in the request of obtaining be that described client had been obtained described target data in the time that this obtains described target data, and detect and between current point in time and the last acquisition time point, comprise the transmission afterwards of described update time of point; Or, the described request of obtaining is that described client had been obtained described target data in the time that this obtains described target data, and detect and between current point in time and the last acquisition time point, do not comprise described update time of point, but time difference between described current point in time and described the last acquisition time point sends while being greater than the scheduled update time interval.
Preferably, described time point provides module, comprising:
The first receiving element, for receiving for the first time the obtain request of described client for described target data, described obtaining for the first time when the described client of request is obtained described target data for the first time sends;
Time point feedback unit, for to described client feedback at least one the update time point corresponding with described target data.
The beneficial effect that the technical scheme that the embodiment of the present invention provides is brought is:
By obtain corresponding with target data at least one of point from server update time; If obtained target data in the time that this obtains target data, detect between current point in time and the last acquisition time point, whether to comprise some update time; If testing result is to comprise some update time between current point in time and the last acquisition time point, send the request of obtaining for target data to server; Solve in the time that client again enters the page or returns to this page from other pages, client all needs again to the corresponding more new data of this page of server lookup, cause inquiry times too much to bring larger pressure to server, cause flow to waste and take the problem of Internet resources; Reach the pressure that reduces inquiry times alleviation server, saved the effect taking of flow and the non-essential Internet resources of minimizing.
Embodiment
For making the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Please refer to Fig. 1, it shows the structural representation of the related a kind of implementation environment of data capture method that the embodiment of the present invention provides.This implementation environment comprises server 120 and at least one client 140.
Server 120 can be a station server, or the server cluster being made up of some station servers, or a cloud computing service center.Server 120 is connected with client 140 by network.
Client 140 can be the electronic equipment of panel computer, desktop computer, notebook computer and intelligent appliance and so on.Client 140 has the ability of the information that reception server 120 sends, and also has the ability of transmission information.
Please refer to Fig. 2, it shows the method flow diagram of the data capture method that one embodiment of the invention provides.The present embodiment is mainly applied in the client shown in Fig. 1 and illustrates with this data capture method.This data capture method, comprising:
Step 202 is obtained corresponding with target data at least one of point from server update time, and update time, point was for identifying the time that target data is modified at server;
Step 204, if obtained target data in the time that this obtains target data, detects between current point in time and the last acquisition time point whether comprise that some update time, the last acquisition time point are the last time of obtaining target data;
Step 206, if testing result is to comprise some update time between current point in time and the last acquisition time point, sends the request of obtaining for target data to server.
In sum, the data capture method that the embodiment of the present invention provides, by obtaining corresponding with target data at least one of some update time from server; If obtained target data in the time that this obtains target data, detect between current point in time and the last acquisition time point, whether to comprise some update time; If testing result is to comprise some update time between current point in time and the last acquisition time point, send the request of obtaining for target data to server; Solve in the time that client again enters the page or returns to this page from other pages, client all needs again to the corresponding more new data of this page of server lookup, cause inquiry times too much to bring larger pressure to server, cause flow to waste and take the problem of Internet resources; Reach the pressure that reduces inquiry times alleviation server, saved the effect taking of flow and the non-essential Internet resources of minimizing.
Please refer to Fig. 3, it shows the method flow diagram of the data capture method that another embodiment of the present invention provides.The present embodiment is mainly applied in the server shown in Fig. 1 and illustrates with this data capture method.This data capture method, comprising:
Step 302, to client provide corresponding with target data at least one update time point, update time, point was for identifying the time that target data is modified at server;
Step 304, receives and comes from the obtain request of client for target data;
Step 306, to the target data of client feedback;
Wherein, the request of obtaining is that client had been obtained target data in the time that this obtains target data, and detects and between current point in time and the last acquisition time point, comprise the transmission afterwards of some update time; Or, the request of obtaining is that client had been obtained target data in the time that this obtains target data, and detect and between current point in time and the last acquisition time point, do not comprise some update time, but time difference between current point in time and the last acquisition time point sends while being greater than the scheduled update time interval.
In sum, the data capture method that the embodiment of the present invention provides, by provide to client corresponding with target data at least one update time point, update time, point was for identifying the time that target data is modified at server; Receipts come from the obtain request of client for target data; To the target data of client feedback; Solve in the time that client again enters the page or returns to this page from other pages, client all needs again to the corresponding more new data of this page of server lookup, cause inquiry times too much to bring larger pressure to server, cause flow to waste and take the problem of Internet resources; Reach the pressure that reduces inquiry times alleviation server, saved the effect taking of flow and the non-essential Internet resources of minimizing.
Please refer to Fig. 4, it shows the method flow diagram of the data capture method that another embodiment of the present invention provides.The present embodiment is mainly applied in the implementation environment shown in Fig. 1 and illustrates with this data capture method.This data capture method, comprising:
Step 401, in the time obtaining target data for the first time, user end to server sends the request of obtaining for the first time for target data;
Obtain for the first time target data and refer to that client is for the first time to this target data of server lookup, such as client is opened for the first time a certain page and obtained for the first time the data message on this page.The request of obtaining is for the first time for triggering server feedback at least one the update time point corresponding with target data.At least one, point referred to that this client need to upgrade the time point of this target data update time, such as, every half an hour set one update time point.
Step 402, server receives for the first time the obtain request of client for target data;
The request of obtaining is for the first time that client sends while obtaining target data for the first time.Obtain for the first time when request when server receives this, can be to server identification this request of obtaining for for the first time so that server learn when this request of obtaining is asked for obtaining for the first time of sending for target data of client to client provide update time point.
Step 403, server to client provide corresponding with target data at least one update time point;
Server is to client feedback at least one the update time point corresponding with target data, and update time, point was for identifying the time that target data is modified at server.Server can also be made list update time by least one of some update time, and to the client feedback update time list corresponding with target data, this list update time comprises at least one of some update time.Server also can feed back the target data corresponding with this request of obtaining for the first time simultaneously.
Step 404, corresponding with target data at least one of the point of client server feedback update time.
Client is obtained at least one the update time point also buffer memory corresponding with target data from server, and update time, point was for identifying the time that target data is modified at server.If server feedback is list update time, this list update time buffer memory of client.
Client can reception server the target data of feedback, can also record the time point while receiving this target data, need to be to server query aim data again to use this time point to judge whether later.
Above-mentioned for user end to server obtains the step of target data for the first time, in the time that user end to server again obtains this target data and also upgrades this target data, have the following steps:
Step 405, if obtained target data in the time that this obtains target data, client detects between current point in time and the last acquisition time point whether comprise some update time;
When this obtains target data, having obtained target data referred to before this obtains target data, client was obtained this target data from server, this obtains target data and also again obtains target data, for upgrading the target data having got.
Current point in time refers to client, and this obtains the time point of target data.The last acquisition time point is the last time point that obtains target data, the time point recording while also referring to the last receiving target data of client.Update time point refer to client send to server for the first time for target data obtain request for the first time after some update time that receives.If client-cache is list update time, whether client can also detect has update time point drop between current point in time and the last acquisition time point in this list update time.
Such as, suppose that current point in time is 00:12:00, the last acquisition time point is 23:56:00, client-cache has puts 22:00:00 update time, puts 22:30:00 update time, puts 23:00:00 update time, put 23:30:00 update time, put 24:00:00 update time, put 00:30:00 update time, between client detection current point in time 00:12:00 and the last acquisition time point 23:56:00, whether comprise any one in putting above-mentioned 6 update times.
Step 406, if testing result is to comprise some update time between current point in time and the last acquisition time point, user end to server sends the request of obtaining for target data;
Also, client detects between current point in time 00:12:00 and the last acquisition time point 23:56:00 and comprises and put 24:00:00 update time, and user end to server sends the request of obtaining for target data.
Step 407, if testing result is not comprise some update time between current point in time and the last acquisition time point, client is calculated the time difference between current point in time and the last acquisition time point;
Do not drop on some update time between current point in time and the last acquisition time point yet, such as, suppose that current point in time is 23:59:00, the last acquisition time point is 23:35:00, in point, does not drop on some update time between current point in time and the last acquisition time point above-mentioned 6 update times.
Therefore, client need to be obtained target data to server in order further to judge whether, the time difference that client is calculated between current point in time 23:59:00 and the last acquisition time point 23:35:00 is 24 minutes.
Step 408, whether client difference detection time is greater than the scheduled update time interval;
The scheduled update time interval is predetermined in advance, and this scheduled update time interval is set according to the actual conditions of target data, while screening inaccuracy, again judges whether to upgrade target data for putting when update time.
Such as, suppose that the 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 the scheduled update time interval, user end to server sends the request of obtaining for target data.
Such as, 24 minutes time differences of above-mentioned current point in time 23:59:00 and the last acquisition time point 23:35:00 are greater than 20 minutes scheduled update time intervals, and user end to server sends the request of obtaining for target data.
Step 410, server receives and comes from the obtain request of client for target data;
Because client had been obtained target data, what this server received the request of obtaining no longer needs mark for the first time, server do not need again to client provide update time point.It should be added that, although server this do not need again to client provide update time point, but in the time that the update time point for this target data changes, server still can to client provide update time point so that client upgrades in time.
Step 411, server is to the target data of client feedback;
This request of obtaining is that client had been obtained target data in the time that this obtains target data, and detects and between current point in time and the last acquisition time point, comprise the transmission afterwards of some update time; Or, the request of obtaining is that client had been obtained target data in the time that this obtains target data, and detect and between current point in time and the last acquisition time point, do not comprise some update time, but time difference between current point in time and the last acquisition time point sends while being greater than the scheduled update time interval.
Step 412, the target data of client server feedback;
The target data that client is used this updating target data to get, to show up-to-date target data to user.
Step 413, this obtains the time of target data client records, and upgrades the last acquisition time point.
Such as, the time that client is obtained target data is 00:12:00, and client removes to upgrade the last acquisition time point 23:56:00 with time point 00:12:00, and so the last acquisition time point has just become 00:12:00.When client detects whether there is point or while calculating the time difference of the two, the last acquisition time point using is 00:12:00 update time between current point in time and the last acquisition time point again.
In sum, the data capture method that the embodiment of the present invention provides, by obtaining corresponding with target data at least one of some update time from server; If obtained target data in the time that this obtains target data, detect between current point in time and the last acquisition time point, whether to comprise some update time; If testing result is to comprise some update time between current point in time and the last acquisition time point, send the request of obtaining for target data to server; Solve in the time that client again enters the page or returns to this page from other pages, client all needs again to the corresponding more new data of this page of server lookup, cause inquiry times too much to bring larger pressure to server, cause flow to waste and take the problem of Internet resources; Reach the pressure that reduces inquiry times alleviation server, saved the effect taking of flow and the non-essential Internet resources of minimizing.
It should be added that, above-mentioned steps 401 to relate in step 404 just in the time obtaining target data for the first time, user end to server sends the situation for the request of obtaining for the first time of target data, in addition, client except obtaining at least one of point to server in the time obtaining target data for the first time update time, client is before obtaining target data for the first time, after obtaining target data for the first time, (also obtain in target data process to server) although or client obtained target data to server, but when client terminal local does not have this target data of buffer memory, client also can be obtained at least one of point from server update time, therefore the acquisition time of putting this at least one update time is not limit.Moreover in the time that on server, the update time point for target data changes, some update time after server also can upgrade to server feedback at any time, so that client is obtained up-to-date some update time.Also it should be added that, server can be set for target data according to list update time that at least one update time, point was made, also general, is determined on a case-by-case basis.
Be below device embodiment of the present invention, for the details of detailed description not wherein, can be with reference to the embodiment of the method for above-mentioned correspondence.
Please refer to Fig. 5, it shows the structural representation of the data acquisition facility that one embodiment of the invention provides.This data acquisition facility can be realized and be become the whole or a part of of client by software, hardware or both combinations.This data acquisition facility comprises: time point acquisition module 520, time point detection module 540 and the first sending module 560;
Time point acquisition module 520, for obtain corresponding with target data at least one of point from server, update time, point was for identifying the time that target data is modified at server update time;
Time point detection module 540, if for obtained target data in the time that this obtains target data, detect between current point in time and the last acquisition time point and whether comprise that some update time that time point acquisition module 520 gets, the last acquisition time point are the last time of obtaining target data;
The first sending module 560, if the testing result detecting for time point detection module 540 is to comprise some update time between current point in time and the last acquisition time point, sends the request of obtaining for target data to server.
In sum, the data acquisition facility that the embodiment of the present invention provides, by obtaining corresponding with target data at least one of some update time from server; If obtained target data in the time that this obtains target data, detect between current point in time and the last acquisition time point, whether to comprise some update time; If testing result is to comprise some update time between current point in time and the last acquisition time point, send the request of obtaining for target data to server; Solve in the time that client again enters the page or returns to this page from other pages, client all needs again to the corresponding more new data of this page of server lookup, cause inquiry times too much to bring larger pressure to server, cause flow to waste and take the problem of Internet resources; Reach the pressure that reduces inquiry times alleviation server, saved the effect taking of flow and the non-essential Internet resources of minimizing.
Please refer to Fig. 6, it shows the structural representation of the data acquisition facility that another embodiment of the present invention provides.This data acquisition facility can be realized and be become the whole or a part of of server by software, hardware or both combinations.This data acquisition facility comprises: time point provides module 620, request receiving module 640 and data feedback module 660;
Time point provides module 620, for provide to client corresponding with target data at least one update time point, update time, point was for identifying the time that target data is modified at server;
Request receiving module 640, comes from the obtain request of client for target data for receiving;
Data feedback module 660, for the target data to client feedback;
Wherein, the request of obtaining is that client had been obtained target data in the time that this obtains target data, and detects and between current point in time and the last acquisition time point, comprise the transmission afterwards of some update time; Or, the request of obtaining is that client had been obtained target data in the time that this obtains target data, and detect and between current point in time and the last acquisition time point, do not comprise some update time, but time difference between current point in time and the last acquisition time point sends while being greater than the scheduled update time interval.
In sum, the data acquisition facility that the embodiment of the present invention provides, by provide to client corresponding with target data at least one update time point, update time, point was for identifying the time that target data is modified at server; Receipts come from the obtain request of client for target data; To the target data of client feedback; Solve in the time that client again enters the page or returns to this page from other pages, client all needs again to the corresponding more new data of this page of server lookup, cause inquiry times too much to bring larger pressure to server, cause flow to waste and take the problem of Internet resources; Reach the pressure that reduces inquiry times alleviation server, saved the effect taking of flow and the non-essential Internet resources of minimizing.
Please refer to Fig. 7, it shows the structural representation of the data-acquisition system that one embodiment of the invention provides.This data-acquisition system comprises client 500 and server 600, and client 500 is connected by network with server 600, specific as follows:
Client 500, comprising: time point acquisition module 520, time point detection module 540 and the first sending module 560;
Time point acquisition module 520, for obtain corresponding with target data at least one of point from server, update time, point was for identifying the time that target data is modified at server update time;
Time point detection module 540, if for obtained target data in the time that this obtains target data, detect between current point in time and the last acquisition time point and whether comprise that some update time that time point acquisition module 520 gets, the last acquisition time point are the last time of obtaining target data;
The first sending module 560, if the testing result detecting for time point detection module 540 is to comprise some update time between current point in time and the last acquisition time point, sends the request of obtaining for target data to server.
Preferably, client 500 also comprises: time difference computing module 550, time difference detection module 551 and the second sending module 552;
Time difference computing module 550, if be not comprise some update time between current point in time and the last acquisition time point for testing result, calculates the time difference between current point in time and the last acquisition time point;
Time difference detection module 551, whether the time difference calculating for detection of time difference computing module 550 is greater than the scheduled update time interval;
The second sending module 552, if the testing result detecting for time difference detection module 551 is the time difference to be more than or equal to the scheduled update time interval, sends the request of obtaining for target data to server.
Preferably, time point acquisition module 520, comprising: request transmitting unit 521 and time point receiving element 522;
Request transmitting unit 521, in the time obtaining target data for the first time, sends for the request of obtaining for the first time of target data to server, and the request of obtaining is for the first time for triggering server feedback at least one the update time point corresponding with target data;
Time point receiving element 522, for corresponding with target data at least one of the point of reception server feedback update time.
Preferably, client 500 also comprises: data reception module 530 and time point update module 531;
Data reception module 530, for the target data of reception server feedback;
Time point update module 531, the time of obtaining target data for recording this, and upgrade the last acquisition time point.
Server 600, comprising: time point provides module 620, request receiving module 640 and data feedback module 660;
Time point provides module 620, for provide to client corresponding with target data at least one update time point, update time, point was for identifying the time that target data is modified at server;
Request receiving module 640, comes from the obtain request of client for target data for receiving;
Data feedback module 660, for the target data to client feedback;
Wherein, the request of obtaining is that client had been obtained target data in the time that this obtains target data, and detects and between current point in time and the last acquisition time point, comprise the transmission afterwards of some update time; Or, the request of obtaining is that client had been obtained target data in the time that this obtains target data, and detect and between current point in time and the last acquisition time point, do not comprise some update time, but time difference between current point in time and the last acquisition time point sends while being greater than the scheduled update time interval.
Preferably, time point provides module 620, comprising: the first receiving element 621 and time point feedback unit 622;
The first receiving element 621, for receiving for the first time the obtain request of client for target data, the request of obtaining is for the first time that client sends while obtaining target data for the first time;
Time point feedback unit 622, for to client feedback at least one the update time point corresponding with target data.
In sum, the data-acquisition system that the embodiment of the present invention provides, by obtaining corresponding with target data at least one of some update time from server; If obtained target data in the time that this obtains target data, detect between current point in time and the last acquisition time point, whether to comprise some update time; If testing result is to comprise some update time between current point in time and the last acquisition time point, send the request of obtaining for target data to server; Solve in the time that client again enters this page or returns to this page from other pages, client all needs again to the corresponding more new data of the server lookup page, cause inquiry times too much to bring larger pressure to server, cause flow to waste and take the problem of Internet resources; Reach the pressure that reduces inquiry times alleviation server, saved the effect taking of flow and the non-essential Internet resources of minimizing.
The invention described above embodiment sequence number, just to describing, does not represent the quality of embodiment.
One of ordinary skill in the art will appreciate that all or part of step that realizes above-described embodiment can complete by hardware, also can carry out the hardware that instruction is relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium of mentioning can be read-only memory, disk or CD etc.
The foregoing is only preferred embodiment of the present invention, in order to limit the present invention, within the spirit and principles in the present invention not all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.