[background technology]
Report to a higher authorities for approval and put on record in the system item process at business data of exploitation, because whole system must be launched business operation by wide area network, so the final development plan of determining is that system architecture adopts three layout layers, that is: client-side program (Client) ━ apps server (Application Server) ━ database server (Database Server), after different client-side program is connected to the apps server at center by wide area network, by with the data communication of apps server, thereby carry out the miscellaneous service operation.In this typical three layout layers, client is store data not, and behind each the startup, it all needs to upgrade all kinds of up-to-date basic datas by apps server from database server, launches all kinds of business operations on the basis of these basic datas afterwards., how efficiently these basic datas to be updated to client synchronously from database server side soon here, just to become the key of a technology.Be updated to synchronously in the process of client by wide area network in the basic data with server end, traditional way is after each client-side program starts, all be connected to first application server, then begin to download all basic datas in the local system internal memory, for oneself, after all operations is complete, withdraw from client-side program, these basic datas that are kept in the internal memory are also discharged fully/are destroyed, this be a kind of fairly simple also be solution comparatively intuitively.But this traditional technology realizes need can only being applicable to the few situation of data record amount of renewal, because when the basic data amount of need upgrading reaches 100,000,1,000,000 even greater number, download the needed time of these data by wide area network will be up to dozens of minutes even more than several hours at every turn, user must wait for during this, can not carry out business operation, this availability and user who has had a strong impact on program experiences.
[summary of the invention]
In order to overcome the shortcoming of above-mentioned technology, the present invention seeks to solve in the situation that need to upgrade a large amount of basic datas to client by wide area network, shorten even save this part data synchronization updating time, to improve the overall performance of system.
The present invention realizes like this, a kind of optimization method of the system data incremental update based on three-tier architecture, it is characterized in that: described three-tier architecture comprises database server, apps server, client-side program, and described optimization method is realized according to the following steps:
Step 10, client-side program start, and are connected to apps server;
Step 20, client-side program send to apps server with the last Data Update time;
Step 30, apps server contrast by the operating time stamp of record, are specially: the operation of all kinds of basic datas of database, all need record the last operation time, and namely each bar basic data all has unique operating time; The operating time of every basic data and described Data Update time are carried out the time contrast; If the basic data of client-side program has renewal, search the data that client-side program need to upgrade, and the data that will upgrade form delta package at database server, if the basic data of client-side program is not upgraded, directly begin the business operation of client-side program;
The delta package that step 40, client-side program downloading data storehouse server form;
Step 50, client-side program merge the delta package of download and the cache file of self, form new cache file, do being updated successfully sign again, then begin the business operation of client-side program.
Usefulness of the present invention is: can shorten largely the system-based data and be updated to the needed time of client from database server, even can ignore the time loss (when database server does not have Data Update) of this part, promoted the overall performance of system.This is for the system that maybe needs to be undertaken by wide area network Data Update based on three-tier architecture, and especially huge when the system data amount, extremely during poor efficiency, the present invention can obtain the overall performance of system the lifting of a matter to the traditional data update method.
[embodiment]
Below in conjunction with drawings and Examples the present invention is described further.
The software management system that Fig. 1 is based on three-tier architecture can be divided into three parts usually: the database server part: be that common Database Systems are installed, such as the SqlServer of common generation, Oracle, DB2 etc.
Apps server part: be to be responsible for concrete business realizing, in the middle of user program and database, play the effect of bridge, define and provide various interface for client program calls.Apps server (Application Server) can in same physical machine, also can be positioned on the different machines with database server (Database Server).
Client-side program part: be towards the end user, according to difference in functionality different client-side program can be arranged, but all must be connected to apps server, form hub-and-spoke configuration, and the various data-interfaces that encapsulated of invokes application server, realize business operation.If the database server side basic data has renewal, the employed related data of client must upgrade in time, guaranteeing the correctness of business datum, this also just why client-side program need the reason of online more new data.
Fig. 2 is the schematic flow sheet that data increment of the present invention upgrades optimization method.Concrete flow process is that minute following steps realize:
Step 10, client-side program start, and are connected to apps server;
Step 20, client-side program send to apps server with the last Data Update time;
Step 30, apps server contrast by the operating time stamp of record, if the basic data of client-side program has renewal, search the data that client-side program need to upgrade, and the data that will upgrade form delta package at database server, if the basic data of client-side program is not upgraded, directly begin the business operation of client-side program;
The delta package that step 40, client-side program downloading data storehouse server form;
Step 50, client-side program merge the delta package of download and the cache file of self, form new cache file, do being updated successfully sign again, then begin the business operation of client-side program.
Client-side program wherein, application server programs, database server all needs to carry out suitable function to be increased or structural adjustment, needs specifically to realize following at least function:
1. in database server side, every operation to all kinds of basic datas of database (comprising that record modification, record increase and record deletion) all needs to register the last operation time, and this is equivalent to each bar basic data record, all have unique operating time, be convenient to follow the tracks of;
2. after each client-side program starts, all need the last Data Update of the machine time is sent to apps server.The apps server program just can learn that by the operating time stamp comparison of record which data active client has not yet upgrade, and upgrades the delta package file thereby form.For different client-side program, the update package that returns is different.
3. if client terminal local does not have data buffer storage file (be linked to server for the first time, or the data buffer storage file being deleted), then need to download basic data full dose bag.This is to guarantee that in the minimum efficiency situation, efficient of the present invention still is not less than the efficient of traditional data update mode.
4. if the basic data of database server side has been carried out large batch of data modification or interpolation, certainly will cause that to return delta package excessive, if return delta package this moment, although reduced data download time, but obviously increased the delta package data returned and the merging time of local cache file.So when delta package is excessive, can directly return the full dose bag, to improve whole efficiency.
5. after the renewal delta package downloaded to client, needs and local basis data buffer storage file bag carried out the data merging and upgrade, and generate new basic data cache file, thereby finish Data Update.
In a word, the present invention can solve in the situation that need to upgrade a large amount of basic datas to client by wide area network, shortens even saves this part data synchronization updating time, to improve the overall performance of system.
The above only is preferred embodiment of the present invention, and all equalizations of doing according to the present patent application claim change and modify, and all should belong to covering scope of the present invention.