WO2013107158A1 - Method and system for managing system parameter in terminal device - Google Patents

Method and system for managing system parameter in terminal device Download PDF

Info

Publication number
WO2013107158A1
WO2013107158A1 PCT/CN2012/077920 CN2012077920W WO2013107158A1 WO 2013107158 A1 WO2013107158 A1 WO 2013107158A1 CN 2012077920 W CN2012077920 W CN 2012077920W WO 2013107158 A1 WO2013107158 A1 WO 2013107158A1
Authority
WO
WIPO (PCT)
Prior art keywords
system parameter
value
parameter
area
storage type
Prior art date
Application number
PCT/CN2012/077920
Other languages
French (fr)
Chinese (zh)
Inventor
赵彬
于芝涛
简志敏
高仁忠
傅来银
Original Assignee
青岛海信传媒网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 青岛海信传媒网络技术有限公司 filed Critical 青岛海信传媒网络技术有限公司
Publication of WO2013107158A1 publication Critical patent/WO2013107158A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level

Definitions

  • the present invention relates to embedded system technologies, and in particular, to a system parameter management method and a management system in a terminal device. Background technique
  • embedded systems are widely used in communications, industrial control, home smart devices, defense, medical and other fields.
  • mobile phones, smart TVs, set-top box devices, handheld computers, etc. all use embedded systems to provide intelligent, better human-computer interaction capabilities.
  • the embedded system has a variety of data, including various file system data saved by the user, such as data of documents, picture files, data in the database, system parameters and the like. Among them, system parameters are very important for embedded systems, which will affect the normal startup and operation of the system.
  • system program needs to read some system parameters, such as the system version number, device ID, network port address, and so on. If these system parameter readings are incorrect or missing, then the system may fail to start or some system functions may fail. Therefore, system parameters are very important for the proper startup and operation of embedded systems.
  • the programmer needs to modify some other related code in the modification of the system program code, and this time increases the probability of writing code errors. If an error occurs, it will cause the embedded system to fail during the next startup run and fail to start or some features will fail.
  • Embodiments of the present invention provide a system parameter management method and system in a terminal device, which are used to provide effective management of system parameters.
  • a system parameter management method in a terminal device including:
  • the in-memory stores the current value of the system parameter and the attribute information of the system parameter for each system parameter; the attribute information includes: a name of the system parameter, a storage address offset, and a storage type;
  • the method for storing the current value of the system parameter and the attribute information of the system parameter in the memory includes:
  • the attribute information of each system parameter is sequentially read from the configuration file; for each system parameter, the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter.
  • the storage type of the system parameter is the first storage type
  • the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter
  • the storage type of the system parameter is the second storage type, Obtaining, according to the storage address offset of the system parameter, the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area, and comparing the two; if the comparison result If they are consistent, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is used as the The current value of the system parameter;
  • the current value of the system parameter is stored in the memory in association with the attribute information of the system parameter. Further, after the value of the system parameter that is to be obtained from the backup parameter area is used as the current value of the system parameter, the method further includes:
  • the value of the system parameter in the backup parameter area is used to update the value of the system parameter in the system parameter area.
  • the method further includes:
  • Bay ij If you receive the name of the system parameter transmitted by the system program and the modified value, Bay ij:
  • the current value of the system parameter in the memory is updated according to the modified value
  • the storage type of the system parameter is the first storage type, updating the value of the system parameter in the system parameter area according to the current value of the updated system parameter in the memory; if the system parameter is determined
  • the storage type is the second storage type, and the value of the system parameter in the system parameter area and the backup parameter area is updated according to the current value of the updated system parameter in the memory.
  • the method further includes:
  • the attribute of the corresponding system parameter is found in the memory according to the name of the system parameter in the recorded modification information, and the storage address of the system parameter is found according to the found
  • the shifting quantity determines the value of the system parameter in the temporary parameter area; after determining that the storage type of the system parameter is the first storage type, updating the system parameter area according to the value of the system parameter in the temporary parameter area The value of the system parameter is determined; after determining that the storage type of the system parameter is the second storage type, updating the system parameter area and the system in the backup parameter area according to the value of the system parameter in the temporary parameter area The value of the parameter.
  • the attribute information further includes: a new value flag, a default value; and,
  • the method further includes:
  • the new value flag of the system parameter indicates that the system parameter is a new system parameter, then: the default value of the system parameter is used as the current value of the system parameter;
  • the storage type of the system parameter is the first storage type, storing the default value of the system parameter to the system parameter area according to the storage address offset of the system parameter; If it is determined that the storage type of the system parameter is the second storage type, the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
  • the method for upgrading the system parameter area and the backup parameter area includes:
  • the version upgrade flag is read
  • the attribute information of each system parameter is sequentially read from the configuration file, and the following operations are performed for each system parameter: searching for the system parameter from the backup file Attribute information, the backup file is a configuration file of a previous version of the terminal device;
  • the new value flag of the system parameter in the backup file indicates that the system parameter is a new system parameter, then: determining that the storage type of the system parameter is After the first storage type, the default value of the system parameter in the configuration file is written to the system parameter area according to the storage address offset of the system parameter; determining that the storage type of the system parameter is the second storage type Afterwards, the default value of the system parameter in the configuration file is written to the system parameter area and the backup parameter area according to the storage address offset of the system parameter; the default value of the system parameter in the configuration file is used as The current value of the system parameter;
  • the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; determining the storage type of the system parameter is After the storage type is obtained, the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset of the system parameter, and the value of the system parameter obtained from the backup parameter area is used as the system parameter.
  • Current value is the value of the system parameter stored in the backup parameter area.
  • the current value of the system parameter is stored in the memory in association with the attribute information of the system parameter.
  • the method for creating the system parameter area and the backup parameter area includes:
  • the attribute information of each system parameter is sequentially read from the configuration file, and the following operations are performed for each system parameter:
  • the default value of the system parameter is used as the current value of the system parameter; the current value of the system parameter is stored in the memory in association with the attribute information of the system parameter;
  • the storage type of the system parameter is the first storage type, storing the default value of the system parameter to the system parameter area according to the storage address offset of the system parameter;
  • the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
  • the method for recovering the system parameter area includes: After reading the attribute information of each system parameter in turn from the configuration file, perform the following operations for each system parameter:
  • the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter;
  • the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area according to the storage address offset of the system parameter.
  • the attribute information further includes: a data type
  • the comparing the modified value with the found current value specifically includes:
  • the data type of the system parameter is an IP address type
  • the IP address of the binary data type is in the memory The current value comparison of the system parameters
  • the data type of the system parameter is an integer data type
  • the converted integer data is used to compare the current parameter of the system parameter in the memory.
  • the converted binary value is used to compare the current parameter of the system parameter in the memory.
  • the modified value is used to compare the current value of the system parameter in the memory.
  • a system parameter management system in a terminal device including:
  • the system parameter is loaded into the memory module, and after the terminal device is started, the attribute information of each system parameter is sequentially read from the configuration file, where the attribute information includes: a name of the system parameter, a storage address offset, and a storage type.
  • the value of the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter; if the storage type of the system parameter is the first storage type, the system parameter is The value of the system parameter obtained in the area is taken as the current value of the system parameter; if the storage type of the system parameter is the second storage type, the storage address offset according to the system parameter is obtained and stored in the backup parameter area.
  • the value of the system parameter is And the value of the system parameter stored in the system parameter area, and compare the two; if the comparison result is consistent, the value of the system parameter obtained from the system parameter area is taken as the current parameter of the system parameter Value; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is taken as the current value of the system parameter; the current value of the system parameter is stored in association with the attribute information of the system parameter to In memory
  • a system parameter reading module configured to: after receiving the name of the system parameter transmitted by the system program, find the current value of the system parameter from the memory according to the name of the received system parameter; The value is returned to the system program.
  • system parameter loading memory module is further configured to: after determining the value of the system parameter obtained from the backup parameter area as the current value of the system parameter, if it is determined that the acquired system parameter is in the backup parameter If the value in the area is different from the value in the system parameter area, the value of the system parameter in the backup parameter area is used to update the value of the system parameter in the system parameter area.
  • system further includes:
  • a system parameter modification module configured to: after receiving the name of the system parameter transmitted by the system program and modifying the value, searching for the current value of the system parameter from the memory according to the name of the received system parameter; Comparing the value with the found current value, determining whether to update according to the comparison result; if deciding to update, updating: the current value of the system parameter in the memory according to the modified value; and determining the system parameter
  • the storage type is the first storage type
  • the value of the system parameter in the system parameter area is updated according to the modified value; after determining that the storage type of the system parameter is the second storage type, according to the modified value Updating the value of the system parameter in the system parameter area and the backup parameter area.
  • system parameter modification module is further configured to: update the value of the system parameter in the system parameter area according to the modified value, or update the system parameter area according to the modified value and back up Before the value of the system parameter in the parameter area is updated, the value of the system parameter in the temporary parameter area is updated according to the current value of the updated system parameter in the memory, and the name of the system parameter is used as the modification information.
  • the storage address offset determines the value of the system parameter in the temporary parameter area; after determining that the storage type of the system parameter is the first storage type, updating the value according to the value of the system parameter in the temporary parameter area The value of the system parameter in the system parameter area; after determining that the storage type of the system parameter is the second storage type, the root Updating the system parameter area and the backup parameter according to the value of the system parameter in the temporary parameter area The value of this system parameter in the zone.
  • the attribute information further includes: a new value flag, a default value; and,
  • the system parameter loading memory module is further configured to: after reading the attribute information of the system parameter from the configuration file, if it is determined that the new value flag of the system parameter indicates that the system parameter is a new system parameter, then: the system The default value of the parameter is used as the current value of the system parameter; and after determining that the storage type of the system parameter is the first storage type, the default value of the system parameter is stored according to the storage address offset of the system parameter. After determining the storage type of the system parameter as the second storage type, the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
  • system further includes:
  • a parameter area creating module configured to read a factory mark after the terminal device is started; if the factory mark indicates that the terminal device is a new factory device, the attribute information of each system parameter is sequentially read from the configuration file, and Performing the following operations for each system parameter: using the default value of the system parameter as the current value of the system parameter; storing the current value of the system parameter and the attribute information of the system parameter in the memory; if the system parameter The storage type is the first storage type, and the default value of the system parameter is stored in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type, The storage address offset of the system parameter stores the default value of the system parameter to the system parameter area and the backup parameter area; if the factory mark indicates that the terminal device is a factory flag, the sending parameter area has created a notification.
  • system further includes:
  • a parameter area upgrading module configured to: after receiving the notification that the parameter area sent by the parameter area creation module has been created, read the version upgrade flag; if the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded,
  • the configuration file sequentially reads the attribute information of each system parameter, and performs the following operations for each system parameter: Searching for the attribute information of the system parameter from the backup file, where the backup file is the configuration of the previous version of the terminal device.
  • Parameter value is written to the system parameters and backup zone area; the default value of the system parameter in the configuration file as a current value of the system parameter; otherwise, determining the storage type for the system parameter After the first storage type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; after determining that the storage type of the system parameter is the second storage type, according to the system parameter
  • the storage address offset obtains the value of the system parameter stored in the backup parameter area, and takes the value of the system parameter obtained from the backup parameter area as the current value of the system parameter;
  • the value is stored in the memory in association with the attribute information of the system parameter; if the version upgrade flag indicates that the system parameter area and the backup parameter area have been upgraded, the parameter area has been upgraded.
  • system further includes:
  • the parameter area recovery module is configured to read the attribute information of each system parameter sequentially from the configuration file after receiving the error information of the system parameter reading, and perform the following operations for each system parameter: if the storage type of the system parameter is The first storage type, the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type Then, according to the storage address offset of the system parameter, the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area.
  • attribute information of system parameters is recorded in a configuration file
  • different management methods are used for different storage types of system parameters, so that some very important system parameters are saved in the system parameter area. It is saved in the backup parameter area. If the current value of the system parameter stored in the system parameter area is incorrect or lost due to an accident, you can use the current value of the system parameter stored in the backup parameter area to recover, thus ensuring and improving. Security of system parameters.
  • the attribute information of the system parameter in the configuration file further includes: a new value flag, so that the programmer can add a system parameter in the system parameter area or the backup parameter area: if the programmer modifies the system program of the terminal device, and New system parameters have also been added. Then, in the process of loading the configuration file information into the memory and the data in the system parameter area or the backup parameter area, the value of the new system parameter can be written to the system parameter area or Backup parameter area for easy management of new system parameters.
  • the system parameters can be avoided according to the backup file.
  • the value is to prevent all system parameters from being restored to their default values during system program upgrade. In this way, some system parameters set by the user will not be modified due to the upgrade of the system program version, and need to be reset, thereby greatly improving the user's body. Test.
  • FIG. 1 is a schematic diagram of a system parameter management system in a terminal device according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for loading system parameters into a memory according to an embodiment of the present invention
  • FIG. 4 is a flowchart of a method for managing system parameter reading system parameters by a system parameter management system according to an embodiment of the present invention
  • FIG. 5 is a flowchart of a method for managing system parameters by modifying a system parameter of a system parameter management system according to an embodiment of the present invention
  • FIG. 6 is a flowchart of a method for creating a system parameter area and a backup parameter area according to an embodiment of the present invention
  • FIG. 7 is a flowchart of a method for upgrading and managing system parameters by a system parameter management system according to an embodiment of the present invention
  • FIG. 8 is a flowchart of a method for recovering and managing a system parameter area by a system parameter management system according to an embodiment of the present invention
  • FIG. 9 is a block diagram showing the internal structure of a system parameter management system according to an embodiment of the present invention.
  • module can be, but is not limited to: a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer.
  • an application running on a computing device and this computing device can be modules.
  • One or more modules can be located within a process and/or thread in execution.
  • the embodiment of the invention provides a system parameter management system according to the characteristics of the system parameters, so as to effectively manage various system parameters in the embedded system, so as to facilitate accessing and modifying system parameters, and increasing reliability and security of system parameters. And saves the storage space occupied by the overall system parameters.
  • the terminal device shown in FIG. 1 includes: a system parameter management system 101, a system program 102, a configuration file, and a system parameter area.
  • the system parameter area is used to store the value of the system parameter.
  • the system parameter area can be set in a non-volatile memory device, such as FLASH.
  • the inventor of the present invention analyzes the characteristics of the system parameters and finds that there are some very important parameters in the system parameters that will affect the normal startup of the system, and the backup system can also create a backup parameter area for the embedded system. The values of some important system parameters stored in the system parameter area are backed up and stored in the backup parameter area.
  • the backup parameter area can be set in a relatively reliable data storage device such as EEPROM, and it is not easy to lose data.
  • the data in the system parameter area described above may be stored in a FLASH storage medium in the form of a binary file, and the data in the backup parameter area may be stored in the EEPROM storage medium in the form of a binary file.
  • the storage types of system parameters include: a first storage type, a second storage type.
  • the system parameter of the first storage type refers to the system parameter whose value is only stored in the system parameter area; the system parameter of the second storage type refers to the value stored in the system parameter area and backed up and stored in the backup. System parameters in the parameter area.
  • the storage type of the system parameter may further include: a third storage type, a fourth storage type.
  • the system parameter of the third storage type refers to the system parameter whose value is only stored in the cache; the system parameter of the fourth storage type refers to the system parameter whose value is only stored in the backup parameter area.
  • the attribute information of the system parameter is recorded separately for each system parameter.
  • the attribute information of the system parameter may specifically include: a name of the system parameter, a storage type, and a storage address offset.
  • the storage address offset of the system parameter indicates the offset of the value of the system parameter stored in the system parameter area or the backup parameter area. That is to say, the value of the system parameter can be read or written from the system parameter area or the backup parameter area according to the storage address offset of the system parameter.
  • the attribute information of the system parameter recorded in the configuration file may further include: a data type, a storage length, and a default value of the system parameter.
  • the attribute information of the system parameter recorded in the configuration file may further include: deleting a flag, a new value flag, creating a flag indicating whether the value of the backup parameter area is writable, and whether the parameter can be restored to a default value when the factory state is restored. Wait.
  • Profiles can store attribute information for each system parameter in a variety of formats. For example, the attribute information of each system parameter is sequentially recorded in the configuration file, and the attribute information of different system parameters is separated by a newline character.
  • the storage manner of the attribute information of the system parameter in a configuration file provided in the embodiment of the present invention is: according to different storage types of the system parameter, the genus is divided for each storage type. In the storage area of the storage type, the same system parameter as the storage type, and the attribute information thereof is stored in the storage area of the storage type.
  • the storage type is a system parameter of the first storage type, and the attribute information is stored in the storage area of the first storage type; the storage type is a system parameter of the second storage type, and the attribute information is stored in the storage of the second storage type.
  • the storage type is a system parameter of the third storage type, and the attribute information is stored in the storage area of the third storage type; the storage type is a system parameter of the fourth storage type, and the attribute information is stored in the storage of the fourth storage type. In the area.
  • the identifier of the first storage type may be OAM-ONLY-GER
  • the identifier of the second storage type may be OAM-BOTH-IM-GER
  • the identifier of the third storage type may be OAM ONLY TMP
  • the fourth storage The type identifier can be OAM-ONLY-IM.
  • the storage area of the first storage type may be delimited in the configuration file according to the identification of the first storage type. Specifically, the end of the storage area of the first storage type is identified by the node identifier ⁇ OAM_ONLY_GER ⁇ t, the beginning of the storage area of the first storage type, and the node identifier ⁇ / OAM_ONLY_GER >.
  • the storage area of the second storage type may be delimited according to the identifier of the second storage type: with the node identifier ⁇ OAM_BOTH_IM_GER ⁇ t, the beginning of the storage area of the first storage type , with node identification ⁇ / OAM — BOTH — IMP — GER ⁇ ⁇ The end of the storage area of the first storage type.
  • each child node includes attribute information of the same system parameter as the storage type.
  • " ⁇ " can be used to mark the beginning of a child node, and "/>” to mark the end of the child node.
  • ⁇ /root> where ⁇ root> is the root node, marking the beginning of the configuration file, and the ⁇ /1"001> flag is the end of the configuration file.
  • the attribute information of the system parameters such as mac_id and device_id are recorded. Since the attribute information of these system parameters is stored in the storage area of the second storage type, it indicates that the storage type of these system parameters is the second storage class. Similarly, the attribute information of the system parameters such as net_user and net_pwd recorded in the storage area of the first storage type indicates that the storage type of the system parameters is the first storage type. This format facilitates separate storage. Management of the type of system parameters.
  • the system parameter management system 101 loads the information recorded in the configuration file and the system parameter values in the system parameter area into the memory, so that the system program can be read during startup and running. Specifically, the system parameter management system 101 sequentially reads the departments from the configuration file. Attribute information of the system parameter; for each system parameter, the current value of the system parameter is obtained from the system parameter area according to the storage address offset of the system parameter in the attribute information of the system parameter, and the system in the configuration file The attribute information of the parameter and the current value of the system parameter in the system parameter area are stored in the memory.
  • the system parameter management system 101 loads the information recorded in the configuration file and the method parameter of the system parameter area and the system parameter value in the backup parameter area into the memory. as shown in picture 2.
  • the system parameter management system 101 creates an array in memory.
  • the configuration file is stored at a fixed address of the non-volatile storage device from which the system parameter management system 101 opens the configuration file.
  • step S202 The attribute information of the system parameter is sequentially read from the configuration file; if the end identifier of the configuration file is read, step S261 is performed; otherwise, step S203 is performed.
  • step S261 is performed; otherwise, the following step S203 is performed for the attribute information of the currently read system parameter.
  • step S203 determining, according to the attribute information of the currently read system parameter, a storage type of the system parameter; if the storage type of the system parameter is the first storage type, executing step S211; if the storage type of the system parameter is the second storage If the storage type of the system parameter is the third storage type, step S231 is performed; if the storage type of the system parameter is the fourth storage type, step S241 is performed.
  • step S211 After obtaining the value of the system parameter from the system parameter area, and taking the current value of the system parameter, step S251 is performed.
  • step S251 the value of the system parameter stored in the system parameter area is obtained as the current value of the system parameter according to the storage address offset in the attribute information of the currently read system parameter.
  • S221 Obtain a value of the system parameter stored in a system parameter area.
  • the value of the system parameter stored in the system parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter.
  • step S223 The value of the system parameter obtained from the system parameter area is compared with the value of the system parameter obtained from the backup parameter area; if not, step S224 is performed; otherwise, step S225 is performed.
  • S224 The value of the system parameter in the system parameter area is updated by using the value of the system parameter in the backup parameter area.
  • the value of the system parameter in the system parameter area is updated using the value of the system parameter obtained from the backup parameter area. In this way, for some very important system parameters, if the value of the system parameter stored in the system parameter area is wrong or lost due to an accident, the value of the system parameter stored in the backup parameter area can be used for recovery, thereby ensuring and improving The security of the system parameters.
  • S225 Compare the value of the system parameter obtained from the backup parameter area with the value of the system parameter obtained from the system parameter area; determine the current value of the system parameter according to the comparison result; and then perform step S251.
  • the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area are obtained according to the storage address offset of the system parameter, and the two are compared; If the comparison result is consistent, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is obtained. As the current value of the system parameter. After that, step S251 is performed.
  • the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area are obtained according to the storage address offset of the system parameter, and the two are compared; If the comparison result is consistent, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the system parameter obtained from the backup parameter area is taken. The value is used as the current value of the system parameter and the value of the system parameter in the backup parameter area is used to update the value of the system parameter in the system parameter area. After that, step S251 is performed.
  • step S231 After the default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, step S251 is performed.
  • the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter.
  • step S251 is performed.
  • S251 The attribute information of the currently read system parameter is stored in the memory in association with the current value of the system parameter.
  • the attribute information of the currently read system parameter and the current value of the system parameter are stored in the i-th array element of the memory array.
  • the attribute information of the parameter may also include: A new value flag.
  • the new value flag is used to indicate whether the system parameter is a new system parameter. For example, a new value flag of 1 indicates that the system parameter is a new system parameter, that is, a system parameter whose value has not been written to the system parameter area or the backup parameter area; a new value flag of 0 indicates that the system parameter is not a new system parameter. , its value has been stored in the system parameter area or the system parameter of the backup parameter area.
  • the process of adding the value of the system parameter in the system parameter area or the backup parameter area is as follows: After the attribute information of the system parameter is read from the configuration file, if the new value flag of the system parameter indicates that the system parameter is a new system parameter Then: if it is determined that the storage type of the system parameter is the first storage type, the default value of the system parameter is stored in the system parameter area according to the storage address offset of the system parameter; if the storage of the system parameter is determined The type is the second storage type, and the default value of the system parameter is stored to the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
  • the process of adding the value of the system parameter in the system parameter area or the backup parameter area may be performed by loading the information recorded in the configuration file and the value of the system parameter in the system parameter area and the backup parameter area into the memory.
  • the specific process is shown in Figure 3, including the following steps:
  • step S302 The attribute information of the system parameter is sequentially read from the configuration file; if the end identifier of the configuration file is read, step S361 is performed; otherwise, step S303 is performed.
  • step S361 is performed; otherwise, the following step S303 is performed for the attribute information of the currently read system parameter.
  • step S303 determining, according to the attribute information of the currently read system parameter, a storage type of the system parameter; if the storage type of the system parameter is the first storage type, performing step S310; if the storage type of the system parameter is the second storage If the storage type of the system parameter is the third storage type, step S331 is performed; if the storage type of the system parameter is the fourth storage Type, then step S340 is performed.
  • the attribute information of the system parameter may further include a delete flag. If the delete flag is set to 1, indicating that the system parameter has been deleted, it may not need to be loaded into the memory, therefore, performing this step.
  • step S303 it may be determined whether the deletion flag in the attribute information of the currently read system parameter is set to 1; if yes, the process directly jumps to step S302 to process the attribute information of the next system parameter; if not, step S303 is performed.
  • step S312 Determine the value of the new value flag in the attribute information of the currently read system parameter, and determine whether the system parameter is a new system parameter according to the value of the new value flag. If the determination is yes, then step S312 is performed; otherwise, step S311 is performed.
  • step S311 After obtaining the value of the system parameter from the system parameter area, and taking the current value of the system parameter, step S351 is performed.
  • step S351 the value of the system parameter stored in the system parameter area is obtained as the current value of the system parameter according to the storage address offset in the attribute information of the currently read system parameter.
  • S312 Write the default value in the attribute information of the currently read system parameter into the system parameter area.
  • the default value of the system parameter is written into the system parameter area according to the storage address offset in the attribute information of the currently read system parameter.
  • step S313 After the default value of the system parameter is used as the current value of the system parameter, step S351 is performed.
  • step S351 is performed.
  • S321 Obtain a value of the system parameter stored in a system parameter area.
  • the value of the system parameter stored in the system parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter.
  • the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter.
  • S323 The value of the system parameter obtained from the system parameter area is compared with the value of the system parameter obtained from the backup parameter area; if not, step S324 is performed; otherwise, step S325 is performed.
  • S324 Update the value of the system parameter in the system parameter area by using the value of the system parameter in the backup parameter area.
  • the value of the system parameter in the system parameter area is updated using the value of the system parameter obtained from the backup parameter area. In this way, for some very important system parameters, if the value of the system parameter stored in the system parameter area is wrong or lost due to an accident, the value of the system parameter stored in the backup parameter area can be used for recovery, thereby ensuring and improving The security of the system parameters.
  • step S325 After obtaining the value of the system parameter from the backup parameter area as the current value of the system parameter, step S351 is performed.
  • S326 Write the default value in the attribute information of the currently read system parameter into the system parameter area and the backup parameter area.
  • the default value of the system parameter is written into the system parameter area and the backup parameter area according to the storage address offset in the attribute information of the currently read system parameter.
  • step S351 After the default value of the system parameter is used as the current value of the system parameter, step S351 is performed.
  • step S331 After the default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, step S351 is performed.
  • step S341 After obtaining the value of the system parameter from the backup parameter area and using it as the current value of the system parameter, step S351 is performed.
  • step S351 the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter. After the value of the system parameter obtained from the backup parameter area is taken as the current value of the system parameter, step S351 is performed.
  • S342 Write the default value in the attribute information of the currently read system parameter into the backup parameter area.
  • the default value of the system parameter is written into the backup parameter area according to the storage address offset in the attribute information of the currently read system parameter.
  • step S351 After the default value of the system parameter is used as the current value of the system parameter, step S351 is performed. Specifically, after the default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, step S351 is performed.
  • S351 Store the attribute information of the currently read system parameter in the memory in association with the current value of the system parameter.
  • the attribute information of the currently read system parameter and the current value of the system parameter are stored in the i-th array element of the memory array.
  • the system parameter management system 101 manages the system parameters, and after loading the information recorded in the configuration file and the system parameter area and the system parameter value in the backup parameter area into the memory, the method may further include: starting the system program 102. Management of reading, modifying, etc. of system parameters during the process.
  • the system parameter management system 101 reads the system parameter management method for the system program 102.
  • the specific process is as shown in FIG. 4, and includes the following steps:
  • S401 Receive the name of the system parameter transmitted by the system program 102.
  • the name of the system parameter can be transmitted to the API function of the system parameter management system 101 that reads the system parameter.
  • S402 Find the current value of the system parameter from the memory according to the name of the received system parameter.
  • the API function of the system parameter management system 101 for reading the system parameter may be based on the received system parameter. Name, find the current value of the system parameter from the memory.
  • the system parameter management system 101 can return the found current value directly to the system program 102.
  • the found current values can be converted into a string and then returned; thus, the interface uniformity for program personnel programming is facilitated.
  • the system parameter management system 101 can convert the converted string to the system program 102 after the conversion according to the data type:
  • the IP value of the string data type is converted after the current value found is converted from the IP address of the binary data type to the IP address of the string data type. Returned to the system program 102; If the data type in the attribute information of the system parameter is an integer data type, the converted current value is converted from the integer data (Int type data) to the integer represented by the string, and the string is returned to the system program. 102;
  • the device value of the string type is returned to the system program 102 after converting the found current value from the binary value to the device type of the string type.
  • the version number of the string type is returned to the system program 102.
  • the current value found is directly returned to the system program 102.
  • the system parameter management system 101 modifies the management method of the system parameters to the system program 102.
  • the specific process is as shown in FIG. 5, and includes the following steps:
  • S501 Receive the name of the system parameter transmitted by the system program 102 and the modified value.
  • the API function of the system parameter modified by the system parameter management system 101 can transmit the name of the system parameter and the modified value.
  • S502 Find a current value of the system parameter from the memory according to the name of the received system parameter.
  • the API function of the system parameter management system 101 for modifying the system parameters finds the current value of the system parameter from the memory according to the name of the received system parameter.
  • step S503 Compare the modified value with the found current value, and determine whether to update according to the comparison result. If it is decided to update, step S504 is performed; otherwise, it ends, and the update success information is returned to the system program.
  • the API function of the system parameter management system 101 for modifying the system parameters compares the modified value with the found current value, and determines whether to update according to the comparison result. If it is decided to update, step S504 is performed; otherwise, it ends, and the update success information is returned to the system program.
  • the API function of the system parameter management system 101 for modifying the system parameters may also convert the modified value, and then perform the converted value and the found current value. Compare, determine whether the comparison results are consistent; if they are inconsistent, decide to update; otherwise, do not have to update.
  • the modified value is generally in the form of a string, and the conversion method includes: If the data type in the attribute information of the system parameter is an IP address type, the modified value is converted from the IP address of the string data type to the IP address of the binary data type, and the IP address of the binary data type is used to compare the in-memory.
  • the current value of the system parameter determines whether the two are consistent; if the data type in the attribute information of the system parameter is an integer data type, the modified value is converted from the integer represented by the string to the integer data (Int type data) After the converted integer data (Int type data) is used to compare the current values of the system parameters in the memory to determine whether the two are consistent; if the data type in the attribute information of the system parameter is the device number type , after converting the modified value from the device number of the string type to the binary value, comparing the current value of the system parameter in the memory with the converted binary value to determine whether the two are consistent;
  • the modified value is converted from the version number of the string type to the binary value, and the system parameter in the memory is compared using the converted binary value. Current value, to determine whether the two are consistent;
  • the current value of the system parameter in the memory is directly compared using the modified value to determine whether the two are consistent.
  • the API function of the system parameter management system 101 for modifying the system parameters may directly update the current value of the system parameter in the memory according to the modified value.
  • the memory may be The updated current value of the system parameter is first written into a temporary parameter area, that is, step S505 is performed.
  • S505 Update the value of the system parameter in the temporary parameter area according to the current value of the updated system parameter in the memory, and record the name of the system parameter as the modification information.
  • the system parameter management system 101 also creates a temporary parameter area in the memory, and writes the current value of the updated system parameter in the memory to the temporary parameter area according to the storage address offset of the system parameter.
  • the system parameter management system 101 also records the name of the system parameter as the modification information.
  • step S506 When the parameter area update period arrives, or after the user triggers the shutdown, the attribute information of the corresponding system parameter in the memory is searched according to the name of the system parameter in the recorded modification information, and step S507 is performed.
  • the storage type and storage address offset of the system parameter can be determined. In this way, it is possible to avoid excessively frequent writing of the system parameter area or the backup parameter area, resulting in damage to the storage device.
  • S511 Update the value of the system parameter in the system parameter area according to the current value of the updated system parameter in the memory.
  • the value of the system parameter in the system parameter area is updated according to the current value of the updated system parameter in the memory according to the storage address offset of the system parameter.
  • S521 Update the value of the system parameter in the system parameter area and the backup parameter area according to the current value of the updated system parameter in the memory.
  • the current parameter value of the updated system parameter in the memory is used to update the value of the system parameter in the system parameter area and the backup parameter area.
  • S531 Update the value of the system parameter in the backup parameter area according to the current value of the updated system parameter in the memory.
  • the value of the system parameter in the backup parameter area is updated according to the current value of the updated system parameter in the memory according to the storage address offset of the system parameter.
  • log level data can be written; if the storage type indicates that the data is log level data, the modified value of the data is used to directly set the log level of the current program.
  • system parameter management system 101 can also automatically create the system parameter area and the backup parameter area.
  • the specific method flow is shown in Figure 6, including the following steps:
  • step S601 After the terminal device is started, the factory mark is read; if the factory mark indicates that the terminal device is a new factory device, step S602 is performed.
  • the system parameter management system 101 reads the factory logo from the set address before loading the information recorded in the configuration file 102 and the system parameter values in the system parameter area and the backup parameter area into the memory. . If the value of the factory mark (such as the factory flag value is 0) indicates that the terminal device is a new factory device, and the system parameter area and the backup parameter area have not been created, perform the following step S602; if the value of the factory mark (such as the factory mark) If the value is set to 1), it indicates that the terminal device is not a new factory device. If the system parameter area and the backup parameter area have been created, the following steps S602-S631 need not be performed.
  • the factory mark such as the factory flag value is 0
  • S602 Open the configuration file.
  • S603 The attribute information of the system parameter in the configuration file is sequentially read, and the attribute information of the currently read system parameter is performed as follows: S604.
  • S604 The default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, and the current value of the system parameter is stored in the memory in association with the attribute information of the system parameter.
  • S611 Write the default value of the system parameter to the corresponding address of the system parameter area according to the storage address offset of the system parameter.
  • S621 Write the default value of the system parameter to the corresponding parameter of the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
  • S641 Write the default value of the system parameter to the corresponding address of the backup parameter area according to the storage address offset of the system parameter.
  • S651 The system parameter area and the backup parameter area are created.
  • the terminal device writes the following values to the backup parameter area according to a predetermined offset: Mac address (mac_id), device ID (device_id), factory flag ( device_flag ).
  • the value of the factory mark is set to 1, indicating that the terminal device is not a new factory device.
  • system parameter management system 101 may further include management for upgrading the system parameters.
  • the specific method flow is as shown in FIG. 7, and includes the following steps:
  • step S701 After the terminal device is started, the version upgrade flag is read; and the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded, and step S702 is performed.
  • the system parameter management system 101 reads the information recorded in the configuration file 102 and the values of the system parameters in the system parameter area and the backup parameter area before loading the factory flag in the above step S601. , you can also read the version upgrade flag to determine whether to upgrade the system parameters. If the value of the version upgrade flag (for example, the version upgrade flag is 1) indicates that the system parameter area and the backup parameter area are to be upgraded, the following step S702 is performed; if the value of the version upgrade flag is set (for example, the version upgrade flag value is set to 0) The system parameter area and the backup parameter area do not need to be upgraded, and it is not necessary to perform the following steps S702-S731.
  • S703 The attribute information of the system parameter in the configuration file is sequentially read, and the attribute information of the currently read system parameter is performed as follows: S704.
  • step S704 Find the pair from the backup file corresponding to the attribute information of the currently read system parameter. Attribute information of the system parameter; If the new value of the found system parameter is not found in the backup file, or the new system value of the found system parameter indicates that the system parameter is a new system parameter, step S711 is performed; otherwise, step S721 is performed.
  • the backup file is the previous version of the configuration file, which records the attribute information of the system parameters used in the previous version of the terminal device.
  • some system parameters may be newly defined or deleted.
  • the upgrade file is upgraded with reference to the previous version of the configuration file.
  • the attribute information of the corresponding system parameter is found from the backup file according to the name of the system parameter in the attribute information of the currently read system parameter.
  • the attribute information of the system parameter currently read in the configuration file is:
  • S711 Write the default value of the system parameter to the system parameter area, backup parameter area or memory.
  • the specific process is as shown in the above steps S604-S641, and details are not described herein again.
  • the attribute information of the corresponding system parameter is not found in the backup file, or the new value flag of the found system parameter indicates that the system parameter is a new system parameter, it indicates that the system parameter is a new system parameter after the upgrade version.
  • the default values of the newly added system parameters are written to the system parameter area, backup parameter area or memory. The specific process is as shown in the above steps S604-S641, and details are not described herein again.
  • S721 It is not necessary to modify the value of the system parameter in the system parameter area and the backup parameter area, but load the value of the system parameter in the system parameter area or the backup parameter area into the memory.
  • the specific process is the same as the above steps S303-S361, and details are not described herein again.
  • the new value flag of the parameter indicates that the system parameter is not a new system parameter, indicating that the value of the system parameter exists in the system parameter area or the backup parameter area, for example, the above system parameter net_user:
  • the specific method is the same as the above steps S303-S361, and details are not described herein again.
  • the backup file contains the values of the system parameters that have been written to the system parameter area and the backup parameter area in the previous version of the configuration file, in the system program upgrade process, the backup of the system parameters can be avoided according to the backup file.
  • system parameter management system 101 may further include management for restoring the system parameter area, and the specific method flow. As shown in Figure 8, the following steps are included:
  • S802 The attribute information of the system parameter in the configuration file is sequentially read, and the attribute information of the currently read system parameter is performed as follows: S803.
  • step S803 Determine a storage type of the system parameter. If it is the first storage type, step S811 is performed; if it is the second storage type, step S821 is performed.
  • S811 Restore the value of the system parameter in the system parameter area according to a storage address offset of the system parameter, using a default value of the system parameter.
  • S821 Obtain a value of the system parameter in the backup parameter area according to the storage address offset of the system parameter, and use the value of the system parameter in the obtained backup parameter area to cover the system parameter in the system parameter area. value.
  • a block diagram of an internal structure of a system parameter management system includes: a system parameter loading memory module 901, a system parameter reading ear module 902
  • the system parameter loading memory module 901 is configured to sequentially read attribute information of each system parameter from the configuration file after the terminal device is started, where the attribute information includes: a name of the system parameter, a storage address offset, and a storage type; For each system parameter, the value of the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter; if the storage type of the system parameter is the first storage type, the system parameter area is Obtaining the value of the system parameter as the current value of the system parameter; if the storage type of the system parameter is the second storage type, according to the system The storage address offset of the system parameter obtains the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area, and compares the two; if the comparison result is consistent, The value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is used as the system parameter.
  • the current value is used, and the
  • the system parameter reading module 902 is configured to: after receiving the name of the system parameter transmitted by the system program, find the current value of the system parameter from the memory according to the name of the received system parameter; The value is returned to the system program.
  • system parameter management system may further include: a system parameter modification module 903.
  • the system parameter modification module 903 is configured to: after receiving the name of the system parameter transmitted by the system program and the modified value, find the current value of the system parameter from the memory according to the name of the received system parameter; The value is compared with the found current value, and whether the update is determined according to the comparison result; if the update is decided, the value of the system parameter in the temporary parameter area is updated according to the current value of the updated system parameter in the memory. And recording the name of the system parameter as the modification information; and, when the parameter area update period arrives, or after the user triggers the shutdown, the corresponding parameter is found in the memory according to the name of the system parameter in the recorded modification information.
  • the attribute of the system parameter determining the value of the system parameter in the temporary parameter area according to the stored storage address offset of the found system parameter; after determining that the storage type of the system parameter is the first storage type, according to the temporary
  • the value of the system parameter in the parameter area updates the system parameter in the system parameter area After determining that the storage type of the system parameter is the second storage type, updating the value of the system parameter in the system parameter area and the backup parameter area according to the value of the system parameter in the temporary parameter area .
  • system parameter loading memory module 901 is further configured to: after reading the attribute information of the system parameter from the configuration file, if it is determined that the new value flag of the system parameter indicates that the system parameter is a new system parameter, then: The default value of the system parameter is taken as the current value of the system parameter; and after determining that the storage type of the system parameter is the first storage type, the default value of the system parameter is stored according to the storage address offset of the system parameter to The system parameter area; after determining that the storage type of the system parameter is the second storage type, storing the default value of the system parameter to the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
  • the system parameter management system may further include: a parameter area creation module 904.
  • the parameter area creating module 904 is configured to read the factory mark after the terminal device is started; if the factory mark indicates that the terminal device is a new factory device, the attribute information of each system parameter is sequentially read from the configuration file, and Performing the following operations for each system parameter: using the default value of the system parameter as the current value of the system parameter; storing the current value of the system parameter and the attribute information of the system parameter in the memory; if the system parameter The storage type is the first storage type, and the default value of the system parameter is stored in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type, The storage address offset of the system parameter stores the default value of the system parameter to the system parameter area and the backup parameter area; if the factory mark indicates that the terminal device is a factory flag, the sending parameter area has created a notification.
  • system parameter management system may further include: a parameter area upgrading module 905.
  • the parameter area upgrading module 905 is configured to: after receiving the notification that the parameter area sent by the parameter area creation module has been created, read the version upgrade flag; if the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded,
  • the configuration file sequentially reads the attribute information of each system parameter, and performs the following operations for each system parameter: Searching for the attribute information of the system parameter from the backup file, where the backup file is the configuration of the previous version of the terminal device.
  • the default value is written to the system parameter area and the backup parameter area; the default value of the system parameter in the configuration file is used as the current value of the system parameter; otherwise, the storage type of the system parameter is determined to be the first After storing the type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; after determining that the storage type of the system parameter is the second storage type, the storage address according to the system parameter is determined.
  • the offset obtains the value of the system parameter stored in the backup parameter area, and takes the value of the system parameter obtained from the backup parameter area as the current value of the system parameter; the current value of the system parameter is The attribute information of the system parameter is stored in the memory; if the version upgrade flag indicates that the system parameter area and the backup parameter area have been upgraded, the parameter area has been upgraded.
  • the above-mentioned system parameter loading memory module 901 specifically reads the attribute information of each system parameter from the configuration file and performs processing after receiving the parameter area upgrade notification sent by the parameter area upgrading module 905.
  • the system parameter loading memory module 901 reads and processes the attribute information of each system parameter. The process has been described in detail before and will not be mentioned here.
  • system parameter management system may further include: a parameter area recovery module 906.
  • the parameter area recovery module 906 is configured to read the attribute information of each system parameter sequentially from the configuration file after receiving the information of the system parameter reading error, and perform the following operations for each system parameter: if the storage type of the system parameter is The first storage type, the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type Then, according to the storage address offset of the system parameter, the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area.
  • system parameter management system may further include: a command input module, a calling module (not marked in the figure).
  • the command input module provides the developer with a command line input interface and receives the command line entered by the developer.
  • the format of the command line can be as follows:
  • OAM Command Command OAM Command
  • Operation Type Data Name
  • Another example is a specific command line: ./oamclient setint net— mode 2 1 , which means that the net_mode data is set to int data with a value of 2 and a length of 1.
  • a specific command line: ./oamclient getval boot ver which means to read the value of the boot-ver data. Operations that back up data in the parameter area, such as reading, writing, restoring default values, and so on.
  • the calling module parses the command line received by the command input module, and calls the corresponding module according to the parsing result. Specifically, the calling module calls the corresponding module according to the parsed operation type. For example, if the operation type is "setval", the system parameter modification module 903 is called, and the parameter value in the command line is written to the system parameter area or the backup parameter area; if the operation type is "getval” as described above. Then, the system parameter reading module 902 is called to read out the parameter values of the corresponding data in the system parameter area or the backup parameter area.
  • Command input modules and call modules provide developers with convenient data manipulation widgets that developers can use to manipulate data, such as modifications, reads, etc., for easy testing.
  • the specific working process involved in each module in the system parameter management system of the embodiment of the present invention may be referred to the related content disclosed in the method for managing the system parameters by the system parameter management system, and details are not described herein again.
  • the terminal device can be a mobile phone, a smart TV, a set top box, and the like.
  • attribute information of system parameters is recorded in a configuration file
  • different management methods are used for different storage types of system parameters, so that some very important system parameters are saved in the system parameter area. It is saved in the backup parameter area. If the current value of the system parameter stored in the system parameter area is incorrect or lost due to an accident, you can use the current value of the system parameter stored in the backup parameter area to recover, thus ensuring and improving. Security of system parameters.
  • the attribute information of the system parameter in the configuration file further includes: a new value flag, so that the programmer can add a system parameter in the system parameter area or the backup parameter area: if the programmer modifies the system program of the terminal device, and New system parameters have also been added. Then, in the process of loading the configuration file information into the memory and the data in the system parameter area or the backup parameter area, the value of the new system parameter can be written to the system parameter area or Backup parameter area for easy management of new system parameters.
  • the system parameters can be avoided according to the backup file.
  • the value is to prevent all system parameters from being restored to their default values during system program upgrade. In this way, some system parameters set by the user are not modified due to the upgrade of the system program version, and need to be reset, thereby greatly improving the user's experience.

