The content of the invention
In view of the above the shortcomings that prior art, it is an object of the invention to provide a kind of method for configuring application program
And the embedded device being applicable, uniformly it can not be configured for solving embedded device in the prior art for application program
The problem of.
In order to achieve the above objects and other related objects, the present invention provides a kind of method for configuring application program, for embedding
Enter formula equipment, including:Preset the interface routine and corresponding access information and the access information for configuring application program
Corresponding parameter item;Provide a user a webpage, to input access information corresponding to application program to be placed and its
The parameter value of each parameter item, and the parameter in the path for the application program that the webpage is provided, access information and its each parameter item
Value is preserved into configuration file table;The application program for finding corresponding interface routine according to the configuration file table to set for user
It is managed for configuration.
Preferably, it is described to provide a user a webpage, to input the access information corresponding to application program to be placed
And its mode of the parameter value of each parameter item includes:Increase, modification are provided in the webpage and deleted corresponding to application program
Access information and its each parameter item parameter value option, and based on the selection of the user, corresponding increase, renewal and delete
Except the access information and its parameter value of each parameter item corresponding to the application program in the configuration file table.
Preferably, it is described to provide a user a webpage, to input the access information of application program to be placed and its each
The mode of the parameter value of parameter item includes:Each application program configured is grouped according to the access information, and according to
The packet provides the webpage of configuration application program;According to the parameter item in the grouping information, the offer pair in the webpage
Answer the parameter item option of packet options.
Preferably, the parameter item includes following at least one:Authority Verification parameter item, access right parameter item.
Preferably, the configuration file table is the binary comprising access information, corresponding each parameter item and its parameter value
File format.
Based on above-mentioned purpose, the present invention also provides a kind of embedded device, including:Default unit, it is used to match somebody with somebody for presetting
Put the interface routine and corresponding access information and the parameter item corresponding to the access information of application program;Configuration information
Setting unit, for providing a user a webpage, to input access information corresponding to application program to be placed and its each
The parameter value of parameter item, and the parameter value in the path for the application program that the webpage is provided, access information and its each parameter item
Preserve into configuration file table;Configuration information management unit, for according to the configuration file table find corresponding interface routine come
The application program set for user is managed for configuration.
Preferably, the configuration information setting unit is used to provide increase, modification in the webpage and delete to apply journey
The option of the parameter value of access information and its each parameter item corresponding to sequence, and based on the selection of the user, it is corresponding to increase, more
Newly and delete the parameter value of the access information and its each parameter item corresponding to application program in the configuration file table.
Preferably, the configuration information setting unit includes:First configuration information setup module, for according to the entrance
Information is grouped to each application program configured, and the webpage of configuration application program is provided according to the packet;Second matches somebody with somebody
Confidence ceases setup module, for according to the parameter item in the access information, being provided in the webpage and configuring same packet
Parameter item option.
Preferably, the parameter item includes following at least one:Authority Verification parameter item, access right parameter item.
Preferably, the configuration file table is the binary comprising access information, corresponding each parameter item and its parameter value
File format.
As described above, the method for the configuration application program of the present invention and the embedded device being applicable, have beneficial below
Effect:It is used to configure the interface routine of application program and corresponding access information, and configuration file table by default, can
Unified, irredundant configuration feature is provided for the application program in embedded device, effectively realizes embedded set
It is standby simplify, quick basic demand;In addition, the boundary for the configuration information that application program is set is provided a user by webpage
Face, the part of the read-write configuration file in the Configuration Framework applied on PC is effectively simplified, moreover it is possible to provide the user effectively
Configuration custom feature.
Embodiment
Illustrate embodiments of the present invention below by way of specific instantiation, those skilled in the art can be by this specification
Disclosed content understands other advantages and effect of the present invention easily.The present invention can also pass through specific realities different in addition
The mode of applying is embodied or practiced, the various details in this specification can also be based on different viewpoints with application, without departing from
Various modifications or alterations are carried out under the spirit of the present invention.
As shown in figure 1, the present invention provides a kind of method for configuring application program.The collocation method is mainly by configuration system
To perform.The configuration system is arranged in embedded device.Multiple application programs can be run in the embedded device, respectively
The authority of application program, running environment etc. can be configured and safeguarded by the configuration system.The embedded device include but
It is not limited to:The network access equipments such as router.
In step sl, the configuration systemic presupposition is used to configure the interface routine of application program and enters message accordingly
Parameter item corresponding to breath and the access information.
Specifically, the interface routine includes but is not limited to:Interface routine based on the configuration feature in SAMBA, make by oneself
Interface routine of justice etc..The access information can correspond to multiple interface routines under a path, the parameter in each interface routine
With the access information corresponding to parameter item it is corresponding.The path of above-mentioned interface routine and the corresponding relation of access information and
The corresponding relation of parameter and parameter item in interface routine can be stored in described embedding by designer in the form of allocation list in advance
Enter in formula equipment.
For example, the allocation list is A.conf files, the rule therein that defines is 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 authorities
#define SMB_WRITELIST_OK " write list " // can write permission user list
When user needs to configure installed in the application program of embedded device, the configuration system performs step S2.
In step s 2, the configuration system provides a user a webpage, right to input application program to be placed
The access information and its parameter value of each parameter item answered, and the path for the application program that the webpage is provided, access information and
The parameter value of its each parameter item is preserved into configuration file table.
Specifically, the configuration system provides the user a webpage, is provided with the webpage to be placed to what is inputted
Application program corresponding to access information and its each parameter item.User can be generated by inputting the parameter value of each parameter item
The configuration file table of corresponding application program.
In order to distribute file table rationally, it is easy to unified management of the configuration file table to application program.The step S2 includes:
Step S2 and S22.(being unillustrated)
In the step s 21, the configuration system is grouped according to the access information to each application program configured,
And the access information option for configuring application program is provided in the webpage according to described be grouped in.
In step S22, the configuration system is used for according to the parameter item in the access information, is carried in the webpage
Parameter item option for configuring same packet.
For example, the path inputting interface of application program is included in the webpage, and access information option.When user from
During the access information of middle selection " Authority Verification ", the configuration system adds the application path according to default form
In the access information packet of " Authority Verification ", and belonged to " Authority Verification " according to what is preserved in the configuration file table
Parameter item and parameter value in the packet of access information perform step S3.Wherein, the configuration file table can be XML format.
When user selects the parameter item and parameter value of change " Authority Verification " access information, the configuration system is by basis
The parameter item and parameter value of " Authority Verification " access information after change performs step S3, to safeguard all applications with group
The Authority Verification of program.
Preferably, in order to allow the configuration system in the embedded device try one's best lightweight, the configuration system with
Binary file format preserves access information, each parameter item and its parameter value corresponding to the path of application program.
For example, the configuration file table preserves access information, each parameter in the form of [Entry] Parameter=Value kinds
Item and its parameter value.Wherein, [Entry] corresponding access information, Parameter correspond to parameter item, and Value corresponds to parameter value.
[global]
Workgroup=mygroup
Passdb backend=smbpasswd
Security=user
In another preferred scheme, the configuration system provides increase, modification in the webpage and deletes application program institute
The option of the parameter value of corresponding access information and its each parameter item, and based on the selection of the user, corresponding increase, renewal,
And access information and its parameter value of each parameter item corresponding to the application program in the deletion configuration file table.
Specifically, the centralized management that the configuration system is grouped according to access information to each application program, then it is 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 change, to access information
Corresponding parameter item, parameter value carry out additions and deletions and changed.Therefore, in the webpage, there is provided into the button or chain of respective page
Connect.Corresponding, the configuration system changes operation according to additions and deletions of the user in the webpage, and corresponding additions and deletions change in configuration file table
Each information.
In step s3, the configuration system finds corresponding interface routine to be set for user according to the configuration file table
The application program put is managed for configuration.
Specifically, after the embedded device starts, the configuration system reads the configuration file table, matches somebody with somebody from described
Put the access information that corresponding each destination application is read in file table, and according to default each interface routine and access information,
Determine the interface routine corresponding to read access information, and by corresponding parameter value substitute into determined by interface routine,
The configuration managements such as authority are carried out to the destination application.
By taking the configuration file table of above-mentioned " global " as an example, it is corresponding to global that the configuration system, which starts access information,
Interface routine, and instruct the interface routine to be grouped name is mygroup, each application program that user object is user enters
Row login password authentication, wherein, checking password is smbsamba.
And for example, included in the 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 the configuration system is to belonging to power of the access information for each file under the share directory of media application program
Limit parameter item is set, and starts the interface routines of the corresponding media access informations to be safeguarded.
As shown in Fig. 2 the present invention provides a kind of embedded device.Configuration system is included in the embedded device 1.Its
In, multiple application programs can be run in the embedded device 1, the authority of each application program, running environment etc. can be by described
Configuration system is configured and safeguarded.The embedded device 1 includes but is not limited to:The network access equipments such as router.
Here, comprising default unit 11 in the configuration system, for presetting the interface routine for configuring application program
And corresponding access information and the parameter item corresponding to the access information.
Specifically, the interface routine includes but is not limited to:Interface routine based on the configuration feature in SAMBA, make by oneself
Interface routine of justice etc..The access information can correspond to multiple interface routines under a path, the parameter in each interface routine
With the access information corresponding to parameter item it is corresponding.The path of above-mentioned interface routine and the corresponding relation of access information and
The corresponding relation of parameter and parameter item in interface routine can be stored in described pre- by designer in the form of allocation list in advance
If in unit 11.
For example, the allocation list is A.conf files, the rule therein that defines is 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 authorities
#define SMB_WRITELIST_OK " write list " // can write permission user list
When user needs to configure installed in the application program of embedded device 1, the configuration system also includes:With confidence
Cease setting unit 12 and configuration information management unit 13.
The configuration information setting unit 12 is used to provide a user a webpage, to input application program institute to be placed
The parameter value of corresponding access information and its each parameter item, and the path for the application program that the webpage is provided, access information
And its parameter value of each parameter item is preserved into configuration file table.
Specifically, the configuration information setting unit 12 provides the user a webpage, is provided with the webpage to defeated
The access information corresponding to application program to be placed and its each parameter item entered.User can be by inputting the ginseng of each parameter item
Numerical value corresponds to the configuration file table of application program to generate.
In order to distribute file table rationally, it is easy to unified management of the configuration file table to application program.The configuration information is set
Putting unit 12 includes:First configuration information setup module and the second configuration information setup module
The first configuration information setup module is used to carry out each application program configured according to the access information
Packet, and the access information option for configuring application program is provided in the webpage according to described be grouped in.
The second configuration information setup module is used for according to the parameter item in the access information, is carried in the webpage
Parameter item option for configuring same packet.
For example, the first configuration information setup module includes the path inputting interface of application program in the webpage,
And access information option.When user therefrom selects the access information of " Authority Verification ", first configuration information sets mould
During the access information of " Authority Verification " described in application path addition is grouped by block according to default form, and according to institute
State the parameter item in the packet for belonging to " Authority Verification " access information preserved in configuration file table and parameter value starts institute
State configuration information management unit 13.Wherein, the configuration file table can be XML format.
When user selects the parameter item and parameter value of change " Authority Verification " access information, second configuration information is set
Module is put by the parameter item according to " Authority Verification " access information after change and parameter value to start the configuration information management
Unit 13, to safeguard the Authority Verification of all application programs with group.
Preferably, in order to allow the configuration information setting unit 12 in the embedded device 1 try one's best lightweight, it is described
Configuration information setting unit 12 preserves access information, each parameter item corresponding to the path of application program with binary file format
And its parameter value.
For example, the configuration file table preserves access information, each parameter in the form of [Entry] Parameter=Value kinds
Item and its parameter value.Wherein, [Entry] corresponding access information, Parameter correspond to parameter item, and Value corresponds to parameter value.
[global]
Workgroup=mygroup
Passdb backend=smbpasswd
Security=user
In another preferred scheme, the configuration information setting unit 12, which is additionally operable to provide in the webpage, to be increased, changes,
And access information and its option of the parameter value of each parameter item corresponding to deletion application program, and based on the choosing of the user
Select, corresponding increase, update and delete the access information corresponding to the application program in the configuration file table and its each parameter item
Parameter value.
Specifically, the concentrate tube that the configuration information setting unit 12 is grouped according to access information to each application program
Reason, then the configuration information setting unit 12 can not only enter to the parameter item of application program in every group and corresponding parameter value
Row additions and deletions change, and carrying out additions and deletions to the parameter item corresponding to access information, parameter value changes.Therefore, in the webpage, there is provided enter
The button of respective page or link.It is corresponding, additions and deletions of the configuration information setting unit 12 according to user in the webpage
Change operation, corresponding additions and deletions change each information in configuration file table.
The configuration information management unit 13 be used for according to the configuration file table find corresponding interface routine come for
The application program that family is set is managed for configuration.
Specifically, after the embedded device 1 starts, the configuration information management unit 13 reads the configuration file
Table, the access information of corresponding each destination application is read from the configuration file table, and according to default each interface routine
And access information, it is determined that the interface routine corresponding to the access information read, and by determined by the substitution of corresponding parameter value
In interface routine, the configuration managements such as authority are carried out to the destination application.
By taking the configuration file table of above-mentioned " global " as an example, the configuration information management unit 13 starts access information and is
Interface routine corresponding to global, and instruct the interface routine will be grouped name be mygroup, user object be user's
Each application program carries out login password authentication, wherein, checking password is smbsamba.
And for example, included in the 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 the configuration information management unit 13 is to belonging under the share directory for the application program that access information is media
The rights parameters item of each file is set, and starts the interface routines of the corresponding media access informations to be safeguarded.
In summary, the method for configuration application program of the invention and the embedded device being applicable, pass through default use
Interface routine and corresponding access information in configuration application program, and configuration file table, can be to be set installed in embedded
Application program in standby provides unified, irredundant configuration feature, effectively realizes the simplifying of embedded device, quick base
This requirement;In addition, providing a user the interface for the configuration information for setting application program by webpage, effectively simplify and applied
The part of read-write configuration file in Configuration Framework on PC, moreover it is possible to provide the user effective configuration custom feature;Also
Have, to application program by the way of packet configuration, can allow needs the interface for similarly configuring function while apply journey to be multiple
Sequence escorts, and avoids same-interface program and is repeatedly called, and reduces resource occupation during interface routine operation;In addition,
Configuration file table is configured with binary file format, can fast resolving, turn avoid in embedded device installation such as XML
The complicated analysis program of resolver, furthermore achieved that simplify, the demand of Effec-tive Function.So the present invention effectively overcomes now
There is the various shortcoming in technology and have high industrial utilization.
The above-described embodiments merely illustrate the principles and effects of the present invention, not for the limitation present invention.It is any ripe
Know the personage of this technology all can carry out modifications and changes under the spirit and scope without prejudice to the present invention to above-described embodiment.Cause
This, those of ordinary skill in the art is complete without departing from disclosed spirit and institute under technological thought such as
Into all equivalent modifications or change, should by the present invention claim be covered.