Summary of the invention
In view of this, the invention solves a technical problem be to provide the method for more new data a kind of, client is logical
It crosses and the data that server is sent is spliced to form more new data.
A method of more new data, comprising: user end to server sends data and updates request, and the data update is asked
It asks and carries filter condition, wherein the parameter of the filter condition includes: start time parameter, latest data time parameter;Institute
It states server and data is obtained according to the filter condition, and the data that will acquire return to the client;The client will
The stored data of data and the client received are spliced, and more new data is formed.
According to one embodiment of present invention, further, the client is using preset time threshold as interval, period
Property send the data to the server and update request;The client has deposited the data received and the client
The data splicing of storage, formation updated data package include: the data and the client that the client this time sends the server
Hold stored data to splice, form the data source of time-tendency graph, also, the client data received are put into it is slow
In depositing.
According to one embodiment of present invention, further, the user end to server sends data update request packet
Include: the client receives the instruction for generating the time-tendency graph;It is described when the time-tendency graph is to load for the first time
Client calculates the start time for needing to obtain data according to the time span of current time and the time-tendency graph, generates institute
It states data to update request and carry the start time parameter, wherein the value of the start time parameter needs to obtain number thus
According to start time;The server obtains data according to the filter condition and the data that will acquire return to the client
End includes: when the server judges that the data update request comprising the start time parameter, from obtaining the time
Point parameter value to current point in time data and return to the client.
According to one embodiment of present invention, further, the user end to server sends data update request packet
Include: when the time-tendency graph is not to load for the first time, the client is from reading latest data in the client in caching
Time, generate the data and update and request and carry the latest data time parameter, wherein the latest data time ginseng
Several values is the time of latest data in the client;The server obtains data according to the filter condition and will obtain
It includes: when the server judges that in the data update request include described newest that the data taken, which return to the client,
When data time parameter, the value of the latest data time parameter is obtained to the data of current point in time and returns to client.
According to one embodiment of present invention, further, time granularity is also carried when the data update in request
When, the method also includes: the server obtains data according to the time granularity, wherein what the server was got
The time interval of pieces of data is the time granularity.
The invention solves a technical problem be to provide the system of more new data a kind of, client is by by server
The data of transmission are spliced to form more new data.
A kind of system of more new data, comprising: client and server;The client includes: to update request to send list
Member updates request for sending data to server, and the data update request and carry filter condition, wherein the filtering
The parameter of condition includes: start time parameter, latest data time parameter;Data concatenation unit, the data for will receive
Splice with the stored data of the client, forms more new data;The server includes: data capture unit, is used for root
Data, data transmission unit are obtained according to the filter condition, the data for will acquire return to the client.
According to one embodiment of present invention, further, the update request transmitting unit, be also used to it is preset when
Between threshold value be interval, periodically send the data to the server and update request;The data concatenation unit, is also used to
The stored data of data and the client that the server is this time sent are spliced, and the number of the time-tendency graph is formed
It is put into caching according to source, also, by the data received.
According to one embodiment of present invention, further, the update request transmitting unit, comprising: start time meter
Operator module, for when the time-tendency graph is to load for the first time, according to the time of current time and the time-tendency graph
Span calculates the start time for needing to obtain data;It updates request and generates submodule, update request simultaneously for generating the data
Carry the start time parameter, wherein the value of the start time parameter needs to obtain the start time of data thus;It is described
Data capture unit, comprising: start point data acquisition submodule, for from judging that the data update request includes the time
When point parameter, the value of the start time parameter is obtained to the data of current point in time.
According to one embodiment of present invention, further, the update request transmitting unit, further includes: latest data
Time computational submodule, for when time-tendency graph is not to load for the first time, from reading newest number in the client in caching
According to time;The update request generates submodule, is also used to generate the data and updates request and carry the latest data
Time parameter, wherein the value of the latest data time parameter thus in client latest data time;The data acquisition
Unit, comprising: latest data acquisition submodule, for when judging to include the latest data in the data update request
Between parameter when, obtain the value of the latest data time parameter to the data of current point in time.
According to one embodiment of present invention, further, the update request transmitting unit, further includes: time granularity
Setting unit, for the time granularity of data to be arranged;The update request generates submodule, is also used to update in request in data
Add the time granularity;The data capture unit is also used to obtain data according to the time granularity, wherein acquired
The time interval of the pieces of data arrived is the time granularity.
The method and system of more new data of the invention, client are spliced to form by the data for sending server
Redundant data is not present in more new data, the data that server returns every time, and by setting filter condition, greatly reduces from clothes
The data volume that business device end obtains, reduces the resource occupation of server end, while it is logical to reduce client and server end data
Believe occupied bandwidth, reduce the resource consumption of server itself, while decreasing bandwidth consumption.
Specific embodiment
With reference to the accompanying drawings to invention is more fully described, wherein illustrating exemplary embodiment of the present invention.Under
Face will combine the attached drawing in the embodiment of the present invention, and technical scheme in the embodiment of the invention is clearly and completely described, show
So, described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Based on the reality in the present invention
Example is applied, every other embodiment obtained by those of ordinary skill in the art without making creative efforts all belongs to
In the scope of protection of the invention.
Fig. 1 is the flow chart of one embodiment of the method for more new data according to the present invention, as shown in Figure 1:
Step 101, user end to server sends data update request, and it includes: filter condition that data, which update request,.
Step 102, server obtains data according to filter condition, and the data that will acquire return to client.
Step 103, client splices the data received and the stored data of client, forms more new data.
In one embodiment, the data that server is sent with stored in the client or existing data do not weigh
Multiple, client can store the data obtained from server using caching, database, file.Client is by the update number of generation
Simultaneously shown according to time-tendency graph as data source, is generated, or can will more new data as data source, directly display.
In one embodiment, client sends data using preset time threshold as interval, periodically to server
Request is updated, for example, can be spaced 3 minute period sends data update request.The data that client this time sends server
Splice with the stored data of client, forms the data source of time-tendency graph, also, the data received are put by client
In caching.
A variety of data transfer modes can be used between client and server, for example, webservice, wcf, webapi
Etc., the filter condition that client will confirm that is sent to server as parameter.
The filter condition that server is passed to according to client obtains the data for meeting filter condition.Server can basis
Filter condition obtains the data for meeting filter condition from database or other data sources, this part number obtained from data source
It is not duplicate according to the existing data of client.After client receives the data of server return, by this data and visitor
It is shown in time-tendency graph after the existing data splicing in family end as data source.
The method of more new data of the invention, the parameter of filter condition include: start time parameter, latest data time ginseng
Number etc..When user end to server sends out request, by the newest time of active client data with existing and other filter conditions
It is sent to server, server only needs to return the later data of its request time to client, does not need to return every time
The data for returning the entire entire time span of time-tendency graph, reduce the resource consumption of server itself, while decreasing band
Width consumption.
In one embodiment, client receives the instruction for generating time-tendency graph.When time-tendency graph is first adds
When load, client calculates the start time for needing the data obtained according to the time span of current time and time-tendency graph.Visitor
Family end sends data to server and updates request, and it includes: start time parameter in request that this data, which updates, and value is the number obtained
According to start time.
From database or other data source, obtain between this time starting point and current point in time all has server
Close data.For example, it is 9 points that client, which obtains current time, in first load, the time span of time-tendency graph is 1 hour,
It is 8 points that user end to server, which sends the start time that data update in request, and server is from database or other data source
In, obtain all related data between 8 points and 9 points of current point in time.
Client first confirms that the filter condition of the data to be requested in request data.Filter condition can be according to tool
The data of body are configured, can also be with for example, the time granularity of time of latest data in client, the data for needing to obtain
It is which kind of data etc. for example, which user belonged to including the querying condition etc. for needing to obtain data.
When time-tendency graph is to load for the first time, client needs the time span according to current time and time-tendency graph
The start time of data required for calculating, such as: client needs to show nearest 12 hours data, then loads for the first time
When, record the time point that current time is elapsed forward to 12 hours.When to server request data, this time point needs
It is put into request as parameter.
In one embodiment, when time-tendency graph is not to load for the first time, client reads latest data from caching
Time.User end to server sends data and updates request, and it includes: latest data time parameter that this data, which updates in request,
Its value is the time of latest data in client.For example, when time-tendency graph is not to load for the first time, then from client-cache
It reads the time of latest data in current client, before for example, 5 minutes, when to server request data, when this is before 5 minutes
Between point be put into request as parameter.
In one embodiment, the time granularity of client setting data.Time granularity refers to accessed by server
Preparation be supplied to client data time interval.Client updates in request in data adds time granularity.Server
Data are obtained according to time granularity, the time interval of the pieces of data got is the time granularity.For example, client needs
The time granularity of the data to be requested of determination, setting time granularity are 1 minute, then mean in desired returned data between the time
It is divided into 1 minute.
For example, in line number be 1,200,000 while line number is 1,000,000,18:01 while 18:00, client is by time grain
Degree is set as 10s, then means that the time interval in desired returned data is 10 seconds, such as in line number while 18:00:00
It is online 1,500,000 while line number is 1,020,000,18:00:20 while for 1,000,000,18:00:10.Then server obtains
The time interval of each data is all 10 seconds, and returns to client.
Client sent data to server for the period with 5 minutes and updates request, updates in request and adds in each data
The time granularity added is 30 seconds, then the data of preparation in server every 5 minutes, and the time interval in data that server prepares is
30s, and it is sent to client.
The frequency that server obtains data depends on the frequency of client hair request, receives the request of client transmission,
Server obtains data and returns.For example, needing to generate the online time trend of counting user for a kind of game on line
Figure, setting time granularity are 1 minute, then the time interval for the pieces of data that server is got all is 1 minute, such as server
Following data: user's online data of 19:00:00, user's online data of 19:01:00, the use of 19:02:00 may be got
Family online data.
The method of more new data of the invention, in addition to being span when requesting entire time-tendency graph to server for the first time
Other than the partial data of degree, backward when each request data, the newest time T of the existing data of active client can all be sent
To server, after server receives request, only the later data of time T can be returned to client, just can guarantee to take in this way
The data that business device returns every time are that client is expected, redundant data is not present.
The method of more new data of the invention, by the way that filter condition is arranged, greatly reduces before client initiates request
The data volume obtained from server end, reduce the resource occupation of server end, data volume is small reduce simultaneously client and
Servers' data communicates occupied bandwidth, reduces the resource consumption of server itself, while decreasing bandwidth consumption.
As shown in Fig. 2, the present invention provides a kind of system of more new data, comprising: client 21 and server 22.Client
21 include: to update request transmitting unit 211 and data concatenation unit 212.Server 22 includes: 221 sum number of data capture unit
According to transmission unit, 222.
It updates request transmitting unit 211 and sends data update request to server, it includes: filtering rod that data, which update request,
Part.Data concatenation unit 212 splices the data received and the stored data of client, forms more new data.Data obtain
Unit 221 is taken to obtain data according to filter condition, the data that data transmission unit 222 will acquire return to client.
In one embodiment, the data that data transmission unit 222 is sent are not repeated with the stored data of client.
Data concatenation unit 212 will more new data as data source, generate time-tendency graph and simultaneously show.
In one embodiment, request transmitting unit 211 is updated using preset time threshold as interval, periodically to clothes
Device transmission data of being engaged in update request.The data and the stored number of client that data concatenation unit 212 this time sends server
According to splicing, the data source of time-tendency graph is formed, also, the data received are put into caching.
In one embodiment, the parameter of filter condition includes: start time parameter, latest data time parameter etc..
Updating request transmitting unit 211 may include: that start time computational submodule, latest data time computational submodule and update are asked
Seek survival into submodule.
When time-tendency graph is to load for the first time, start time computational submodule is according to current time and time-tendency graph
Time span calculates the start time for needing to obtain data.When update request generates submodule generation data update request and carries
Between origin parameters, wherein the value of start time parameter needs to obtain the start time of data thus.
Data capture unit 221 may include start point data acquisition submodule, include the time when judging that data update request
When origin parameters, start point data obtains the value of module acquisition time origin parameters to the data of current point in time.
In one embodiment, when time-tendency graph is not to load for the first time, latest data time computational submodule is postponed
Deposit the time of latest data in reading client.Request generation submodule generation data update is updated to request and carry newest number
According to time parameter, the value of latest data time parameter thus in client latest data time.
Data capture unit 221 may include latest data acquisition submodule, include when judging that data update in request
When latest data time parameter, data acquisition submodule obtains the value of latest data time parameter to the data of current point in time.
In one embodiment, the time granularity that data are arranged in request transmitting unit 211 is updated.Update request transmitting unit
211 add time granularity in data update request.Data capture unit 221 obtains data according to time granularity, accessed
Pieces of data time interval be time granularity.
The method and system of more new data of the invention is asked every time later other than being for the first time to obtain partial data
When seeking data, all the newest time T of the existing data of active client can be sent to server, after server receives request,
Only the later data of time T can be returned to client, can guarantee that redundant data is not present in the data that server returns every time,
And by setting filter condition, the data volume obtained from server end is greatly reduced, the resource occupation of server end is reduced,
The small client and server end data that reduces simultaneously of data volume communicates occupied bandwidth, reduces the money of server itself
Source consumption, while decreasing bandwidth consumption.
Method and system of the invention may be achieved in many ways.For example, can by software, hardware, firmware or
Software, hardware, firmware any combination realize method and system of the invention.The said sequence of the step of for method is only
In order to be illustrated, the step of method of the invention, is not limited to sequence described in detail above, especially says unless otherwise
It is bright.In addition, in some embodiments, also the present invention can be embodied as to record program in the recording medium, these programs include
For realizing machine readable instructions according to the method for the present invention.Thus, the present invention also covers storage for executing according to this hair
The recording medium of the program of bright method.