Abstract

Disclosed are a method and system for managing a system parameter in a terminal device. The method comprises: after receiving the name of a system parameter transmitted by a system program, searching for the current value of the system parameter from a memory and returning same; the memory associatively storing the current value of the system parameter and attribute information about the system parameter; the attribute information about the system parameter being read from a configuration file in sequence, and the current value of the system parameter being obtained from a system parameter region or a backup parameter region. Because the attribute information about the system parameter is recorded in the configuration file, there are different management methods for different storage types of system parameters, and thus, for some very important system parameters which are stored in the system parameter region as well as the backup parameter region, if the data stored in the system parameter region generates errors or is lost due to an accident, the data in the backup parameter region can be used for conducting restoration, thereby guaranteeing and increasing the security of the system parameters.

Description

说 明 书 终端设备中系统参数管理方法及系统  Method and system for managing system parameters in terminal equipment
技术领域 Technical field
本发明涉及嵌入式系统技术, 尤其涉及一种终端设备中系统参数管理方 法以及管理系统。 背景技术  The present invention relates to embedded system technologies, and in particular, to a system parameter management method and a management system in a terminal device. Background technique
目前, 嵌入式系统被广泛应用于通讯领域、 工业控制领域、 家庭智能设 备、 国防、 医疗等领域。 例如, 手机、 智能电视、 机顶盒终端设备、 掌上电 脑等均采用嵌入式系统, 以提供智能化的、 具有较好人机交互性能的功能。  At present, embedded systems are widely used in communications, industrial control, home smart devices, defense, medical and other fields. For example, mobile phones, smart TVs, set-top box devices, handheld computers, etc. all use embedded systems to provide intelligent, better human-computer interaction capabilities.
嵌入式系统中具有多种数据, 包括用户保存的各种文件系统数据, 比如 文档、 图片文件的数据、 数据库中的数据、 系统参数等数据。 其中, 系统参 数对嵌入式系统而言非常重要, 其将影响到系统的正常启动和运行。  The embedded system has a variety of data, including various file system data saved by the user, such as data of documents, picture files, data in the database, system parameters and the like. Among them, system parameters are very important for embedded systems, which will affect the normal startup and operation of the system.
嵌入式系统在启动或运行过程中, 系统程序需要读取一些系统参数, 例 如, 系统的版本号、 设备标识、 网络端口地址等。 如果, 这些系统参数读取 出现错误或丢失, 那么将^艮可能导致系统的启动失败或一些系统功能的失效。 因此, 系统参数对于嵌入式系统的正常启动和运行非常重要。  During the startup or running of the embedded system, the system program needs to read some system parameters, such as the system version number, device ID, network port address, and so on. If these system parameter readings are incorrect or missing, then the system may fail to start or some system functions may fail. Therefore, system parameters are very important for the proper startup and operation of embedded systems.
然而, 有时无法避免要对系统参数进行修改。 例如, 版本号发生变化、 网络端口地址发生变化, 则需要对相应的系统参数进行修改。 然而, 现有技 术的嵌入式系统中, 系统参数的赋值往往直接编写在系统程序之中。 如果要 修改系统参数, 则需要查找到相应的系统程序代码, 进行系统参数赋值修改 以及其它相关代码修改后, 再重新编译、 重新发布运行程序, 才能实现嵌入 式系统在下次启动运行时根据修改后的系统参数进行处理。  However, sometimes it is unavoidable to modify the system parameters. For example, if the version number changes and the network port address changes, you need to modify the corresponding system parameters. However, in prior art embedded systems, the assignment of system parameters is often written directly into the system program. If you want to modify the system parameters, you need to find the corresponding system program code, modify the system parameters and other related code, then recompile and re-release the running program, in order to realize the embedded system according to the modified after the next startup. The system parameters are processed.
事实上, 程序员在修改系统程序代码中除了关注修改的系统参数外, 还 需要修改一些其它相关代码, 而这期间增加了编写代码出错的几率。 如果出 现错误, 将导致嵌入式系统在下次启动运行时出现错误而启动失败或者某些 功能失效。  In fact, in addition to focusing on modified system parameters, the programmer needs to modify some other related code in the modification of the system program code, and this time increases the probability of writing code errors. If an error occurs, it will cause the embedded system to fail during the next startup run and fail to start or some features will fail.
因此, 现有技术的嵌入式系统对系统参数管理的方法, 既不方便程序员 修改系统参数, 也使得系统具有不可靠性。 或者说, 现有技术对嵌入式系统 的系统参数并无有效管理, 使得系统参数修改、 读取的可靠性低, 修改不方 便。 发明内容 本发明实施例提供了一种终端设备中系统参数管理方法及系统, 用以提 供对系统参数有效的管理。 Therefore, the method of system parameter management of the embedded system of the prior art is neither convenient for the programmer to modify the system parameters nor makes the system unreliable. In other words, the prior art does not effectively manage the system parameters of the embedded system, so that the system parameters are modified, the reliability of the reading is low, and the modification is inconvenient. Summary of the invention Embodiments of the present invention provide a system parameter management method and system in a terminal device, which are used to provide effective management of system parameters.
根据本发明的一个方面, 提供了一种终端设备中系统参数管理方法, 包 括:  According to an aspect of the present invention, a system parameter management method in a terminal device is provided, including:
在接收到系统程序传送的系统参数的名称后, 根据接收的系统参数的名 称, 从内存中查找出该系统参数的当前取值; 根据查找到的当前取值向所述 系统程序进行返回; 其中, 所述内存中针对每个系统参数, 关联存储了该系 统参数的当前取值与该系统参数的属性信息; 所述属性信息包括: 系统参数 的名称、 存储地址偏移量以及存储类型;  After receiving the name of the system parameter transmitted by the system program, searching for the current value of the system parameter from the memory according to the name of the received system parameter; and returning to the system program according to the found current value; The in-memory stores the current value of the system parameter and the attribute information of the system parameter for each system parameter; the attribute information includes: a name of the system parameter, a storage address offset, and a storage type;
针对每个系统参数, 将该系统参数的当前取值与该系统参数的属性信息 关联存储到内存的方法包括:  For each system parameter, the method for storing the current value of the system parameter and the attribute information of the system parameter in the memory includes:
在所述终端设备启动后, 从配置文件中依次读取各系统参数的属性信息; 针对每个系统参数, 依据该系统参数的存储地址偏移量获取存储于系统 参数区中的该系统参数的取值;  After the terminal device is started, the attribute information of each system parameter is sequentially read from the configuration file; for each system parameter, the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter. Value
若该系统参数的存储类型为第一存储类型, 则将从系统参数区中获取的 该系统参数的取值作为该系统参数的当前取值; 若该系统参数的存储类型为 第二存储类型, 则依据该系统参数的存储地址偏移量获取存储于备份参数区 中的该系统参数的取值以及存储于系统参数区中的该系统参数的取值, 并对 两者进行比较; 若比较结果为一致, 则将从系统参数区中获取的该系统参数 的取值作为该系统参数的当前取值; 若比较结果为不同, 则将从备份参数区 中获取的该系统参数的取值作为该系统参数的当前取值;  If the storage type of the system parameter is the first storage type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the storage type of the system parameter is the second storage type, Obtaining, according to the storage address offset of the system parameter, the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area, and comparing the two; if the comparison result If they are consistent, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is used as the The current value of the system parameter;
将该系统参数的当前取值与该系统参数的属性信息关联存储到内存中。 进一步, 在所述将从备份参数区中获取的该系统参数的取值作为该系统 参数的当前取值之后, 所述方法还包括:  The current value of the system parameter is stored in the memory in association with the attribute information of the system parameter. Further, after the value of the system parameter that is to be obtained from the backup parameter area is used as the current value of the system parameter, the method further includes:
若获取的该系统参数在备份参数区中的取值与系统参数区中的取值不 同, 则使用该系统参数在备份参数区中的取值更新该系统参数在系统参数区 中的取值。  If the value of the obtained system parameter in the backup parameter area is different from the value in the system parameter area, the value of the system parameter in the backup parameter area is used to update the value of the system parameter in the system parameter area.
进一步, 在所述内存中针对每个系统参数, 关联存储该系统参数的当前 取值与该系统参数的属性信息之后, 所述方法还包括:  Further, after the current value of the system parameter and the attribute information of the system parameter are stored in the memory for each system parameter, the method further includes:
若接收到系统程序传送的系统参数的名称以及修改值, 贝 ij :  If you receive the name of the system parameter transmitted by the system program and the modified value, Bay ij:
根据接收到的系统参数的名称从所述内存中查找出该系统参数的当前取 值; 将所述修改值与查找出的当前取值进行比较, 根据比较结果决定是否更 新; Finding a current value of the system parameter from the memory according to the name of the received system parameter; comparing the modified value with the found current value, and determining whether it is more based on the comparison result New
若决定更新, 则根据所述修改值更新所述内存中的该系统参数的当前取 值; 并  If the update is decided, the current value of the system parameter in the memory is updated according to the modified value; and
若确定该系统参数的存储类型为第一存储类型, 则根据所述内存中更新 后的该系统参数的当前取值更新所述系统参数区中的该系统参数的取值; 若确定该系统参数的存储类型为第二存储类型, 则根据所述内存中更新 后的该系统参数的当前取值更新所述系统参数区以及备份参数区中的该系统 参数的取值。  If it is determined that the storage type of the system parameter is the first storage type, updating the value of the system parameter in the system parameter area according to the current value of the updated system parameter in the memory; if the system parameter is determined The storage type is the second storage type, and the value of the system parameter in the system parameter area and the backup parameter area is updated according to the current value of the updated system parameter in the memory.
进一步, 在所述根据所述内存中更新后的该系统参数的当前取值更新所 述系统参数区中的该系统参数的取值, 或者所述根据所述内存中更新后的该 系统参数的当前取值更新所述系统参数区以及备份参数区中的该系统参数的 取值之前, 所述还包括:  Further, updating the value of the system parameter in the system parameter area according to the current value of the updated system parameter in the memory, or according to the updated system parameter in the memory Before the value of the system parameter is updated, and the value of the system parameter in the backup parameter area is updated, the method further includes:
根据所述内存中更新后的该系统参数的当前取值更新临时参数区中该系 统参数的取值, 并将该系统参数的名称作为修改信息进行记录; 以及,  Updating the value of the system parameter in the temporary parameter area according to the current value of the updated system parameter in the memory, and recording the name of the system parameter as the modification information; and
所述若确定该系统参数的存储类型为第一存储类型, 则根据所述修改值 更新所述系统参数区中的该系统参数的取值; 若确定该系统参数的存储类型 为第二存储类型, 则根据所述修改值更新所述系统参数区以及备份参数区中 的该系统参数的取值具体为:  If it is determined that the storage type of the system parameter is the first storage type, updating the value of the system parameter in the system parameter area according to the modified value; if it is determined that the storage type of the system parameter is the second storage type And updating, according to the modified value, the value of the system parameter in the system parameter area and the backup parameter area is specifically:
在参数区更新周期到达时, 或者用户触发关机后, 则根据记录的修改信 息中的系统参数的名称在所述内存中查找出对应的系统参数的属性, 根据查 找出的系统参数的存储地址偏移量确定出临时参数区中该系统参数的取值; 在确定该系统参数的存储类型为第一存储类型后, 根据所述临时参数区中该 系统参数的取值更新所述系统参数区中的该系统参数的取值; 在确定该系统 参数的存储类型为第二存储类型后, 根据所述临时参数区中该系统参数的取 值更新所述系统参数区以及备份参数区中的该系统参数的取值。  When the parameter area update period arrives, or after the user triggers the shutdown, the attribute of the corresponding system parameter is found in the memory according to the name of the system parameter in the recorded modification information, and the storage address of the system parameter is found according to the found The shifting quantity determines the value of the system parameter in the temporary parameter area; after determining that the storage type of the system parameter is the first storage type, updating the system parameter area according to the value of the system parameter in the temporary parameter area The value of the system parameter is determined; after determining that the storage type of the system parameter is the second storage type, updating the system parameter area and the system in the backup parameter area according to the value of the system parameter in the temporary parameter area The value of the parameter.
较优地, 所述属性信息还包括: 新值标志、 默认值; 以及,  Preferably, the attribute information further includes: a new value flag, a default value; and,
在所述终端设备启动后, 从配置文件中读取了系统参数的属性信息后还 包括:  After the terminal device is started, after reading the attribute information of the system parameter from the configuration file, the method further includes:
若该系统参数的新值标志表示该系统参数为新增系统参数, 则: 将该系统参数的默认值作为该系统参数的当前取值;  If the new value flag of the system parameter indicates that the system parameter is a new system parameter, then: the default value of the system parameter is used as the current value of the system parameter;
若确定该系统参数的存储类型为第一存储类型, 则根据该系统参数的存 储地址偏移量将该系统参数的默认值存储到所述系统参数区; 若确定该系统参数的存储类型为第二存储类型, 则根据该系统参数的存 储地址偏移量将该系统参数的默认值存储到所述系统参数区和备份参数区。 If it is determined that the storage type of the system parameter is the first storage type, storing the default value of the system parameter to the system parameter area according to the storage address offset of the system parameter; If it is determined that the storage type of the system parameter is the second storage type, the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
其中, 所述系统参数区和备份参数区的升级方法包括:  The method for upgrading the system parameter area and the backup parameter area includes:
在所述终端设备启动后, 读取版本升级标志;  After the terminal device is started, the version upgrade flag is read;
若版本升级标志表示所述系统参数区和备份参数区待升级, 则从配置文 件中依次读取各系统参数的属性信息, 并针对每个系统参数进行如下操作: 从备份文件中查找该系统参数的属性信息, 所述备份文件为所述终端设 备的上一版本的配置文件;  If the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded, the attribute information of each system parameter is sequentially read from the configuration file, and the following operations are performed for each system parameter: searching for the system parameter from the backup file Attribute information, the backup file is a configuration file of a previous version of the terminal device;
若确定所述备份文件中不存在该系统参数的属性信息, 或所述备份文件 中该系统参数的新值标志表示该系统参数为新增系统参数, 则: 在确定该系 统参数的存储类型为第一存储类型后, 根据该系统参数的存储地址偏移量将 所述配置文件中该系统参数的默认值写入到所述系统参数区; 在确定该系统 参数的存储类型为第二存储类型后, 根据该系统参数的存储地址偏移量将所 述配置文件中该系统参数的默认值写入到所述系统参数区和备份参数区; 将 所述配置文件中该系统参数的默认值作为该系统参数的当前取值;  If it is determined that the attribute information of the system parameter does not exist in the backup file, or the new value flag of the system parameter in the backup file indicates that the system parameter is a new system parameter, then: determining that the storage type of the system parameter is After the first storage type, the default value of the system parameter in the configuration file is written to the system parameter area according to the storage address offset of the system parameter; determining that the storage type of the system parameter is the second storage type Afterwards, the default value of the system parameter in the configuration file is written to the system parameter area and the backup parameter area according to the storage address offset of the system parameter; the default value of the system parameter in the configuration file is used as The current value of the system parameter;
否则, 在确定该系统参数的存储类型为第一存储类型后, 将从系统参数 区中获取的该系统参数的取值作为该系统参数的当前取值; 在确定该系统参 数的存储类型为第二存储类型后, 则依据该系统参数的存储地址偏移量获取 存储于备份参数区中的该系统参数的取值, 将从备份参数区中获取的该系统 参数的取值作为该系统参数的当前取值;  Otherwise, after determining that the storage type of the system parameter is the first storage type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; determining the storage type of the system parameter is After the storage type is obtained, the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset of the system parameter, and the value of the system parameter obtained from the backup parameter area is used as the system parameter. Current value
将该系统参数的当前取值与该系统参数的属性信息关联存储到内存中。 所述系统参数区和备份参数区的创建方法包括:  The current value of the system parameter is stored in the memory in association with the attribute information of the system parameter. The method for creating the system parameter area and the backup parameter area includes:
在所述终端设备启动后, 读取出厂标志;  After the terminal device is started, the factory mark is read;
若所述出厂标志表示该终端设备为新出厂设备, 则从配置文件中依次读 取各系统参数的属性信息, 并针对每个系统参数进行如下操作:  If the factory mark indicates that the terminal device is a new factory device, the attribute information of each system parameter is sequentially read from the configuration file, and the following operations are performed for each system parameter:
将该系统参数的默认值作为该系统参数的当前取值; 将该系统参数的当 前取值与该系统参数的属性信息关联存储到内存中;  The default value of the system parameter is used as the current value of the system parameter; the current value of the system parameter is stored in the memory in association with the attribute information of the system parameter;
若该系统参数的存储类型为第一存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述系统参数区;  If the storage type of the system parameter is the first storage type, storing the default value of the system parameter to the system parameter area according to the storage address offset of the system parameter;
若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述系统参数区和备份参数区。  If the storage type of the system parameter is the second storage type, the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
所述系统参数区的恢复方法包括: 从配置文件中依次读取各系统参数的属性信息后, 针对每个系统参数进 行如下操作: The method for recovering the system parameter area includes: After reading the attribute information of each system parameter in turn from the configuration file, perform the following operations for each system parameter:
若该系统参数的存储类型为第一存储类型, 则根据该系统参数的存储地 址偏移量, 使用该系统参数的默认值恢复所述系统参数区中该系统参数的取 值;  If the storage type of the system parameter is the first storage type, the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter;
若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地 址偏移量, 使用备份参数区中该系统参数的取值覆盖所述系统参数区中该系 统参数的取值。  If the storage type of the system parameter is the second storage type, the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area according to the storage address offset of the system parameter.
较优地, 所述属性信息还包括: 数据类型; 以及  Preferably, the attribute information further includes: a data type;
所述将所述修改值与查找出的当前取值进行比较具体包括:  The comparing the modified value with the found current value specifically includes:
根据接收到的系统参数的名称从所述内存中查找出该系统参数的数据类 型;  Finding the data type of the system parameter from the memory according to the name of the received system parameter;
若该系统参数的数据类型为 IP地址类型, 则将所述修改值从字符串数据 类型的 IP地址转换为二进制数据类型的 IP地址后,将所述二进制数据类型的 IP地址与所述内存中的该系统参数的当前取值比较;  If the data type of the system parameter is an IP address type, after converting the modified value from an IP address of a string data type to an IP address of a binary data type, the IP address of the binary data type is in the memory The current value comparison of the system parameters;
若该系统参数的数据类型为整数数据类型, 则将所述修改值从字符串表 示的整数转换为整型数据后, 使用转换后的整型数据比较所述内存中的该系 统参数的当前取值;  If the data type of the system parameter is an integer data type, after the modified value is converted from the integer represented by the string to the integer data, the converted integer data is used to compare the current parameter of the system parameter in the memory. Value
若该系统参数的数据类型为设备号类型, 则将所述修改值从字符串类型 的设备号转换为二进制的数值后, 使用转换后的二进制的数值比较所述内存 中的该系统参数的当前取值;  If the data type of the system parameter is a device number type, after converting the modified value from a string type device number to a binary value, the converted binary value is used to compare the current parameter of the system parameter in the memory. Value
若该系统参数的数据类型为字符串类型, 则使用所述修改值比较所述内 存中的该系统参数的当前取值。  If the data type of the system parameter is a string type, the modified value is used to compare the current value of the system parameter in the memory.
根据本发明的另一个方面, 还提供了一种终端设备中系统参数管理系统, 包括:  According to another aspect of the present invention, a system parameter management system in a terminal device is provided, including:
系统参数载入内存模块, 用于在所述终端设备启动后, 从配置文件中依 次读取各系统参数的属性信息, 所述属性信息包括: 系统参数的名称、 存储 地址偏移量以及存储类型; 针对每个系统参数, 依据该系统参数的存储地址 偏移量获取存储于系统参数区中的该系统参数的取值; 若该系统参数的存储 类型为第一存储类型, 则将从系统参数区中获取的该系统参数的取值作为该 系统参数的当前取值; 若该系统参数的存储类型为第二存储类型, 则依据该 系统参数的存储地址偏移量获取存储于备份参数区中的该系统参数的取值以 及存储于系统参数区中的该系统参数的取值, 并对两者进行比较; 若比较结 果为一致, 则将从系统参数区中获取的该系统参数的取值作为该系统参数的 当前取值; 若比较结果为不同, 则将从备份参数区中获取的该系统参数的取 值作为该系统参数的当前取值; 将该系统参数的当前取值与该系统参数的属 性信息关联存储到内存中; The system parameter is loaded into the memory module, and after the terminal device is started, the attribute information of each system parameter is sequentially read from the configuration file, where the attribute information includes: a name of the system parameter, a storage address offset, and a storage type. For each system parameter, the value of the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter; if the storage type of the system parameter is the first storage type, the system parameter is The value of the system parameter obtained in the area is taken as the current value of the system parameter; if the storage type of the system parameter is the second storage type, the storage address offset according to the system parameter is obtained and stored in the backup parameter area. The value of the system parameter is And the value of the system parameter stored in the system parameter area, and compare the two; if the comparison result is consistent, the value of the system parameter obtained from the system parameter area is taken as the current parameter of the system parameter Value; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is taken as the current value of the system parameter; the current value of the system parameter is stored in association with the attribute information of the system parameter to In memory
系统参数读取模块, 用于在接收到系统程序传送的系统参数的名称后, 根据接收的系统参数的名称, 从所述内存中查找出该系统参数的当前取值; 根据查找到的当前取值向所述系统程序进行返回。  a system parameter reading module, configured to: after receiving the name of the system parameter transmitted by the system program, find the current value of the system parameter from the memory according to the name of the received system parameter; The value is returned to the system program.
进一步, 所述系统参数载入内存模块还用于在所述将从备份参数区中获 取的该系统参数的取值作为该系统参数的当前取值之后, 若确定获取的该系 统参数在备份参数区中的取值与系统参数区中的取值不同, 则使用该系统参 数在备份参数区中的取值更新该系统参数在系统参数区中的取值。  Further, the system parameter loading memory module is further configured to: after determining the value of the system parameter obtained from the backup parameter area as the current value of the system parameter, if it is determined that the acquired system parameter is in the backup parameter If the value in the area is different from the value in the system parameter area, the value of the system parameter in the backup parameter area is used to update the value of the system parameter in the system parameter area.
进一步, 所述系统还包括:  Further, the system further includes:
系统参数修改模块, 用于在接收到系统程序传送的系统参数的名称以及 修改值后, 根据接收到的系统参数的名称从所述内存中查找出该系统参数的 当前取值; 将所述修改值与查找出的当前取值进行比较, 根据比较结果决定 是否更新; 若决定更新, 则: 根据所述修改值更新所述内存中的该系统参数 的当前取值; 并且, 在确定该系统参数的存储类型为第一存储类型后, 根据 所述修改值更新所述系统参数区中的该系统参数的取值; 在确定该系统参数 的存储类型为第二存储类型后, 根据所述修改值更新所述系统参数区以及备 份参数区中的该系统参数的取值。  a system parameter modification module, configured to: after receiving the name of the system parameter transmitted by the system program and modifying the value, searching for the current value of the system parameter from the memory according to the name of the received system parameter; Comparing the value with the found current value, determining whether to update according to the comparison result; if deciding to update, updating: the current value of the system parameter in the memory according to the modified value; and determining the system parameter After the storage type is the first storage type, the value of the system parameter in the system parameter area is updated according to the modified value; after determining that the storage type of the system parameter is the second storage type, according to the modified value Updating the value of the system parameter in the system parameter area and the backup parameter area.
进一步, 所述系统参数修改模块还用于在所述根据所述修改值更新所述 系统参数区中的该系统参数的取值, 或者所述根据所述修改值更新所述系统 参数区以及备份参数区中的该系统参数的取值之前, 根据所述内存中更新后 的该系统参数的当前取值更新临时参数区中该系统参数的取值, 并将该系统 参数的名称作为修改信息进行记录; 以及, 在参数区更新周期到达时, 或者 用户触发关机后, 则根据记录的修改信息中的系统参数的名称在所述内存中 查找出对应的系统参数的属性, 根据查找出的系统参数的存储地址偏移量确 定出临时参数区中该系统参数的取值; 在确定该系统参数的存储类型为第一 存储类型后, 根据所述临时参数区中该系统参数的取值更新所述系统参数区 中的该系统参数的取值; 在确定该系统参数的存储类型为第二存储类型后, 根据所述临时参数区中该系统参数的取值更新所述系统参数区以及备份参数 区中的该系统参数的取值。 Further, the system parameter modification module is further configured to: update the value of the system parameter in the system parameter area according to the modified value, or update the system parameter area according to the modified value and back up Before the value of the system parameter in the parameter area is updated, the value of the system parameter in the temporary parameter area is updated according to the current value of the updated system parameter in the memory, and the name of the system parameter is used as the modification information. Recording; and, when the parameter area update period arrives, or after the user triggers the shutdown, the attribute of the corresponding system parameter is found in the memory according to the name of the system parameter in the recorded modification information, according to the found system parameter The storage address offset determines the value of the system parameter in the temporary parameter area; after determining that the storage type of the system parameter is the first storage type, updating the value according to the value of the system parameter in the temporary parameter area The value of the system parameter in the system parameter area; after determining that the storage type of the system parameter is the second storage type, the root Updating the system parameter area and the backup parameter according to the value of the system parameter in the temporary parameter area The value of this system parameter in the zone.
较优地, 所述属性信息还包括: 新值标志、 默认值; 以及,  Preferably, the attribute information further includes: a new value flag, a default value; and,
所述系统参数载入内存模块还用于在从配置文件中读取了系统参数的属 性信息后, 若确定该系统参数的新值标志表示该系统参数为新增系统参数, 则: 将该系统参数的默认值作为该系统参数的当前取值; 并且, 在确定该系 统参数的存储类型为第一存储类型后, 根据该系统参数的存储地址偏移量将 该系统参数的默认值存储到所述系统参数区; 在确定该系统参数的存储类型 为第二存储类型后, 根据该系统参数的存储地址偏移量将该系统参数的默认 值存储到所述系统参数区和备份参数区。  The system parameter loading memory module is further configured to: after reading the attribute information of the system parameter from the configuration file, if it is determined that the new value flag of the system parameter indicates that the system parameter is a new system parameter, then: the system The default value of the parameter is used as the current value of the system parameter; and after determining that the storage type of the system parameter is the first storage type, the default value of the system parameter is stored according to the storage address offset of the system parameter. After determining the storage type of the system parameter as the second storage type, the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
进一步, 所述系统还包括:  Further, the system further includes:
参数区创建模块, 用于在所述终端设备启动后, 读取出厂标志; 若所述 出厂标志表示该终端设备为新出厂设备, 则从配置文件中依次读取各系统参 数的属性信息, 并针对每个系统参数进行如下操作: 将该系统参数的默认值 作为该系统参数的当前取值; 将该系统参数的当前取值与该系统参数的属性 信息关联存储到内存中; 若该系统参数的存储类型为第一存储类型, 则根据 该系统参数的存储地址偏移量将该系统参数的默认值存储到所述系统参数 区; 若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述系统参数区和备份参数区; 若所 述出厂标志表示该终端设备为已出厂标志, 则发送参数区已创建通知。  a parameter area creating module, configured to read a factory mark after the terminal device is started; if the factory mark indicates that the terminal device is a new factory device, the attribute information of each system parameter is sequentially read from the configuration file, and Performing the following operations for each system parameter: using the default value of the system parameter as the current value of the system parameter; storing the current value of the system parameter and the attribute information of the system parameter in the memory; if the system parameter The storage type is the first storage type, and the default value of the system parameter is stored in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type, The storage address offset of the system parameter stores the default value of the system parameter to the system parameter area and the backup parameter area; if the factory mark indicates that the terminal device is a factory flag, the sending parameter area has created a notification.
进一步, 所述系统还包括:  Further, the system further includes:
参数区升级模块, 用于在接收到所述参数区创建模块发送的参数区已创 建通知后, 读取版本升级标志; 若版本升级标志表示所述系统参数区和备份 参数区待升级, 则从配置文件中依次读取各系统参数的属性信息, 并针对每 个系统参数进行如下操作: 从备份文件中查找该系统参数的属性信息, 所述 备份文件为所述终端设备的上一版本的配置文件; 若确定所述备份文件中不 存在该系统参数的属性信息, 或所述备份文件中该系统参数的新值标志表示 该系统参数为新增系统参数, 则: 在确定该系统参数的存储类型为第一存储 类型后, 根据该系统参数的存储地址偏移量将所述配置文件中该系统参数的 默认值写入到所述系统参数区; 则确定该系统参数的存储类型为第二存储类 型后, 根据该系统参数的存储地址偏移量将所述配置文件中该系统参数的默 认值写入到所述系统参数区和备份参数区; 将所述配置文件中该系统参数的 默认值作为该系统参数的当前取值; 否则, 在确定该系统参数的存储类型为 第一存储类型后, 将从系统参数区中获取的该系统参数的取值作为该系统参 数的当前取值; 在确定该系统参数的存储类型为第二存储类型后, 则依据该 系统参数的存储地址偏移量获取存储于备份参数区中的该系统参数的取值, 将从备份参数区中获取的该系统参数的取值作为该系统参数的当前取值; 将 该系统参数的当前取值与该系统参数的属性信息关联存储到内存中; 若版本 升级标志表示所述系统参数区和备份参数区已升级, 则发送参数区已升级通 知。 a parameter area upgrading module, configured to: after receiving the notification that the parameter area sent by the parameter area creation module has been created, read the version upgrade flag; if the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded, The configuration file sequentially reads the attribute information of each system parameter, and performs the following operations for each system parameter: Searching for the attribute information of the system parameter from the backup file, where the backup file is the configuration of the previous version of the terminal device. a file; if it is determined that the attribute information of the system parameter does not exist in the backup file, or the new value flag of the system parameter in the backup file indicates that the system parameter is a new system parameter, then: determining the storage of the system parameter After the type is the first storage type, the default value of the system parameter in the configuration file is written to the system parameter area according to the storage address offset of the system parameter; then the storage type of the system parameter is determined to be the second After storing the type, the system parameter in the configuration file is silent according to the storage address offset of the system parameter. Parameter value is written to the system parameters and backup zone area; the default value of the system parameter in the configuration file as a current value of the system parameter; otherwise, determining the storage type for the system parameter After the first storage type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; after determining that the storage type of the system parameter is the second storage type, according to the system parameter The storage address offset obtains the value of the system parameter stored in the backup parameter area, and takes the value of the system parameter obtained from the backup parameter area as the current value of the system parameter; The value is stored in the memory in association with the attribute information of the system parameter; if the version upgrade flag indicates that the system parameter area and the backup parameter area have been upgraded, the parameter area has been upgraded.
进一步, 所述系统还包括:  Further, the system further includes:
参数区恢复模块, 用于在接收到系统参数读取错误的信息后, 从配置文 件中依次读取各系统参数的属性信息, 针对每个系统参数进行如下操作: 若 该系统参数的存储类型为第一存储类型, 则根据该系统参数的存储地址偏移 量, 使用该系统参数的默认值恢复所述系统参数区中该系统参数的取值; 若 该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地址偏移 量, 使用备份参数区中该系统参数的取值覆盖所述系统参数区中该系统参数 的取值。  The parameter area recovery module is configured to read the attribute information of each system parameter sequentially from the configuration file after receiving the error information of the system parameter reading, and perform the following operations for each system parameter: if the storage type of the system parameter is The first storage type, the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type Then, according to the storage address offset of the system parameter, the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area.
本发明实施例中由于将系统参数的属性信息记录在配置文件中, 针对系 统参数的不同的存储类型具有不同的管理方法, 这样, 对于一些非常重要的 系统参数, 既保存在系统参数区中又保存在备份参数区中, 如果由于意外而 导致系统参数区中存储的系统参数的当前取值出错或丢失, 可以使用备份参 数区中存储的系统参数的当前取值进行恢复, 从而保障、 提高了系统参数的 安全性。  In the embodiment of the present invention, since attribute information of system parameters is recorded in a configuration file, different management methods are used for different storage types of system parameters, so that some very important system parameters are saved in the system parameter area. It is saved in the backup parameter area. If the current value of the system parameter stored in the system parameter area is incorrect or lost due to an accident, you can use the current value of the system parameter stored in the backup parameter area to recover, thus ensuring and improving. Security of system parameters.
进一步, 配置文件中的系统参数的属性信息中还包括: 新值标志, 以便 于程序员在系统参数区或备份参数区新增系统参数: 如果程序员对终端设备 的系统程序进行了修改, 并且还增加了新的系统参数, 那么, 在向内存载入 配置文件的信息以及系统参数区或备份参数区中的数据的过程中, 可以将新 的系统参数的取值写入到系统参数区或备份参数区, 便于对新增系统参数的 管理。  Further, the attribute information of the system parameter in the configuration file further includes: a new value flag, so that the programmer can add a system parameter in the system parameter area or the backup parameter area: if the programmer modifies the system program of the terminal device, and New system parameters have also been added. Then, in the process of loading the configuration file information into the memory and the data in the system parameter area or the backup parameter area, the value of the new system parameter can be written to the system parameter area or Backup parameter area for easy management of new system parameters.
进一步, 由于备份文件中记载了上一版配置文件中已写入到系统参数区、 备份参数区的系统参数的取值, 从而在系统程序升级过程中, 根据备份文件 可以避免覆盖掉这些系统参数的取值, 防止在系统程序升级过程中, 将所有 系统参数都恢复为默认值。 这样, 用户设置过的一些系统参数不会因为系统 程序版本升级的原因而被修改, 又需要重新设置, 从而大大改善了用户的体 验。 Further, since the value of the system parameter written in the system parameter area and the backup parameter area in the previous version configuration file is recorded in the backup file, in the system program upgrade process, the system parameters can be avoided according to the backup file. The value is to prevent all system parameters from being restored to their default values during system program upgrade. In this way, some system parameters set by the user will not be modified due to the upgrade of the system program version, and need to be reset, thereby greatly improving the user's body. Test.
附图说明 DRAWINGS
图 1为本发明实施例的终端设备中系统参数管理系统的示意图; 图 2、 3为本发明实施例的系统参数载入内存的方法流程图;  1 is a schematic diagram of a system parameter management system in a terminal device according to an embodiment of the present invention; and FIG. 2 is a flowchart of a method for loading system parameters into a memory according to an embodiment of the present invention;
图 4 为本发明实施例的系统参数管理系统对系统程序读取系统参数的管 理方法流程图;  4 is a flowchart of a method for managing system parameter reading system parameters by a system parameter management system according to an embodiment of the present invention;
图 5 为本发明实施例的系统参数管理系统对系统程序修改系统参数的管 理方法流程图;  FIG. 5 is a flowchart of a method for managing system parameters by modifying a system parameter of a system parameter management system according to an embodiment of the present invention; FIG.
图 6为本发明实施例的系统参数区、 备份参数区的创建方法流程图; 图 7 为本发明实施例的系统参数管理系统对系统参数进行升级管理的方 法流程图;  6 is a flowchart of a method for creating a system parameter area and a backup parameter area according to an embodiment of the present invention; FIG. 7 is a flowchart of a method for upgrading and managing system parameters by a system parameter management system according to an embodiment of the present invention;
图 8 为本发明实施例的系统参数管理系统对系统参数区进行恢复管理的 方法流程图;  8 is a flowchart of a method for recovering and managing a system parameter area by a system parameter management system according to an embodiment of the present invention;
图 9为本发明实施例的系统参数管理系统内部结构框图。  FIG. 9 is a block diagram showing the internal structure of a system parameter management system according to an embodiment of the present invention.
具体实施方式 detailed description
为使本发明的目的、 技术方案及优点更加清楚明白, 以下参照附图并举 出优选实施例, 对本发明进一步详细说明。 然而, 需要说明的是, 说明书中 列出的许多细节仅仅是为了使读者对本发明的一个或多个方面有一个透彻的 本申请使用的 "模块"、 "系统" 等术语旨在包括与计算机相关的实体, 例如但不限于硬件、 固件、 软硬件组合、 软件或者执行中的软件。 例如, 模 块可以是, 但并不仅限于: 处理器上运行的进程、 处理器、 对象、 可执行程 序、 执行的线程、 程序和 /或计算机。 举例来说, 计算设备上运行的应用程序 和此计算设备都可以是模块。 一个或多个模块可以位于执行中的一个进程和 / 或线程内。  The present invention will be further described in detail below with reference to the accompanying drawings. It should be noted, however, that many of the details are set forth in the specification in order to provide the reader with a thorough understanding of one or more aspects of the present invention. The terms "module", "system" and the like are intended to include computer-related terms. Entities such as, but not limited to, hardware, firmware, hardware/software combinations, software, or software in execution. For example, a module can be, but is not limited to: a process running on a processor, a processor, an object, an executable, a thread of execution, a program, and/or a computer. For example, an application running on a computing device and this computing device can be modules. One or more modules can be located within a process and/or thread in execution.
本发明实施例根据系统参数的特点提供了一个系统参数管理系统, 以便 有效地管理嵌入式系统中各种系统参数, 以方便对系统参数的访问、 修改, 增加了系统参数的可靠性、 安全性, 并且节约了整体系统参数所占用的存储 空间。  The embodiment of the invention provides a system parameter management system according to the characteristics of the system parameters, so as to effectively manage various system parameters in the embedded system, so as to facilitate accessing and modifying system parameters, and increasing reliability and security of system parameters. And saves the storage space occupied by the overall system parameters.
下面结合附图详细说明本发明实施例的技术方案。 如图 1 所示的终端设 备中包括: 系统参数管理系统 101、 系统程序 102、 配置文件、 系统参数区。 其中, 系统参数区用以存储系统参数的取值。 系统参数区可以设置于非 易失性存储器件中, 如 FLASH等。 此外, 本发明的发明人对系统参数的特点 进行分析, 发现在系统参数中还有一些非常重要的、 会影响到系统正常启动 的参数, 那么嵌入式系统中还可以为之创建备份参数区, 将系统参数区中存 储的一些重要的系统参数的取值再备份存储于备份参数区中。 而备份参数区 可以设置于 EEPROM等比较可靠的数据存储器件中, 不易丢失数据。 上述的 系统参数区中的数据可以是以二进制文件的形式存储于 FLASH存储介质中, 备份参数区的数据可以是以二进制文件的形式存储于 EEPROM存储介质中。 The technical solutions of the embodiments of the present invention are described in detail below with reference to the accompanying drawings. The terminal device shown in FIG. 1 includes: a system parameter management system 101, a system program 102, a configuration file, and a system parameter area. The system parameter area is used to store the value of the system parameter. The system parameter area can be set in a non-volatile memory device, such as FLASH. In addition, the inventor of the present invention analyzes the characteristics of the system parameters and finds that there are some very important parameters in the system parameters that will affect the normal startup of the system, and the backup system can also create a backup parameter area for the embedded system. The values of some important system parameters stored in the system parameter area are backed up and stored in the backup parameter area. The backup parameter area can be set in a relatively reliable data storage device such as EEPROM, and it is not easy to lose data. The data in the system parameter area described above may be stored in a FLASH storage medium in the form of a binary file, and the data in the backup parameter area may be stored in the EEPROM storage medium in the form of a binary file.
鉴于上述对系统参数的特点的分析, 本发明实施例中为不同的系统参数 定义了不同的存储类型。 系统参数的存储类型包括: 第一存储类型、 第二存 储类型。  In view of the above analysis of the characteristics of the system parameters, different storage types are defined for different system parameters in the embodiments of the present invention. The storage types of system parameters include: a first storage type, a second storage type.
第一存储类型的系统参数指的是其取值仅存储于系统参数区中的系统参 数; 第二存储类型的系统参数指的是其取值既存储于系统参数区中, 又备份 存储于备份参数区中的系统参数。  The system parameter of the first storage type refers to the system parameter whose value is only stored in the system parameter area; the system parameter of the second storage type refers to the value stored in the system parameter area and backed up and stored in the backup. System parameters in the parameter area.
此外, 系统参数的存储类型还可包括: 第三存储类型、 第四存储类型。 第三存储类型的系统参数指的是其取值仅存于緩存中的系统参数; 第四 存储类型的系统参数指的是其取值仅存于备份参数区中的系统参数。  In addition, the storage type of the system parameter may further include: a third storage type, a fourth storage type. The system parameter of the third storage type refers to the system parameter whose value is only stored in the cache; the system parameter of the fourth storage type refers to the system parameter whose value is only stored in the backup parameter area.
在配置文件中, 针对每个系统参数分别记录了该系统参数的属性信息。 系统参数的属性信息具体可以包括: 系统参数的名称、 存储类型、 存储地址 偏移量。 其中, 系统参数的存储地址偏移量指示出了该系统参数的取值在系 统参数区或备份参数区中存储的地址的偏移量。 也就是说, 可以根据该系统 参数的存储地址偏移量从系统参数区或备份参数区中读取或写入该系统参数 的取值。  In the configuration file, the attribute information of the system parameter is recorded separately for each system parameter. The attribute information of the system parameter may specifically include: a name of the system parameter, a storage type, and a storage address offset. The storage address offset of the system parameter indicates the offset of the value of the system parameter stored in the system parameter area or the backup parameter area. That is to say, the value of the system parameter can be read or written from the system parameter area or the backup parameter area according to the storage address offset of the system parameter.
此外, 作为更优的实施方式, 配置文件中记录的系统参数的属性信息还 可以包括: 系统参数的数据类型、 存储长度、 默认值。  In addition, as a better implementation manner, the attribute information of the system parameter recorded in the configuration file may further include: a data type, a storage length, and a default value of the system parameter.
更进一步, 配置文件中记录的系统参数的属性信息还可以包括: 删除标 志、 新值标志、 创建初始化是备份参数区的值是否可写标志、 恢复出厂状态 时参数是否可恢复为默认值的标志等。  Further, the attribute information of the system parameter recorded in the configuration file may further include: deleting a flag, a new value flag, creating a flag indicating whether the value of the backup parameter area is writable, and whether the parameter can be restored to a default value when the factory state is restored. Wait.
配置文件可以多种格式来存储每个系统参数的属性信息。 例如, 将每个 系统参数的属性信息依次记录于配置文件中, 不同系统参数的属性信息以换 行符进行分隔。 本发明实施例中提供的一种配置文件中对系统参数的属性信 息的存储方式为: 根据系统参数的不同存储类型, 为每个存储类型划分了属 于该存储类型的存储区域, 与该存储类型相同的系统参数, 其属性信息被存 储于该存储类型的存储区域中。 Profiles can store attribute information for each system parameter in a variety of formats. For example, the attribute information of each system parameter is sequentially recorded in the configuration file, and the attribute information of different system parameters is separated by a newline character. The storage manner of the attribute information of the system parameter in a configuration file provided in the embodiment of the present invention is: according to different storage types of the system parameter, the genus is divided for each storage type. In the storage area of the storage type, the same system parameter as the storage type, and the attribute information thereof is stored in the storage area of the storage type.
具体地, 存储类型为第一存储类型的系统参数, 其属性信息存储于第一 存储类型的存储区域中; 存储类型为第二存储类型的系统参数, 其属性信息 存储于第二存储类型的存储区域中; 存储类型为第三存储类型的系统参数, 其属性信息存储于第三存储类型的存储区域中; 存储类型为第四存储类型的 系统参数, 其属性信息存储于第四存储类型的存储区域中。  Specifically, the storage type is a system parameter of the first storage type, and the attribute information is stored in the storage area of the first storage type; the storage type is a system parameter of the second storage type, and the attribute information is stored in the storage of the second storage type. In the area, the storage type is a system parameter of the third storage type, and the attribute information is stored in the storage area of the third storage type; the storage type is a system parameter of the fourth storage type, and the attribute information is stored in the storage of the fourth storage type. In the area.
在配置文件中, 第一存储类型的标识可以为 OAM— ONLY— GER, 第二存 储类型的标识可以为 OAM— BOTH— IMP— GER, 第三存储类型的标识可以为 OAM ONLY TMP , 第四存储类型的标识可以为 OAM— ONLY— IMP。  In the configuration file, the identifier of the first storage type may be OAM-ONLY-GER, the identifier of the second storage type may be OAM-BOTH-IM-GER, and the identifier of the third storage type may be OAM ONLY TMP, the fourth storage The type identifier can be OAM-ONLY-IM.
第一存储类型的存储区域可以根据第一存储类型的标识在配置文件中进 行划界。 具体地, 以节点标识 <OAM— ONLY— GER^^t、第一存储类型的存储 区域的起始, 以节点标识 </ OAM— ONLY— GER >标志第一存储类型的存储区 域的结束。  The storage area of the first storage type may be delimited in the configuration file according to the identification of the first storage type. Specifically, the end of the storage area of the first storage type is identified by the node identifier <OAM_ONLY_GER^^t, the beginning of the storage area of the first storage type, and the node identifier </ OAM_ONLY_GER >.
类似地, 在配置文件中可以根据第二存储类型的标识划界第二存储类型 的存储区域: 以节点标识 <OAM— BOTH— IMP— GER^^t、第一存储类型的存储 区域的起始, 以节点标识 </ OAM— BOTH— IMP— GER^^志第一存储类型的存 储区域的结束。  Similarly, in the configuration file, the storage area of the second storage type may be delimited according to the identifier of the second storage type: with the node identifier <OAM_BOTH_IM_GER^^t, the beginning of the storage area of the first storage type , with node identification </ OAM — BOTH — IMP — GER ^ ^ The end of the storage area of the first storage type.
在以节点划分的同一存储类型的存储区域中, 还可包括若干子节点, 每 个子节点中包含有一个与该存储类型相同的系统参数的属性信息。 在配置文 件中具体可以 "<" 标志一个子节点的起始, 以 "/>" 标志该子节点的结束。  In the storage area of the same storage type divided by nodes, several child nodes may be further included, and each child node includes attribute information of the same system parameter as the storage type. In the configuration file, "<" can be used to mark the beginning of a child node, and "/>" to mark the end of the child node.
以下示出了一个配置文件中具体记录的系统参数的属性信息:  The following shows the attribute information of the system parameters specifically recorded in a configuration file:
<root>  <root>
<OAM_BOTH_IMP_GER>  <OAM_BOTH_IMP_GER>
<mac_id default_val="l 12233445566" offset=M0" len="6" delete_mark=M0" val_type="3" write_mark="l " factory_mark=" 1 " new_value="l " /> <mac_id default_val="l 12233445566" offset= M 0"len="6" delete_mark= M 0"val_type="3"write_mark="l"factory_mark=" 1 "new_value="l"/>
<device_id default_val="l 1223344556677889900AABBCCDDEE" offset="6" len="16" delete_mark="0" val_type="3" write_mark="l" factory_mark=" 1 " new_value="l" />  <device_id default_val="l 1223344556677889900AABBCCDDEE" offset="6" len="16" delete_mark="0" val_type="3" write_mark="l" factory_mark=" 1 " new_value="l" />
<net_mode default_val="l " offset="22" len="l" delete_mark="0" val_type="0" write_mark="0" factory_mark="0" new_value="0" /> </OAM BOTH IMP GER> <net_mode default_val="l "offset="22"len="l"delete_mark="0"val_type="0"write_mark="0"factory_mark="0"new_value="0"/> </OAM BOTH IMP GER>
<OAM ONLY IMP>  <OAM ONLY IMP>
<device_flag default_val=" 115" offset="77" len=" 1 " delete_mark="0 val_type="0" write_mark=" 1 " factory_mark=" 1 " new_value="0" />  <device_flag default_val=" 115" offset="77" len=" 1 " delete_mark="0 val_type="0" write_mark=" 1 " factory_mark=" 1 " new_value="0" />
</OAM ONLY IMP> </OAM ONLY IMP>
<OAM ONLY GER>  <OAM ONLY GER>
<net_user default_val="hitvtest" offset="256" len="32" delete_mark="0' val_type="l" write_mark="0" factory_mark="0" new_value="0" /> <net_pwd default_val=" 123456" offset="288" len="16" delete_mark="0 val_type="l" write_mark="0" factory_mark="0" new_value="0" />  <net_user default_val="hitvtest" offset="256" len="32" delete_mark="0' val_type="l" write_mark="0" factory_mark="0" new_value="0" /> <net_pwd default_val=" 123456 " offset="288" len="16" delete_mark="0 val_type="l" write_mark="0" factory_mark="0" new_value="0" />
</OAM ONLY GER> </OAM ONLY GER>
<OAM ONLY TMP>  <OAM ONLY TMP>
<subscriber_id default_val="0" offset:"" len="4" delete_mark="0" val_type="0" write_mark="0" factory_mark="0" new_value="0" /> <channel_valid_time default_val="16" offset:"" len="4" delete_mark="0 val_type="0" write_mark="0" factory_mark="0" new_value="0" />  <subscriber_id default_val="0" offset:"" len="4" delete_mark="0" val_type="0" write_mark="0" factory_mark="0" new_value="0" /> <channel_valid_time default_val="16" Offset:"" len="4" delete_mark="0 val_type="0" write_mark="0" factory_mark="0" new_value="0" />
</OAM ONLY TMP> </OAM ONLY TMP>
</root> 其中 <root>为根节点,标志配置文件的起始, </1"001>标志配置文件的结束。 在上述的配置文件中可以看出,在第二存储类型的存储区域中记录了 mac— id、 device— id等系统参数的属性信息, 由于这些系统参数的属性信息存储于第二 存储类型的存储区域中也就表明了这些系统参数的存储类型即为第二存储 类。 类似地, 在第一存储类型的存储区域中记录的 net— user、 net_pwd等系统 参数的属性信息, 则表明这些系统参数的存储类型即为第一存储类型。 这种 格式便于分别对各种存储类型的系统参数的管理。  </root> where <root> is the root node, marking the beginning of the configuration file, and the </1"001> flag is the end of the configuration file. As can be seen in the above configuration file, in the storage area of the second storage type The attribute information of the system parameters such as mac_id and device_id are recorded. Since the attribute information of these system parameters is stored in the storage area of the second storage type, it indicates that the storage type of these system parameters is the second storage class. Similarly, the attribute information of the system parameters such as net_user and net_pwd recorded in the storage area of the first storage type indicates that the storage type of the system parameters is the first storage type. This format facilitates separate storage. Management of the type of system parameters.
在终端设备启动后, 系统参数管理系统 101 将配置文件中记录的信息以 及系统参数区中的系统参数取值载入到内存中, 以便于系统程序在启动、 运 行过程中读取。 具体地, 系统参数管理系统 101 从配置文件中依次读取各系 统参数的属性信息; 针对每个系统参数, 根据该系统参数的属性信息中的系 统参数的存储地址偏移量从系统参数区中获取该系统参数的当前取值, 并将 配置文件中该系统参数的属性信息以及系统参数区中该系统参数的当前取值 关联保存于内存中。 After the terminal device is started, the system parameter management system 101 loads the information recorded in the configuration file and the system parameter values in the system parameter area into the memory, so that the system program can be read during startup and running. Specifically, the system parameter management system 101 sequentially reads the departments from the configuration file. Attribute information of the system parameter; for each system parameter, the current value of the system parameter is obtained from the system parameter area according to the storage address offset of the system parameter in the attribute information of the system parameter, and the system in the configuration file The attribute information of the parameter and the current value of the system parameter in the system parameter area are stored in the memory.
作为更优的实施方式, 对于还具有备份参数区的情况, 系统参数管理系 统 101 将配置文件中记录的信息以及系统参数区、 备份参数区中的系统参数 取值载入到内存的方法流程, 如图 2所示。  As a more preferred embodiment, for the case where the backup parameter area is also provided, the system parameter management system 101 loads the information recorded in the configuration file and the method parameter of the system parameter area and the system parameter value in the backup parameter area into the memory. as shown in picture 2.
参见图 2, 流程开始于步骤 S201 : 开始, 创建内存数组, i=0, 打开配置 文件; 其中, i为整数, 指示当前内存数组的元素序号。  Referring to Figure 2, the process begins in step S201: Start, create a memory array, i=0, open the configuration file; where i is an integer indicating the element number of the current memory array.
系统参数管理系统 101在内存中创建一个数组。  The system parameter management system 101 creates an array in memory.
配置文件存于非易失性存储器件的某个固定地址处, 系统参数管理系统 101从该固定地址处打开配置文件。  The configuration file is stored at a fixed address of the non-volatile storage device from which the system parameter management system 101 opens the configuration file.
S202: 从配置文件中依次读取系统参数的属性信息; 若读取到配置文件 的结束标识, 则执行步骤 S261 ; 否则, 执行步骤 S203。  S202: The attribute information of the system parameter is sequentially read from the configuration file; if the end identifier of the configuration file is read, step S261 is performed; otherwise, step S203 is performed.
从配置文件中逐条读取系统参数的属性信息, 若当前读取到配置文件的 结束标识, 则执行步骤 S261 ; 否则, 对于当前读取的系统参数的属性信息执 行如下步骤 S203。  The attribute information of the system parameter is read one by one from the configuration file. If the end identifier of the configuration file is currently read, step S261 is performed; otherwise, the following step S203 is performed for the attribute information of the currently read system parameter.
S203 : 针对当前读取的系统参数的属性信息, 确定该系统参数的存储类 型; 若该系统参数的存储类型为第一存储类型, 则执行步骤 S211 ; 若该系统 参数的存储类型为第二存储类型, 则执行步骤 S221 ; 若该系统参数的存储类 型为第三存储类型, 则执行步骤 S231 ; 若该系统参数的存储类型为第四存储 类型, 则执行步骤 S241。  S203: determining, according to the attribute information of the currently read system parameter, a storage type of the system parameter; if the storage type of the system parameter is the first storage type, executing step S211; if the storage type of the system parameter is the second storage If the storage type of the system parameter is the third storage type, step S231 is performed; if the storage type of the system parameter is the fourth storage type, step S241 is performed.
S211 : 从系统参数区中获取该系统参数的取值, 并作为该系统参数的当 前取值后, 执行步骤 S251。  S211: After obtaining the value of the system parameter from the system parameter area, and taking the current value of the system parameter, step S251 is performed.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取系统参数区中存储的该系统参数的取值作为该系统参数的当前取值。 之后, 执行步骤 S251。  Specifically, the value of the system parameter stored in the system parameter area is obtained as the current value of the system parameter according to the storage address offset in the attribute information of the currently read system parameter. After that, step S251 is performed.
S221 : 获取系统参数区中存储的该系统参数的取值。  S221: Obtain a value of the system parameter stored in a system parameter area.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取系统参数区中存储的该系统参数的取值。  Specifically, the value of the system parameter stored in the system parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter.
S222: 获取备份参数区中存储的该系统参数的取值。  S222: Obtain a value of the system parameter stored in the backup parameter area.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取备份参数区中存储的该系统参数的取值。 Specifically, according to the storage address offset in the attribute information of the currently read system parameter, Take the value of the system parameter stored in the backup parameter area.
S223 : 将从系统参数区中获取的该系统参数的取值与从备份参数区中获 取的该系统参数的取值进行比较; 若不同, 执行步骤 S224; 否则, 执行步骤 S225。  S223: The value of the system parameter obtained from the system parameter area is compared with the value of the system parameter obtained from the backup parameter area; if not, step S224 is performed; otherwise, step S225 is performed.
S224: 使用该系统参数在备份参数区中的取值更新该系统参数在系统参 数区中的取值。  S224: The value of the system parameter in the system parameter area is updated by using the value of the system parameter in the backup parameter area.
使用从备份参数区中获取的该系统参数的取值更新系统参数区中该系统 参数的取值。 这样, 对于一些非常重要的系统参数, 如果由于意外而导致系 统参数区中存储的系统参数的取值出错或丢失, 可以使用备份参数区中存储 的系统参数的取值进行恢复, 从而保障、 提高了系统参数的安全性。  The value of the system parameter in the system parameter area is updated using the value of the system parameter obtained from the backup parameter area. In this way, for some very important system parameters, if the value of the system parameter stored in the system parameter area is wrong or lost due to an accident, the value of the system parameter stored in the backup parameter area can be used for recovery, thereby ensuring and improving The security of the system parameters.
S225 : 将从备份参数区中获取该系统参数的取值与从系统参数区中获取 该系统参数的取值进行比较; 根据比较结果确定该系统参数的当前取值; 之 后, 执行步骤 S251。  S225: Compare the value of the system parameter obtained from the backup parameter area with the value of the system parameter obtained from the system parameter area; determine the current value of the system parameter according to the comparison result; and then perform step S251.
具体地, 依据该系统参数的存储地址偏移量获取存储于备份参数区中的 该系统参数的取值以及存储于系统参数区中的该系统参数的取值, 并对两者 进行比较; 若比较结果为一致, 则将从系统参数区中获取的该系统参数的取 值作为该系统参数的当前取值; 若比较结果为不同, 则将从备份参数区中获 取的该系统参数的取值作为该系统参数的当前取值。 之后, 执行步骤 S251。  Specifically, the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area are obtained according to the storage address offset of the system parameter, and the two are compared; If the comparison result is consistent, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is obtained. As the current value of the system parameter. After that, step S251 is performed.
较佳地, 依据该系统参数的存储地址偏移量获取存储于备份参数区中的 该系统参数的取值以及存储于系统参数区中的该系统参数的取值, 并对两者 进行比较; 若比较结果为一致, 则将从系统参数区中获取的该系统参数的取 值作为该系统参数的当前取值; 若比较结果为不同, 则将从备份参数区中获 取的该系统参数的取值作为该系统参数的当前取值并使用该系统参数在备份 参数区中的取值更新该系统参数在系统参数区中的取值。 之后, 执行步骤 S251。  Preferably, the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area are obtained according to the storage address offset of the system parameter, and the two are compared; If the comparison result is consistent, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the system parameter obtained from the backup parameter area is taken. The value is used as the current value of the system parameter and the value of the system parameter in the backup parameter area is used to update the value of the system parameter in the system parameter area. After that, step S251 is performed.
S231: 将当前读取的系统参数的属性信息中的默认值作为该系统参数的 当前取值后, 执行步骤 S251。  S231: After the default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, step S251 is performed.
S241 : 从备份参数区中获取该系统参数的取值, 并将之作为该系统参数 的当前取值后, 执行步骤 S251。  S241: Obtain the value of the system parameter from the backup parameter area, and use the current value of the system parameter, and then perform step S251.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取备份参数区中存储的该系统参数的取值。 将从备份参数区中获取的该系统 参数的取值作为该系统参数的当前取值后, 执行步骤 S251。 S251 : 将当前读取的系统参数的属性信息与该系统参数的当前取值关联 存储到内存中。 Specifically, the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter. After the value of the system parameter obtained from the backup parameter area is taken as the current value of the system parameter, step S251 is performed. S251: The attribute information of the currently read system parameter is stored in the memory in association with the current value of the system parameter.
具体地, 将当前读取的系统参数的属性信息以及该系统参数的当前取值 存储到内存数组的第 i个数组元素中。  Specifically, the attribute information of the currently read system parameter and the current value of the system parameter are stored in the i-th array element of the memory array.
S252: i=i+l , 跳转到步骤 S202。  S252: i=i+l , the process goes to step S202.
S261 : 结束。  S261: End.
如果程序员对终端设备的系统程序 102进行了修改, 并且还增加了新的 系统参数, 那么为便于程序员在系统参数区或备份参数区新增系统参数的取 值, 则配置文件中的系统参数的属性信息中还可包括: 新值标志。 新值标志 用以指示该系统参数是否为新增系统参数。 例如, 新值标志为 1 表示该系统 参数为新增系统参数, 即取值还没有写入到系统参数区或备份参数区的系统 参数; 新值标志为 0表示该系统参数不是新增系统参数, 其取值已存入到系 统参数区或备份参数区的系统参数。 在系统参数区或备份参数区新增系统参 数的取值的过程为: 从配置文件中读取了系统参数的属性信息后, 若该系统 参数的新值标志表示该系统参数为新增系统参数, 则: 若确定该系统参数的 存储类型为第一存储类型, 则根据该系统参数的存储地址偏移量将该系统参 数的默认值存储到所述系统参数区; 若确定该系统参数的存储类型为第二存 储类型, 则根据该系统参数的存储地址偏移量将该系统参数的默认值存储到 所述系统参数区和备份参数区。  If the programmer modifies the system program 102 of the terminal device and adds new system parameters, then in order to facilitate the programmer to add the value of the system parameter in the system parameter area or the backup parameter area, the system in the configuration file The attribute information of the parameter may also include: A new value flag. The new value flag is used to indicate whether the system parameter is a new system parameter. For example, a new value flag of 1 indicates that the system parameter is a new system parameter, that is, a system parameter whose value has not been written to the system parameter area or the backup parameter area; a new value flag of 0 indicates that the system parameter is not a new system parameter. , its value has been stored in the system parameter area or the system parameter of the backup parameter area. The process of adding the value of the system parameter in the system parameter area or the backup parameter area is as follows: After the attribute information of the system parameter is read from the configuration file, if the new value flag of the system parameter indicates that the system parameter is a new system parameter Then: if it is determined that the storage type of the system parameter is the first storage type, the default value of the system parameter is stored in the system parameter area according to the storage address offset of the system parameter; if the storage of the system parameter is determined The type is the second storage type, and the default value of the system parameter is stored to the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
具体地, 在系统参数区或备份参数区中新增系统参数的取值的过程可以 在将配置文件中记录的信息以及系统参数区、 备份参数区中的系统参数取值 载入到内存中实现, 具体过程如图 3所示, 包括如下步骤:  Specifically, the process of adding the value of the system parameter in the system parameter area or the backup parameter area may be performed by loading the information recorded in the configuration file and the value of the system parameter in the system parameter area and the backup parameter area into the memory. The specific process is shown in Figure 3, including the following steps:
S301 : 开始, 创建内存数组, i=0, 打开配置文件;  S301: Start, create a memory array, i=0, open the configuration file;
S302: 从配置文件中依次读取系统参数的属性信息; 若读取到配置文件 的结束标识, 则执行步骤 S361 ; 否则, 执行步骤 S303。  S302: The attribute information of the system parameter is sequentially read from the configuration file; if the end identifier of the configuration file is read, step S361 is performed; otherwise, step S303 is performed.
从配置文件中逐条读取系统参数的属性信息, 若当前读取到配置文件的 结束标识, 则执行步骤 S361 ; 否则, 对于当前读取的系统参数的属性信息执 行如下步骤 S303。  The attribute information of the system parameter is read one by one from the configuration file. If the end identifier of the configuration file is currently read, step S361 is performed; otherwise, the following step S303 is performed for the attribute information of the currently read system parameter.
S303: 针对当前读取的系统参数的属性信息, 确定该系统参数的存储类 型; 若该系统参数的存储类型为第一存储类型, 则执行步骤 S310; 若该系统 参数的存储类型为第二存储类型, 则执行步骤 S320; 若该系统参数的存储类 型为第三存储类型, 则执行步骤 S331 ; 若该系统参数的存储类型为第四存储 类型, 则执行步骤 S340。 S303: determining, according to the attribute information of the currently read system parameter, a storage type of the system parameter; if the storage type of the system parameter is the first storage type, performing step S310; if the storage type of the system parameter is the second storage If the storage type of the system parameter is the third storage type, step S331 is performed; if the storage type of the system parameter is the fourth storage Type, then step S340 is performed.
较优地, 系统参数的属性信息中还可包括删除标志, 若删除标志被置 1 , 表示该系统参数已被删除, 可以不必再载入到内存中, 因此, 在执行本步骤 Preferably, the attribute information of the system parameter may further include a delete flag. If the delete flag is set to 1, indicating that the system parameter has been deleted, it may not need to be loaded into the memory, therefore, performing this step.
S303之前, 还可以判断当前读取的系统参数的属性信息中的删除标志是否置 1 ; 若是, 则直接跳转到步骤 S302处理下一个系统参数的属性信息; 若不是, 则执行本步骤 S303。 Before S303, it may be determined whether the deletion flag in the attribute information of the currently read system parameter is set to 1; if yes, the process directly jumps to step S302 to process the attribute information of the next system parameter; if not, step S303 is performed.
S310: 判断该系统参数的新值标志是否表示该系统参数为新增系统参数; 若是, 则执行步骤 S312; 否则, 执行步骤 S311。  S310: Determine whether the new value flag of the system parameter indicates that the system parameter is a new system parameter; if yes, execute step S312; otherwise, execute step S311.
确定当前读取的系统参数的属性信息中的新值标志的取值, 根据新值标 志的取值判断该系统参数是否为新增系统参数。 如果判断是, 则执行步骤 S312; 否则, 执行步骤 S311。  Determine the value of the new value flag in the attribute information of the currently read system parameter, and determine whether the system parameter is a new system parameter according to the value of the new value flag. If the determination is yes, then step S312 is performed; otherwise, step S311 is performed.
S311 : 从系统参数区中获取该系统参数的取值, 并作为该系统参数的当 前取值后, 执行步骤 S351。  S311: After obtaining the value of the system parameter from the system parameter area, and taking the current value of the system parameter, step S351 is performed.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取系统参数区中存储的该系统参数的取值作为该系统参数的当前取值。 之后, 执行步骤 S351。  Specifically, the value of the system parameter stored in the system parameter area is obtained as the current value of the system parameter according to the storage address offset in the attribute information of the currently read system parameter. After that, step S351 is performed.
S312: 将当前读取的系统参数的属性信息中的默认值写入到系统参数区 中。  S312: Write the default value in the attribute information of the currently read system parameter into the system parameter area.
具体地, 依据当前读取的系统参数的属性信息中的存储地址偏移量, 将 该系统参数的默认值写入到系统参数区中。  Specifically, the default value of the system parameter is written into the system parameter area according to the storage address offset in the attribute information of the currently read system parameter.
S313 : 将该系统参数的默认值作为该系统参数的当前取值后, 执行步骤 S351。  S313: After the default value of the system parameter is used as the current value of the system parameter, step S351 is performed.
具体地, 将当前读取的系统参数的属性信息中的默认值作为该系统参数 的当前取值后, 执行步骤 S351。  Specifically, after the default value in the attribute information of the currently read system parameter is taken as the current value of the system parameter, step S351 is performed.
S320: 判断该系统参数的新值标志是否表示该系统参数为新增系统参数; 若是, 则执行步骤 S326; 否则, 执行步骤 S321。  S320: Determine whether the new value flag of the system parameter indicates that the system parameter is a new system parameter; if yes, execute step S326; otherwise, execute step S321.
S321 : 获取系统参数区中存储的该系统参数的取值。  S321: Obtain a value of the system parameter stored in a system parameter area.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取系统参数区中存储的该系统参数的取值。  Specifically, the value of the system parameter stored in the system parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter.
S322: 获取备份参数区中存储的该系统参数的取值。  S322: Obtain a value of the system parameter stored in the backup parameter area.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取备份参数区中存储的该系统参数的取值。 S323 : 将从系统参数区中获取的该系统参数的取值与从备份参数区中获 取的该系统参数的取值进行比较; 若不同, 执行步骤 S324; 否则, 执行步骤 S325。 Specifically, the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter. S323: The value of the system parameter obtained from the system parameter area is compared with the value of the system parameter obtained from the backup parameter area; if not, step S324 is performed; otherwise, step S325 is performed.
S324: 使用该系统参数在备份参数区中的取值更新该系统参数在系统参 数区中的取值。  S324: Update the value of the system parameter in the system parameter area by using the value of the system parameter in the backup parameter area.
使用从备份参数区中获取的该系统参数的取值更新系统参数区中该系统 参数的取值。 这样, 对于一些非常重要的系统参数, 如果由于意外而导致系 统参数区中存储的系统参数的取值出错或丢失, 可以使用备份参数区中存储 的系统参数的取值进行恢复, 从而保障、 提高了系统参数的安全性。  The value of the system parameter in the system parameter area is updated using the value of the system parameter obtained from the backup parameter area. In this way, for some very important system parameters, if the value of the system parameter stored in the system parameter area is wrong or lost due to an accident, the value of the system parameter stored in the backup parameter area can be used for recovery, thereby ensuring and improving The security of the system parameters.
S325 : 将从备份参数区中获取该系统参数的取值作为该系统参数的当前 取值后, 执行步骤 S351。  S325: After obtaining the value of the system parameter from the backup parameter area as the current value of the system parameter, step S351 is performed.
S326: 将当前读取的系统参数的属性信息中的默认值写入到系统参数区 和备份参数区中。  S326: Write the default value in the attribute information of the currently read system parameter into the system parameter area and the backup parameter area.
具体地, 依据当前读取的系统参数的属性信息中的存储地址偏移量, 将 该系统参数的默认值写入到系统参数区和备份参数区中。  Specifically, the default value of the system parameter is written into the system parameter area and the backup parameter area according to the storage address offset in the attribute information of the currently read system parameter.
S327: 将该系统参数的默认值作为该系统参数的当前取值后, 执行步骤 S351。  S327: After the default value of the system parameter is used as the current value of the system parameter, step S351 is performed.
S331 : 将当前读取的系统参数的属性信息中的默认值作为该系统参数的 当前取值后, 执行步骤 S351。  S331: After the default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, step S351 is performed.
S340: 判断该系统参数的新值标志是否表示该系统参数为新增系统参数; 若是, 则执行步骤 S342; 否则, 执行步骤 S341。  S340: Determine whether the new value flag of the system parameter indicates that the system parameter is a new system parameter; if yes, execute step S342; otherwise, execute step S341.
S341 : 从备份参数区中获取该系统参数的取值, 并将之作为该系统参数 的当前取值后, 执行步骤 S351。  S341: After obtaining the value of the system parameter from the backup parameter area and using it as the current value of the system parameter, step S351 is performed.
具体地, 根据当前读取的系统参数的属性信息中的存储地址偏移量, 获 取备份参数区中存储的该系统参数的取值。 将从备份参数区中获取的该系统 参数的取值作为该系统参数的当前取值后, 执行步骤 S351。  Specifically, the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset in the attribute information of the currently read system parameter. After the value of the system parameter obtained from the backup parameter area is taken as the current value of the system parameter, step S351 is performed.
S342: 将当前读取的系统参数的属性信息中的默认值写入到备份参数区 中。  S342: Write the default value in the attribute information of the currently read system parameter into the backup parameter area.
具体地, 依据当前读取的系统参数的属性信息中的存储地址偏移量, 将 该系统参数的默认值写入到备份参数区中。  Specifically, the default value of the system parameter is written into the backup parameter area according to the storage address offset in the attribute information of the currently read system parameter.
S343: 将该系统参数的默认值作为该系统参数的当前取值后, 执行步骤 S351。 具体地, 将当前读取的系统参数的属性信息中的默认值作为该系统参数 的当前取值后, 执行步骤 S351。 S343: After the default value of the system parameter is used as the current value of the system parameter, step S351 is performed. Specifically, after the default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, step S351 is performed.
S351 : 将当前读取的系统参数的属性信息与该系统参数的当前取值关联 存储到内存中。  S351: Store the attribute information of the currently read system parameter in the memory in association with the current value of the system parameter.
具体地, 将当前读取的系统参数的属性信息以及该系统参数的当前取值 存储到内存数组的第 i个数组元素中。  Specifically, the attribute information of the currently read system parameter and the current value of the system parameter are stored in the i-th array element of the memory array.
S352: i=i+l , 跳转到步骤 S302。  S352: i=i+l , and the process goes to step S302.
S361 : 结束。  S361: End.
系统参数管理系统 101 对系统参数进行管理, 在将配置文件中记录的信 息以及系统参数区、 备份参数区中的系统参数取值载入到内存后, 还可包括: 在系统程序 102的启动运行过程中对系统参数的读取、 修改等管理。  The system parameter management system 101 manages the system parameters, and after loading the information recorded in the configuration file and the system parameter area and the system parameter value in the backup parameter area into the memory, the method may further include: starting the system program 102. Management of reading, modifying, etc. of system parameters during the process.
系统参数管理系统 101对系统程序 102读取系统参数的管理方法, 具体 流程如图 4所示, 包括如下步骤:  The system parameter management system 101 reads the system parameter management method for the system program 102. The specific process is as shown in FIG. 4, and includes the following steps:
S401 : 接收系统程序 102传送的系统参数的名称。  S401: Receive the name of the system parameter transmitted by the system program 102.
具体地, 当系统程序 102 需要读取某个系统参数的当前取值时, 可以向 系统参数管理系统 101提供的读取系统参数的 API函数传送系统参数的名称。  Specifically, when the system program 102 needs to read the current value of a certain system parameter, the name of the system parameter can be transmitted to the API function of the system parameter management system 101 that reads the system parameter.
S402: 根据接收的系统参数的名称, 从内存中查找出该系统参数的当前 取值。  S402: Find the current value of the system parameter from the memory according to the name of the received system parameter.
由于内存中针对每个系统参数, 已经关联存储了该系统参数的当前取值 与该系统参数的属性信息; 因此系统参数管理系统 101 提供的读取系统参数 的 API函数可以根据接收的系统参数的名称, 从内存中查找出该系统参数的 当前取值。  Since the current value of the system parameter and the attribute information of the system parameter are already stored in association for each system parameter in the memory; therefore, the API function of the system parameter management system 101 for reading the system parameter may be based on the received system parameter. Name, find the current value of the system parameter from the memory.
S403: 根据查找到的当前取值向系统程序 102进行返回。  S403: Return to the system program 102 according to the found current value.
系统参数管理系统 101可以将查找到的当前取值直接向系统程序 102返 回。  The system parameter management system 101 can return the found current value directly to the system program 102.
较优地, 为统一系统程序 102 的返回接口, 可以将查找到的当前取值均 转换为字符串后再进行返回; 这样, 利于程序人员编程的接口统一性。 系统 参数管理系统 101 可以根据数据类型作转换后, 将转换后的字符串返回给系 统程序 102:  Preferably, in order to unify the return interface of the system program 102, the found current values can be converted into a string and then returned; thus, the interface uniformity for program personnel programming is facilitated. The system parameter management system 101 can convert the converted string to the system program 102 after the conversion according to the data type:
若该系统参数的属性信息中的数据类型为 IP地址类型, 则将查找到的当 前取值从二进制数据类型的 IP地址转换为字符串数据类型的 IP地址后,将字 符串数据类型的 IP地址返回给系统程序 102; 若该系统参数的属性信息中的数据类型为整数数据类型, 则将查找到的 当前取值从整型数据(Int型数据)转换为以字符串表示的整数后, 将字符串 返回给系统程序 102; If the data type in the attribute information of the system parameter is an IP address type, the IP value of the string data type is converted after the current value found is converted from the IP address of the binary data type to the IP address of the string data type. Returned to the system program 102; If the data type in the attribute information of the system parameter is an integer data type, the converted current value is converted from the integer data (Int type data) to the integer represented by the string, and the string is returned to the system program. 102;
若该系统参数的属性信息中的数据类型为设备号类型, 则将查找到的当 前取值从二进制的数值转换为字符串类型的设备号后, 将字符串类型的设备 号返回给系统程序 102;  If the data type in the attribute information of the system parameter is the device number type, the device value of the string type is returned to the system program 102 after converting the found current value from the binary value to the device type of the string type. ;
若该系统参数的属性信息中的数据类型为版本号类型, 则将查找到的当 前取值从二进制的数值转换为字符串类型的版本号后, 将字符串类型的版本 号返回给系统程序 102;  If the data type in the attribute information of the system parameter is the version number type, after the found current value is converted from the binary value to the version number of the string type, the version number of the string type is returned to the system program 102. ;
若该系统参数的属性信息中的数据类型为字符串类型, 则将查找到的当 前取值直接向系统程序 102返回。  If the data type in the attribute information of the system parameter is a string type, the current value found is directly returned to the system program 102.
系统参数管理系统 101对系统程序 102修改系统参数的管理方法, 具体 流程如图 5所示, 包括如下步骤:  The system parameter management system 101 modifies the management method of the system parameters to the system program 102. The specific process is as shown in FIG. 5, and includes the following steps:
S501 : 接收系统程序 102传送的系统参数的名称以及修改值。  S501: Receive the name of the system parameter transmitted by the system program 102 and the modified value.
具体地, 当系统程序 102需要修改某个系统参数的当前取值时, 可以向 系统参数管理系统 101提供的修改系统参数的 API函数传送系统参数的名称 以及修改值。  Specifically, when the system program 102 needs to modify the current value of a certain system parameter, the API function of the system parameter modified by the system parameter management system 101 can transmit the name of the system parameter and the modified value.
S502: 根据接收到的系统参数的名称从所述内存中查找出该系统参数的 当前取值。  S502: Find a current value of the system parameter from the memory according to the name of the received system parameter.
系统参数管理系统 101提供的修改系统参数的 API函数根据接收的系统 参数的名称, 从内存中查找出该系统参数的当前取值。  The API function of the system parameter management system 101 for modifying the system parameters finds the current value of the system parameter from the memory according to the name of the received system parameter.
S503: 将修改值与查找出的当前取值进行比较, 根据比较结果决定是否 更新。 若决定更新, 则执行步骤 S504; 否则, 结束, 向系统程序返回更新成 功信息。  S503: Compare the modified value with the found current value, and determine whether to update according to the comparison result. If it is decided to update, step S504 is performed; otherwise, it ends, and the update success information is returned to the system program.
系统参数管理系统 101提供的修改系统参数的 API函数将修改值与查找 出的当前取值进行比较, 根据比较结果决定是否更新。 若决定更新, 则执行 步骤 S504; 否则, 结束, 向系统程序返回更新成功信息。  The API function of the system parameter management system 101 for modifying the system parameters compares the modified value with the found current value, and determines whether to update according to the comparison result. If it is decided to update, step S504 is performed; otherwise, it ends, and the update success information is returned to the system program.
较优地, 在实际应用中, 为节约存储空间, 系统参数管理系统 101 提供 的修改系统参数的 API函数也可以对修改值进行转换后, 再将转换后的值与 查找出的当前取值进行比较, 确定比较结果是否一致; 若不一致, 则决定更 新; 否则, 不必更新。 通常而言, 修改值一般为字符串形式的, 则转换方法 包括: 若该系统参数的属性信息中的数据类型为 IP地址类型, 则将修改值从字 符串数据类型的 IP地址转换为二进制数据类型的 IP地址后,使用二进制数据 类型的 IP地址比较所述内存中的该系统参数的当前取值,确定两者是否一致; 若该系统参数的属性信息中的数据类型为整数数据类型, 则将修改值从 字符串表示的整数转换为整型数据 ( Int型数据)后, 使用转换后的整型数据 ( Int型数据)比较所述内存中的该系统参数的当前取值,确定两者是否一致; 若该系统参数的属性信息中的数据类型为设备号类型, 则将修改值从字 符串类型的设备号转换为二进制的数值后, 使用转换后的二进制的数值比较 所述内存中的该系统参数的当前取值, 确定两者是否一致; Preferably, in practical applications, in order to save storage space, the API function of the system parameter management system 101 for modifying the system parameters may also convert the modified value, and then perform the converted value and the found current value. Compare, determine whether the comparison results are consistent; if they are inconsistent, decide to update; otherwise, do not have to update. In general, the modified value is generally in the form of a string, and the conversion method includes: If the data type in the attribute information of the system parameter is an IP address type, the modified value is converted from the IP address of the string data type to the IP address of the binary data type, and the IP address of the binary data type is used to compare the in-memory. The current value of the system parameter determines whether the two are consistent; if the data type in the attribute information of the system parameter is an integer data type, the modified value is converted from the integer represented by the string to the integer data (Int type data) After the converted integer data (Int type data) is used to compare the current values of the system parameters in the memory to determine whether the two are consistent; if the data type in the attribute information of the system parameter is the device number type , after converting the modified value from the device number of the string type to the binary value, comparing the current value of the system parameter in the memory with the converted binary value to determine whether the two are consistent;
若该系统参数的属性信息中的数据类型为版本号类型, 则将修改值从字 符串类型的版本号转换为二进制的数值后, 使用转换后的二进制的数值比较 所述内存中的该系统参数的当前取值, 确定两者是否一致;  If the data type in the attribute information of the system parameter is the version number type, the modified value is converted from the version number of the string type to the binary value, and the system parameter in the memory is compared using the converted binary value. Current value, to determine whether the two are consistent;
若该系统参数的属性信息中的数据类型为字符串类型, 则直接使用修改 值比较所述内存中的该系统参数的当前取值, 确定两者是否一致。  If the data type in the attribute information of the system parameter is a string type, the current value of the system parameter in the memory is directly compared using the modified value to determine whether the two are consistent.
S504: 根据所述修改值更新所述内存中的该系统参数的当前取值。  S504: Update a current value of the system parameter in the memory according to the modified value.
系统参数管理系统 101提供的修改系统参数的 API函数可以根据所述修 改值直接更新所述内存中的该系统参数的当前取值。  The API function of the system parameter management system 101 for modifying the system parameters may directly update the current value of the system parameter in the memory according to the modified value.
较佳地, 在根据所述内存中更新后的该系统参数的当前取值, 更新系统 参数区或备份参数区中的该系统参数的取值之前, 即执行步骤 S507之前, 还 可以将内存中更新后的该系统参数的当前取值先写入到一个临时参数区中, 即执行步骤 S505。  Preferably, before the value of the system parameter in the system parameter area or the backup parameter area is updated according to the current value of the updated system parameter in the memory, before the step S507 is performed, the memory may be The updated current value of the system parameter is first written into a temporary parameter area, that is, step S505 is performed.
S505: 根据所述内存中更新后的该系统参数的当前取值更新临时参数区 中该系统参数的取值, 并将该系统参数的名称作为修改信息进行记录。  S505: Update the value of the system parameter in the temporary parameter area according to the current value of the updated system parameter in the memory, and record the name of the system parameter as the modification information.
系统参数管理系统 101 在内存中还创建了一个临时参数区, 根据该系统 参数的存储地址偏移量, 将所述内存中更新后的该系统参数的当前取值写入 到临时参数区中。 系统参数管理系统 101 还将该系统参数的名称作为修改信 息进行 i己录。  The system parameter management system 101 also creates a temporary parameter area in the memory, and writes the current value of the updated system parameter in the memory to the temporary parameter area according to the storage address offset of the system parameter. The system parameter management system 101 also records the name of the system parameter as the modification information.
S506: 在参数区更新周期到达时, 或者用户触发关机后, 根据记录的修 改信息中的系统参数的名称查找内存中对应系统参数的属性信息, 执行步骤 S507。  S506: When the parameter area update period arrives, or after the user triggers the shutdown, the attribute information of the corresponding system parameter in the memory is searched according to the name of the system parameter in the recorded modification information, and step S507 is performed.
查找出对应的系统参数的属性信息后, 则可以确定该系统参数的存储类 型、 存储地址偏移量。 这样, 可以避免对系统参数区或备份参数区写入操作过于频繁, 而导致 存储器件的损害。 After finding the attribute information of the corresponding system parameter, the storage type and storage address offset of the system parameter can be determined. In this way, it is possible to avoid excessively frequent writing of the system parameter area or the backup parameter area, resulting in damage to the storage device.
S507:判断该系统参数的存储类型;若为第一存储类型,则执行步骤 S511 ; 若为第二存储类型,则执行步骤 S521 ; 若为第四存储类型,则执行步骤 S531 ;  S507: determining the storage type of the system parameter; if it is the first storage type, executing step S511; if it is the second storage type, executing step S521; if it is the fourth storage type, executing step S531;
S511 : 根据所述内存中更新后的该系统参数的当前取值更新所述系统参 数区中的该系统参数的取值。  S511: Update the value of the system parameter in the system parameter area according to the current value of the updated system parameter in the memory.
具体地, 根据该系统参数的存储地址偏移量, 使用所述内存中更新后的 该系统参数的当前取值更新系统参数区中的该系统参数的取值。  Specifically, the value of the system parameter in the system parameter area is updated according to the current value of the updated system parameter in the memory according to the storage address offset of the system parameter.
S521: 根据所述内存中更新后的该系统参数的当前取值更新所述系统参 数区以及备份参数区中的该系统参数的取值。  S521: Update the value of the system parameter in the system parameter area and the backup parameter area according to the current value of the updated system parameter in the memory.
具体地, 根据该系统参数的存储地址偏移量, 使用所述内存中更新后的 该系统参数的当前取值更新系统参数区以及备份参数区中的该系统参数的取 值。  Specifically, according to the storage address offset of the system parameter, the current parameter value of the updated system parameter in the memory is used to update the value of the system parameter in the system parameter area and the backup parameter area.
S531: 根据所述内存中更新后的该系统参数的当前取值更新所述备份参 数区中的该系统参数的取值。  S531: Update the value of the system parameter in the backup parameter area according to the current value of the updated system parameter in the memory.
具体地, 根据该系统参数的存储地址偏移量, 使用所述内存中更新后的 该系统参数的当前取值更新备份参数区中的该系统参数的取值。  Specifically, the value of the system parameter in the backup parameter area is updated according to the current value of the updated system parameter in the memory according to the storage address offset of the system parameter.
此外, 还可以写入其它数据, 如日志级别数据; 如果存储类型指示出该 数据为日志级别数据, 则使用该数据的修改值直接设置当前程序的日志级别。  In addition, other data, such as log level data, can be written; if the storage type indicates that the data is log level data, the modified value of the data is used to directly set the log level of the current program.
此外, 对于第一次开机运行的终端设备, 系统参数管理系统 101 还可进 行系统参数区、 备份参数区的自动创建, 具体方法流程如图 6所示, 包括如 下步骤:  In addition, for the terminal device that is started for the first time, the system parameter management system 101 can also automatically create the system parameter area and the backup parameter area. The specific method flow is shown in Figure 6, including the following steps:
S601 : 在终端设备启动后, 读取出厂标志; 确定出厂标志表示该终端设 备为新出厂设备, 则执行步骤 S602。  S601: After the terminal device is started, the factory mark is read; if the factory mark indicates that the terminal device is a new factory device, step S602 is performed.
在终端设备启动后, 系统参数管理系统 101在将配置文件 102中记录的 信息以及系统参数区、 备份参数区中的系统参数取值载入到内存之前, 先从 设定地址处读取出厂标志。 如果出厂标志的取值 (比如出厂标志值为 0 )表示 该终端设备为新出厂设备, 还未创建系统参数区、 备份参数区, 则执行如下 步骤 S602; 如果出厂标志的取值(比如出厂标志值被置 1 )表示该终端设备 不是新出厂设备, 已经创建了系统参数区、 备份参数区, 则不必执行如下步 骤 S602-S631。  After the terminal device is started, the system parameter management system 101 reads the factory logo from the set address before loading the information recorded in the configuration file 102 and the system parameter values in the system parameter area and the backup parameter area into the memory. . If the value of the factory mark (such as the factory flag value is 0) indicates that the terminal device is a new factory device, and the system parameter area and the backup parameter area have not been created, perform the following step S602; if the value of the factory mark (such as the factory mark) If the value is set to 1), it indicates that the terminal device is not a new factory device. If the system parameter area and the backup parameter area have been created, the following steps S602-S631 need not be performed.
S602: 打开配置文件。 S603 : 依次读取配置文件中的系统参数的属性信息, 将当前读取到的系 统参数的属性信息作如下 S604操作。 S602: Open the configuration file. S603: The attribute information of the system parameter in the configuration file is sequentially read, and the attribute information of the currently read system parameter is performed as follows: S604.
S604: 将当前读取到的系统参数的属性信息中的默认值作为该系统参数 的当前取值, 将该系统参数的当前取值与该系统参数的属性信息关联存储到 内存中。  S604: The default value in the attribute information of the currently read system parameter is used as the current value of the system parameter, and the current value of the system parameter is stored in the memory in association with the attribute information of the system parameter.
S605:判断该系统参数的存储类型;若为第一存储类型,则执行步骤 S611 ; 若为第二存储类型,则执行步骤 S621 ; 若为第四存储类型,则执行步骤 S641。  S605: Determine the storage type of the system parameter; if it is the first storage type, execute step S611; if it is the second storage type, execute step S621; if it is the fourth storage type, execute step S641.
S611 : 根据该系统参数的存储地址偏移量将该系统参数的默认值写入到 系统参数区的相应地址处。  S611: Write the default value of the system parameter to the corresponding address of the system parameter area according to the storage address offset of the system parameter.
S621 : 根据该系统参数的存储地址偏移量将该系统参数的默认值写入到 系统参数区以及备份参数区的相应地址处。  S621: Write the default value of the system parameter to the corresponding parameter of the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
S641: 根据该系统参数的存储地址偏移量将该系统参数的默认值写入到 备份参数区的相应地址处。  S641: Write the default value of the system parameter to the corresponding address of the backup parameter area according to the storage address offset of the system parameter.
S651 : 系统参数区、 备份参数区创建结束, 终端设备按预先规定的偏移 量向备份参数区中写如下几个值: Mac地址( mac— id )、设备 ID ( device— id )、 出厂标志 ( device— flag )。 其中, 出厂标志的取值被设置为 1 , 表示该终端设 备已不是新出厂设备。  S651: The system parameter area and the backup parameter area are created. The terminal device writes the following values to the backup parameter area according to a predetermined offset: Mac address (mac_id), device ID (device_id), factory flag ( device_flag ). The value of the factory mark is set to 1, indicating that the terminal device is not a new factory device.
更进一步, 为便于系统程序的升级, 系统参数管理系统 101 还可包括对 系统参数进行升级的管理, 具体方法流程如图 7所示, 包括如下步骤:  Further, in order to facilitate the upgrade of the system program, the system parameter management system 101 may further include management for upgrading the system parameters. The specific method flow is as shown in FIG. 7, and includes the following steps:
S701 : 终端设备启动后, 读取版本升级标志; 确定版本升级标志表示所 述系统参数区和备份参数区待升级, 则执行步骤 S702。  S701: After the terminal device is started, the version upgrade flag is read; and the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded, and step S702 is performed.
在终端设备启动后, 系统参数管理系统 101在执行了上述步骤 S601读取 出厂标志后, 将配置文件 102 中记录的信息以及系统参数区、 备份参数区中 的系统参数取值载入到内存之前, 还可读取版本升级标志, 判断是否进行系 统参数的版本升级。 如果版本升级标志的取值 (比如版本升级标志为 1 )表示 系统参数区和备份参数区待升级, 则执行如下步骤 S702; 如果版本升级标志 的取值 (比如版本升级标志值被置 0 )表示系统参数区和备份参数区不必进行 升级操作, 则不必执行如下步骤 S702-S731。  After the terminal device is started, the system parameter management system 101 reads the information recorded in the configuration file 102 and the values of the system parameters in the system parameter area and the backup parameter area before loading the factory flag in the above step S601. , you can also read the version upgrade flag to determine whether to upgrade the system parameters. If the value of the version upgrade flag (for example, the version upgrade flag is 1) indicates that the system parameter area and the backup parameter area are to be upgraded, the following step S702 is performed; if the value of the version upgrade flag is set (for example, the version upgrade flag value is set to 0) The system parameter area and the backup parameter area do not need to be upgraded, and it is not necessary to perform the following steps S702-S731.
S702: 打开配置文件。  S702: Open the configuration file.
S703 : 依次读取配置文件中的系统参数的属性信息, 将当前读取到的系 统参数的属性信息作如下 S704操作。  S703: The attribute information of the system parameter in the configuration file is sequentially read, and the attribute information of the currently read system parameter is performed as follows: S704.
S704: 对应于当前读取到的系统参数的属性信息, 从备份文件中查找对 应的系统参数的属性信息; 若备份文件中没查找到, 或查找到的系统参数的 新值标志表示该系统参数为新增系统参数, 则执行步骤 S711 ; 否则, 执行步 骤 S721。 S704: Find the pair from the backup file corresponding to the attribute information of the currently read system parameter. Attribute information of the system parameter; If the new value of the found system parameter is not found in the backup file, or the new system value of the found system parameter indicates that the system parameter is a new system parameter, step S711 is performed; otherwise, step S721 is performed.
备份文件为上一版本的配置文件, 其中记录了上一版本终端设备中所使 用的系统参数的属性信息。 而当前版本的配置文件中, 则可能新定义了或删 除了一些系统参数。 在升级过程中, 为了保留上一版本中一些已经设置的系 统参数取值, 因此, 在升级过程中参考上一版本的配置文件, 即备份文件进 行升级。  The backup file is the previous version of the configuration file, which records the attribute information of the system parameters used in the previous version of the terminal device. In the current version of the configuration file, some system parameters may be newly defined or deleted. During the upgrade process, in order to retain the values of some system parameters that have been set in the previous version, the upgrade file is upgraded with reference to the previous version of the configuration file.
根据当前读取的系统参数的属性信息中的系统参数的名称从备份文件中 查找出对应系统参数的属性信息。 例如, 配置文件中当前读取的系统参数的 属性信息为:  The attribute information of the corresponding system parameter is found from the backup file according to the name of the system parameter in the attribute information of the currently read system parameter. For example, the attribute information of the system parameter currently read in the configuration file is:
<net_user default_val="test" offset="256" len="32" delete_mark="0"  <net_user default_val="test" offset="256" len="32" delete_mark="0"
val_type="l" write_mark="0" factory_mark="0" new_value="l" /> 则从备份文件中查找到系统参数的名称为 net— user 的系统参数的属性信 息:  Val_type="l" write_mark="0" factory_mark="0" new_value="l" /> Then find the attribute information of the system parameter whose name is net_user from the backup file:
<net_user default_val=" test " offset="256" len="32" delete_mark="0"  <net_user default_val=" test " offset="256" len="32" delete_mark="0"
val_type="l" write_mark="0" factory_mark="0" new_value="0" /> 从备份文件的 net— user的属性信息的 new— value="0"中可以看出, 在上一 版的终端设备中 net— user的取值已经设置到系统参数区了,也就是说, 系统参 数区中已经保存了 net— user的取值,如果仅根据当前版本的配置文件进行升级 将会使用默认值 "test" 覆盖掉系统参数区中的取值, 因此, 为避免覆盖掉系 统参数区中的取值, 则执行如下步骤 S721。  Val_type="l" write_mark="0" factory_mark="0" new_value="0" /> It can be seen from the new_value="0" of the net-user attribute information of the backup file, in the previous version The value of net-user in the terminal device has been set to the system parameter area. That is, the value of net-user has been saved in the system parameter area. If the upgrade is based only on the current version of the configuration file, the default value will be used. "test" overrides the value in the system parameter area. Therefore, to avoid overwriting the value in the system parameter area, the following step S721 is performed.
S711 : 将该系统参数的默认值写入到系统参数区、 备份参数区或内存中。 具体过程如上述步骤 S604-S641所示, 此处不再赘述。  S711: Write the default value of the system parameter to the system parameter area, backup parameter area or memory. The specific process is as shown in the above steps S604-S641, and details are not described herein again.
如果备份文件中没查找到对应的系统参数的属性信息, 或查找到的系统 参数的新值标志表示该系统参数为新增系统参数, 则说明该系统参数为升级 版本后新增的系统参数, 则将新增的系统参数的默认值写入到系统参数区、 备份参数区或内存中。 具体过程如上述步骤 S604-S641所示, 此处不再赘述。  If the attribute information of the corresponding system parameter is not found in the backup file, or the new value flag of the found system parameter indicates that the system parameter is a new system parameter, it indicates that the system parameter is a new system parameter after the upgrade version. The default values of the newly added system parameters are written to the system parameter area, backup parameter area or memory. The specific process is as shown in the above steps S604-S641, and details are not described herein again.
S721 : 则不必修改系统参数区、 备份参数区中该系统参数的取值, 而是 将系统参数区或备份参数区中该系统参数的取值载入到内存中。 具体过程如 上述步骤 S303-S361相同, 此处不再赘述。  S721: It is not necessary to modify the value of the system parameter in the system parameter area and the backup parameter area, but load the value of the system parameter in the system parameter area or the backup parameter area into the memory. The specific process is the same as the above steps S303-S361, and details are not described herein again.
如果备份文件中查找到对应的系统参数的属性信息, 并且查找到的系统 参数的新值标志表示该系统参数不是新增系统参数, 则表示系统参数区或备 份参数区中已存有该系统参数的取值, 例如上述的系统参数 net— user: If the attribute information of the corresponding system parameter is found in the backup file, and the found system is found The new value flag of the parameter indicates that the system parameter is not a new system parameter, indicating that the value of the system parameter exists in the system parameter area or the backup parameter area, for example, the above system parameter net_user:
<net_user default_val=" test " offset="256" len="32" delete_mark="0"  <net_user default_val=" test " offset="256" len="32" delete_mark="0"
val_type="l" write_mark="0" factory_mark="0" new_value="0" /> 那么在该步骤 S721中将系统参数区或备份参数区中该系统参数的取值载 入到内存中即可, 具体方法与上述步骤 S303-S361相同, 此处不再赘述。  Val_type="l" write_mark="0" factory_mark="0" new_value="0" /> Then in this step S721, the value of the system parameter in the system parameter area or the backup parameter area can be loaded into the memory. The specific method is the same as the above steps S303-S361, and details are not described herein again.
由于备份文件中记载了上一版配置文件中已写入到系统参数区、 备份参 数区的系统参数的取值, 从而在系统程序升级过程中, 根据备份文件可以避 免覆盖掉这些系统参数的取值, 防止在系统程序升级过程中, 将所有系统参 数都恢复为默认值。 这样, 用户设置过的一些系统参数不会因为系统程序版 本升级的原因而被修改, 又需要重新设置, 从而大大改善了用户的体验。  Because the backup file contains the values of the system parameters that have been written to the system parameter area and the backup parameter area in the previous version of the configuration file, in the system program upgrade process, the backup of the system parameters can be avoided according to the backup file. A value that prevents all system parameters from being restored to their default values during system program upgrades. In this way, some system parameters set by the user will not be modified due to the upgrade of the system program version, and need to be reset, thereby greatly improving the user experience.
更进一步, 若无法从系统参数区读取系统参数的取值, 说明系统参数区 中的数据被损坏或丢失, 则系统参数管理系统 101 还可包括对系统参数区进 行恢复的管理, 具体方法流程如图 8所示, 包括如下步骤:  Further, if the value of the system parameter cannot be read from the system parameter area, indicating that the data in the system parameter area is damaged or lost, the system parameter management system 101 may further include management for restoring the system parameter area, and the specific method flow. As shown in Figure 8, the following steps are included:
S801 : 打开配置文件。  S801: Open the configuration file.
S802: 依次读取配置文件中的系统参数的属性信息, 将当前读取到的系 统参数的属性信息作如下 S803操作。  S802: The attribute information of the system parameter in the configuration file is sequentially read, and the attribute information of the currently read system parameter is performed as follows: S803.
S803:确定该系统参数的存储类型。若为第一存储类型,则执行步骤 S811; 若为第二存储类型, 则执行步骤 S821。  S803: Determine a storage type of the system parameter. If it is the first storage type, step S811 is performed; if it is the second storage type, step S821 is performed.
S811 : 根据该系统参数的存储地址偏移量, 使用该系统参数的默认值恢 复所述系统参数区中该系统参数的取值。  S811: Restore the value of the system parameter in the system parameter area according to a storage address offset of the system parameter, using a default value of the system parameter.
S821 : 根据该系统参数的存储地址偏移量, 获取备份参数区中该系统参 数的取值, 使用获取的备份参数区中该系统参数的取值覆盖所述系统参数区 中该系统参数的取值。  S821: Obtain a value of the system parameter in the backup parameter area according to the storage address offset of the system parameter, and use the value of the system parameter in the obtained backup parameter area to cover the system parameter in the system parameter area. value.
本发明实施例提供的一种系统参数管理系统内部结构框图, 如图 9所示, 包括: 系统参数载入内存模块 901、 系统参数读耳 ^莫块 902  A block diagram of an internal structure of a system parameter management system according to an embodiment of the present invention, as shown in FIG. 9, includes: a system parameter loading memory module 901, a system parameter reading ear module 902
系统参数载入内存模块 901 用于在终端设备启动后, 从配置文件中依次 读取各系统参数的属性信息, 所述属性信息包括: 系统参数的名称、 存储地 址偏移量以及存储类型; 针对每个系统参数, 依据该系统参数的存储地址偏 移量获取存储于系统参数区中的该系统参数的取值; 若该系统参数的存储类 型为第一存储类型, 则将从系统参数区中获取的该系统参数的取值作为该系 统参数的当前取值; 若该系统参数的存储类型为第二存储类型, 则依据该系 统参数的存储地址偏移量获取存储于备份参数区中的该系统参数的取值以及 存储于系统参数区中的该系统参数的取值, 并对两者进行比较; 若比较结果 为一致, 则将从系统参数区中获取的该系统参数的取值作为该系统参数的当 前取值; 若比较结果为不同, 则将从备份参数区中获取的该系统参数的取值 作为该系统参数的当前取值, 并使用该系统参数在备份参数区中的取值更新 该系统参数在系统参数区中的取值; 之后, 将该系统参数的当前取值与该系 统参数的属性信息关联存储到内存中。 The system parameter loading memory module 901 is configured to sequentially read attribute information of each system parameter from the configuration file after the terminal device is started, where the attribute information includes: a name of the system parameter, a storage address offset, and a storage type; For each system parameter, the value of the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter; if the storage type of the system parameter is the first storage type, the system parameter area is Obtaining the value of the system parameter as the current value of the system parameter; if the storage type of the system parameter is the second storage type, according to the system The storage address offset of the system parameter obtains the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area, and compares the two; if the comparison result is consistent, The value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is used as the system parameter. The current value is used, and the value of the system parameter in the backup parameter area is used to update the value of the system parameter in the system parameter area; after that, the current value of the system parameter is stored in association with the attribute information of the system parameter to In memory.
系统参数读取模块 902用于在接收到系统程序传送的系统参数的名称后, 根据接收的系统参数的名称, 从所述内存中查找出该系统参数的当前取值; 根据查找到的当前取值向所述系统程序进行返回。  The system parameter reading module 902 is configured to: after receiving the name of the system parameter transmitted by the system program, find the current value of the system parameter from the memory according to the name of the received system parameter; The value is returned to the system program.
进一步, 系统参数管理系统还可包括: 系统参数修改模块 903。  Further, the system parameter management system may further include: a system parameter modification module 903.
系统参数修改模块 903 用于在接收到系统程序传送的系统参数的名称以 及修改值后, 根据接收到的系统参数的名称从所述内存中查找出该系统参数 的当前取值; 将所述修改值与查找出的当前取值进行比较, 根据比较结果决 定是否更新; 若决定更新, 则: 根据所述内存中更新后的该系统参数的当前 取值更新临时参数区中该系统参数的取值, 并将该系统参数的名称作为修改 信息进行记录; 以及, 在参数区更新周期到达时, 或者用户触发关机后, 则 根据记录的修改信息中的系统参数的名称在所述内存中查找出对应的系统参 数的属性, 根据查找出的系统参数的存储地址偏移量确定出临时参数区中该 系统参数的取值; 在确定该系统参数的存储类型为第一存储类型后, 根据所 述临时参数区中该系统参数的取值更新所述系统参数区中的该系统参数的取 值; 在确定该系统参数的存储类型为第二存储类型后, 根据所述临时参数区 中该系统参数的取值更新所述系统参数区以及备份参数区中的该系统参数的 取值。  The system parameter modification module 903 is configured to: after receiving the name of the system parameter transmitted by the system program and the modified value, find the current value of the system parameter from the memory according to the name of the received system parameter; The value is compared with the found current value, and whether the update is determined according to the comparison result; if the update is decided, the value of the system parameter in the temporary parameter area is updated according to the current value of the updated system parameter in the memory. And recording the name of the system parameter as the modification information; and, when the parameter area update period arrives, or after the user triggers the shutdown, the corresponding parameter is found in the memory according to the name of the system parameter in the recorded modification information. The attribute of the system parameter, determining the value of the system parameter in the temporary parameter area according to the stored storage address offset of the found system parameter; after determining that the storage type of the system parameter is the first storage type, according to the temporary The value of the system parameter in the parameter area updates the system parameter in the system parameter area After determining that the storage type of the system parameter is the second storage type, updating the value of the system parameter in the system parameter area and the backup parameter area according to the value of the system parameter in the temporary parameter area .
进一步, 系统参数载入内存模块 901 还用于在从配置文件中读取了系统 参数的属性信息后, 若确定该系统参数的新值标志表示该系统参数为新增系 统参数, 则: 将该系统参数的默认值作为该系统参数的当前取值; 并且, 在 确定该系统参数的存储类型为第一存储类型后, 根据该系统参数的存储地址 偏移量将该系统参数的默认值存储到所述系统参数区; 在确定该系统参数的 存储类型为第二存储类型后, 根据该系统参数的存储地址偏移量将该系统参 数的默认值存储到所述系统参数区和备份参数区。  Further, the system parameter loading memory module 901 is further configured to: after reading the attribute information of the system parameter from the configuration file, if it is determined that the new value flag of the system parameter indicates that the system parameter is a new system parameter, then: The default value of the system parameter is taken as the current value of the system parameter; and after determining that the storage type of the system parameter is the first storage type, the default value of the system parameter is stored according to the storage address offset of the system parameter to The system parameter area; after determining that the storage type of the system parameter is the second storage type, storing the default value of the system parameter to the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
进一步, 系统参数管理系统还可包括: 参数区创建模块 904。 参数区创建模块 904用于在所述终端设备启动后, 读取出厂标志; 若所 述出厂标志表示该终端设备为新出厂设备, 则从配置文件中依次读取各系统 参数的属性信息, 并针对每个系统参数进行如下操作: 将该系统参数的默认 值作为该系统参数的当前取值; 将该系统参数的当前取值与该系统参数的属 性信息关联存储到内存中; 若该系统参数的存储类型为第一存储类型, 则根 据该系统参数的存储地址偏移量将该系统参数的默认值存储到所述系统参数 区; 若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述系统参数区和备份参数区; 若所 述出厂标志表示该终端设备为已出厂标志, 则发送参数区已创建通知。 Further, the system parameter management system may further include: a parameter area creation module 904. The parameter area creating module 904 is configured to read the factory mark after the terminal device is started; if the factory mark indicates that the terminal device is a new factory device, the attribute information of each system parameter is sequentially read from the configuration file, and Performing the following operations for each system parameter: using the default value of the system parameter as the current value of the system parameter; storing the current value of the system parameter and the attribute information of the system parameter in the memory; if the system parameter The storage type is the first storage type, and the default value of the system parameter is stored in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type, The storage address offset of the system parameter stores the default value of the system parameter to the system parameter area and the backup parameter area; if the factory mark indicates that the terminal device is a factory flag, the sending parameter area has created a notification.
进一步, 系统参数管理系统还可包括: 参数区升级模块 905。  Further, the system parameter management system may further include: a parameter area upgrading module 905.
参数区升级模块 905 用于在接收到所述参数区创建模块发送的参数区已 创建通知后, 读取版本升级标志; 若版本升级标志表示所述系统参数区和备 份参数区待升级, 则从配置文件中依次读取各系统参数的属性信息, 并针对 每个系统参数进行如下操作: 从备份文件中查找该系统参数的属性信息, 所 述备份文件为所述终端设备的上一版本的配置文件; 若确定所述备份文件中 不存在该系统参数的属性信息, 或所述备份文件中该系统参数的新值标志表 示该系统参数为新增系统参数, 则: 在确定该系统参数的存储类型为第一存 储类型后, 根据该系统参数的存储地址偏移量将所述配置文件中该系统参数 的默认值写入到所述系统参数区; 则确定该系统参数的存储类型为第二存储 类型后, 根据该系统参数的存储地址偏移量将所述配置文件中该系统参数的 默认值写入到所述系统参数区和备份参数区; 将所述配置文件中该系统参数 的默认值作为该系统参数的当前取值; 否则, 在确定该系统参数的存储类型 为第一存储类型后, 将从系统参数区中获取的该系统参数的取值作为该系统 参数的当前取值; 在确定该系统参数的存储类型为第二存储类型后, 则依据 该系统参数的存储地址偏移量获取存储于备份参数区中的该系统参数的取 值, 将从备份参数区中获取的该系统参数的取值作为该系统参数的当前取值; 将该系统参数的当前取值与该系统参数的属性信息关联存储到内存中; 若版 本升级标志表示所述系统参数区和备份参数区已升级, 则发送参数区已升级 通知。  The parameter area upgrading module 905 is configured to: after receiving the notification that the parameter area sent by the parameter area creation module has been created, read the version upgrade flag; if the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded, The configuration file sequentially reads the attribute information of each system parameter, and performs the following operations for each system parameter: Searching for the attribute information of the system parameter from the backup file, where the backup file is the configuration of the previous version of the terminal device. a file; if it is determined that the attribute information of the system parameter does not exist in the backup file, or the new value flag of the system parameter in the backup file indicates that the system parameter is a new system parameter, then: determining the storage of the system parameter After the type is the first storage type, the default value of the system parameter in the configuration file is written to the system parameter area according to the storage address offset of the system parameter; then the storage type of the system parameter is determined to be the second After storing the type, the system parameter in the configuration file is determined according to the storage address offset of the system parameter. The default value is written to the system parameter area and the backup parameter area; the default value of the system parameter in the configuration file is used as the current value of the system parameter; otherwise, the storage type of the system parameter is determined to be the first After storing the type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; after determining that the storage type of the system parameter is the second storage type, the storage address according to the system parameter is determined. The offset obtains the value of the system parameter stored in the backup parameter area, and takes the value of the system parameter obtained from the backup parameter area as the current value of the system parameter; the current value of the system parameter is The attribute information of the system parameter is stored in the memory; if the version upgrade flag indicates that the system parameter area and the backup parameter area have been upgraded, the parameter area has been upgraded.
上述的系统参数载入内存模块 901具体在接收到参数区升级模块 905发 送的参数区已升级通知后, 从配置文件中依次读取各系统参数的属性信息并 进行处理。 系统参数载入内存模块 901 读取并处理各系统参数的属性信息的 过程在之前已详细介绍, 此处不再赞述。 The above-mentioned system parameter loading memory module 901 specifically reads the attribute information of each system parameter from the configuration file and performs processing after receiving the parameter area upgrade notification sent by the parameter area upgrading module 905. The system parameter loading memory module 901 reads and processes the attribute information of each system parameter. The process has been described in detail before and will not be mentioned here.
进一步, 系统参数管理系统还可包括: 参数区恢复模块 906。  Further, the system parameter management system may further include: a parameter area recovery module 906.
参数区恢复模块 906用于在接收到系统参数读取错误的信息后, 从配置 文件中依次读取各系统参数的属性信息, 针对每个系统参数进行如下操作: 若该系统参数的存储类型为第一存储类型, 则根据该系统参数的存储地址偏 移量, 使用该系统参数的默认值恢复所述系统参数区中该系统参数的取值; 若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地址偏 移量, 使用备份参数区中该系统参数的取值覆盖所述系统参数区中该系统参 数的取值。  The parameter area recovery module 906 is configured to read the attribute information of each system parameter sequentially from the configuration file after receiving the information of the system parameter reading error, and perform the following operations for each system parameter: if the storage type of the system parameter is The first storage type, the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type Then, according to the storage address offset of the system parameter, the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area.
进一步, 系统参数管理系统还可包括: 命令输入模块、 调用模块(图中 未标)。  Further, the system parameter management system may further include: a command input module, a calling module (not marked in the figure).
命令输入模块可以为开发人员提供命令行输入界面, 并接收开发人员输 入的命令行。  The command input module provides the developer with a command line input interface and receives the command line entered by the developer.
命令行的格式可以如下:  The format of the command line can be as follows:
OAM Command命令 | 操作种类 | 数据名称 | 数据值 | 数据长度; 例如, 一个具体的命令行: ./oamclient setval ip addr 172.168.56.78 4, 表 示将 ip— addr数据设置为 172.168.56.78 4值。  OAM Command Command | Operation Type | Data Name | Data Value | Data Length; For example, a specific command line: ./oamclient setval ip addr 172.168.56.78 4, the ip-addr data is set to 172.168.56.78 4 value.
又如,一个具体的命令行: ./oamclient setint net— mode 2 1 ,表示将 net— mode 数据设置为 int型数据, 值为 2, 长度为 1。  Another example is a specific command line: ./oamclient setint net— mode 2 1 , which means that the net_mode data is set to int data with a value of 2 and a length of 1.
又如, 一个具体的命令行: ./oamclient getval boot ver, 表示读取 boot— ver 数据的值。 备份参数区的数据的操作, 如读取、 写入、 恢复默认值等。  As another example, a specific command line: ./oamclient getval boot ver, which means to read the value of the boot-ver data. Operations that back up data in the parameter area, such as reading, writing, restoring default values, and so on.
调用模块对命令输入模块接收的命令行进行解析, 根据解析结果调用相 应模块。 具体地, 调用模块根据解析出的操作种类调用相应模块。 例如, 若 解析出操作种类为上述的 "setval" 则调用系统参数修改模块 903 , 将命令行 中的参数值写入到系统参数区或备份参数区; 若解析出操作种类为上述的 "getval" 则调用系统参数读取模块 902 , 将系统参数区或备份参数区中相应 数据的参数值读取出来。  The calling module parses the command line received by the command input module, and calls the corresponding module according to the parsing result. Specifically, the calling module calls the corresponding module according to the parsed operation type. For example, if the operation type is "setval", the system parameter modification module 903 is called, and the parameter value in the command line is written to the system parameter area or the backup parameter area; if the operation type is "getval" as described above. Then, the system parameter reading module 902 is called to read out the parameter values of the corresponding data in the system parameter area or the backup parameter area.
命令输入模块和调用模块为开发人员提供了方便的数据操作小工具, 开 发人员可以使用这个小工具对数据进行操作, 如修改、 读取等, 从而方便地 进行测试工作。 具体地, 本发明实施例的系统参数管理系统中的各模块所涉及的具体工 作过程, 可以参考上述系统参数管理系统对系统参数进行管理的方法中所公 开的相关内容, 此处不再赘述。 Command input modules and call modules provide developers with convenient data manipulation widgets that developers can use to manipulate data, such as modifications, reads, etc., for easy testing. Specifically, the specific working process involved in each module in the system parameter management system of the embodiment of the present invention may be referred to the related content disclosed in the method for managing the system parameters by the system parameter management system, and details are not described herein again.
这里需要指出, 虽然本发明实施例的系统参数管理系统是以应用在嵌入 式系统中为例讲述具体技术方案, 但是, 本领域技术人员可以轻而易举将其 应用于其它操作系统中, 因此对于其它操作系统中应用本发明实施例的系统 参数管理系统也应视为本发明的保护范围内。 终端设备可以是手机、 智能电 视、 机顶盒等设备。  It should be noted here that although the system parameter management system of the embodiment of the present invention is a specific technical solution as an example of application in an embedded system, those skilled in the art can easily apply it to other operating systems, and thus, for other operations. The system parameter management system to which the embodiment of the present invention is applied in the system should also be considered as the protection scope of the present invention. The terminal device can be a mobile phone, a smart TV, a set top box, and the like.
本发明实施例中由于将系统参数的属性信息记录在配置文件中, 针对系 统参数的不同的存储类型具有不同的管理方法, 这样, 对于一些非常重要的 系统参数, 既保存在系统参数区中又保存在备份参数区中, 如果由于意外而 导致系统参数区中存储的系统参数的当前取值出错或丢失, 可以使用备份参 数区中存储的系统参数的当前取值进行恢复, 从而保障、 提高了系统参数的 安全性。  In the embodiment of the present invention, since attribute information of system parameters is recorded in a configuration file, different management methods are used for different storage types of system parameters, so that some very important system parameters are saved in the system parameter area. It is saved in the backup parameter area. If the current value of the system parameter stored in the system parameter area is incorrect or lost due to an accident, you can use the current value of the system parameter stored in the backup parameter area to recover, thus ensuring and improving. Security of system parameters.
进一步, 配置文件中的系统参数的属性信息中还包括: 新值标志, 以便 于程序员在系统参数区或备份参数区新增系统参数: 如果程序员对终端设备 的系统程序进行了修改, 并且还增加了新的系统参数, 那么, 在向内存载入 配置文件的信息以及系统参数区或备份参数区中的数据的过程中, 可以将新 的系统参数的取值写入到系统参数区或备份参数区, 便于对新增系统参数的 管理。  Further, the attribute information of the system parameter in the configuration file further includes: a new value flag, so that the programmer can add a system parameter in the system parameter area or the backup parameter area: if the programmer modifies the system program of the terminal device, and New system parameters have also been added. Then, in the process of loading the configuration file information into the memory and the data in the system parameter area or the backup parameter area, the value of the new system parameter can be written to the system parameter area or Backup parameter area for easy management of new system parameters.
进一步, 由于备份文件中记载了上一版配置文件中已写入到系统参数区、 备份参数区的系统参数的取值, 从而在系统程序升级过程中, 根据备份文件 可以避免覆盖掉这些系统参数的取值, 防止在系统程序升级过程中, 将所有 系统参数都恢复为默认值。 这样, 用户设置过的一些系统参数不会因为系统 程序版本升级的原因而被修改, 又需要重新设置, 从而大大改善了用户的体 验。  Further, since the value of the system parameter written in the system parameter area and the backup parameter area in the previous version configuration file is recorded in the backup file, in the system program upgrade process, the system parameters can be avoided according to the backup file. The value is to prevent all system parameters from being restored to their default values during system program upgrade. In this way, some system parameters set by the user are not modified due to the upgrade of the system program version, and need to be reset, thereby greatly improving the user's experience.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤 是可以通过程序来指令相关的硬件来完成, 该程序可以存储于一计算机可读 取存储介质中, 如: ROM/RAM、 磁碟、 光盘等。  A person skilled in the art can understand that all or part of the steps of implementing the above embodiments can be completed by a program to instruct related hardware, and the program can be stored in a computer readable storage medium, such as: ROM/RAM, Disk, CD, etc.
以上所述仅是本发明的优选实施方式, 应当指出, 对于本技术领域的普 通技术人员来说, 在不脱离本发明原理的前提下, 还可以作出若干改进和润 饰, 这些改进和润饰也应视为本发明的保护范围。  The above description is only a preferred embodiment of the present invention, and it should be noted that those skilled in the art can also make several improvements and retouchings without departing from the principles of the present invention. It is considered as the scope of protection of the present invention.

