Summary of the invention
The shortcoming of prior art in view of the above, the object of the present invention is to provide a kind of method of configuring application program and the embedded device that is suitable for, for the problem be configured for application program solving that embedded device in prior art cannot unify.
For achieving the above object and other relevant objects, the invention provides a kind of method of configuring application program, for embedded device, comprising: preset for the parameter item corresponding to the interface routine of configuring application program and corresponding access information and described access information; There is provided a webpage to user, in order to input the parameter value of access information corresponding to application program to be placed and each parameter item thereof, and the parameter value of the path of the application program provided by described webpage, access information and each parameter item thereof preserves into configuration file table; Find according to described configuration file table the application program that corresponding interface routine arranges for user to be managed for configuration.
Preferably, describedly provide a webpage to user, mode in order to the parameter value inputting access information corresponding to application program to be placed and each parameter item thereof comprises: the option of parameter value providing increase, amendment and the access information deleted corresponding to application program and each parameter item thereof in described webpage, and based on the selection of described user, the parameter value of the corresponding access information corresponding to application program that increases, upgrade and delete in described configuration file table and each parameter item thereof.
Preferably, describedly provide a webpage to user, mode in order to the parameter value of the access information and each parameter item thereof that input application program to be placed comprises: divide into groups to configured each application program according to described access information, and provide the webpage of configuring application program according to described grouping; According to the parameter item in described grouping information, in described webpage, provide the parameter item option of corresponding packet options.
Preferably, described parameter item comprises following at least one: Authority Verification parameter item, rights of using parameter item.
Preferably, described configuration file table is the binary file layout comprising access information, corresponding each parameter item and parameter value thereof.
Based on above-mentioned purpose, the present invention also provides a kind of embedded device, comprising: preset unit, for presetting for the parameter item corresponding to the interface routine of configuring application program and corresponding access information and described access information; Configuration information setting unit, for providing a webpage to user, in order to input the parameter value of access information corresponding to application program to be placed and each parameter item thereof, and the parameter value of the path of the application program provided by described webpage, access information and each parameter item thereof preserves into configuration file table; Configuration information management unit, the application program arranged for user for finding corresponding interface routine according to described configuration file table is managed for configuration.
Preferably, described configuration information setting unit is used for the option of the parameter value of access information and each parameter item thereof providing increase, amendment and deletion corresponding to application program in described webpage, and based on the selection of described user, the parameter value of the corresponding access information corresponding to application program that increases, upgrade and delete in described configuration file table and each parameter item thereof.
Preferably, described configuration information setting unit comprises: the first configuration information arranges module, for dividing into groups to configured each application program according to described access information, and provides the webpage of configuring application program according to described grouping; Second configuration information arranges module, for according to the parameter item in described access information, provides the parameter item option configuring same grouping in described webpage.
Preferably, described parameter item comprises following at least one: Authority Verification parameter item, rights of using parameter item.
Preferably, described configuration file table is the binary file layout comprising access information, corresponding each parameter item and parameter value thereof.
As mentioned above, the method of configuring application program of the present invention and the embedded device that is suitable for, there is following beneficial effect: by the default interface routine for configuring application program and corresponding access information, and configuration file table, unified, break-even configuration feature can be provided for the application program be arranged in embedded device, effectively achieve the simplifying of embedded device, basic demand fast; In addition, provided the interface of the configuration information that application program is set to user by webpage, effectively simplified the part of the read-write configuration file in the Configuration Framework be applied on PC, effectively can also configure custom feature for user provides.
Embodiment
Below by way of specific instantiation, embodiments of the present invention are described, those skilled in the art the content disclosed by this instructions can understand other advantages of the present invention and effect easily.The present invention can also be implemented or be applied by embodiments different in addition, and the every details in this instructions also can based on different viewpoints and application, carries out various modification or change not deviating under spirit of the present invention.
As shown in Figure 1, the invention provides a kind of method of configuring application program.Described collocation method performs primarily of configuration-system.Described configuration-system is arranged in embedded device.Can run multiple application program in described embedded device, the authority, running environment etc. of each application program can carry out configure and maintenance by described configuration-system.Including but not limited to of described embedded device: the network access equipments such as router.
In step sl, described configuration-system is preset for the parameter item corresponding to the interface routine of configuring application program and corresponding access information and described access information.
Particularly, described interface routine includes but not limited to: based on the interface routine of the configuration feature in SAMBA, self-defining interface routine etc.Described access information may correspond to the multiple interface routines under a path, and the parameter item corresponding with described access information of the parameter in each interface routine is corresponding.Parameter in the path of above-mentioned interface routine and the corresponding relation of access information and interface routine and the corresponding relation of parameter item can be kept in described embedded device with the form of allocation list by designer in advance.
Such as, described allocation list is A.conf file, and definition rule is wherein exemplified below:
#define SAMBA_CONF "/tmp/samba/lib/smb.conf " // Profile Path
//global info
#define SMB_GLOBAL "global"
#define SMB_WORKGROUP "global:workgroup"
#define SMB_TDB "global:passdb backend"
#define SMB_SECURITY "global:"
//shared info
#define SMB_MEDIA " media " // virtual share directory name
#define SMB_PATH " path " // shared file catalogue
#define SMB_WRITEABLE " writeable " // file read-write authority
#define SMB_BROWSEABLE " browseable " // whether visible
#define SMB_VALID_USERS " valid users " // validated user title
#define SMB_GUEST_OK " guest ok " //guest authority
#define SMB_WRITELIST_OK " write list " // can write permission user list
When user needs to configure the application program being arranged on embedded device, described configuration-system performs step S2.
In step s 2, described configuration-system provides a webpage to user, in order to input the parameter value of access information corresponding to application program to be placed and each parameter item thereof, and the parameter value of the path of the application program provided by described webpage, access information and each parameter item thereof preserves into configuration file table.
Particularly, described configuration-system provides a webpage for user, is provided with in order to the access information corresponding to the application program to be placed of input and each parameter item thereof in described webpage.User can generate the configuration file table of corresponding application program by the parameter value inputting each parameter item.
In order to distribute file table rationally, be convenient to the unified management of configuration file table application programs.Described step S2 comprises: step S2 and S22.(all not giving diagram)
In the step s 21, described configuration-system divides into groups to configured each application program according to described access information, and is grouped according to described the access information option providing configuring application program in described webpage.
In step S22, described configuration-system is used for according to the parameter item in described access information, provides the parameter item option configuring same grouping in described webpage.
Such as, in described webpage, comprise the path inputting interface of application program, and access information option.When user therefrom selects the access information of " Authority Verification ", described application path to add in the access information grouping of described " Authority Verification " according to the form preset by described configuration-system, and according to preserved in described configuration file table belong to parameter item in the grouping of " Authority Verification " access information and parameter value performs step S3.Wherein, described configuration file table can be XML format.
When user selects parameter item and the parameter value changing " Authority Verification " access information, described configuration-system performs step S3 by according to the parameter item of " Authority Verification " access information after change and parameter value, to safeguard the Authority Verification of all application programs with group.
Preferably, in order to allow the lightweight as far as possible in described embedded device of described configuration-system, described configuration-system preserves the access information corresponding to the path of application program, each parameter item and parameter value thereof with binary file layout.
Such as, described configuration file table preserves access information, each parameter item and parameter value thereof with [Entry] Parameter=Value kind form.Wherein, [Entry] corresponding access information, the corresponding parameter item of Parameter, the corresponding parameter value of Value.
[global]
workgroup =mygroup
passdb backend =smbpasswd
security =user
In another preferred version, described configuration-system provides increase, amendment and deletes the option of parameter value of access information corresponding to application program and each parameter item thereof in described webpage, and based on the selection of described user, the parameter value of the corresponding access information corresponding to application program that increases, upgrade and delete in described configuration file table and each parameter item thereof.
Particularly, the centralized management that described configuration-system divides into groups to each application program according to access information, then described configuration-system not only can carry out additions and deletions to the parameter item of application program in every group and corresponding parameter value and changes, and the parameter item corresponding to access information, parameter value are carried out to additions and deletions and change.Therefore, in described webpage, provide the button or link that enter respective page.Corresponding, described configuration-system changes operation according to the additions and deletions of user in described webpage, and corresponding additions and deletions change each information in configuration file table.
In step s3, described configuration-system is found according to described configuration file table the application program that corresponding interface routine arranges for user and is managed for configuration.
Particularly, after described embedded device starts, described configuration-system reads described configuration file table, the access information of corresponding each destination application is read from described configuration file table, and according to each interface routine preset and access information, determine the interface routine corresponding to read access information, and corresponding parameter value is substituted in determined interface routine, described destination application is carried out to the configuration managements such as authority.
For the configuration file table of above-mentioned " global ", described configuration-system starts the interface routine of access information corresponding to global, and each application program that name is mygroup, user object is user of dividing into groups is carried out login password authentication by interface routine described in instruction, wherein, authentication password is smbsamba.
And for example, comprise in described configuration file table:
[media] (// note: virtual share directory name)
path =/media
writeable =no
browseable =yes
valid users =admin
write list =admin
guest ok =no
Then described configuration-system is that the rights parameters item of each file sets under the share directory of the application program of media to belonging to access information, and the interface routine starting corresponding described media access information is safeguarded.
As shown in Figure 2, the invention provides a kind of embedded device.Configuration-system is comprised in described embedded device 1.Wherein, can run multiple application program in described embedded device 1, the authority, running environment etc. of each application program can carry out configure and maintenance by described configuration-system.Including but not limited to of described embedded device 1: the network access equipments such as router.
At this, in described configuration-system, comprise default unit 11, for presetting for the parameter item corresponding to the interface routine of configuring application program and corresponding access information and described access information.
Particularly, described interface routine includes but not limited to: based on the interface routine of the configuration feature in SAMBA, self-defining interface routine etc.Described access information may correspond to the multiple interface routines under a path, and the parameter item corresponding with described access information of the parameter in each interface routine is corresponding.Parameter in the path of above-mentioned interface routine and the corresponding relation of access information and interface routine and the corresponding relation of parameter item can be kept in described default unit 11 with the form of allocation list by designer in advance.
Such as, described allocation list is A.conf file, and definition rule is wherein exemplified below:
#define SAMBA_CONF "/tmp/samba/lib/smb.conf " // Profile Path
//global info
#define SMB_GLOBAL "global"
#define SMB_WORKGROUP "global:workgroup"
#define SMB_TDB "global:passdb backend"
#define SMB_SECURITY "global:"
//shared info
#define SMB_MEDIA " media " // virtual share directory name
#define SMB_PATH " path " // shared file catalogue
#define SMB_WRITEABLE " writeable " // file read-write authority
#define SMB_BROWSEABLE " browseable " // whether visible
#define SMB_VALID_USERS " valid users " // validated user title
#define SMB_GUEST_OK " guest ok " //guest authority
#define SMB_WRITELIST_OK " write list " // can write permission user list
When user needs to configure the application program being arranged on embedded device 1, described configuration-system also comprises: configuration information setting unit 12 and configuration information management unit 13.
Described configuration information setting unit 12 is for providing a webpage to user, in order to input the parameter value of access information corresponding to application program to be placed and each parameter item thereof, and the parameter value of the path of the application program provided by described webpage, access information and each parameter item thereof preserves into configuration file table.
Particularly, described configuration information setting unit 12 provides a webpage for user, is provided with in order to the access information corresponding to the application program to be placed of input and each parameter item thereof in described webpage.User can generate the configuration file table of corresponding application program by the parameter value inputting each parameter item.
In order to distribute file table rationally, be convenient to the unified management of configuration file table application programs.Described configuration information setting unit 12 comprises: the first configuration information arranges module and the second configuration information arranges module
Described first configuration information arranges module for dividing into groups to configured each application program according to described access information, and is grouped according to described the access information option providing configuring application program in described webpage.
Described second configuration information arranges module for according to the parameter item in described access information, provides the parameter item option configuring same grouping in described webpage.
Such as, described first configuration information arranges the path inputting interface that module comprises application program in described webpage, and access information option.When user therefrom selects the access information of " Authority Verification ", described first configuration information arranges module and described application path to be added in the access information grouping of described " Authority Verification " according to the form preset, and according to preserved in described configuration file table belong to parameter item in the grouping of " Authority Verification " access information and parameter value starts described configuration information management unit 13.Wherein, described configuration file table can be XML format.
When user selects parameter item and the parameter value changing " Authority Verification " access information, described second configuration information arranges module and starts described configuration information management unit 13 by according to the parameter item of " Authority Verification " access information after change and parameter value, to safeguard the Authority Verification of all application programs with group.
Preferably, in order to allow the lightweight as far as possible in described embedded device 1 of described configuration information setting unit 12, described configuration information setting unit 12 preserves the access information corresponding to path of application program, each parameter item and parameter value thereof with binary file layout.
Such as, described configuration file table preserves access information, each parameter item and parameter value thereof with [Entry] Parameter=Value kind form.Wherein, [Entry] corresponding access information, the corresponding parameter item of Parameter, the corresponding parameter value of Value.
[global]
workgroup =mygroup
passdb backend =smbpasswd
security =user
In another preferred version, described configuration information setting unit 12 also for providing the option of parameter value of increase, amendment and the access information deleted corresponding to application program and each parameter item thereof in described webpage, and based on the selection of described user, the parameter value of the corresponding access information corresponding to application program that increases, upgrade and delete in described configuration file table and each parameter item thereof.
Particularly, the centralized management that described configuration information setting unit 12 divides into groups to each application program according to access information, then described configuration information setting unit 12 not only can carry out additions and deletions to the parameter item of application program in every group and corresponding parameter value and changes, and the parameter item corresponding to access information, parameter value are carried out to additions and deletions and change.Therefore, in described webpage, provide the button or link that enter respective page.Corresponding, described configuration information setting unit 12 changes operation according to the additions and deletions of user in described webpage, and corresponding additions and deletions change each information in configuration file table.
Described configuration information management unit 13 is managed for configuration for the application program found corresponding interface routine according to described configuration file table and arrange for user.
Particularly, after described embedded device 1 starts, described configuration information management unit 13 reads described configuration file table, the access information of corresponding each destination application is read from described configuration file table, and according to each interface routine preset and access information, determine the interface routine corresponding to read access information, and corresponding parameter value is substituted in determined interface routine, described destination application is carried out to the configuration managements such as authority.
For the configuration file table of above-mentioned " global ", described configuration information management unit 13 starts the interface routine of access information corresponding to global, and each application program that name is mygroup, user object is user of dividing into groups is carried out login password authentication by interface routine described in instruction, wherein, authentication password is smbsamba.
And for example, comprise in described configuration file table:
[media] (// note: virtual share directory name)
path =/media
writeable =no
browseable =yes
valid users =admin
write list =admin
guest ok =no
Then described configuration information management unit 13 is that the rights parameters item of each file sets under the share directory of the application program of media to belonging to access information, and the interface routine starting corresponding described media access information is safeguarded.
In sum, the method of configuring application program of the present invention and the embedded device that is suitable for, by the default interface routine for configuring application program and corresponding access information, and configuration file table, unified, break-even configuration feature can be provided for the application program be arranged in embedded device, effectively achieve the simplifying of embedded device, basic demand fast; In addition, provided the interface of the configuration information that application program is set to user by webpage, effectively simplified the part of the read-write configuration file in the Configuration Framework be applied on PC, effectively can also configure custom feature for user provides; Further, application programs adopts the mode of packet configuration, can allow and need the interface of identical configuration feature to escort for multiple application program simultaneously, avoid same-interface program and repeatedly called, and decreases resource occupation when interface routine runs; In addition, configuration file table is arranged with binary file layout, can fast resolving, turn avoid the complicated analysis program installed in embedded device as XML parser, furthermore achieved that simplify, the demand of Effec-tive Function.So the present invention effectively overcomes various shortcoming of the prior art and tool high industrial utilization.
Above-described embodiment is illustrative principle of the present invention and effect thereof only, but not for limiting the present invention.Any person skilled in the art scholar all without prejudice under spirit of the present invention and category, can modify above-described embodiment or changes.Therefore, such as have in art usually know the knowledgeable do not depart from complete under disclosed spirit and technological thought all equivalence modify or change, must be contained by claim of the present invention.