Summary of the invention
The objective of the invention is to solve in the prior art and only can whether judge upgrading according to the similarities and differences of version number, can't realize the flexible modification of system configuration information, if need to revise configuration information, then all equipment all must be revised as identical configuration or upgrade to the problem of identical target version.
For achieving the above object, the invention provides a kind of method that realizes network terminal equipment configuration automatic updating, described method comprises:
Explain and carry out the escalation policy script that sets in advance, obtain and the corresponding file destination information of the local configuration information of network-termination device, and operation is upgraded in trigger network terminal equipment execution configuration automatically;
Described escalation policy script is provided with the configuration information of network-termination device and the file destination information corresponding with described configuration information by script.
The step that described escalation policy script is carried out in described explanation further comprises:
2.1 explain described escalation policy script, call the corresponding interface function of program to be upgraded in the described network-termination device according to the configuration function in the described escalation policy script;
2.2 the configuration information that returns according to the interface function of described program to be upgraded reads file destination information corresponding in the described escalation policy script;
2.3 carrying out, the trigger network terminal equipment disposes automatically more new technological process.
The software and hardware version number of described configure packet includes network terminal equipment is or/and system configuration parameter.
Described configuration is upgraded automatically and is comprised that the auto-update of program to be upgraded is or/and the automatic modification of system configuration information.
Described script comprises JavaScript.
Described script interpreter is the program to be upgraded in html browser or the network-termination device.
For achieving the above object, the present invention also provides a kind of system that realizes network terminal equipment configuration automatic updating, and described system comprises:
The escalation policy script generator is arranged at upgrade server, and the escalation policy script is set, and described escalation policy script is provided with the configuration information of network-termination device and the file destination information corresponding with described configuration information by script;
Script interpreter is arranged at network equipment terminal, is used for explaining carrying out described escalation policy script, obtain and the corresponding file destination information of the local configuration information of network-termination device, and operation is upgraded in trigger network terminal equipment execution configuration automatically.
Described configuration is upgraded automatically and is comprised that the auto-update of program to be upgraded is or/and the automatic modification of system configuration information.
The software and hardware version number of described configure packet includes network terminal equipment is or/and system configuration parameter.
Described script interpreter is the program to be upgraded in html browser or the network-termination device.
By the present invention, can be according to the different configuring conditions of different network-termination devices and network-termination device, realize the automatic renewal of network-termination device configuration flexibly, solved the problem that to carry out the distinctiveness config update in the prior art at different network-termination devices.
Embodiment
In order to make purpose of the present invention, technical scheme and advantage clearer,, the present invention is further elaborated below in conjunction with drawings and Examples.Should be appreciated that specific embodiment described herein only in order to explanation the present invention, and be not used in qualification the present invention.
In the present invention, upgrade server is by the script setting file destination information corresponding with the configuration information of network-termination device, network-termination device is carried out directive script by explaining, obtain the file destination information corresponding with local configuration information, obtain file destination then and finish the automatic renewal of network-termination device configuration, comprise the auto-update of program and the automatic modification of system configuration information.
Fig. 2 shows and is suitable for network configuration of the present invention, network-termination device 200 is by FTP (FileTransfer Protocol, file transfer protocol (FTP)) or HTTP (Hypertext Transfer Protocol, HTML (Hypertext Markup Language)) links to each other with upgrade server 100, download escalation policy script and target program from upgrade server 100.
Escalation policy script generator 101 adopts general script to write the escalation policy script.Because most of network-termination devices are all supported HTML (Hyper Text Markup Language, Hypertext Markup Language) browser, and support html browser also to support the JavaScript script usually.Therefore, select for use the grammer of JavaScript script to come the escalation policy script is described in the present invention, can certainly realize by other script.
The configuration information that has comprised network-termination device in the escalation policy script, and the file destination information corresponding with the configuration information of network-termination device.
In the present invention, the escalation policy of network terminal equipment configuration automatic updating can be provided with flexibly according to the configuration information and the target program situation of network-termination device, for example:
(1) with the foundation of the current software and hardware version number of network-termination device as network terminal equipment configuration automatic updating;
(2) with network-termination device current or multinomial configuration parameter foundation as network terminal equipment configuration automatic updating;
(3) with current software and hardware version number+one of network-termination device or multinomial configuration parameter foundation as network terminal equipment configuration automatic updating;
(4) with the current software and hardware version number of network-termination device as foundation, revise present configuration information;
(5) with network-termination device current or multinomial configuration parameter as basis for estimation, revise present configuration information;
(6) with the current version number of network-termination device+or multinomial configuration parameter as basis for estimation, revise present configuration information;
(7) with the current software and hardware version number of network-termination device as basis for estimation, revise present configuration information, and select target program to be upgraded to upgrade;
(8) with the network terminal current or multinomial configuration parameter as basis for estimation, revise present configuration information, and select target program to be upgraded to upgrade;
(9) with current software and hardware version number+one of the network terminal or multinomial configuration parameter as basis for estimation, revise present configuration information, and select file destination to be upgraded to upgrade etc.
The configuration information of network-termination device can be different according to the difference of escalation policy, when for example selecting version number according to the current program to be upgraded of network-termination device to upgrade, includes the version number of current program to be upgraded in the configuration information; When selection is upgraded according to the hardware information of network-termination device, comprise the various software and hardware parameter informations of network-termination device in the configuration information, as the model of CPU, size of hard disk or the like.As one embodiment of the present of invention, file destination information is the filename or the access path of the target program corresponding with the corresponding configuration information of network-termination device.
Include a series of configuration functions in the escalation policy script, be used to obtain network-termination device configuration information, the specified configuration item is set and initiates at the upgrading flow process of intended target file etc., specifically the function that need finish can define flexibly according to the demand of software upgrading or config update.Script interpreter 201 is carried out these configuration functions by explaining, can obtain and the corresponding file destination information of local configuration information.
Below by example the escalation policy script is specifically described:
Selecting file destination to be upgraded with the version number of the current program to be upgraded of the network terminal as basis for estimation is example:
// finish strategy:
// version number is the user of VERSION_1, uses file " ObjectFile1 " to upgrade;
// version number is the user of VERSION_2.5, uses file " ObjectFile2 " to upgrade;
// all the other situations do not change version;
// to should tactful escalation policy script false code being:
var?CurrentVersion=GetCurrentVersion(SOFTWARE);
if(CurrentVersion==VERSION_1)Upgrate?To?Version(ObjectFile1);
else?if(CurrentVersion>=VERSION_2.5)Upgrate?To?Version(ObjectFile2);
else?DoNothing();
Selecting file destination to be upgraded with the current a certain configuration information of network-termination device as basis for estimation is example:
// finish strategy:
The equipment that comprises " sz " in // current user name uses file " ObjectFile1 " to upgrade;
The equipment that comprises " gd " in // current user name uses file " ObjectFile2 " to upgrade;
// all the other situations do not change version;
// to should tactful escalation policy script false code being:
var?CurrentConf_Para_1=GetCurrentPARA(USERNAME);
if(IfStringInlucde(CurrentConf_Para_1,″sz″)==TRUE)
Upgrate?To?Version(ObjectFile1);
else?if(CurrentConf_Para_1==″gd″)Upgrate?To?Version(ObjectFile2);
else?DoNothing();
Selecting file destination to be upgraded with the version number+a certain configuration information of the current program to be upgraded of network-termination device as basis for estimation is example;
// finish strategy:
// current version number is VERSION_1, and comprises the equipment of " sz " in the current user name, uses literary composition
Part " ObjectFile1 " is upgraded;
// current version number is VERSION_1, and comprises the equipment of " gz " in the current user name, uses literary composition
Part " ObjectFile2 " is upgraded;
// current version is number less than VERSION_3, and comprises the equipment of " gd " in the current user name, uses
File " ObjectFile3 " is upgraded;
// all the other situations do not change version;
// to should tactful escalation policy script false code being:
var?CurrentVersion=GetCurrentVersion(SOFTWARE);
var?CurrentConf_Para_1=GetCurrentPARA(USERNAME);
if(CurrentVersion==VERSION_1&&CurrentConf_Para_1==″sz″)
UpgrateToVersion(ObjectFile1);
else?if(CurrentVersion==VERSION_1&&CurrentConf_Para_1==″gz″)
Upgrate?To?Version(ObjectFile2);
else?if(CurrentVersion<=VERSION_3&&CurrentConf_Para_1==″gd″)
Upgrate?To?Version(ObjectFile3);
else?DoNothing();
Under other configuration information situations, the realization of escalation policy script is similar to the above, repeats no more.
Object program library 102 has been stored network-termination device 200 and has been carried out software upgrading or the needed target program of configuration information update, when network-termination device 200 obtains the file destination information corresponding with local configuration information, network-termination device 200 can be logined upgrade server 100, and corresponding target program is installed renewal in the download object program library 102.
As one embodiment of the present of invention, script interpreter 201 can be the html browser of network-termination device, html browser must provide the processing capacity to the configuration function in the escalation policy script, realize the corresponding call relation of interface function in configuration function and the program to be upgraded in the escalation policy script, the line parameter transmission of going forward side by side reaches the processing to return value.
As an alternative embodiment of the invention, script interpreter 201 can be the script explanation function module that program 202 to be upgraded provides.Because system configuration information, version number etc. should be self to be provided by network-termination device 200, so this script explanation function module is by some functions, for example be provided with/read the function of configuration information, the function explanation execution escalation policy script of initiating the upgrading flow process, obtain the configuration information and the corresponding file destination information of network-termination device 200.
Program 202 to be upgraded is programs to be upgraded of network-termination device 200 current operations, have a series of interface functions in the program 202 to be upgraded, form corresponding relation with the configuration function in the escalation policy script, and finish the function of the required execution of corresponding configuration function, for example setting/reading system configuration information, initiate to download the flow process of target program etc.
With script is that JavaScript is an example, after the system start-up, script interpreter 201 according to the grammer of JavaScript to the script execution that makes an explanation, when running in the escalation policy script self-defining JavaScript function, call the interface function of program 202 to be upgraded by script interpreter 201 according to self-defining function name again, and relevant parameters is handed down to the interface function of program 202 to be upgraded.After interface function is finished corresponding operation, for example return corresponding information after the flow process of setting/reading system configuration information, initiation download target program and give script interpreter 101, script interpreter 101 is explained according to the return value of interface function and is carried out follow-up escalation policy script.
The realization flow that configuration provided by the invention is upgraded automatically has been shown among Fig. 3, and details are as follows:
In step S301, network-termination device 200 auto-update flow processs are triggered, and download the escalation policy script from upgrade server 100.Obtain the escalation policy script and answer the service-strong host-host protocol, for example FTP (File Transfer Protocol, file transfer protocol (FTP)) or HTTP (Hypertext Transfer Protocol, HTML (Hypertext Markup Language)).
In step S302, network-termination device 200 judges from server 100 and downloads the whether success of escalation policy script files, is execution in step S303 then, otherwise process ends.
In step S303, after network-termination device 200 obtains the escalation policy script, by the execution that makes an explanation of 201 pairs of escalation policy scripts of script interpreter, obtain the target program file information corresponding with local configuration information, according to the target program of the target program file information of obtaining to upgrade server acquisition request correspondence, the local software Automatic Program is upgraded to target program, perhaps revise local configuration.
Fig. 4 shows the realization flow that the escalation policy script is made an explanation and carries out of script interpreter 201, and details are as follows:
In step S401, after the escalation policy script is explained the startup of executing the task, judge whether to arrive the end position of escalation policy script, be that then the escalation policy script explains that execution finishes, otherwise execution in step S402;
In step S402, read the escalation policy script and according to the execution that makes an explanation of the grammer of script;
In step S403, judge whether to have called self-defining configuration function in the escalation policy script, be execution in step S404 then, otherwise return step S401;
In step S404, when script interpreter 201 runs into configuration function in the escalation policy script, call the interface function of program 202 to be upgraded, and relevant parameters is handed down to interface function according to the function name of configuration function;
In step S405, the interface function of program 202 to be upgraded is finished corresponding operation, after for example the flow process of target program is downloaded in setting/reading system configuration information, initiation, returns corresponding information and gives script interpreter 201;
In step S406, script interpreter 201 is explained the further part of carrying out the escalation policy script according to the return value of the interface function of program 202 to be upgraded.
The above only is preferred embodiment of the present invention, not in order to restriction the present invention, all any modifications of being done within the spirit and principles in the present invention, is equal to and replaces and improvement etc., all should be included within protection scope of the present invention.