Claims

权 利 要 求 书 Claim
1. 一种终端设备中系统参数管理方法, 包括:  A system parameter management method in a terminal device, comprising:
在接收到系统程序传送的系统参数的名称后, 根据接收的系统参数的名 称, 从内存中查找出该系统参数的当前取值; 根据查找到的当前取值向所述 系统程序进行返回; 其中, 在所述内存中针对每个系统参数, 关联存储了该 系统参数的当前取值与该系统参数的属性信息; 所述属性信息包括: 系统参 数的名称、 存储地址偏移量以及存储类型;  After receiving the name of the system parameter transmitted by the system program, searching for the current value of the system parameter from the memory according to the name of the received system parameter; and returning to the system program according to the found current value; And storing, in the memory for each system parameter, a current value of the system parameter and attribute information of the system parameter; the attribute information includes: a name of the system parameter, a storage address offset, and a storage type;
针对每个系统参数, 将该系统参数的当前取值与该系统参数的属性信息 关联存储到内存的方法包括:  For each system parameter, the method for storing the current value of the system parameter and the attribute information of the system parameter in the memory includes:
在所述终端设备启动后, 从配置文件中依次读取各系统参数的属性信息; 针对每个系统参数, 依据该系统参数的存储地址偏移量获取存储于系统 参数区中的该系统参数的取值;  After the terminal device is started, the attribute information of each system parameter is sequentially read from the configuration file; for each system parameter, the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter. Value
若该系统参数的存储类型为第一存储类型, 则将从系统参数区中获取的 该系统参数的取值作为该系统参数的当前取值; 若该系统参数的存储类型为 第二存储类型, 则依据该系统参数的存储地址偏移量获取存储于备份参数区 中的该系统参数的取值以及存储于系统参数区中的该系统参数的取值, 并对 两者进行比较; 若比较结果为一致, 则将从系统参数区中获取的该系统参数 的取值作为该系统参数的当前取值; 若比较结果为不同, 则将从备份参数区 中获取的该系统参数的取值作为该系统参数的当前取值;  If the storage type of the system parameter is the first storage type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the storage type of the system parameter is the second storage type, Obtaining, according to the storage address offset of the system parameter, the value of the system parameter stored in the backup parameter area and the value of the system parameter stored in the system parameter area, and comparing the two; if the comparison result If they are consistent, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; if the comparison result is different, the value of the system parameter obtained from the backup parameter area is used as the The current value of the system parameter;
将该系统参数的当前取值与该系统参数的属性信息关联存储到内存中。  The current value of the system parameter is stored in the memory in association with the attribute information of the system parameter.
2. 如权利要求 1所述的方法, 其特征在于,在所述对两者进行比较之后, 若比较结果为不同, 还包括: 2. The method according to claim 1, wherein after comparing the two, if the comparison result is different, the method further comprises:
使用该系统参数在备份参数区中的取值更新该系统参数在系统参数区中 的取值。  Use the value of the system parameter in the backup parameter area to update the value of the system parameter in the system parameter area.
3. 如权利要求 2所述的方法, 其特征在于, 在所述内存中针对每个系统 参数, 关联存储该系统参数的当前取值与该系统参数的属性信息之后, 还包 括: The method according to claim 2, further comprising: storing, in the memory, the current value of the system parameter and the attribute information of the system parameter for each system parameter, further comprising:
若接收到系统程序传送的系统参数的名称以及修改值, 贝 ij :  If you receive the name of the system parameter transmitted by the system program and the modified value, Bay ij:
根据接收到的系统参数的名称从所述内存中查找出该系统参数的当前取 值; 将所述修改值与查找出的当前取值进行比较, 根据比较结果决定是否更 新; Finding a current value of the system parameter from the memory according to the name of the received system parameter; comparing the modified value with the found current value, and determining whether it is more based on the comparison result New
若决定更新, 则根据所述修改值更新所述内存中的该系统参数的当前取 值; 并  If the update is decided, the current value of the system parameter in the memory is updated according to the modified value; and
若确定该系统参数的存储类型为第一存储类型, 则根据所述内存中更新 后的该系统参数的当前取值更新所述系统参数区中的该系统参数的取值; 若确定该系统参数的存储类型为第二存储类型, 则根据所述内存中更新 后的该系统参数的当前取值更新所述系统参数区以及备份参数区中的该系统 参数的取值。  If it is determined that the storage type of the system parameter is the first storage type, updating the value of the system parameter in the system parameter area according to the current value of the updated system parameter in the memory; if the system parameter is determined The storage type is the second storage type, and the value of the system parameter in the system parameter area and the backup parameter area is updated according to the current value of the updated system parameter in the memory.
4. 如权利要求 3所述的方法, 其特征在于, 在所述根据所述内存中更新 后的该系统参数的当前取值更新所述系统参数区中的该系统参数的取值, 或 者所述根据所述内存中更新后的该系统参数的当前取值更新所述系统参数区 以及备份参数区中的该系统参数的取值之前, 还包括: The method according to claim 3, wherein the value of the system parameter in the system parameter area is updated according to the current value of the updated system parameter in the memory, or Before updating the system parameter area and the value of the system parameter in the backup parameter area according to the current value of the updated system parameter in the memory, the method further includes:
根据所述内存中更新后的该系统参数的当前取值更新临时参数区中该系 统参数的取值, 并将该系统参数的名称作为修改信息进行记录; 以及,  Updating the value of the system parameter in the temporary parameter area according to the current value of the updated system parameter in the memory, and recording the name of the system parameter as the modification information; and
所述若确定该系统参数的存储类型为第一存储类型, 则根据所述修改值 更新所述系统参数区中的该系统参数的取值; 若确定该系统参数的存储类型 为第二存储类型, 则根据所述修改值更新所述系统参数区以及备份参数区中 的该系统参数的取值具体为:  If it is determined that the storage type of the system parameter is the first storage type, updating the value of the system parameter in the system parameter area according to the modified value; if it is determined that the storage type of the system parameter is the second storage type And updating, according to the modified value, the value of the system parameter in the system parameter area and the backup parameter area is specifically:
在参数区更新周期到达时, 或者用户触发关机后, 则根据记录的修改信 息中的系统参数的名称在所述内存中查找出对应的系统参数的属性, 根据查 找出的系统参数的存储地址偏移量确定出临时参数区中该系统参数的取值; 在确定该系统参数的存储类型为第一存储类型后, 根据所述临时参数区中该 系统参数的取值更新所述系统参数区中的该系统参数的取值; 在确定该系统 参数的存储类型为第二存储类型后, 根据所述临时参数区中该系统参数的取 值更新所述系统参数区以及备份参数区中的该系统参数的取值。  When the parameter area update period arrives, or after the user triggers the shutdown, the attribute of the corresponding system parameter is found in the memory according to the name of the system parameter in the recorded modification information, and the storage address of the system parameter is found according to the found The shifting quantity determines the value of the system parameter in the temporary parameter area; after determining that the storage type of the system parameter is the first storage type, updating the system parameter area according to the value of the system parameter in the temporary parameter area The value of the system parameter is determined; after determining that the storage type of the system parameter is the second storage type, updating the system parameter area and the system in the backup parameter area according to the value of the system parameter in the temporary parameter area The value of the parameter.
5. 如权利要求 3所述的方法, 其特征在于, 所述属性信息还包括: 新值 标志、 默认值; 以及, 5. The method according to claim 3, wherein the attribute information further comprises: a new value flag, a default value;
在所述终端设备启动后, 从配置文件中读取了系统参数的属性信息后还 包括:  After the terminal device is started, after reading the attribute information of the system parameter from the configuration file, the method further includes:
若该系统参数的新值标志表示该系统参数为新增系统参数, 则: 将该系统参数的默认值作为该系统参数的当前取值; If the new value flag of the system parameter indicates that the system parameter is a new system parameter, then: The default value of the system parameter is taken as the current value of the system parameter;
若确定该系统参数的存储类型为第一存储类型, 则根据该系统参数的存 储地址偏移量将该系统参数的默认值存储到所述系统参数区;  If it is determined that the storage type of the system parameter is the first storage type, storing the default value of the system parameter to the system parameter area according to the storage address offset of the system parameter;
若确定该系统参数的存储类型为第二存储类型, 则根据该系统参数的存 储地址偏移量将该系统参数的默认值存储到所述系统参数区和备份参数区。  If it is determined that the storage type of the system parameter is the second storage type, the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter.
6. 如权利要求 5所述的方法, 其特征在于, 所述系统参数区和备份参数 区的升级方法包括: The method according to claim 5, wherein the upgrading method of the system parameter area and the backup parameter area comprises:
在所述终端设备启动后, 读取版本升级标志;  After the terminal device is started, the version upgrade flag is read;
若版本升级标志表示所述系统参数区和备份参数区待升级, 则从配置文 件中依次读取各系统参数的属性信息, 并针对每个系统参数进行如下操作: 从备份文件中查找该系统参数的属性信息, 所述备份文件为所述终端设 备的上一版本的配置文件;  If the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded, the attribute information of each system parameter is sequentially read from the configuration file, and the following operations are performed for each system parameter: searching for the system parameter from the backup file Attribute information, the backup file is a configuration file of a previous version of the terminal device;
若确定所述备份文件中不存在该系统参数的属性信息, 或所述备份文件 中该系统参数的新值标志表示该系统参数为新增系统参数, 则: 在确定该系 统参数的存储类型为第一存储类型后, 根据该系统参数的存储地址偏移量将 所述配置文件中该系统参数的默认值写入到所述系统参数区; 在确定该系统 参数的存储类型为第二存储类型后, 根据该系统参数的存储地址偏移量将所 述配置文件中该系统参数的默认值写入到所述系统参数区和备份参数区; 将 所述配置文件中该系统参数的默认值作为该系统参数的当前取值;  If it is determined that the attribute information of the system parameter does not exist in the backup file, or the new value flag of the system parameter in the backup file indicates that the system parameter is a new system parameter, then: determining that the storage type of the system parameter is After the first storage type, the default value of the system parameter in the configuration file is written to the system parameter area according to the storage address offset of the system parameter; determining that the storage type of the system parameter is the second storage type Afterwards, the default value of the system parameter in the configuration file is written to the system parameter area and the backup parameter area according to the storage address offset of the system parameter; the default value of the system parameter in the configuration file is used as The current value of the system parameter;
否则, 在确定该系统参数的存储类型为第一存储类型后, 将从系统参数 区中获取的该系统参数的取值作为该系统参数的当前取值; 在确定该系统参 数的存储类型为第二存储类型后, 则依据该系统参数的存储地址偏移量获取 存储于备份参数区中的该系统参数的取值, 将从备份参数区中获取的该系统 参数的取值作为该系统参数的当前取值;  Otherwise, after determining that the storage type of the system parameter is the first storage type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; determining the storage type of the system parameter is After the storage type is obtained, the value of the system parameter stored in the backup parameter area is obtained according to the storage address offset of the system parameter, and the value of the system parameter obtained from the backup parameter area is used as the system parameter. Current value
将该系统参数的当前取值与该系统参数的属性信息关联存储到内存中。  The current value of the system parameter is stored in the memory in association with the attribute information of the system parameter.
7. 如权利要求 1-6任一所述的方法, 其特征在于, 所述系统参数区和备 份参数区的创建方法包括: The method according to any one of claims 1-6, wherein the method for creating the system parameter area and the backup parameter area comprises:
在所述终端设备启动后, 读取出厂标志;  After the terminal device is started, the factory mark is read;
若所述出厂标志表示该终端设备为新出厂设备, 则从配置文件中依次读 取各系统参数的属性信息, 并针对每个系统参数进行如下操作: 将该系统参数的默认值作为该系统参数的当前取值; 将该系统参数的当 前取值与该系统参数的属性信息关联存储到内存中; If the factory mark indicates that the terminal device is a new factory device, the attribute information of each system parameter is sequentially read from the configuration file, and the following operations are performed for each system parameter: The default value of the system parameter is used as the current value of the system parameter; the current value of the system parameter is associated with the attribute information of the system parameter and stored in the memory;
若该系统参数的存储类型为第一存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述系统参数区;  If the storage type of the system parameter is the first storage type, storing the default value of the system parameter to the system parameter area according to the storage address offset of the system parameter;
若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述系统参数区和备份参数区;  If the storage type of the system parameter is the second storage type, storing the default value of the system parameter to the system parameter area and the backup parameter area according to the storage address offset of the system parameter;
若该系统参数的存储类型为第四存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述备份参数区。  If the storage type of the system parameter is the fourth storage type, the default value of the system parameter is stored in the backup parameter area according to the storage address offset of the system parameter.
8. 如权利要求 7所述的方法, 其特征在于, 根据如下步骤对所述系统参 数区进行恢复: 8. The method of claim 7, wherein the system parameter area is restored according to the following steps:
从配置文件中依次读取各系统参数的属性信息后, 针对每个系统参数进 行如下操作:  After reading the attribute information of each system parameter in turn from the configuration file, perform the following operations for each system parameter:
若该系统参数的存储类型为第一存储类型, 则根据该系统参数的存储地 址偏移量, 使用该系统参数的默认值恢复所述系统参数区中该系统参数的取 值;  If the storage type of the system parameter is the first storage type, the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter;
若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地 址偏移量, 使用备份参数区中该系统参数的取值覆盖所述系统参数区中该系 统参数的取值。  If the storage type of the system parameter is the second storage type, the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area according to the storage address offset of the system parameter.
9. 如权利要求 8所述的方法, 其特征在于, 所述属性信息还包括: 数据 类型; 以及 9. The method according to claim 8, wherein the attribute information further comprises: a data type;
所述将所述修改值与查找出的当前取值进行比较具体包括:  The comparing the modified value with the found current value specifically includes:
根据接收到的系统参数的名称从所述内存中查找出该系统参数的数据类 型;  Finding the data type of the system parameter from the memory according to the name of the received system parameter;
若该系统参数的数据类型为 IP地址类型, 则将所述修改值从字符串数据 类型的 IP地址转换为二进制数据类型的 IP地址后,将所述二进制数据类型的 IP地址与所述内存中的该系统参数的当前取值比较;  If the data type of the system parameter is an IP address type, after converting the modified value from an IP address of a string data type to an IP address of a binary data type, the IP address of the binary data type is in the memory The current value comparison of the system parameters;
若该系统参数的数据类型为整数数据类型, 则将所述修改值从字符串表 示的整数转换为整型数据后, 将转换后的整型数据与所述内存中的该系统参 数的当前取值进行比较;  If the data type of the system parameter is an integer data type, after the modified value is converted from the integer represented by the string to the integer data, the converted integer data and the current parameter of the system parameter in the memory are taken. Values are compared;
若该系统参数的数据类型为设备号类型, 则将所述修改值从字符串类型 的设备号转换为二进制的数值后, 将转换后的二进制的数值与所述内存中的 该系统参数的当前取值进行比较; If the data type of the system parameter is the device number type, the modified value is from the string type. After converting the device number to a binary value, comparing the converted binary value with the current value of the system parameter in the memory;
若该系统参数的数据类型为字符串类型, 则将所述修改值与所述内存中 的该系统参数的当前取值进行比较。  If the data type of the system parameter is a string type, the modified value is compared with the current value of the system parameter in the memory.
10. 一种终端设备中系统参数管理系统, 包括: 10. A system parameter management system in a terminal device, comprising:
系统参数载入内存模块, 用于在所述终端设备启动后, 从配置文件中依 次读取各系统参数的属性信息, 所述属性信息包括: 系统参数的名称、 存储 地址偏移量以及存储类型; 针对每个系统参数, 依据该系统参数的存储地址 偏移量获取存储于系统参数区中的该系统参数的取值; 若该系统参数的存储 类型为第一存储类型, 则将从系统参数区中获取的该系统参数的取值作为该 系统参数的当前取值; 若该系统参数的存储类型为第二存储类型, 则依据该 系统参数的存储地址偏移量获取存储于备份参数区中的该系统参数的取值以 及存储于系统参数区中的该系统参数的取值, 并对两者进行比较; 若比较结 果为一致, 则将从系统参数区中获取的该系统参数的取值作为该系统参数的 当前取值; 若比较结果为不同, 则将从备份参数区中获取的该系统参数的取 值作为该系统参数的当前取值; 并将该系统参数的当前取值与该系统参数的 属性信息关联存储到内存中;  The system parameter is loaded into the memory module, and after the terminal device is started, the attribute information of each system parameter is sequentially read from the configuration file, where the attribute information includes: a name of the system parameter, a storage address offset, and a storage type. For each system parameter, the value of the system parameter stored in the system parameter area is obtained according to the storage address offset of the system parameter; if the storage type of the system parameter is the first storage type, the system parameter is The value of the system parameter obtained in the area is taken as the current value of the system parameter; if the storage type of the system parameter is the second storage type, the storage address offset according to the system parameter is obtained and stored in the backup parameter area. The value of the system parameter and the value of the system parameter stored in the system parameter area, and compare the two; if the comparison result is consistent, the value of the system parameter obtained from the system parameter area As the current value of the system parameter; if the comparison result is different, the system parameter obtained from the backup parameter area The value of the number is used as the current value of the system parameter; and the current value of the system parameter is stored in the memory in association with the attribute information of the system parameter;
系统参数读取模块, 用于在接收到系统程序传送的系统参数的名称后, 根据接收的系统参数的名称, 从所述内存中查找出该系统参数的当前取值; 根据查找到的当前取值向所述系统程序进行返回。  a system parameter reading module, configured to: after receiving the name of the system parameter transmitted by the system program, find the current value of the system parameter from the memory according to the name of the received system parameter; The value is returned to the system program.
11. 如权利要求 10所述的系统, 其特征在于, 11. The system of claim 10, wherein
所述系统参数载入内存模块还用于在所述对两者进行比较之后, 若比较 结果为不同, 则使用该系统参数在备份参数区中的取值更新该系统参数在系 统参数区中的取值。  The system parameter loading memory module is further configured to: after comparing the two, if the comparison result is different, use the value of the system parameter in the backup parameter area to update the system parameter in the system parameter area. Value.
12. 如权利要求 11所述的系统, 其特征在于, 12. The system of claim 11 wherein:
系统参数修改模块, 用于在接收到系统程序传送的系统参数的名称以及 修改值后, 根据接收到的系统参数的名称从所述内存中查找出该系统参数的 当前取值; 将所述修改值与查找出的当前取值进行比较, 根据比较结果决定 是否更新; 若决定更新, 则: 根据所述修改值更新所述内存中的该系统参数 的当前取值; 并且, 在确定该系统参数的存储类型为第一存储类型后, 根据 所述修改值更新所述系统参数区中的该系统参数的取值; 在确定该系统参数 的存储类型为第二存储类型后, 根据所述修改值更新所述系统参数区以及备 份参数区中的该系统参数的取值。 a system parameter modification module, configured to: after receiving the name of the system parameter transmitted by the system program and modifying the value, searching for the current value of the system parameter from the memory according to the name of the received system parameter; The value is compared with the found current value, and the update is determined according to the comparison result; if the update is decided, the system parameter in the memory is updated according to the modified value. And determining, after determining that the storage type of the system parameter is the first storage type, updating the value of the system parameter in the system parameter area according to the modified value; determining a storage type of the system parameter After the second storage type, the value of the system parameter in the system parameter area and the backup parameter area is updated according to the modified value.
13. 如权利要求 12所述的系统, 其特征在于, 13. The system of claim 12, wherein
所述系统参数修改模块还用于在所述根据所述修改值更新所述系统参数 区中的该系统参数的取值, 或者所述根据所述修改值更新所述系统参数区以 及备份参数区中的该系统参数的取值之前, 根据所述内存中更新后的该系统 参数的当前取值更新临时参数区中该系统参数的取值, 并将该系统参数的名 称作为修改信息进行记录; 以及, 在参数区更新周期到达时, 或者用户触发 关机后, 则根据记录的修改信息中的系统参数的名称在所述内存中查找出对 应的系统参数的属性, 根据查找出的系统参数的存储地址偏移量确定出临时 参数区中该系统参数的取值; 在确定该系统参数的存储类型为第一存储类型 后, 根据所述临时参数区中该系统参数的取值更新所述系统参数区中的该系 统参数的取值; 在确定该系统参数的存储类型为第二存储类型后, 根据所述 临时参数区中该系统参数的取值更新所述系统参数区以及备份参数区中的该 系统参数的取值。  The system parameter modification module is further configured to: update the value of the system parameter in the system parameter area according to the modified value, or update the system parameter area and the backup parameter area according to the modified value; Before the value of the system parameter is updated, the value of the system parameter in the temporary parameter area is updated according to the current value of the updated system parameter in the memory, and the name of the system parameter is recorded as the modification information; And, when the parameter area update period arrives, or after the user triggers the shutdown, the attribute of the corresponding system parameter is found in the memory according to the name of the system parameter in the recorded modification information, and the system parameter is stored according to the found The address offset determines the value of the system parameter in the temporary parameter area; after determining that the storage type of the system parameter is the first storage type, updating the system parameter according to the value of the system parameter in the temporary parameter area The value of the system parameter in the zone; after determining that the storage type of the system parameter is the second storage type, according to The value of the system parameter area of said temporary parameter update the parameter value of the system parameter area and the parameter area in the backup system.
14. 如权利要求 12所述的系统, 其特征在于, 所述属性信息还包括: 新 值标志、 默认值; 以及, 14. The system according to claim 12, wherein the attribute information further comprises: a new value flag, a default value;
所述系统参数载入内存模块还用于在从配置文件中读取了系统参数的属 性信息后, 若确定该系统参数的新值标志表示该系统参数为新增系统参数, 贝1 J : 将该系统参数的默认值作为该系统参数的当前取值; 并且, 在确定该系 统参数的存储类型为第一存储类型后, 根据该系统参数的存储地址偏移量将 该系统参数的默认值存储到所述系统参数区; 在确定该系统参数的存储类型 为第二存储类型后, 根据该系统参数的存储地址偏移量将该系统参数的默认 值存储到所述系统参数区和备份参数区。 The system parameter loading memory module is further configured to: after reading the attribute information of the system parameter from the configuration file, if it is determined that the new value flag of the system parameter indicates that the system parameter is a new system parameter, the shell 1 J: The default value of the system parameter is used as the current value of the system parameter; and after determining that the storage type of the system parameter is the first storage type, the default value of the system parameter is stored according to the storage address offset of the system parameter. Go to the system parameter area; after determining that the storage type of the system parameter is the second storage type, store the default value of the system parameter to the system parameter area and the backup parameter area according to the storage address offset of the system parameter .
15. 如权利要求 14所述的系统, 其特征在于, 还包括: 15. The system of claim 14, further comprising:
参数区创建模块, 用于在所述终端设备启动后, 读取出厂标志; 若所述 出厂标志表示该终端设备为新出厂设备, 则从配置文件中依次读取各系统参 数的属性信息, 并针对每个系统参数进行如下操作: 将该系统参数的默认值 作为该系统参数的当前取值; 将该系统参数的当前取值与该系统参数的属性 信息关联存储到内存中; 若该系统参数的存储类型为第一存储类型, 则根据 该系统参数的存储地址偏移量将该系统参数的默认值存储到所述系统参数 区; 若该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地 址偏移量将该系统参数的默认值存储到所述系统参数区和备份参数区; 若所 述出厂标志表示该终端设备为已出厂标志, 则发送参数区已创建通知。 a parameter area creating module, configured to read a factory mark after the terminal device is started; if the factory mark indicates that the terminal device is a new factory device, read each system parameter sequentially from the configuration file The attribute information of the number, and the following operations are performed for each system parameter: the default value of the system parameter is taken as the current value of the system parameter; the current value of the system parameter is associated with the attribute information of the system parameter and stored in the memory If the storage type of the system parameter is the first storage type, the default value of the system parameter is stored in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is The second storage type, the default value of the system parameter is stored in the system parameter area and the backup parameter area according to the storage address offset of the system parameter; if the factory mark indicates that the terminal device is a factory flag, then the sending A notification has been created in the parameter area.
16. 如权利要求 15所述的系统, 其特征在于, 还包括: 16. The system of claim 15 further comprising:
参数区升级模块, 用于在接收到所述参数区创建模块发送的参数区已创 建通知后, 读取版本升级标志; 若版本升级标志表示所述系统参数区和备份 参数区待升级, 则从配置文件中依次读取各系统参数的属性信息, 并针对每 个系统参数进行如下操作: 从备份文件中查找该系统参数的属性信息, 所述 备份文件为所述终端设备的上一版本的配置文件; 若确定所述备份文件中不 存在该系统参数的属性信息, 或所述备份文件中该系统参数的新值标志表示 该系统参数为新增系统参数, 则: 在确定该系统参数的存储类型为第一存储 类型后, 根据该系统参数的存储地址偏移量将所述配置文件中该系统参数的 默认值写入到所述系统参数区; 则确定该系统参数的存储类型为第二存储类 型后, 根据该系统参数的存储地址偏移量将所述配置文件中该系统参数的默 认值写入到所述系统参数区和备份参数区; 将所述配置文件中该系统参数的 默认值作为该系统参数的当前取值; 否则, 在确定该系统参数的存储类型为 第一存储类型后, 将从系统参数区中获取的该系统参数的取值作为该系统参 数的当前取值; 在确定该系统参数的存储类型为第二存储类型后, 则依据该 系统参数的存储地址偏移量获取存储于备份参数区中的该系统参数的取值, 将从备份参数区中获取的该系统参数的取值作为该系统参数的当前取值; 将 该系统参数的当前取值与该系统参数的属性信息关联存储到内存中; 若版本 升级标志表示所述系统参数区和备份参数区已升级, 则发送参数区已升级通 知。  a parameter area upgrading module, configured to: after receiving the notification that the parameter area sent by the parameter area creation module has been created, read the version upgrade flag; if the version upgrade flag indicates that the system parameter area and the backup parameter area are to be upgraded, The configuration file sequentially reads the attribute information of each system parameter, and performs the following operations for each system parameter: Searching for the attribute information of the system parameter from the backup file, where the backup file is the configuration of the previous version of the terminal device. a file; if it is determined that the attribute information of the system parameter does not exist in the backup file, or the new value flag of the system parameter in the backup file indicates that the system parameter is a new system parameter, then: determining the storage of the system parameter After the type is the first storage type, the default value of the system parameter in the configuration file is written to the system parameter area according to the storage address offset of the system parameter; then the storage type of the system parameter is determined to be the second After storing the type, the system parameter in the configuration file is determined according to the storage address offset of the system parameter. The default value is written to the system parameter area and the backup parameter area; the default value of the system parameter in the configuration file is used as the current value of the system parameter; otherwise, the storage type of the system parameter is determined to be the first After storing the type, the value of the system parameter obtained from the system parameter area is taken as the current value of the system parameter; after determining that the storage type of the system parameter is the second storage type, the storage address according to the system parameter is determined. The offset obtains the value of the system parameter stored in the backup parameter area, and takes the value of the system parameter obtained from the backup parameter area as the current value of the system parameter; the current value of the system parameter is The attribute information of the system parameter is stored in the memory; if the version upgrade flag indicates that the system parameter area and the backup parameter area have been upgraded, the parameter area has been upgraded.
17. 如权利要求 16所述的系统, 其特征在于, 17. The system of claim 16 wherein:
所述系统参数载入内存模块具体用于在接收到所述参数区升级模块发送 的参数区已升级通知后, 从配置文件中依次读取各系统参数的属性信息并进 行处理。 The system parameter loading memory module is specifically configured to, after receiving the parameter area upgrade notification sent by the parameter area upgrading module, read the attribute information of each system parameter in turn from the configuration file. Line processing.
18. 如权利要求 16所述的系统, 其特征在于, 还包括: 18. The system of claim 16, further comprising:
参数区恢复模块, 用于在接收到系统参数读取错误的信息后, 从配置文 件中依次读取各系统参数的属性信息, 针对每个系统参数进行如下操作: 若 该系统参数的存储类型为第一存储类型, 则根据该系统参数的存储地址偏移 量, 使用该系统参数的默认值恢复所述系统参数区中该系统参数的取值; 若 该系统参数的存储类型为第二存储类型, 则根据该系统参数的存储地址偏移 量, 使用备份参数区中该系统参数的取值覆盖所述系统参数区中该系统参数 的取值。  The parameter area recovery module is configured to read the attribute information of each system parameter sequentially from the configuration file after receiving the error information of the system parameter reading, and perform the following operations for each system parameter: if the storage type of the system parameter is The first storage type, the default value of the system parameter is used to restore the value of the system parameter in the system parameter area according to the storage address offset of the system parameter; if the storage type of the system parameter is the second storage type Then, according to the storage address offset of the system parameter, the value of the system parameter in the backup parameter area is used to cover the value of the system parameter in the system parameter area.
PCT/CN2012/077920 2012-01-19 2012-06-29 Method and system for managing system parameter in terminal device WO2013107158A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210017149.1 2012-01-19
CN 201210017149 CN102609336B (en) 2012-01-19 2012-01-19 Data administration method and data administration system

