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, relatively disperses.In use, because a variety of causes, application program need to be made amendment.After each modification was finished, client more new capital required the user to reinstall application program.And the C/S model management system may have tens, hundreds of even several thousand clients, and client may distribute dispersion, and each application program updating all can expend huge maintenance workload.
Therefore, the shortcoming of C/S model maximum is exactly that maintenance upgrade is loaded down with trivial details.Maintenance upgrade work after system installs is the most important link of application program life cycle.For the upgrading of the client application of C/S model, the past often by online file and USB flash disk copy realize.This method needs manual intervention, sometimes also may be with virus, and when a lot of application programs of client were carried out frequent updating, the task of renewal can't bear with regard to heavy, also tends to occur omitting the client of upgrading.
Because the upgrading of application program is a lasting process, so a lot of upgraded versions can occur.But client operation can only be a unified application version, have like this unstable and unreliable of the application program that also caused FTP client FTP when a plurality of version.
Carry out application program updating according to existing mode and have following problems:
(1) professional need to arrive on-the-spot the carry out upgrade job of application program, labor intensive resource;
(2) complicated operation because upgrading is part, makes the mistake constantly;
(3) user must be appreciated that and will go down loading updating document upgrading application program, and user's Experience Degree is not high;
(4) Component Gallery is chaotic, the update status of the application version that administrative staff can't 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, can't carry out complete upgrading to using software, Component Gallery is chaotic, administrative staff can't each client of global knowledge the defective of update status of application version, a kind of method and system of auto-update application program is provided, can the automatic decision application program whether need upgrading, and the application program of needs upgradings carried out complete upgrading, and allow administrative staff to check the update status of the application version of each client.
The technical scheme that the present invention solves its technical problem employing is: a kind of method of auto-update application program is provided, may further comprise the steps:
The upgrade components of S1, client is obtained the server end version number of the client application of described database server stores by Web server accessing database server;
S2, described upgrade components read the client terminal local configuration file, obtain the current client release of client application number;
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, will download to client with number corresponding transaction file of described server version;
S4, described upgrade components use the transaction file of the downloading described client application of upgrading, and described client release number are revised as consistent with described server end version number;
S5, described upgrade components be by described Web server, number stores amended client release into described database server.
Preferably, step S3 may further comprise the 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 carries out S3c;
S3b, carry out described client application;
S3c, described upgrade components are accessed described file server by described Web server, will download to client with number corresponding transaction file of described server version.
Further preferably, step S3c may further comprise the steps:
S3c1, described upgrade components are accessed described database server by described Web server, the transaction file corresponding with described server end version number that obtains described database server stores deposit the path;
S3c2, described upgrade components be by described Web server, according to described transaction file deposit the described file server of path access, will download to client with number corresponding transaction file of described server version.
Further preferably, the lastest imformation of described client application also comprises from date and date of expiry, revised context and the publisher of the client application that the system number of client, described server end version number are corresponding; The lastest imformation of described client application also comprises the client release number of physical location, updating mark, client application of computer name, the client of IP address, the client of system number, the client of client and the time that last upgrading is finished;
In step S5, described upgrade components number stores amended client release into described database server by described Web server, with the client release of the client application of replacing described client application number.
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:
The transaction file that S6, the deletion of described upgrade components are downloaded.
A kind of system of auto-update application program is provided, comprises Web server and by communication network and the client that described Web server is connected, it is characterized in that, the system of described auto-update application program also comprises:
Database server, it is connected with described Web server, and it comprises relational database, and described relational database comprises the version information of client application, and the version information of described client application comprises server end version number; And
File server, it is connected with described Web server, is used for the storage update file;
Described client also comprises upgrade components, described upgrade components is accessed described database server by described Web server, obtain the described server end version number of client application, described upgrade components reads the client terminal local configuration file, obtain the current client release of client application number, described upgrade components judges whether described server end version number and described client release be number identical, and when both are not identical, access described file server by described Web server, to download to described client with number corresponding transaction file of described server version, the transaction file of use the downloading described client application of upgrading, and described client release number is revised as consistent with described server end version number.
Preferably, described relation data bag also comprises the lastest imformation of client application, and the lastest imformation of described client application comprises the client release number of client application; The version information of described client application also comprises the path of depositing of transaction file; Described upgrade components is when described server end version number and described client release are number not identical, access described database server by described Web server, obtain the path of depositing of described transaction file, and by described Web server, according to described transaction file deposit the described file server of path access, will download to described client with number corresponding transaction file of described server version.
Preferably, the lastest imformation of described client application also comprises from date and date of expiry, revised context and the publisher of the client application that the system number of client, described server end version number are corresponding; The lastest imformation of described client application also comprises the client release number of physical location, updating mark, client application of computer name, the client of IP address, the client of system number, the client of client and the time that last upgrading is finished.
Further preferably, described upgrade components is by described Web server, number stores amended client release into described database server, with the client release in the lastest imformation of upgrading described client application number.
The method and system of auto-update application program of the present invention has following beneficial effect: after starting client application, upgrade components starts, upgrade components is obtained client release number and the server end version number of application program, whether need upgrading by relatively judging current client application, and the transaction file that server end version number is corresponding downloads to the customer side when needs are upgraded, use transaction file that the edition upgrading of current client application is version corresponding to server end version number, and amended client release number is saved in database server, in the situation that need the user to participate in judging, realized 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 the relational database, monitor the upgrade case of the application program of each client, realize the global administration to the client application upgrading.
Description of drawings
Fig. 1 is the schematic diagram of one embodiment of system of auto-update application program of the present invention;
Fig. 2 is the functional block diagram of the client among 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 explanation.
Fig. 1 is the schematic diagram of 100 1 embodiment of system of auto-update application program of the present invention, and referring to Fig. 1 and Fig. 2, system 100 of the present invention comprises Web server 110, a plurality of long-range client 120, database server 130 and file server 140.Client is by communication network, and for example local area network (LAN), metropolitan area network, wide area network connect Web server 110.Database server 130 is connected with file server and is connected with Web server 110 respectively.
Wherein, Web server 110 is used for providing the access mode of transaction file download, can adopt File Transfer Protocol or HTTP mode to download, and selects according to factors such as the network bandwidth, fail safe, performances.For example adopt the downloading mode of HTTP multithreading, the main cause that adopts this mode is the http protocol Simple fast, can customize the data package size of each download, and allows the data object of transmission any type.
Database server 130 comprises relational database, and relational database comprises the lastest imformation of version information and the client application of client application.What wherein, the version information of client application comprised the from date of client-side program of server end version number, this version of system number, the client application journey of client 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 than the money version), transaction file deposits path and publisher.The lastest imformation of client application also comprises the client release number of physical location (physical address of computer), updating mark, client application of computer name, the client 120 of IP address, the client 120 of system number, the client 120 of client 120 and the time that the last upgrading of client application is finished.
File server 140 is used for storage client application is upgraded to the version required transaction file corresponding with server end version number.
Client 120 comprises upgrade components 121.Fig. 3 is the workflow diagram (in the HTTP mode as example) 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, at this moment, client application is not also carried out.The configuration file of upgrade components 121 read locals comprises in the local profile for the current client release of the configuration information of the relational database of connection data storehouse server 130 and client application number, i.e. the version number of current application program.Upgrade components 121 by Web server 110 accessing database servers 130, is obtained the server end version number of the client application of storing in the relational database according to the configuration information of the relational database that is used for connection data storehouse server 130.
Upgrade components 121 judges that whether the server end version number that obtains and client release be number identical, determines whether to upgrade with this.After an application issued, it is a baseline version that each client is issued when initial, such as V1.0.Behind server updating, the version model changes, the suchlike version of generation V1.1, V1.2 etc. (annotate: the 1st numeral key plate is originally. the 2nd numeral time version, general great renewal and improvement. and the major version number of just can upgrading).Client is just determined the active client application program according to the version model, and whether needs are upgraded.
If server end version number and client release are number identical, representing current client application is latest edition, need not upgrading, and will directly carry out client application this moment, 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 servers 130, obtain the path of depositing of transaction file, and by Web server 110 according to transaction file deposit path access file server 140, will download to client 120 with number corresponding transaction file of server version.Wherein, upgrade components 121 downloads to transaction file under 120 1 interim application catalogs of client, has avoided like this problem of sharing conflict.
After transaction file is downloaded and is finished, upgrade components 121 is used 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 servers 130, the flag update sign, new client release number is stored in the relational database, to replace original client release number.The Download Info that is about to client terminal local 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: the transaction file of downloading is copied under the corresponding catalogue of client, replace former program file of haveing been friends in the past.In addition, copy finish after transaction file under the interim application catalog of destruction.After upgrading is finished, the client application after the 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 the relational database, monitor the upgrade case of the application program of each client 120, realize the global administration to the client application upgrading.
Among other embodiment of its system 100 of the present invention, can also write for the program that realizes upgrade components 121 functions, and write in the client application.Same, when starting client application, client application can call for the program that realizes upgrade components 121 functions and realize 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 may further comprise the steps:
S1, upgrade components 121 are obtained the server end version number of the client application of described database server 130 storages by Web server 110 accessing database servers 130;
S2, upgrade components 121 read client 120 local profiles, obtain the current client release of client application number;
S3, upgrade components 121 judge whether server end version number and described client release number identical, and when both are not identical by Web server 110 access file servers 140, will download to client 120 with number corresponding transaction file of server version;
S4, upgrade components 121 uses the transaction file of the downloading described client application of upgrading, and client release number is revised as consistent with server end version number;
S5, upgrade components 121 be by described Web server 110, number stores amended client release into described database server 130.
In the present embodiment, step S3 may further comprise the 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 carries out S3c; S3b, execution client application; S3c, upgrade components 121 be by Web server 110 access file servers 140, will download to client 120 with number corresponding transaction file of server version.
Wherein, step S3c may further comprise the steps: S3c1, upgrade components 121 be by Web server 110 accessing database servers 130, obtain database server 130 storages the transaction file corresponding with server end version number deposit the path; S3c2, upgrade components 121 be by Web server 110, according to transaction file deposit path access file server 140, will download to client 120 with number corresponding transaction file of server version.
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 client system number, client application the server end version number, from date and date of expiry, revised context and the publisher of client application corresponding to server end version number.The lastest imformation of client application comprises the client release number of physical location, updating mark, client application of computer name, the client 120 of IP address, the client 120 of system number, the client 120 of client 120 and the time that last upgrading is finished.
In step S5, upgrade components 121 No. 110 stores amended client release into database server 130 by described Web server, with the client release of the client application of replacing client application number.
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, also comprises step: S0 before step S1, starts client application, and client application calls upgrade components 121.Method of the present invention also comprises the transaction file that step: S6, upgrade components 121 deletions are 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 above is the preferred embodiments of the present invention only, is not limited to the present invention, and 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 modification of doing, be equal to replacement, improvement etc., all should be included within the claim scope of the present invention.In addition, the technical characterictic in the various embodiments of the present invention may be used alone, can also be used in combination.And the order of the step of putting down in writing in the method for the present invention is not limited to the present invention, and for example, the order of step S1 and S2 can be changed, and the order of step S5 and S6 can be changed etc.