Parameter configuration method, device, equipment, medium and product
By preconfiguring security constraints and logical addresses in the parameter configuration file, the problem of the instability of the existing technology to be compatible with more application scenarios and system instability is solved, and a safer and more stable parameter configuration is achieved.
Patent Information
- Application Number
- CN202411866606.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-17
- Publication Date
- 2025-03-25
AI Technical Summary
The prior art is not compatible with more application scenarios to implement the configuration of system parameters, and it is easy to cause system instability when modifying the parameters corresponding to the configuration information.
By preconfiguring security constraints in the parameter configuration file, security constraints are imposed on the configuration behavior of parameters, and logical addresses are introduced to weaken the direct relationship between parameters and configuration information, so as to modify the parameters corresponding to the configuration information only when the corresponding relationship between parameters and logical addresses is only required.
It realizes compatible parameter configuration in more application scenarios, improves the security of parameter configuration, and solves the problem that directly modifying parameter configuration files can easily lead to system instability.
Smart Images

Figure CN119690505A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of parameter configuration, and in particular to a parameter configuration method, device, equipment, medium and product. Background Art
[0002] In the embedded field, configuring system functions by loading parameters has become the mainstream, with the purpose of improving the versatility of software. However, with the emergence of this configuration mode, parameter support for configurability has also become a rigid requirement of the system. The existing technology generally requires the use of a specified method (such as a matching host computer or communication interface, communication method, etc.) to configure system parameters. The reason is that the specified method is pre-configured with an authentication module. For example, the customer first enters the user name and password through the matching host computer, and then configures the system parameters after the authentication module authenticates the user name and password. However, the customer may not be able to use the specified method to configure the system parameters due to constraints such as the on-site installation form and the customer system topology design.
[0003] Furthermore, the prior art generally configures parameters and corresponding configuration information directly in the parameter configuration file, but this will cause strong coupling between the parameters and the configuration information. At this time, if you want to modify the parameters corresponding to the configuration information, you need to modify the parameter configuration file accordingly. The system operation depends on the parameter configuration file, and multiple modifications can easily lead to system instability.
[0004] Therefore, in the process of implementing the present invention, the inventors found that the prior art has at least the following problems: 1. The prior art is not compatible with more application scenarios to realize the configuration of system parameters; 2. The prior art needs to modify the parameter configuration file when modifying the parameters corresponding to the configuration information, which easily leads to system instability. Summary of the invention
[0005] In view of this, the purpose of the present invention is to provide a parameter configuration method, device, equipment, medium and product, which can use the security constraints pre-configured in the parameter configuration file to make security constraints on the configuration behavior of the parameters, so as to be compatible with more application scenarios; and introduce logical addresses to weaken the direct relationship between parameters and configuration information, so that the parameters corresponding to the configuration information can be modified by only modifying the corresponding relationship between the parameters and the logical addresses. The specific scheme is as follows:
[0006] In a first aspect, the present application provides a parameter configuration method, comprising:
[0007] Get the parameter configuration request initiated for the target parameter;
[0008] Determine the security constraint condition corresponding to the target logical address from the current parameter configuration file; the target logical address is the logical address corresponding to the target parameter;
[0009] Based on the parameter configuration request that satisfies the security constraint condition, the attribute information corresponding to the target logical address in the current parameter configuration file is configured to update the current parameter configuration file.
[0010] Optionally, before determining the security constraint condition corresponding to the target logical address from the current parameter configuration file, the method further includes:
[0011] Determine the physical memory address corresponding to the target parameter from a preset memory distribution table;
[0012] The target logical address corresponding to the physical memory address is determined based on a preset mapping relationship.
[0013] Optionally, the security constraint condition includes a first constraint condition and / or a second constraint condition;
[0014] The first constraint condition is that the parameter value to be configured corresponding to the parameter configuration request is within a preset parameter value range; the second constraint condition is that the access permission level corresponding to the parameter configuration request reaches the preset access permission level.
[0015] Optionally, before determining the security constraint condition corresponding to the target logical address from the current parameter configuration file, the method further includes:
[0016] determining the original parameter profile as the current parameter profile;
[0017] or, determining the current parameter configuration file based on a backup file of the original parameter configuration file;
[0018] The original parameter configuration file is a file pre-stored in a preset system, and at least one set of configuration information is pre-configured in the original parameter configuration file, and each set of configuration information includes a logical address corresponding to a parameter and corresponding attribute information and security constraints.
[0019] Optionally, the parameter configuration method further includes:
[0020] When the current parameter configuration file is determined based on the backup file of the original parameter configuration file, the original parameter configuration file and the current parameter configuration file are respectively stored in different storage areas in the preset system.
[0021] Optionally, determining the current parameter configuration file based on the backup file of the original parameter configuration file includes:
[0022] Determining target group configuration information from an original parameter configuration file according to the attribute information; wherein the attribute information includes parameter preservation attributes;
[0023] The target group configuration information is backed up to obtain a backup file, and a current parameter configuration file is determined based on the backup file.
[0024] Optionally, after updating the current parameter configuration file, the method further includes:
[0025] The preset system is controlled to continue to operate based on the updated current parameter configuration file.
[0026] Optionally, the parameter configuration method further includes:
[0027] When the preset system is started for the first time, controlling the preset system to start running based on the original parameter configuration file;
[0028] When the preset system is powered off and restarted, the preset system is controlled to start running based on the latest current parameter configuration file.
[0029] Optionally, the parameter configuration method further includes:
[0030] If the original parameter configuration file is updated, the preset system is controlled to re-run based on the updated original parameter configuration file, and the current parameter configuration file is re-determined based on the updated original parameter configuration file.
[0031] Optionally, the updating of the original parameter configuration file includes performing a target update operation on the attribute information and / or security constraint conditions; the target update operation is any one or more of adding, deleting and modifying.
[0032] In a second aspect, the present application provides a parameter configuration device, including:
[0033] A request acquisition module is used to obtain parameter configuration requests initiated for target parameters;
[0034] A constraint determination module, used to determine the security constraint corresponding to the target logical address from the current parameter configuration file; the target logical address is the logical address corresponding to the target parameter;
[0035] A parameter configuration module is used to configure the attribute information corresponding to the target logical address in the current parameter configuration file based on the parameter configuration request that meets the security constraint condition, so as to update the current parameter configuration file.
[0036] In a third aspect, the present application provides an electronic device, including:
[0037] Memory, used to store computer programs;
[0038] A processor is used to execute the computer program to implement the aforementioned parameter configuration method.
[0039] In a fourth aspect, the present application provides a computer-readable storage medium for storing a computer program, wherein the computer program implements the aforementioned parameter configuration method when executed by a processor.
[0040] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which implements the aforementioned parameter configuration method when executed by a processor.
[0041] In this application, a parameter configuration request initiated for a target parameter is obtained; the security constraints corresponding to the target logical address are determined from the current parameter configuration file; the target logical address is the logical address corresponding to the target parameter; based on the parameter configuration request that satisfies the security constraints, the attribute information corresponding to the target logical address in the current parameter configuration file is configured to update the current parameter configuration file.
[0042] It can be seen that the present application pre-configures the security constraint conditions in the parameter configuration file, so that when the parameter configuration request is obtained, the parameter configuration request is verified by the security constraint conditions, so as to make security constraints on the configuration behavior of the parameters by using the security constraint conditions, so as to be compatible with more application scenarios, which not only improves the security of the parameter configuration, but also supports parameter configuration in more application scenarios. In addition, the present application associates the parameters with the logical addresses, and pre-configures the logical addresses corresponding to the parameters and the corresponding attribute information and security constraint conditions in the parameter configuration file, so as to perform parameter configuration according to the relationship between the parameters and the logical addresses, and between the logical addresses and the attribute information and the security constraint conditions. Compared with the prior art, the present application does not need to directly couple the parameters and the configuration information in the parameter configuration file, and weakens the direct relationship between the parameters and the configuration information, so as to achieve the modification of the parameters corresponding to the configuration information when only the corresponding relationship between the parameters and the logical addresses needs to be modified, and solves the problem that the direct modification of the parameter configuration file easily leads to system instability. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0044] Figure 1 A flow chart of a parameter configuration method disclosed in this application;
[0045] Figure 2 A schematic diagram of a parameter configuration file disclosed in this application;
[0046] Figure 3 A schematic diagram of mapping a memory distribution table and a parameter configuration file disclosed in this application;
[0047] Figure 4 A specific parameter configuration flow chart disclosed in this application;
[0048] Figure 5 This is a schematic diagram of the structure of a parameter configuration device disclosed in this application;
[0049] Figure 6 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0051] In the process of implementing the present invention, the inventors found that the prior art has at least the following problems: 1. The prior art is not compatible with more application scenarios to realize the configuration of system parameters; 2. The prior art needs to modify the parameter configuration file when modifying the parameters corresponding to the configuration information, which easily leads to system instability. To this end, the present application provides a parameter configuration method, which makes security constraints on the configuration behavior of the parameters by utilizing the security constraints pre-configured in the parameter configuration file, so as to be compatible with more application scenarios; and introduces logical addresses to weaken the direct relationship between parameters and configuration information, so that the modification of the parameters corresponding to the configuration information is realized when only the corresponding relationship between the parameters and the logical addresses needs to be modified, thereby improving the stability of the system.
[0052] See also Figure 1 As shown, an embodiment of the present invention discloses a parameter configuration method, including:
[0053] Step S11: Obtain a parameter configuration request initiated for a target parameter.
[0054] In this embodiment, during the operation of the preset system, a parameter configuration request initiated for the target parameter is obtained through the preset system. The preset system can obtain the parameter configuration request sent by the host computer or communication interface supporting the preset system, or the parameter configuration request sent by the external interface, which can be a customer-defined communication interface.
[0055] It should be noted that the application subject of the parameter configuration method proposed in this embodiment is a preset system. The preset system may be a computer system, such as an embedded system. In addition, in this embodiment, a parameter management system may be set in the preset system to respond to the parameter configuration request through the parameter management system, thereby realizing parameter configuration.
[0056] Step S12: Determine the security constraint condition corresponding to the target logical address from the current parameter configuration file; the target logical address is the logical address corresponding to the target parameter.
[0057] In this embodiment, before determining the security constraints corresponding to the target logical address from the current parameter configuration file, it is necessary to first determine the current parameter configuration file based on the original parameter configuration file. Then, when a parameter configuration request initiated for the target parameter is obtained, the corresponding security constraints can be determined from the current parameter configuration file based on the target logical address corresponding to the target parameter.
[0058] Among them, the original parameter configuration file is a file pre-stored in the preset system. The original parameter configuration file can support the initial startup and operation of the preset system, and when an abnormality occurs in the preset system, the preset system can be restored based on the original parameter configuration file to restore the parameters in the preset system to the default values.
[0059] Furthermore, at least one set of configuration information is pre-configured in the original parameter configuration file, and each set of configuration information includes a logical address corresponding to a parameter and attribute information and security constraints corresponding to the logical address. That is, the original parameter configuration file includes at least one set of configuration information based on the logical address, attribute information, and security constraints, wherein the logical address is a unique identifier for each set of configuration information in the original parameter configuration file, and different logical addresses correspond to different parameters.
[0060] Since the logical address corresponds to the parameter and the attribute information corresponds to the logical address, the attribute information corresponding to the logical address can also be understood as the attribute information corresponding to the parameter, that is, the attribute information represents the attribute information of the parameter. Moreover, different logical addresses correspond to different attribute information, which means that different parameters correspond to different attribute information.
[0061] The attribute information includes but is not limited to parameter type, parameter saving attribute and parameter default value; wherein, parameter type includes signed number (signed) and unsigned number (unsigned), for example, S16 represents a 16-bit signed number, and U32 represents a 32-bit unsigned number; parameter saving attributes include power-off saving, permanent saving and not saving.
[0062] Since the logical address corresponds to the parameter and the security constraint corresponds to the logical address, the security constraint corresponding to the logical address can also be understood as the security constraint corresponding to the parameter, that is, the security constraint represents the security constraint of the parameter. Moreover, different logical addresses correspond to different security constraints, which means that different parameters correspond to different security constraints.
[0063] The security constraints include but are not limited to the first constraint and the second constraint. The first constraint is that the value of the parameter to be configured corresponding to the parameter configuration request is within the preset parameter value range, that is, the preset parameter value range is used to constrain the configurable range of the parameter. If the value of the parameter to be configured corresponding to the parameter configuration request is not within the preset parameter value range, the default value of the parameter is not allowed to be modified. The second constraint is that the access permission level corresponding to the parameter configuration request reaches the preset access permission level, that is, the preset access permission level is used to constrain whether there is permission to configure the attribute information of the parameter. If the access permission level corresponding to the parameter configuration request does not reach the preset access permission level, it indicates that there is no permission to configure the attribute information of the parameter.
[0064] by Figure 2 Take the parameter configuration file shown as an example, the parameter configuration file includes three groups of configuration information. The first group of configuration information has a logical address of 0, a parameter type of S16 (16-bit signed number), a parameter saving attribute of power-off saving, a parameter default value of 100, a preset parameter value range of [0, 1000], and a preset access right level of level 1; the second group of configuration information has a logical address of 1, a parameter type of U16 (16-bit unsigned number), a parameter saving attribute of permanent saving, a parameter default value of 0, a preset parameter value range of [0, 2000], and a preset access right level of level 2; the third group of configuration information has a logical address of 2, a parameter type of U32 (32-bit unsigned number), a parameter saving attribute of not saving, a parameter default value of 300, a preset parameter value range of [0, 3000], and a preset access right level of level 3. Whether the access right level is level 1 < level 2 < level 3, or level 1 > level 2 > level 3, it can be set according to the system development requirements.
[0065] In this embodiment, for determining the current parameter configuration file based on the original parameter configuration file, one way is to determine the original parameter configuration file as the current parameter configuration file; another way is to determine the current parameter configuration file based on a backup file of the original parameter configuration file.
[0066] It should be noted that determining the original parameter configuration file as the current parameter configuration file can save a certain amount of storage space, while determining the current parameter configuration file based on the backup file of the original parameter configuration file can retain the original parameter configuration file so that the system can be restored based on the original parameter configuration file when an abnormality occurs in the preset system. Both methods support parameter configuration based on the current parameter configuration file, and use security constraints to impose security constraints on the configuration behavior of parameters, so as to be compatible with more application scenarios, improve the security of parameter configuration, and support parameter configuration in more application scenarios.
[0067] When the current parameter configuration file is determined based on the backup file of the original parameter configuration file, the original parameter configuration file and the current parameter configuration file are respectively stored in different storage areas in the preset system, that is, the original parameter configuration file and the current parameter configuration file are stored in different storage areas in the preset system. For example, the original parameter configuration file is stored in the first storage area in the preset system, and the current parameter configuration file determined based on the backup file of the original parameter configuration file is stored in the second storage area in the preset system.
[0068] When determining the original parameter configuration file as the current parameter configuration file, only one storage area is required, that is, the original parameter configuration file is stored in the first storage area in the preset system, and the original parameter configuration file stored in the first storage area is determined as the current parameter configuration file.
[0069] Specifically, in the process of determining the current parameter configuration file based on the backup file of the original parameter configuration file, it is necessary to first determine the target group configuration information from the original parameter configuration file based on the attribute information, back up the target group configuration information to obtain a backup file, and then determine the current parameter configuration file based on the backup file.
[0070] Exemplarily, the target group configuration information is determined from the original parameter configuration file according to the parameter preservation attribute; wherein the parameter preservation attribute can be any one or a combination of power-off preservation, permanent preservation, and non-preservation. Figure 2 For example, assuming that the target group configuration information is determined from the original parameter configuration file according to power-off preservation and permanent preservation, the target group configuration information at this time includes the first group configuration information and the second group configuration information.
[0071] Exemplarily, the target group configuration information is determined from the original parameter configuration file according to the parameter type; wherein the parameter type can be a signed number and / or an unsigned number. Figure 2 For example, assume that the target group configuration information is determined from the original parameter configuration file according to a signed number, and the target group configuration information at this time includes the first group configuration information.
[0072] Furthermore, before determining the security constraint corresponding to the target logical address from the current parameter configuration file, the present embodiment needs to determine the target logical address first. Specifically, after obtaining the parameter configuration request initiated for the target parameter, the parameter configuration request is parsed to obtain the target parameter and determine the target logical address corresponding to the target parameter.
[0073] More specifically, the physical memory address corresponding to the target parameter is first determined from the preset memory distribution table, and then the target logical address corresponding to the physical memory address is determined based on the preset mapping relationship. The preset memory distribution table is used to record the parameters corresponding to each physical memory address, that is, the preset memory distribution table records the specific parameter meaning of each physical memory address; the preset mapping relationship is used to record the mapping relationship between the physical memory address and the logical address; and the physical memory address in this embodiment can refer to either a physical memory address or a physical memory address segment composed of multiple physical memory addresses.
[0074] Considering that if the parameters and the corresponding configuration information are directly coupled together in the parameter configuration file, when modifying the parameters corresponding to the configuration information, the parameter configuration file must be modified accordingly, but the parameter configuration file is a file that supports the operation of the system, and multiple modifications are likely to cause system instability. Therefore, this embodiment uses the memory mapping principle to utilize the mapping relationship between the logical address and the physical memory address to weaken the strong coupling between the parameters and the configuration information, so that the parameters corresponding to the configuration information can be modified by only modifying the parameters corresponding to the physical memory address without modifying the parameter configuration file.
[0075] Specifically, this embodiment records the parameters corresponding to each physical memory address through a preset memory distribution table, and records the configuration information (attribute information and security constraints) corresponding to each logical address through a parameter configuration file, and the preset mapping relationship records the mapping relationship between the physical memory address and the logical address. Therefore, this embodiment only needs to modify the parameters corresponding to the physical memory address in the preset memory distribution table, that is, modify the specific parameter meaning of the physical memory address, and the parameters corresponding to the configuration information in the parameter configuration file can be modified through the preset mapping relationship.
[0076] like Figure 3 As shown, Figure 3The mapping diagram of the memory distribution table and the parameter configuration file is shown, wherein in the memory distribution table, the physical memory address 0x10000000-0x10000001 corresponds to the cooling set point, the physical memory address 0x10000002-0x10000003 corresponds to the accumulated running time, and the physical memory address 0x10000004-0x10000007 corresponds to the authentication tag. The parameter configuration file includes three groups of configuration information, the first group of configuration information includes logical address 0 and corresponding configuration information 0, the second group of configuration information includes logical address 1 and corresponding configuration information 1, and the third group of configuration information includes logical address 2 and corresponding configuration information 2. In the preset mapping relationship, physical memory address 0x10000000-0x10000001 corresponds to logical address 0, physical memory address 0x10000002-0x10000003 corresponds to logical address 1, and physical memory address 0x10000004-0x10000007 corresponds to logical address 2. At this time, configuration information 0 corresponds to the cooling set point, configuration information 1 corresponds to the accumulated running time, and configuration information 2 corresponds to the authentication tag.
[0077] If you want to change the parameters corresponding to configuration information 0 from the cooling set point to the heating set point, you only need to change the parameters corresponding to the physical memory address 0x10000000-0x10000001 from the cooling set point to the heating set point. At this time, since the physical memory address 0x10000000-0x10000001 corresponds to the logical address 0, and the logical address 0 corresponds to the configuration information 0, the modification of the parameters corresponding to the configuration information 0 can be completed by using the memory mapping principle.
[0078] Step S13: Based on the parameter configuration request that satisfies the security constraint condition, configure the attribute information corresponding to the target logical address in the current parameter configuration file to update the current parameter configuration file.
[0079] In this embodiment, after determining the security constraint corresponding to the target logical address from the current parameter configuration file, the parameter configuration request is verified using the security constraint to determine whether the parameter configuration request satisfies the security constraint. If the parameter configuration request does not satisfy the security constraint, the attribute information corresponding to the target logical address in the current parameter configuration file is not allowed to be configured. If the parameter configuration request satisfies the security constraint, the attribute information corresponding to the target logical address in the current parameter configuration file is configured based on the parameter configuration request that satisfies the security constraint, thereby updating the current parameter configuration file.
[0080] The security constraint condition includes a first constraint condition and / or a second constraint condition; the first constraint condition is that the parameter value to be configured corresponding to the parameter configuration request is within a preset parameter value range; the second constraint condition is that the access permission level corresponding to the parameter configuration request reaches the preset access permission level. In this way, this embodiment pre-configures the security constraint condition in the parameter configuration file, so that when the parameter configuration needs to be modified, the security constraint condition is used to constrain the parameter configuration behavior, thereby preventing the parameters from being accidentally modified or tampered with, thereby improving the security of the parameter configuration.
[0081] For example, Figure 2 As shown, if the security constraints corresponding to the target logical address in the current parameter configuration file include a first constraint and a second constraint, then when the parameter value to be configured corresponding to the parameter configuration request is within the preset parameter value range, and the access permission level corresponding to the parameter configuration request reaches the preset access permission level, the parameter default value corresponding to the target logical address in the current parameter configuration file is modified using the parameter value to be configured to update the current parameter configuration file.
[0082] For example, Figure 2 As shown, if the security constraint conditions corresponding to the target logical address in the current parameter configuration file include the first constraint condition, then when the parameter value to be configured corresponding to the parameter configuration request is within the preset parameter value range, no matter what level of access permission corresponding to the parameter configuration request is, the parameter default value corresponding to the target logical address in the current parameter configuration file can be modified using the parameter value to be configured to update the current parameter configuration file.
[0083] For example, Figure 2 As shown, if the security constraints corresponding to the target logical address in the current parameter configuration file include the second constraint, then when the access permission level corresponding to the parameter configuration request reaches the preset access permission level, the parameter saving properties corresponding to the target logical address in the current parameter configuration file are modified using the parameter saving properties to be configured corresponding to the parameter configuration request to update the current parameter configuration file.
[0084] Furthermore, after updating the current parameter configuration file, the present embodiment needs to control the preset system to continue to run based on the updated current parameter configuration file. In this way, the present embodiment can support the configurability of parameters during the system operation process to meet the user's use requirements for the system.
[0085] It should be noted that when the preset system is started for the first time, it is necessary to control the startup of the preset system based on the original parameter configuration file, that is, the startup of the preset system is controlled by the default parameter configuration or the original parameter configuration. When the preset system is powered off and restarted, it is necessary to control the startup of the preset system based on the latest current parameter configuration file, that is, the preset system restarted after power failure can be started with the parameter configuration before power failure, thereby restoring the preset system restarted after power failure to the system state before power failure, retaining the parameter configuration made by the user before power failure, and improving the user's system experience.
[0086] If the original parameter configuration file is updated, it is necessary to control the preset system to run again based on the updated original parameter configuration file, and redetermine the current parameter configuration file based on the updated original parameter configuration file. It should be noted that since the original parameter configuration file is the file that supports the initial startup and operation of the preset system and contains the original parameter configuration, when the original parameter configuration file is updated, it is necessary to control the preset system to run again based on the updated original parameter configuration file, and redetermine the current parameter configuration file.
[0087] Among them, the updating of the original parameter configuration file includes the target updating operation of the attribute information and / or the security constraint condition, and the target updating operation includes any one or more of adding, deleting and modifying. It can be found that this embodiment supports the adding, deleting and modifying of the attribute information and the security constraint condition through the original parameter configuration file, that is, supports the configuration configuration of the attribute information and the security constraint condition, so that the adding and deleting of the attribute information and the security constraint condition will not affect the operation of the system, and supports the extensibility of the attribute information and the security constraint condition.
[0088] It can be seen that this embodiment pre-configures the security constraint condition in the parameter configuration file, so that when the parameter configuration request is obtained, the parameter configuration request is verified by the security constraint condition, so as to make security constraints on the configuration behavior of the parameter by using the security constraint condition, so as to be compatible with more application scenarios, which not only improves the security of the parameter configuration, but also supports parameter configuration in more application scenarios. In addition, this embodiment associates the parameter with the logical address, and pre-configures the logical address corresponding to the parameter and the corresponding attribute information and security constraint condition in the parameter configuration file, so as to perform parameter configuration according to the relationship between the parameter and the logical address, the logical address and the attribute information and the security constraint condition. Compared with the prior art, this embodiment does not need to directly couple the parameter and the configuration information in the parameter configuration file, and weakens the direct relationship between the parameter and the configuration information, so as to achieve the modification of the parameter corresponding to the configuration information when only the corresponding relationship between the parameter and the logical address needs to be modified, and solves the problem that the direct modification of the parameter configuration file easily leads to system instability.
[0089] like Figure 4 As shown, taking the preset system as an embedded system, and the embedded system including a parameter management system and application software as an example, the parameter configuration method of the present application is described, and the specific scheme is as follows:
[0090] In the system preparation stage, the original parameter configuration file is stored in the first storage area of the preset system, and the target group configuration information is determined from the original parameter configuration file according to the parameter preservation attribute (such as power-off preservation and permanent preservation), and the target group configuration information is backed up to determine the current parameter configuration file based on the backup file, and the current parameter configuration file is stored in the second storage area of the preset system. Among them, the parameter configuration file includes the logical address corresponding to the parameter and the corresponding attribute information and security constraints, and the attribute information includes the parameter preservation attribute.
[0091] During the system operation phase, the parameter configuration request initiated for the target parameter is obtained through the application software, and the parameter configuration request is sent to the parameter management system. After the parameter management system obtains the parameter configuration request, the parameter configuration request is parsed to obtain the target parameter, and the physical memory address corresponding to the target parameter is determined from the preset memory distribution table, and the target logical address corresponding to the physical memory address is determined based on the preset mapping relationship, and then the security constraint condition corresponding to the target logical address is determined from the current parameter configuration file located in the second storage area.
[0092] The security constraints are parsed and executed through the parameter management system to determine whether the parameter configuration request satisfies the security constraints. If the security constraints are satisfied, the attribute information corresponding to the target logical address in the current parameter configuration file is configured based on the parameter configuration request to update the current parameter configuration file.
[0093] In addition, the parameter management system parses and executes the attribute information of each parameter in the current parameter configuration file, such as assigning the parameter default value to the corresponding parameter, performing a save operation on the corresponding parameter based on the parameter save attribute, etc. At the same time, the system application logic of each parameter is executed based on the current parameter configuration file by the application software to control the preset system operation.
[0094] It can be seen that this embodiment pre-configures the security constraint conditions in the parameter configuration file so that when the parameter configuration request is obtained, the parameter configuration request is verified by the security constraint conditions, thereby using the security constraint conditions to make security constraints on the configuration behavior of the parameters, so as to be compatible with more application scenarios, which not only improves the security of parameter configuration, but also supports parameter configuration in more application scenarios. In addition, this embodiment uses the mapping relationship between logical addresses and physical memory addresses to weaken the direct coupling relationship between parameters and configuration information (attribute information and security constraint conditions), so that without modifying the parameter configuration file, the parameters corresponding to the configuration information can be modified by only modifying the parameters corresponding to the physical memory address in the memory distribution table.
[0095] See also Figure 5 As shown, an embodiment of the present invention discloses a parameter configuration device, including:
[0096] A request acquisition module 11 is used to acquire a parameter configuration request initiated for a target parameter;
[0097] The constraint determination module 12 is used to determine the security constraint corresponding to the target logical address from the current parameter configuration file; the target logical address is the logical address corresponding to the target parameter;
[0098] The parameter configuration module 13 is used to configure the attribute information corresponding to the target logical address in the current parameter configuration file based on the parameter configuration request that meets the security constraint condition, so as to update the current parameter configuration file.
[0099] It can be seen that the present application pre-configures the security constraint conditions in the parameter configuration file, so that when the parameter configuration request is obtained, the parameter configuration request is verified by the security constraint conditions, so as to make security constraints on the configuration behavior of the parameters by using the security constraint conditions, so as to be compatible with more application scenarios, which not only improves the security of the parameter configuration, but also supports parameter configuration in more application scenarios. In addition, the present application associates the parameters with the logical addresses, and pre-configures the logical addresses corresponding to the parameters and the corresponding attribute information and security constraint conditions in the parameter configuration file, so as to perform parameter configuration according to the relationship between the parameters and the logical addresses, and between the logical addresses and the attribute information and the security constraint conditions. Compared with the prior art, the present application does not need to directly couple the parameters and the configuration information in the parameter configuration file, and weakens the direct relationship between the parameters and the configuration information, so as to achieve the modification of the parameters corresponding to the configuration information when only the corresponding relationship between the parameters and the logical addresses needs to be modified, and solves the problem that the direct modification of the parameter configuration file easily leads to system instability.
[0100] In some specific embodiments, the parameter configuration device further includes:
[0101] A physical address determination unit, used to determine a physical memory address corresponding to the target parameter from a preset memory distribution table;
[0102] The logical address determination unit is used to determine the target logical address corresponding to the physical memory address based on a preset mapping relationship.
[0103] In some specific embodiments, the security constraint condition includes a first constraint condition and / or a second constraint condition;
[0104] The first constraint condition is that the parameter value to be configured corresponding to the parameter configuration request is within a preset parameter value range; the second constraint condition is that the access permission level corresponding to the parameter configuration request reaches the preset access permission level.
[0105] In some specific embodiments, the parameter configuration device further includes:
[0106] A first file determination unit, configured to determine an original parameter configuration file as a current parameter configuration file;
[0107] A second file determining unit, configured to determine a current parameter configuration file based on a backup file of the original parameter configuration file;
[0108] The original parameter configuration file is a file pre-stored in a preset system, and at least one set of configuration information is pre-configured in the original parameter configuration file, and each set of configuration information includes a logical address corresponding to a parameter and corresponding attribute information and security constraints.
[0109] In some specific embodiments, the parameter configuration device further includes:
[0110] The file storage unit is used to store the original parameter configuration file and the current parameter configuration file in different storage areas in the preset system respectively when the current parameter configuration file is determined based on the backup file of the original parameter configuration file.
[0111] In some specific embodiments, the second file determining unit includes:
[0112] A configuration information determination unit, configured to determine target group configuration information from an original parameter configuration file according to attribute information; wherein the attribute information includes parameter storage attributes;
[0113] The file backup unit is used to back up the target group configuration information to obtain a backup file, and determine the current parameter configuration file based on the backup file.
[0114] In some specific embodiments, the parameter configuration device further includes:
[0115] The first operating unit is used to control the preset system to continue operating based on the updated current parameter configuration file.
[0116] In some specific embodiments, the parameter configuration device further includes:
[0117] A second operation unit, configured to control the startup and operation of the preset system based on the original parameter configuration file when the preset system is started for the first time;
[0118] The third operation unit is used to control the preset system to start running based on the latest current parameter configuration file when the preset system is powered off and restarted.
[0119] In some specific embodiments, the parameter configuration device further includes:
[0120] The fourth operation unit is used to control the preset system to re-operate based on the updated original parameter configuration file if the original parameter configuration file is updated, and to redetermine the current parameter configuration file based on the updated original parameter configuration file.
[0121] In some specific embodiments, the updating of the original parameter configuration file includes performing a target update operation on the attribute information and / or security constraints; the target update operation is any one or more of adding, deleting and modifying.
[0122] Furthermore, the present application also discloses an electronic device. Figure 6 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.
[0123] Figure 6 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the parameter configuration method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0124] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.
[0125] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0126] The operating system 221 is used to manage and control the hardware devices and computer programs 222 on the electronic device 20, and may be Windows Server, Netware, Unix, Linux, etc. In addition to computer programs that can be used to complete the parameter configuration method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 may further include computer programs that can be used to complete other specific tasks.
[0127] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the parameter configuration method disclosed above. The specific steps of the method can refer to the corresponding contents disclosed in the above embodiments, and will not be repeated here.
[0128] Furthermore, the present application also discloses a computer program product, including a computer program / instruction, wherein the computer program / instruction implements the parameter configuration method disclosed above when executed by a processor. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.
[0129] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.
[0130] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0131] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0132] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0133] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A parameter configuration method, characterized in that: include: Get the parameter configuration request initiated for the target parameter; Determine the security constraint condition corresponding to the target logical address from the current parameter configuration file; The target logical address is the logical address corresponding to the target parameter; Based on the parameter configuration request that satisfies the security constraint condition, the attribute information corresponding to the target logical address in the current parameter configuration file is configured to update the current parameter configuration file.
2. The parameter configuration method according to claim 1, characterized in that: Before determining the security constraint condition corresponding to the target logical address from the current parameter configuration file, the method further includes: Determine the physical memory address corresponding to the target parameter from a preset memory distribution table; The target logical address corresponding to the physical memory address is determined based on a preset mapping relationship.
3. The parameter configuration method according to claim 1, characterized in that: The safety constraint condition includes a first constraint condition and / or a second constraint condition; The first constraint condition is that the parameter value to be configured corresponding to the parameter configuration request is within a preset parameter value range; the second constraint condition is that the access permission level corresponding to the parameter configuration request reaches the preset access permission level.
4. The parameter configuration method according to any one of claims 1 to 3, characterized in that: Before determining the security constraint condition corresponding to the target logical address from the current parameter configuration file, the method further includes: determining the original parameter profile as the current parameter profile; or, determining the current parameter configuration file based on a backup file of the original parameter configuration file; The original parameter configuration file is a file pre-stored in a preset system, and at least one set of configuration information is pre-configured in the original parameter configuration file, and each set of configuration information includes a logical address corresponding to a parameter and corresponding attribute information and security constraints.
5. The parameter configuration method according to claim 4, characterized in that: Also includes: When the current parameter configuration file is determined based on the backup file of the original parameter configuration file, the original parameter configuration file and the current parameter configuration file are respectively stored in different storage areas in the preset system.
6. The parameter configuration method according to claim 4, characterized in that: The step of determining the current parameter configuration file based on the backup file of the original parameter configuration file includes: Determining target group configuration information from an original parameter configuration file according to the attribute information; wherein the attribute information includes parameter preservation attributes; The target group configuration information is backed up to obtain a backup file, and a current parameter configuration file is determined based on the backup file.
7. The parameter configuration method according to claim 4, characterized in that: After updating the current parameter configuration file, the method further includes: The preset system is controlled to continue to operate based on the updated current parameter configuration file.
8. The parameter configuration method according to claim 7, characterized in that: Also includes: When the preset system is started for the first time, controlling the preset system to start running based on the original parameter configuration file; When the preset system is powered off and restarted, the preset system is controlled to start running based on the latest current parameter configuration file.
9. The parameter configuration method according to claim 4, characterized in that: Also includes: If the original parameter configuration file is updated, the preset system is controlled to re-run based on the updated original parameter configuration file, and the current parameter configuration file is re-determined based on the updated original parameter configuration file.
10. The parameter configuration method according to claim 9, characterized in that: The updating of the original parameter configuration file includes performing a target update operation on the attribute information and / or security constraint conditions; the target update operation is any one or more of adding, deleting and modifying.
11. A parameter configuration device, characterized in that: include: A request acquisition module is used to obtain parameter configuration requests initiated for target parameters; A constraint determination module, used to determine the security constraint corresponding to the target logical address from the current parameter configuration file; The target logical address is the logical address corresponding to the target parameter; A parameter configuration module is used to configure the attribute information corresponding to the target logical address in the current parameter configuration file based on the parameter configuration request that meets the security constraint condition, so as to update the current parameter configuration file.
12. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, configured to execute the computer program to implement the parameter configuration method according to any one of claims 1 to 10.
13. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the parameter configuration method according to any one of claims 1 to 10.
14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the parameter configuration method according to any one of claims 1 to 10 is implemented.