Publications (1)

Publication Number Publication Date
WO2013107158A1 true WO2013107158A1 (en) 2013-07-25

Family

ID=46526728

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/077920 WO2013107158A1 (en) 2012-01-19 2012-06-29 Method and system for managing system parameter in terminal device

Country Status (2)

Country Link
CN (1) CN102609336B (en)
WO (1) WO2013107158A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489439A (en) * 2019-09-12 2019-11-22 宁波三星医疗电气股份有限公司 A kind of parameter processing method and electric power terminal
CN112653564A (en) * 2019-10-10 2021-04-13 中盈优创资讯科技有限公司 Equipment opening configuration method and device

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105828196B (en) * 2016-03-09 2019-01-15 青岛海信电器股份有限公司 A kind of smart television data processing method and device
CN106021029A (en) * 2016-05-27 2016-10-12 努比亚技术有限公司 Backup-recovery device and method of NV parameters
CN109683948A (en) * 2018-12-13 2019-04-26 深圳创维-Rgb电子有限公司 System data introduction method, device, electronic product and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1746857A (en) * 2004-09-08 2006-03-15 华为技术有限公司 Method for restoring mobile terminal key parameter
CN1783025A (en) * 2004-12-03 2006-06-07 华为技术有限公司 Embedded system data back-up device and method
US20080235471A1 (en) * 2007-03-23 2008-09-25 Michael Feldman Smart batteryless backup device and method therefor

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7366740B2 (en) * 2004-05-03 2008-04-29 Microsoft Corporation Systems and methods for automatic maintenance and repair of enitites in a data model
US7509544B2 (en) * 2007-02-26 2009-03-24 Inventec Corporation Data repair and synchronization method of dual flash read only memory
CN102243602B (en) * 2010-05-11 2013-03-27 西安龙飞软件有限公司 Method for saving system configuration by using flash memory in Linux system
CN102081577B (en) * 2011-01-12 2013-02-13 厦门雅迅网络股份有限公司 Data storage structure of Flash memory and data manipulation mode thereof

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1746857A (en) * 2004-09-08 2006-03-15 华为技术有限公司 Method for restoring mobile terminal key parameter
CN1783025A (en) * 2004-12-03 2006-06-07 华为技术有限公司 Embedded system data back-up device and method
US20080235471A1 (en) * 2007-03-23 2008-09-25 Michael Feldman Smart batteryless backup device and method therefor

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110489439A (en) * 2019-09-12 2019-11-22 宁波三星医疗电气股份有限公司 A kind of parameter processing method and electric power terminal
CN112653564A (en) * 2019-10-10 2021-04-13 中盈优创资讯科技有限公司 Equipment opening configuration method and device
CN112653564B (en) * 2019-10-10 2023-04-18 中盈优创资讯科技有限公司 Equipment opening configuration method and device

