A kind of method and system of auto-update application program
Technical field
The present invention relates to computer realm, more particularly, relate to a kind of method and system of auto-update application program.
Background technology
Client application based on client/server (C/S, Client/Server) schema management system is deployed in different physical nodes, compares dispersion.In use, due to a variety of causes, application program needs to modify.After each amendment completes, client more new capital requires that user reinstalls application program.And C/S model management system may have tens, individual even several thousand clients of hundreds of, and client may distribute dispersion, each application program updating, all can expend huge maintenance workload.
Therefore, the shortcoming that C/S model is maximum is exactly that maintenance upgrade is loaded down with trivial details.Maintenance upgrade work after system installation is the most important link of application program life cycle.For the upgrading of the client application of C/S model, the past realizes often by online file and copying of USB flash disk.This method needs manual intervention, sometimes also may with virus, and when a lot of application programs of client carry out frequent updating, the task of renewal is just heavy can't bear, and also often occurs the client of omitting upgrading.
Upgrading due to application program is a lasting process, so there will be a lot of upgraded version.But what run in client can only be a unified application version, while multiple like this version, there is the instability that also result in the application program of FTP client FTP and unreliable.
Carry out application program updating according to existing mode and there is following problems:
(1) professional needs the upgrade job carrying out application program to scene, labor intensive resource;
(2) complicated operation, because upgrading is partly, makes the mistake constantly;
(3) user must be appreciated that and will go down loading updating document upgrading application program, and the Experience Degree of user is not high;
(4) Component Gallery is chaotic, and administrative staff cannot the update status of application version of each client of global knowledge.
Summary of the invention
The method and system of auto-update application program of the present invention needs professional's execute-in-place for prior art, and complicated operation, complete upgrading cannot be carried out to application software, Component Gallery is chaotic, administrative staff cannot the defect of update status of application version of each client of global knowledge, a kind of method and system of auto-update application program is provided, can automatic decision application program the need of upgrading, and to needing the application program of upgrading to carry out complete upgrading, and administrative staff are allowed to check the update status of the application version of each client.
The technical scheme that the present invention solves the employing of its technical problem is: a kind of method providing auto-update application program, comprises the following steps:
The upgrade components of S1, client, by Web server accessing database server, obtains the server end version number of the client application that described database server stores;
S2, described upgrade components read client local profile, obtain the client release number that client application is current;
S3, described upgrade components judge whether described server end version number and described client release be number identical, and when both are not identical by described Web server access file server, download to client by with a described server version number corresponding transaction file;
S4, described upgrade components use the transaction file downloaded to upgrade described client application, and are revised as by described client release number consistent with described server end version number;
Amended client release number, by described Web server, is stored into described database server by S5, described upgrade components;
Wherein, described database server comprises relational database, and described relational database comprises the lastest imformation of client application, and lastest imformation comprises the client release number upgrading mark and client application;
Described step S5 comprises following sub-step:
Described upgrade components accesses described database server by described Web server, marks described renewal mark, and amended client release number is stored into described relational database, to replace original client release number.
Preferably, step S3 comprises the following steps:
S3a, described upgrade components judge that whether described server end version number and described client release be number identical, if both are identical execution S3b, otherwise performs S3c;
S3b, perform described client application;
S3c, described upgrade components access described file server by described Web server, download to client by with a described server version number corresponding transaction file.
Further preferably, step S3c comprises the following steps:
S3c1, described upgrade components access described database server by described Web server, and what obtain the transaction file corresponding with described server end version number of described database server storage deposits path;
S3c2, described upgrade components by described Web server, deposit file server described in path access according to described transaction file, download to client by with a described server version number corresponding transaction file.
Further preferably, described relational database also comprises the version information of client application, and the version information of described client application also comprises from date and date of expiry, revised context and the publisher of client application corresponding to the system number of client, described server end version number; The time that the lastest imformation of described client application also comprises the system number of client, the IP address of client, the computer name of client, the physical location of client and upgraded for the last time.
Preferably, described method also comprised step before step S1:
S0, start described client application, described client application calls described upgrade components.
Preferably, described method also comprises step:
S6, described upgrade components delete the transaction file downloaded.
There is provided a kind of system of auto-update application program, the client comprising Web server and be connected with described Web server by communication network, be is characterized in that, the system of described auto-update application program also comprises:
Database server, it is connected with described Web server, it comprises relational database, described relational database comprises the version information of client application and the lastest imformation of client application, the version information of described client application comprises server end version number, and the lastest imformation of described client application comprises the client release number upgrading mark and client application; And
File server, it is connected with described Web server, for storage update file;
Described client also comprises upgrade components, described upgrade components accesses described database server by described Web server, obtain the described server end version number of client application, described upgrade components reads client local profile, obtain the client release number that client application is current, described upgrade components judges whether described server end version number and described client release be number identical, and access described file server when both are not identical by described Web server, described client is downloaded to by with a described server version number corresponding transaction file, the transaction file downloaded is used to upgrade described client application, and described client release number is revised as consistent with described server end version number,
Described upgrade components also accesses described database server by described Web server, marks described renewal mark, and amended client release number is stored into described relational database, to replace original client release number.
Preferably, what the version information of described client application also comprised transaction file deposits path; Described upgrade components is when described server end version number and described client release are number not identical, described database server is accessed by described Web server, what obtain described transaction file deposits path, and by described Web server, deposit file server described in path access according to described transaction file, download to described client by with a described server version number corresponding transaction file.
Preferably, the version information of described client application also comprises from date and date of expiry, revised context and the publisher of client application corresponding to the system number of client, described server end version number; The time that the lastest imformation of described client application also comprises the system number of client, the IP address of client, the computer name of client, the physical location of client and upgraded for the last time.
The method and system of auto-update application program of the present invention has following beneficial effect: after startup client application, upgrade components starts, upgrade components obtains client release number and the server end version number of application program, current client application is gone out the need of upgrading by multilevel iudge, and when needing upgrading, transaction file corresponding for server end version number is downloaded to customer side, transaction file is used to be version corresponding to server end version number by the edition upgrading of current client application, and amended client release number is saved in database server, when needs user participates in judging, achieve the automation complete upgrading of client application degree, in addition, allow administrative staff by Web server accessing database server, read the lastest imformation of the client application in relational database, monitor the upgrade case of the application program of each client, realize the global administration to client application upgrading.
Accompanying drawing explanation
Fig. 1 is the schematic diagram of system one embodiment of auto-update application program of the present invention;
Fig. 2 is the functional block diagram of the client in the present invention;
Fig. 3 is the workflow diagram that the system of auto-update application program of the present invention realizes auto-update;
Fig. 4 is the flow chart of method first embodiment of auto-update application program of the present invention;
Fig. 5 is the flow chart of method second embodiment of auto-update application program of the present invention.
Embodiment
Below in conjunction with drawings and Examples, the present invention is further explained.
Fig. 1 is the schematic diagram of system 100 1 embodiment of auto-update application program of the present invention, and see Fig. 1 and Fig. 2, system 100 of the present invention comprises Web server 110, multiple long-range client 120, database server 130 and file server 140.Client such as, by communication network, local area network (LAN), metropolitan area network, wide area network, connects Web server 110.Database server 130 is connected with Web server 110 respectively with file server 140.
Wherein, the access mode of Web server 110 for providing transaction file to download, can adopt File Transfer Protocol or HTTP mode to download, according to the network bandwidth, fail safe, performance etc. because usually selecting.Such as adopt the downloading mode of HTTP multithreading, the main cause of adopting in this way is that http protocol is simple and quick, can customize each data package size downloaded, and allows the data object of transmission any type.
Database server 130 comprises relational database, and relational database comprises the version information of client application and the lastest imformation of client application.Wherein, the version information of client application comprise the system number of client, the server end version number of client application journey, the from date of the client-side program of this version and date of expiry (from date of the client application that server end version number is corresponding and date of expiry), revised context (improvement that the client application of this version is done compared with money version), transaction file deposit path and publisher.The lastest imformation of client application also comprise the system number of client 120, the IP address of client 120, the computer name of client 120, client 120 physical location (physical address of computer), upgrade the time that mark, the client release number of client application and client application upgraded for the last time.
File server 140 is for storing the transaction file upgraded to by client application needed for the version corresponding with server end version number.
Client 120 comprises upgrade components 121.Fig. 3 is the workflow diagram (in HTTP mode) that the system 100 of auto-update application program of the present invention realizes auto-update, as shown in Figure 3, when client 120 starts client application, client application calls upgrade components 121, now, client application does not also perform.Upgrade components 121 reads local configuration file, and local profile comprises for the configuration information of the relational database of connection data storehouse server 130 and the current client release number of client application, i.e. the version number of current application program.Upgrade components 121, according to the configuration information of the relational database for connection data storehouse server 130, by Web server 110 accessing database server 130, obtains the server end version number of the client application stored in relational database.
Upgrade components 121 judges that whether the server end version number and the client release that obtain be number identical, determines whether to upgrade with this.After an application issued, be a baseline version when each client is issued initial, as V1.0.After server updating, version model changes, produce V1.1, V1.2 etc. version like this (note: the 1st numeral key plate this. the 2nd numeral time version, general great renewal and improvement. major version number of just upgrading).According to version model height, client determines that active client application program is the need of upgrading.
If server end version number and client release are number identical, representing current client application is latest edition, without the need to upgrading, now directly will perform client application, and preferably, upgrade components 121 is closed simultaneously.If both are not identical, represent current client application and need upgrading, upgrade components 121 is by Web server 110 accessing database server 130, what obtain transaction file deposits path, and deposit path access file server 140 by Web server 110 according to transaction file, download to client 120 by with a server version number corresponding transaction file.Wherein, upgrade components 121 this avoid the problem of sharing conflict under transaction file being downloaded to client 120 1 interim application catalogs.
After transaction file has been downloaded, upgrade components 121 uses the application program of transaction file updating client current version, and client release number is revised as consistent with server end version number, by Web server 110 accessing database server 130, flag update mark, new client release number is stored in relational database, to replace original client release number.Download Info by client this locality is recorded in the daily record of database server 130, to avoid repeatedly upgrading.
Wherein, upgrade components 121 uses the detailed process of the application program of transaction file updating client current version to be: under the transaction file of download being copied to the corresponding catalogue of client, replace original old program file.In addition, the transaction file under the interim application catalog of rear destruction has been copied.After having upgraded, the client application after upgrading will be performed.
System 100 of the present invention, allow administrative staff by Web server accessing database server 130, read the lastest imformation of the client application in relational database, monitor the upgrade case of the application program of each client 120, realize the global administration to client application upgrading.
In other embodiments of its system 100 of the present invention, the program for realizing upgrade components 121 function can also be write, and write in client application.Same, when starting client application, the program that client application can call for realizing upgrade components 121 function realizes similar function.
Fig. 4 is the flow chart of method first embodiment of auto-update application program of the present invention, and as shown in Figure 4, in the present embodiment, method of the present invention comprises the following steps:
S1, upgrade components 121, by Web server 110 accessing database server 130, obtain the server end version number of the client application that described database server 130 stores;
S2, upgrade components 121 read client 120 local profile, obtain the client release number that client application is current;
S3, upgrade components 121 judge whether server end version number and described client release be number identical, and when both are not identical by Web server 110 access file server 140, download to client 120 by with a server version number corresponding transaction file;
S4, upgrade components 121 use the transaction file downloaded to upgrade described client application, and are revised as by client release number consistent with server end version number;
Amended client release number, by described Web server 110, is stored into described database server 130 by S5, upgrade components 121.
In the present embodiment, step S3 comprises the following steps: S3a, upgrade components 121 judge that whether server end version number and client release be number identical, if both are identical execution S3b, otherwise performs S3c; S3b, execution client application; S3c, upgrade components 121, by Web server 110 access file server 140, download to client 120 by with a server version number corresponding transaction file.
Wherein, step S3c comprises the following steps: S3c1, upgrade components 121 are by Web server 110 accessing database server 130, and what obtain the transaction file corresponding with server end version number of database server 130 storage deposits path; S3c2, upgrade components 121, by Web server 110, deposit path access file server 140 according to transaction file, download to client 120 by with a server version number corresponding transaction file.
Database server 130 comprises relational database, relational database comprises the lastest imformation of client application and the lastest imformation of client application, wherein, the lastest imformation of client application comprise the system number of client, the server end version of client application number, the from date of client application corresponding to server end version number and date of expiry, revised context and publisher.The lastest imformation of client application comprise the system number of client 120, the IP address of client 120, the computer name of client 120, client 120 physical location, upgrade mark, the client release number of client application and time of having upgraded for the last time.
In step s 5, amended client release number is stored into database server 130 by described Web server 110 by upgrade components 121, to replace the client release number of the client application of client application.
Fig. 5 is the flow chart of method second embodiment of auto-update application program of the present invention, as shown in Figure 5, in the present embodiment, before step S1, also comprises step: S0, startup client application, client application calls upgrade components 121.Method of the present invention also comprises step: S6, upgrade components 121 delete the transaction file downloaded.
In the present embodiment, all the other situations are identical with method first embodiment of auto-update application program of the present invention, do not repeat them here.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within right of the present invention.In addition, the technical characteristic in various embodiments of the present invention may be used alone, can also be used in combination.Further, the order of the step recorded in method of the present invention is not limited to the present invention, and such as, the order of step S1 and S2 can be exchanged, and the order of step S5 and S6 can be exchanged.