[summary of the invention]
the technical problem to be solved in the present invention is, while for the above-mentioned method for supervising when equipment of prior art, changing, embodying application and the structure division of the software of described method for supervising need to write again, hardware interface need to again be developed and can't be multi-functional by unified software desk Implementation, the unified management defect of many interface platforms, while providing a kind of method for supervising when equipment to change, do not need again to write application and the structure division of software, do not need again to develop hardware interface and can pass through unified software desk Implementation multi-functional, the collocation method of the embedded system of the unified management of many interface platforms and device.
The technical solution adopted for the present invention to solve the technical problems is: the collocation method of a kind of embedded system of structure comprises the steps:
A) data set is set, the parameter that system is related to deposits described data centralization in;
B) in described data centralization, described parameter is described;
C) data configuration file is set, the parameter that this configuration needs is put into described configuration file;
D), by reading the parameter in described configuration file, access the parametric description of described data centralization, and configure this parameter, realize the configuration of embedded system.
In embedded system of the present invention in the method for supervising of parameter, described steps A) parameter in comprises the monitoring parameter of embedded system and/or controls parameter.
In the collocation method of embedded system of the present invention, described step B) by the inherent feature of described each data, described data are described in.
In the collocation method of embedded system of the present invention, described inherent feature comprises a plurality of parameter items, and described parameter item comprises: parameter name, parameter type, parameter values, the definition of parameter physical interface, parametric technique interface definition are or/and the next node position.
At the collocation method of embedded system of the present invention, a plurality of parameter items of a parameter join end to end and form the argument structure body of this parameter, and the argument structure body of a plurality of parameters joins end to end and forms described data set.
In the collocation method of embedded system of the present invention, described step C) comprise the parameter name of needs configuration is added in described configuration file or deleted and do not need the parameter name that configures from described configuration file.
In the collocation method of embedded system of the present invention, described step D) further comprise:
D1) determine the position of the parameter that will search in described data centralization by adopting hashing algorithm to search parameter name;
D2) extract the particular content of each parameter item in this parameter;
D3) carry out respective handling according to the particular content of each parameter item.
In the collocation method of embedded system of the present invention, described step D2) further comprise the steps:
D21) extract the rear rear physical detection address that is obtained described parameter by described parameter configuration files of physical interface definition that obtains the physical control address of described parameter or extract described parameter by described parameter configuration files of physical interface definition of described parameter;
D22) obtain the function interface of this parametric technique by described parameter configuration files after the method interface definition of the described parameter of extraction, thereby obtain the particular content of its control method or detection method.
In the collocation method of embedded system of the present invention, described step D3) respective handling described in comprises: the physical address that the data after described control method is processed is sent to described parameter is exported or the information on the physical address of described parameter is sent to the corresponding interface after the method computing after testing.
The present invention has also disclosed a kind of device of the collocation method be used to realizing above-mentioned embedded system, comprise the primary module of realizing systemic-function, it is characterized in that, parameter configuration module and parameter of also comprise the parametric description module of describing these all parameter characteristics of system, being provided with this configuration desired parameters of this system are searched module, and described parameter configuration module is searched module by described parameter and is connected on described parametric description module; Described parameter is searched module for providing logical channel between described primary module and described parameter configuration module, and described parameter configuration module is searched module by described parameter and obtained the described specific descriptions of configuration parameter that need by described parametric description module and offer described primary module to complete configuration.
implement collocation method and the device of embedded system of the present invention, has following beneficial effect: because system is not that pattern by direct access obtains the parameter that it need to be controlled or monitor, but by parameter name in parameter configuration files, can obtain the parameter item particular location of data centralization relevant parameter and read its value, thereby when the method for supervising of equipment changes, do not need again to write application and the structure division of software, do not need again to develop hardware interface only need change configuration file namely can be multi-functional by unified software desk Implementation, the unified management of many interface platforms.
[embodiment]
In an embodiment of the present invention, before realizing the configuration of embedded system, at first to set up the data set of describing all parameters that native system relates to and set up according to demand parameter configuration files.
As shown in Figure 1, in collocation method first embodiment of embedded system of the present invention, comprise the steps:
S11 sets up blank data set: the data set of setting up a blank in system, this document is as a matrix, makes the user parameter related in system and pointer value or the function interface describing the value of the necessary parameter item of this parameter or point to this parameter item can be inputted and be stored in this document.
The S12 parameter that native system is related is input to above-mentioned data centralization: all parameters related in native system are input in above-mentioned document data set; At this moment, data centralization may only have parameter and not have for the design parameter item of describing this parameter.
S13 is according to the inherent feature of each parameter, add or revise the parameter item content of parameter: the numerous types of the parameter that relates to due to system, and each parameter has respectively the characteristics of himself, so describing the design parameter item of each parameter may be different, after the parameter input, the user also may increase and decrease or the design parameter item of characterising parameter is increased and decreased or revises parameter, so in this step, the design parameter item that to describe respectively a certain parameter is grouped into below its described parameter, and can add or revise.Take the structure of above-mentioned frame-type, make above-mentioned data set set up more neatly and to revise.
S14 arranges parameter and the parameter item thereof of described data centralization, obtain complete data set: in this step, emphasis is to set up complete data set, due to the difference between parameter, the data volume of its description can not be identical, so after description is completed, need to arrange above-mentioned parameter, it is joined end to end, be convenient to call and search.In the present embodiment, data centralization has comprised the related parameter of all native systems.Wherein, parameter is described by a plurality of parameter items that represent its inherent feature, and this parameter item arranges in a certain way, obtains changing the argument structure body of parameter; Also arrange in a certain way between the argument structure body of a plurality of parameters and obtain above-mentioned data set.Fig. 2 shows parameter item arrangement mode in the argument structure body of single parameter, and Fig. 3 shows the arrangement mode between its argument structure body between a plurality of parameters, i.e. arrangement mode between a plurality of parameters; In Fig. 2, the parameter item of single parameter comprises: parameter name, parameter type, parameter values, the definition of parameter physical interface, parametric technique interface definition and next node position; The parameter item of above-mentioned single parameter, by the data length of stipulating in advance, joins end to end, and forms the argument structure body of this parameter; And in Fig. 3, arrange according to the mode of Fig. 2 equally between the parameter item of each parameter, obtain its argument structure body separately, and also join end to end between its argument structure body, namely above-mentioned data set has formed a chained list in the present embodiment.Wherein, last single parameter of this chained list is not pointed out the position of next chained list node, and means without next node.
After having set up a complete parameter set, also need to set up a configuration file, this Profile Description in current configuration needed parameter, parameter at this configuration file all can find in above-mentioned data centralization, but the parameter of above-mentioned data centralization not necessarily is included in this configuration file, those are not included in configuration file and are input to the parameter of data set, may be to be input in advance data centralization, but have not used now or prepared to use in the future.As total A1, A2, N the parameters such as A3, A4......An in parameter configuration files, now only need A1, A3, A4 just can satisfy the demands, only need while therefore setting up configuration file needed parameter name is configured into configuration file or with the deletion of the parameter name in above-mentioned configuration file and gets final product.
After the foundation of completing the data set shown in Fig. 1 and configuration file, just can carry out system configuration, wherein most step is identical with step of the prior art, but difference is arranged also, search parameter and to its process of processing, it comprises the steps: in above-mentioned data centralization shown in Fig. 4
S41 determines parameter to be detected: system is by obtaining the parameter to be detected that will configure in described configuration file, searching and detecting and make target for next step.
S42 retrieve data collection, determine the reference position of this parameter: in this step, system obtains the parameter name of parameter according to step S41, be parameter I D, search the residing position of this parameter in above-mentioned data centralization, this position refers to the argument structure body that is comprised of a plurality of parameter items reference position in described data centralization; Simultaneously, in the present embodiment, be to use the parameter I D of this parameter by hashing algorithm to find this argument structure body in the position of described data centralization as the search target.For example, need query argument A1, by the parameter I D in the parameter item take parameter A 1, be the search target, adopt the HASH algorithm to search in data centralization, the reference position in described data centralization of pointed parameter A 1.
S43 determines the position of each parameter item in this argument structure body: obtain the reference position of argument structure body in step S42 after,, according to the Rankine-Hugoniot relations of the parameter item of prior setting and the data length of each parameter item, can calculate the particular location of certain parameter item of this parameter to be detected.So can obtain one by one the position of each parameter item in this parameter.
S44 obtains the physical interface address of this parameter: in the present embodiment, in the argument structure body, the particular content of this parameter physical interface address is placed in the physical interface address.In this step, by the physical interface address of this parameter that obtains in step S43.
S45 carries out and detects interface method: in the present embodiment, what deposit in the address of the detection interface method of this parameter in the argument structure body is the function interface of this detection method.In this step,, by the function interface of the detection interface method in this argument structure body that obtains in step S43, by this function interface, call its corresponding detection method function, complete the detection of this parameter.For example, if A3 is a parameter that need to detect, by above-mentioned steps, extract the detection method of A3, after the information of the physical address reaction of the A3 that obtains by step S44 is carried out the algorithm computing of detection method, be sent to CPU carry out computing or preserve after leave other algorithms for and use.
The parameter that S46 need to detect? judge whether the parameter that need to detect, in this way, return to execution step S41, as no, execution step S47; After executing the algorithm of parameter current, inquire about the next node parameter item in current parameter, as also having thereafter the argument structure body, continue the detection of parameter, after for example parameter A 3 executed algorithm, after showing, a node was parameter A 4, enter parameter A 4, carry out the processing of A4 parameter; If the subsequent node of parameter A 3 is empty, represent that current retrieval is complete, withdraw from this time retrieval.
S47 finishes: finish the configuration of this detected parameters.
In steps, i.e. step S11-S14 and step S41-S47, form in the embedded system of the first embodiment of the present invention collocation method to detected parameters for above-mentioned institute.
The second embodiment of the present invention has disclosed in the embedded system controlling the collocation method of parameter, in the second embodiment of the present invention, the method for building up of its parameter configuration files and data set is identical with the first embodiment, and when system configuration parameter search with treatment step in slightly different.
As shown in Figure 5, the parameter of second embodiment of the invention is searched and is processed and comprises the steps:
S51 determines parameter to be controlled: system determines by obtaining the parameter that will control that will configure in described configuration file, searching and controlling and make target for next step.
S52 retrieve data collection, determine this parameter reference position: in this step, system is made the parameter name of parameter according to step S51, be parameter I D, search the residing position of this parameter in above-mentioned data centralization, this position refers to the argument structure body that is comprised of a plurality of parameter items reference position in described data centralization; Simultaneously, in the present embodiment, be to use the parameter I D of this parameter by hashing algorithm to find this argument structure body in the position of described data centralization as the search target.For example, need query argument A0, by the parameter I D in the parameter item take parameter A 0, be the search target, adopt the HASH algorithm to search in data centralization, the reference position in described data centralization of pointed parameter A 0.
S53 determines the position of each parameter item in this argument structure body: obtain the reference position of argument structure body in step S52 after,, according to the Rankine-Hugoniot relations of the parameter item of prior setting and the data length of each parameter item, can calculate the position of certain parameter item of this parameter to be detected.So can obtain one by one the position of each parameter item in this parameter.
S54 obtains the physical interface address of this parameter: in this step, and by the position of the physical interface address of this argument structure body that obtains in step S53, by wherein taking out the physical interface address of this actual parameter.
S55 carries out the control interface method: in the present embodiment, what deposit in the control interface method parameter item of data centralization parameter is the function interface of this control method.In this step,, by the address of the definition of the control interface method in this argument structure body that obtains in step S53,, by wherein taking out above-mentioned function interface, by this function interface, call its corresponding control method function, complete the control of this parameter.For example, establishing A2 is the parameter that need to control,, by the control method of above-mentioned steps extracting parameter A2, after carrying out computing, is sent to the physical address of the A2 that obtains by step S54.
The parameter that S56 need to control? judge whether the parameter that need to control, in this way, return to execution step S51, as no, execution step S57; After executing the algorithm of parameter current, inquire about the next node parameter item in current argument structure body,, as also having thereafter parameter, continue, after for example parameter A 2 executed algorithm, after showing, a node was parameter A 5, enters parameter A 5, carries out the processing of A5 parameter; If the subsequent node of parameter A 2 is empty, represent that current retrieval is complete, withdraw from this time retrieval.
S57 finishes: finish this and control the configuration of parameter.
By the first embodiment of the present invention and the second embodiment are described as can be known, in the above-described embodiments, need to increase when for different type of machines or while delete parameter, need not revise source code, only need the described data set of modification to get final product; When the parameter change of needs configurations, need not revise source code equally, only need to re-establish parameter configuration files and get final product.
The present invention has also disclosed a kind of device of realizing parameter monitoring method in embedded system, as shown in Figure 6, realize in the embodiment of the device of parameter monitoring method in embedded system at this, this device comprises that primary module 61, parameter search module 62, parameter configuration module 63 and parametric description module 64, wherein, primary module 61 is used for the function of completion system, as the main control module of system, exists; Preserve the parameter name that needs configuration in parameter configuration module 63, parametric description module 64 comprises the description of all parameters that native system is related, wherein, the description of each parameter forms by a plurality of parameter items, the parameter item that belongs to same parameter all concentrates in together, and is kept in the scope of this parameter; Parameter is searched module 62 and is used for providing logical channel between above-mentioned parameter describing module 64 and parameter configuration module 63, when parameter configuration module 63 provides certain search condition, parameter is searched module 62 under the restriction of above-mentioned search condition, search in above-mentioned parametric description module 64, the parameter that finds its search condition to limit, and these parameters are offered primary module 61, be used for this embedded system of configuration.In the present embodiment, parametric description module 64 has comprised the whole parameters in parameter configuration module 63, and be index with the parameter project of these parameters respectively, make parameter search module 62 and can obtain the content of the parameter item that needs under the search condition restriction of parameter configuration module 63 in parametric description module 64.Like this, these content of parameter can be provided to described primary module 61 and complete the configuration of embedded system.
The above embodiment has only expressed several embodiment of the present invention, and it describes comparatively concrete and detailed, but can not therefore be interpreted as the restriction to the scope of the claims of the present invention.Should be pointed out that for the person of ordinary skill of the art, without departing from the inventive concept of the premise, can also make some distortion and improvement, these all belong to protection scope of the present invention.Therefore, the protection domain of patent of the present invention should be as the criterion with claims.