Also Published As

Publication number Publication date
CN102609336A (en) 2012-07-25
CN102609336B (en) 2013-12-25

Similar Documents

Publication Publication Date Title
KR101510808B1 (en) Robust firmware upgrade in a network terminal
US8789035B2 (en) Method and apparatus for updating firmware
US9465603B2 (en) Application management apparatus, application management system, application management method, and non-transitory computer readable medium
CN108170495B (en) BIOS upgrading method, system, equipment and computer readable storage medium
WO2013107158A1 (en) Method and system for managing system parameter in terminal device
CN108509215B (en) System software replacing method and device, terminal equipment and storage medium
CN108234554B (en) Cloud file editing method and device
US20140033229A1 (en) Method and computation node for processing application data
US20150012732A1 (en) Method and device for recombining runtime instruction
CN111989656A (en) Configurable recovery state
JP2009301264A (en) Nand flash memory access device, nand flash memory access program and recording medium
CN108037932B (en) SPI-NAND configuration file acquisition method and device
CN114780019A (en) Electronic device management method and device, electronic device and storage medium
JP2016533588A (en) Storage processing method, apparatus and terminal
WO2023198056A1 (en) Firmware update method for embedded device, and embedded device
WO2020113382A1 (en) Hardware upgrading method, apparatus and device, and storage medium
US10564894B2 (en) Free space pass-through
KR20060088654A (en) System and method for recovering data in mobile terminal
CN114020211B (en) Storage space management method, device, equipment and storage medium
CN112181467B (en) Method and device for upgrading memory firmware of terminal, terminal and storage medium
CN111858018B (en) Cgroup configuration method and device, computer equipment and storage medium
CN114356290A (en) Data processing method and device and computer readable storage medium
CN108920216B (en) Method, device, terminal and storage medium for closing software compatible mode
CN112036133A (en) File saving method and device, electronic equipment and storage medium
CN117270914B (en) System upgrading method, device, equipment and medium of terminal equipment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12866236

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12866236

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 12866236

Country of ref document: EP

Kind code of ref document: A1