Summary of the invention
In view of this, the technical matters that the present invention will solve is to provide a kind of method of more new data, and client is undertaken being spliced to form more new data by the data sent by server.
A more method for new data, comprising: user end to server sends Data Update request, and described Data Update request carries filtercondition, and wherein, the parameter of described filtercondition comprises: start time parameter, latest data time parameter; Described server obtains data according to described filtercondition, and the data of acquisition are returned to described client; The data that the data received and described client have stored are spliced by described client, form more new data.
According to one embodiment of present invention, further, described client is interval with the time threshold preset, periodically sends described Data Update request to described server; The data that the data received and described client have stored are spliced by described client, form more new data packets draws together: the data that described server this time sends by described client and the data that described client has stored are spliced, the data source of formation time trend map, further, the data received are put into buffer memory by described client.
According to one embodiment of present invention, further, the request of described user end to server transmission Data Update comprises: described client receives the instruction generating described time-tendency graph; When described time-tendency graph be load for the first time time, described client calculates according to the time span of current time and described time-tendency graph the start time needing to obtain data, generate described Data Update request and carry described start time parameter, wherein, the value of described start time parameter needs the start time obtaining data for this reason; Described server obtains data according to described filtercondition and the data of acquisition is returned to described client and comprises: when described server judges that described Data Update request comprises described start time parameter, the value obtaining described start time parameter to current point in time data and return described client.
According to one embodiment of present invention, further, described user end to server sends Data Update request and comprises: when described time-tendency graph be not load for the first time time, described client reads the time of latest data in described client from buffer memory, generate described Data Update request and carry described latest data time parameter, wherein, the value of described latest data time parameter is the time of latest data in described client; Described server obtains data according to described filtercondition and the data of acquisition is returned to described client and comprises: when described server judges to include described latest data time parameter in described Data Update request, the value obtaining described latest data time parameter to current point in time data and return client.
According to one embodiment of present invention, further, when also carrying time granularity in described Data Update request, described method also comprises: described server obtains data according to described time granularity, wherein, time interval of pieces of data that described server gets is described time granularity.
The technical matters that the present invention will solve is to provide a kind of system of more new data, and client is undertaken being spliced to form more new data by the data sent by server.
A more system for new data, comprising: client and server; Described client comprises: update request transmitting element, and for sending Data Update request to server, described Data Update request carries filtercondition, and wherein, the parameter of described filtercondition comprises: start time parameter, latest data time parameter; Data concatenation unit, splices for the data data received and described client stored, forms more new data; Described server comprises: data capture unit, and for obtaining data according to described filtercondition, data transmission unit, for returning to described client by the data of acquisition.
According to one embodiment of present invention, further, described update request transmitting element, also for being interval with the time threshold preset, periodically sending described Data Update request to described server; Described data concatenation unit, the data also for the data of described server this time transmission and described client having been stored are spliced, and form the data source of described time-tendency graph, and, the data received are put into buffer memory.
According to one embodiment of present invention, further, described update request transmitting element, comprising: start time calculating sub module, for when described time-tendency graph be load for the first time time, calculate the start time needing to obtain data according to the time span of current time and described time-tendency graph; Update request generates submodule, and for generating described Data Update request and carrying described start time parameter, wherein, the value of described start time parameter needs the start time obtaining data for this reason; Described data capture unit, comprising: start point data obtains submodule, for when judging that described Data Update request comprises described start time parameter, obtains the data of value to current point in time of described start time parameter.
According to one embodiment of present invention, further, described update request transmitting element, also comprises: latest data Time Calculation submodule, for when time-tendency graph be not load for the first time time, from buffer memory, read the time of latest data in described client; Described update request generates submodule, and also for generating described Data Update request and carrying described latest data time parameter, wherein, the value of described latest data time parameter is time of latest data in client for this reason; Described data capture unit, comprising: latest data obtains submodule, for when judging to include described latest data time parameter in described Data Update request, obtains the data of value to current point in time of described latest data time parameter.
According to one embodiment of present invention, further, described update request transmitting element, also comprises: time granularity setting unit, for the time granularity of setting data; Described update request generates submodule, also for adding described time granularity in Data Update request; Described data capture unit, also for obtaining data according to described time granularity, wherein, the time interval of accessed pieces of data is described time granularity.
The method and system of more new data of the present invention, client is undertaken being spliced to form more new data by the data sent by server, there is not redundant data in the data that server returns at every turn, and by arranging filtercondition, greatly reduce the data volume obtained from server end, reduce the resource occupation of server end, decrease the bandwidth shared by the communication of client and server end data simultaneously, reduce the resource consumption of server self, decrease bandwidth consumption simultaneously.
Description of the invention provides in order to example with for the purpose of describing, and is not exhaustively or limit the invention to disclosed form.Many modifications and variations are obvious for the ordinary skill in the art.Selecting and describing embodiment is in order to principle of the present invention and practical application are better described, and enables those of ordinary skill in the art understand the present invention thus design the various embodiments with various amendment being suitable for special-purpose.
Embodiment
With reference to the accompanying drawings the present invention is described more fully, exemplary embodiment of the present invention is wherein described.Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
Fig. 1 is the process flow diagram of an embodiment of method according to more new data of the present invention, as shown in Figure 1:
Step 101, user end to server sends Data Update request, and Data Update request comprises: filtercondition.
Step 102, server obtains data according to filtercondition, and the data of acquisition are returned to client.
Step 103, the data that the data received and client have stored by client are spliced, and form more new data.
In one embodiment, the data that server sends and the data stored in the client or exist do not repeat, and client can adopt buffer memory, database, file to store the data obtained from server.Client is using the more new data that generates as data source, and rise time trend map also shows, or more new data, as data source, directly can be shown.
In one embodiment, client is interval with the time threshold preset, periodically sends Data Update request to server, such as, 3 minute cycle of interval can send Data Update request.The data that server this time sends by client and the data that client has stored are spliced, the data source of formation time trend map, and the data received are put into buffer memory by client.
Can adopt several data transmission mode between client and server, such as, webservice, wcf, webapi etc., the filtercondition of confirmation is sent to server as parameter by client.
The filtercondition that server imports into according to client, obtains the data meeting filtercondition.Server can obtain according to filtercondition the data meeting filtercondition from database or other data source, and this partial data obtained from data source and the existing data of client are less than repetition.After client receives the data that server returns, be illustrated in after these data and the existing data splicing of client in time-tendency graph as data source.
The method of more new data of the present invention, the parameter of filtercondition comprises: start time parameter, latest data time parameter etc.When user end to server sends out request, the up-to-date time of active client data with existing and other filtercondition are sent to server, server only needs to return the later data of its request time to client, do not need the data at every turn all returning the whole time span of whole time-tendency graph, reduce the resource consumption of server self, decrease bandwidth consumption simultaneously.
In one embodiment, client receives the instruction of rise time trend map.When time-tendency graph be load for the first time time, client calculates the start time of the data needing to obtain according to the time span of current time and time-tendency graph.User end to server sends Data Update request, and this Data Update request comprises: start time parameter, and its value is the start time of the data obtained.
Server, from database or other data source, obtains all relevant datas between this start time and current point in time.Such as, when loading for the first time, it is 9 points that client obtains current time, the time span of time-tendency graph is 1 hour, the start time that user end to server sends in Data Update request is 8 points, server, from database or other data source, obtains all relevant datas between and current point in time 9 at 8.
Client, when request msg, first confirms the filtercondition of the data that will ask.Filtercondition can be arranged according to concrete data, and such as, the time granularity of the time of latest data, the data of needs acquisition in client, also can comprise querying condition needing to obtain data etc., such as, belonging to which user, is which kind of data etc.
When time-tendency graph be load for the first time time, client needs the start time calculating required data according to the time span of current time and time-tendency graph, such as: client needs the data of showing nearest 12 hours, then when loading for the first time, record time point current time passed 12 hours forward.When to server request data, this time point needs to put into request as parameter.
In one embodiment, when time-tendency graph be not load for the first time time, client reads the time of latest data from buffer memory.User end to server sends Data Update request, and this Data Update request comprises: latest data time parameter, and its value is the time of latest data in client.Such as, when time-tendency graph be not load for the first time time, then from client-cache, read the time of latest data in current client, such as, be before 5 minutes, when to server request data, this before 5 minutes time point put into request as parameter.
In one embodiment, the time granularity of client setting data.The time granularity preparation referred to accessed by server is supplied to the time interval of the data of client.Client adds time granularity in Data Update request.Server obtains data according to time granularity, and the time interval of the pieces of data got is described time granularity.Such as, client needs the time granularity determining the data that will ask, and setup times granularity is 1 minute, then mean that in the return data of expectation, the time interval is 1 minute.
Such as, while 18:00, number is 1,000,000 online, while 18:01, number is 1,200,000 online, time granularity is set to 10s by client, then mean that the time interval in the return data of expectation is 10 seconds, while such as 18:00:00 online number while being 1,000,000,18:00:10 online number be 1,500,000 online while being 1,020,000,18:00:20.Then the time interval of each data of server acquisition is all 10 seconds, and returns to client.
Client was the cycle send Data Update request to server with 5 minutes, the time granularity added in each Data Update request is 30 seconds, then server prepares a secondary data in every 5 minutes, and the time interval in the data that server prepares is 30s, and sends to client.
The frequency that server obtains data depends on that client sends out the frequency of request, and receive the request that client sends, namely server obtains data and return.Such as, for a kind of game on line, need to generate the online time-tendency graph of counting user, setup times granularity is 1 minute, time interval of pieces of data that then server gets is all 1 minute, such as server may get following data: user's online data of 19:00:00, user's online data of 19:01:00, user's online data of 19:02:00.
The method of more new data of the present invention, except being for the first time except the partial data of the time span of the whole time-tendency graph of server request, backward during each request msg, the up-to-date time T of existing for active client data is sent to server by capital, after server receives request, only data later for time T can be returned to client, can the data that at every turn return of Deterministic service device be so just that client expected, there is not redundant data.
The method of more new data of the present invention, before client initiates request, by arranging filtercondition, greatly reduce the data volume obtained from server end, reduce the resource occupation of server end, data volume is little decrease simultaneously client and server end data communication shared by bandwidth, reduce the resource consumption of server self, decrease bandwidth consumption simultaneously.
As shown in Figure 2, the invention provides a kind of system of more new data, comprising: client 21 and server 22.Client 21 comprises: update request transmitting element 211 and data concatenation unit 212.Server 22 comprises: data capture unit 221 and data transmission unit, 222.
Update request transmitting element 211 sends Data Update request to server, and Data Update request comprises: filtercondition.The data that the data received and client have stored by data concatenation unit 212 are spliced, and form more new data.Data capture unit 221 obtains data according to filtercondition, and the data of acquisition are returned to client by data transmission unit 222.
In one embodiment, the data that send of data transmission unit 222 and the data that stored of client do not repeat.Data concatenation unit 212 will more new data be as data source, and rise time trend map also shows.
In one embodiment, update request transmitting element 211 is interval with the time threshold preset, periodically sends Data Update request to server.The data that server this time sends by data concatenation unit 212 and the data that client has stored are spliced, the data source of formation time trend map, and, the data received are put into buffer memory.
In one embodiment, the parameter of filtercondition comprises: start time parameter, latest data time parameter etc.Update request transmitting element 211 can comprise: start time calculating sub module, latest data Time Calculation submodule and update request generate submodule.
When time-tendency graph be load for the first time time, start time calculating sub module calculates the start time needing to obtain data according to the time span of current time and time-tendency graph.Update request generates submodule and generates Data Update request and carry start time parameter, and wherein, the value of start time parameter needs the start time obtaining data for this reason.
Data capture unit 221 can comprise start point data and obtain submodule, and when judging that Data Update request comprises start time parameter, the value of start point data acquisition module acquisition time origin parameters is to the data of current point in time.
In one embodiment, when time-tendency graph be not load for the first time time, latest data Time Calculation submodule reads the time of latest data in client from buffer memory.Update request generates submodule and generates Data Update request and also carry latest data time parameter, and the value of latest data time parameter is time of latest data in client for this reason.
Data capture unit 221 can comprise latest data and obtain submodule, and when judging to include latest data time parameter in Data Update request, data acquisition submodule obtains the data of value to current point in time of latest data time parameter.
In one embodiment, the time granularity of update request transmitting element 211 setting data.Update request transmitting element 211 adds time granularity in Data Update request.Data capture unit 221 obtains data according to time granularity, and the time interval of accessed pieces of data is time granularity.
The method and system of more new data of the present invention, except being acquisition partial data for the first time, later during each request msg, the up-to-date time T of existing for active client data is sent to server by capital, after server receives request, only data later for time T can be returned to client, the data that at every turn return of Deterministic service device can there is not redundant data, and by arranging filtercondition, greatly reduce the data volume obtained from server end, reduce the resource occupation of server end, data volume is little decrease simultaneously client and server end data communication shared by bandwidth, reduce the resource consumption of server self, decrease bandwidth consumption simultaneously.
Method and system of the present invention may be realized in many ways.Such as, any combination by software, hardware, firmware or software, hardware, firmware realizes method and system of the present invention.Said sequence for the step of method is only to be described, and the step of method of the present invention is not limited to above specifically described order, unless specifically stated otherwise.In addition, in certain embodiments, can be also record program in the recording medium by the invention process, these programs comprise the machine readable instructions for realizing according to method of the present invention.Thus, the present invention also covers the recording medium stored for performing the program according to method of the present invention.