Nothing Special   »   [go: up one dir, main page]

CN105528265A - Method for saving parameters and electronic device - Google Patents

Method for saving parameters and electronic device Download PDF

Info

Publication number
CN105528265A
CN105528265A CN201510973933.3A CN201510973933A CN105528265A CN 105528265 A CN105528265 A CN 105528265A CN 201510973933 A CN201510973933 A CN 201510973933A CN 105528265 A CN105528265 A CN 105528265A
Authority
CN
China
Prior art keywords
parameters
parameter
storage
saving
preservation
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201510973933.3A
Other languages
Chinese (zh)
Other versions
CN105528265B (en
Inventor
梁柱
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SHENZHEN TENDZONE INTELLIGENT TECHNOLOGY Co Ltd
Original Assignee
SHENZHEN TENDZONE INTELLIGENT TECHNOLOGY Co Ltd
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 SHENZHEN TENDZONE INTELLIGENT TECHNOLOGY Co Ltd filed Critical SHENZHEN TENDZONE INTELLIGENT TECHNOLOGY Co Ltd
Priority to CN201510973933.3A priority Critical patent/CN105528265B/en
Publication of CN105528265A publication Critical patent/CN105528265A/en
Application granted granted Critical
Publication of CN105528265B publication Critical patent/CN105528265B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)
  • Stored Programmes (AREA)

Abstract

The invention provides a method for saving parameters. The method comprises the following steps: S1, saving manner: each parameter can be saved by four kinds of manners: a default manner, manual saving, automatic saving, not saving, wherein the default manner is the same as a father node saving manner; the manual saving is used for saving when a definite saving order is transmitted; the automatic saving is used for regularly saving if modification exists, and used for saving once at certain intervals if parameters are modified. The invention also provides an electronic device. The method and the electronic device provided by the invention have the beneficial effects that the parameters can be partially saved, can be saved out of order or in order, and can be saved after compression, parameter names and values can be saved, the upgrading is convenient, the occupied storage space is less and the parameter protection is facilitated.

Description

Parameter saving method and electronic device
Technical Field
The present invention relates to data storage, and more particularly, to a method for saving parameters and an electronic device.
Background
As shown in fig. 1, the parameters inside the device are generally organized into a tree structure according to the internal logical classification. Parameter 1 is the root of all parameters; parameter 13 is the parent node of parameter 132; parameter 132 is a child of parameter 13; the bottom-most parameter 1111 is a leaf node.
In a special case, the parameters may also be organized into a "forest" shape, where there are a plurality of root nodes, as shown in fig. 2.
In general, the parameters of the electronic device are stored completely (all parameters have a corresponding entry on the memory chip), and are stored in a fixed order (e.g., all leaf nodes are left to right).
In general, parameters are adjacent to each other on a memory chip and have no idle space.
When storing parameters, most of the parameters are stored with leaf nodes, and binary values are stored in a non-compression mode.
The traditional parameter storage method has the following defects:
a) when software is upgraded, newly added parameters are inconvenient. Particularly, one item is additionally arranged in the middle of the leaf node, so that the storage influence is large. The prior art solutions store the data in the storage space in a certain fixed order. When a new parameter is added, the new parameter is often added at the end of the original parameter; unless a storage space is reserved in the original parameters, the space is not necessarily completely enough, and the use efficiency of the storage space is affected. Over time, the logical relationship of the parameter classification hierarchy becomes chaotic.
b) When the software is upgraded, the original parameters are not convenient to delete. After the original parameters are deleted, the space can not be recovered, and the storage space still needs to be occupied.
c) All parameters can only receive operation and are stored all at once; some parameters cannot be saved and some parameters are saved.
d) Most of the parameters are stored in plain text, which is not beneficial to protecting the parameters.
Disclosure of Invention
In order to solve the problems in the prior art, the invention provides a parameter saving method and an electronic device.
The invention provides a parameter storage method, which comprises the following steps:
s1, storage modes, wherein each parameter can select four different storage modes: default mode, manual preservation, automatic preservation and non-preservation;
wherein,
the default mode is as follows: the storage mode is the same as that of the father node;
and (3) manual preservation: storing when issuing an explicit storage command;
automatic preservation: if the parameters are modified, the parameters are stored at regular time, and if the parameters are modified, the parameters are stored at intervals of a certain time;
and (3) no preservation: real-time status, no need to save;
s2, a single parameter storage mode, wherein each stored parameter is divided into a parameter path, a separator and a parameter value;
s3, storing all leaf node parameters according to a certain ordered sequence in a parameter storage mode;
s4, after the parameters are continuously modified, the formed disorder is stored;
s5, compressing and encrypting the parameters, wherein the parameters are compressed and encrypted before being stored; after the parameters are read, decryption and decompression are carried out;
s6, storing multiple groups of parameters respectively and independently, when the parameters are divided into several groups, organizing the groups into forest-shaped structures, and independently selecting whether each group of parameters is compressed or not and whether the parameters are encrypted or not;
s7, multiplexing the stored parameters with the external interface commands, and when the user operates or communicates with other devices, the communication data format adopts the same form as the parameter storage format, thereby improving the multiplexing capability.
As a further improvement of the present invention, in step S1, the root node parameter can only be selected from three storage modes, i.e., manual storage, automatic storage, and non-storage.
As a further improvement of the present invention, in step S1, the following are automatically saved: if the parameters are modified, the parameters are stored regularly, and if the parameters are modified, the parameters are stored once every 30 seconds.
As a further improvement of the present invention, in step S2, the parameter path includes names of all nodes on the shortest path from the root node parameter to the leaf node parameter, the names being separated by a certain separator; the parameter value is the specific value of the leaf node parameter; the parameter path is separated from the parameter value by a separator.
As a further improvement of the present invention, in step S3, all leaf node parameters are saved in order from left to right.
The invention also provides an electronic device, which comprises a processor and a storage chip, wherein the processor is connected with the storage chip, and the storage chip stores parameters according to any one of the parameter storage methods.
The invention has the beneficial effects that: the parameters can be stored partially, can be stored out of order and can be stored in sequence, the parameter names and values can be stored after compression, the upgrading is convenient, the occupied storage space is small, and the parameters can be protected.
Drawings
Fig. 1 is a tree structure diagram of parameters in the prior art.
FIG. 2 is a diagram of a forest structure of parameters in the prior art.
FIG. 3 is a diagram illustrating an automatic saving method for saving parameters according to the present invention.
FIG. 4 is a diagram of a method for saving parameters according to the present invention, in which automatic saving, non-saving and manual saving are adopted.
FIG. 5 is a schematic diagram of storing a single parameter in a parameter storage method according to the present invention.
FIG. 6 is a schematic diagram of a parameter saving method according to the present invention, in which parameters are saved from left to right.
FIG. 7 is a diagram illustrating the method for saving parameters according to the present invention, wherein the parameters are saved out of order after being modified.
FIG. 8 is a diagram illustrating compressing and decompressing parameters in a parameter saving method according to the present invention.
FIG. 9 is a schematic diagram of independent storage of multiple sets of parameters according to a parameter storage method of the present invention.
Fig. 10 is a schematic diagram of an electronic device according to the present invention.
Detailed Description
The invention is further described with reference to the following description and embodiments in conjunction with the accompanying drawings.
A method of parameter preservation comprising the steps of:
1. storage mode
In the method, each parameter can select four different storage modes: default mode, manual save, automatic save, no save. The root node parameters can only be the last 3 modes.
The default mode is as follows: the same way as the father node is kept.
And (3) manual preservation: and saving when an explicit saving command is issued.
Automatic preservation: if the modification is carried out, the timing is saved. If there is a parameter modification, it is stored every 30 seconds.
And (3) no preservation: real-time status, no need to save.
As shown in fig. 3, if the parameter 1 is set to the "auto save" mode and all other parameters are set to the "default mode", all other data samples are finally set to the "auto save" mode.
As shown in fig. 4, the parameter 1 is set to the "auto save" mode, the parameter 111 is set to the "no save" mode, the parameter 13 is set to the "manual save" mode, and all the other parameters are set to the "default mode". The final parameters 11, 12, 112 are set to "auto save" mode; parameter 1111 is set to "not save" mode; the parameters 131, 132, 1321, 1322, 1323 are set to the "manual save" method.
2. Storage mode of single parameter
In the method, each stored parameter is divided into a parameter path, a separator and a parameter value.
As shown in fig. 5, the parameter path includes the names of all nodes on the shortest path from the root node parameter to the leaf node parameter, separated by some delimiter (e.g., "/").
As shown in fig. 5, the parameter value is a specific value of the leaf node parameter.
As shown in FIG. 5, the parameter path is separated from the parameter value by a separator (e.g., ":').
3. Parameter storage mode
When all leaf node parameters are stored in a certain order (e.g., from left to right), the result is shown in FIG. 6.
4. Out-of-order storage formed after parameters are continuously modified
Assume that the device is operating initially without parameters 1321 and 131. When the leaf node parameters are stored in a certain order (e.g., from left to right), the result is shown as (1) in fig. 7.
After the subsequent software upgrade is updated, the parameter 1321 and the parameter 131 are added successively, and the latter of the former parameters exists, as shown in (2) and (3) in fig. 7 respectively.
Namely, in the device, the mapping relationship between the parameter logic classification relationship and the sequence in the memory chip is not invariable. If not from left to right, all leaf node parameters are saved in sequence.
5. Parameter compression and encryption
As shown in fig. 8, before (after) the parameters are stored (or read), the parameters may be compressed and encrypted (decrypted and decompressed) first (or later), so as to reduce the occupied storage space and improve the security.
6. Multiple sets of parameters are stored independently
When the parameters are divided into several groups (organized into forest-shaped structures), each group of parameters can be independently selected whether to be compressed or encrypted, as shown in fig. 9.
7. Storage parameter multiplexing with external interface-pressing command
As shown in fig. 10, when the user operates or communicates with another device, the communication data format of the external interface 3 may be in the same form as the parameter storage format, thereby improving the multiplexing capability.
As shown in fig. 10, an electronic device includes a processor 100, a memory chip 200, and an external interface 300, wherein the processor 1 is connected to the memory chip 200 and the external interface 300, respectively, and the memory chip 200 stores parameters according to any one of the above-mentioned parameter storage methods.
The electronic device may be an embedded device, such as a digital audio matrix, with a memory chip 200 (e.g., Flash, E2 PROM) in the device itself; in the using process of an end user, the equipment parameters can be modified; the device parameters modified by the user need to be saved; the equipment parameters are more and more complex; the memory chip 2 (e.g. Flash) is limited in capacity, e.g. not more than 64 MByte. All the parameters are organized according to tree shapes and forest shapes. Four different storage modes can be selected for each parameter: default mode, manual save, automatic save, no save. The root node parameters can only be the last 3 modes. Each stored parameter mainly comprises a parameter path (composed of names of a plurality of parameters) and a parameter value. The mapping relationship between the parameter logic classification relationship and the sequence in the memory chip in the device is not invariable. For example, the logical classification of the parameters during the operation of the device is from left to right, and the order of the parameters of the storage chip (e.g., Flash) may be the time order of the random modification of the parameters by the user. Before (after) the parameters are stored (or read), the parameters can be compressed (after) and encrypted (decrypted and decompressed), so that the occupied storage space is reduced, and the safety is improved. When the user operates or communicates with other devices on the external interface 300, the communication data format can adopt the same form as the parameter storage format, thereby improving the multiplexing capability.
The parameter saving method and the electronic device provided by the invention have the following advantages that:
a) when the software is upgraded, the new parameters are convenient to add. The newly added parameter can be put at the end of saving, but when the program runs, because of the path of the parameter, the parameter can still be classified and saved according to the original relation. Even if one item is newly added in the middle of the leaf node, the storage is not influenced. Even if a program modifies many parameters, the hierarchical relationship of the classification of the parameters can be maintained.
b) The parameters can be classified, partially saved, partially not saved, automatically saved at regular time, manually saved and the like.
c) The real-time status of the device may be set to not be saved and organized with the associated parameters in the neighborhood of the parameter tree. Therefore, developers and end users can understand more easily, the research and development threshold of the equipment can be reduced, and the usability is improved.
d) And (3) improving the consistency of the program: the configuration instructions are consistent with the peripheral control instructions. When the user operates or communicates with other equipment on the external interface, the communication data format can adopt the same form as the parameter storage format, thereby improving the multiplexing capability.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.

Claims (6)

1. A method of parameter preservation, comprising the steps of:
s1, storage modes, wherein each parameter can select four different storage modes: default mode, manual preservation, automatic preservation and non-preservation;
wherein,
the default mode is as follows: the storage mode is the same as that of the father node;
and (3) manual preservation: storing when issuing an explicit storage command;
automatic preservation: if the parameters are modified, the parameters are stored at regular time, and if the parameters are modified, the parameters are stored at intervals of a certain time;
and (3) no preservation: real-time status, no need to save;
s2, a single parameter storage mode, wherein each stored parameter is divided into a parameter path, a separator and a parameter value;
s3, storing all leaf node parameters according to a certain ordered sequence in a parameter storage mode;
s4, after the parameters are continuously modified, the formed disorder is stored;
s5, compressing and encrypting the parameters, wherein the parameters are compressed and encrypted before being stored; after the parameters are read, decryption and decompression are carried out;
s6, storing multiple groups of parameters respectively and independently, when the parameters are divided into several groups, organizing the groups into forest-shaped structures, and independently selecting whether each group of parameters is compressed or not and whether the parameters are encrypted or not;
s7, multiplexing the stored parameters with the external interface commands, and when the user operates or communicates with other devices, the communication data format adopts the same form as the parameter storage format, thereby improving the multiplexing capability.
2. The method of parameter preservation according to claim 1, wherein: in step S1, the root node parameter can only be saved manually, automatically, or not.
3. The method of parameter preservation according to claim 1, wherein: in step S1, automatically save: if the parameters are modified, the parameters are stored regularly, and if the parameters are modified, the parameters are stored once every 30 seconds.
4. The method of parameter preservation according to claim 1, wherein: in step S2, the parameter path includes the names of all nodes on the shortest path from the root node parameter to the leaf node parameter, the names being separated by a separator; the parameter value is the specific value of the leaf node parameter; the parameter path is separated from the parameter value by a separator.
5. The method of parameter preservation according to claim 1, wherein: in step S3, all leaf node parameters are saved in order from left to right.
6. An electronic device, characterized in that: the method comprises a processor and a storage chip, wherein the processor is connected with the storage chip, and the storage chip stores parameters according to the parameter storage method of any one of claims 1 to 5.
CN201510973933.3A 2015-12-22 2015-12-22 A kind of method and electronic device of parameter preservation Active CN105528265B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510973933.3A CN105528265B (en) 2015-12-22 2015-12-22 A kind of method and electronic device of parameter preservation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510973933.3A CN105528265B (en) 2015-12-22 2015-12-22 A kind of method and electronic device of parameter preservation

Publications (2)

Publication Number Publication Date
CN105528265A true CN105528265A (en) 2016-04-27
CN105528265B CN105528265B (en) 2018-08-10

Family

ID=55770509

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510973933.3A Active CN105528265B (en) 2015-12-22 2015-12-22 A kind of method and electronic device of parameter preservation

Country Status (1)

Country Link
CN (1) CN105528265B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101297266A (en) * 2005-10-24 2008-10-29 尤尼西斯公司 Updating information in an interlocking trees datastore
CN101526292A (en) * 2008-05-27 2009-09-09 河南鸿昌电子有限公司 Mini ice bucket
CN102567000A (en) * 2010-12-31 2012-07-11 新奥特(北京)视频技术有限公司 Method and device for special effect plug-in supporting dynamic parameter
CN103329124A (en) * 2010-11-24 2013-09-25 万梅戈切伦和蒂拉努斯有限公司 Method and system for compiling a unique sample code for an existing digital sample

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101297266A (en) * 2005-10-24 2008-10-29 尤尼西斯公司 Updating information in an interlocking trees datastore
CN101526292A (en) * 2008-05-27 2009-09-09 河南鸿昌电子有限公司 Mini ice bucket
CN103329124A (en) * 2010-11-24 2013-09-25 万梅戈切伦和蒂拉努斯有限公司 Method and system for compiling a unique sample code for an existing digital sample
CN102567000A (en) * 2010-12-31 2012-07-11 新奥特(北京)视频技术有限公司 Method and device for special effect plug-in supporting dynamic parameter

Also Published As

Publication number Publication date
CN105528265B (en) 2018-08-10

Similar Documents

Publication Publication Date Title
EP3252605B1 (en) Vehicle-mounted control device, program writing device, program generating device and program
CN103942058B (en) A kind of EMBEDDED AVIONICS method for upgrading software and system
US20170083406A1 (en) Method and apparatus for incremental backup
US11514025B2 (en) Snapshot conscious internal file data modification for network-attached storage
CN104077420A (en) Method and device for importing data into HBase database
CN104778222A (en) Media library establishing and updating method on basis of USB (Universal Serial Bus) storage equipment
CN107943501A (en) Embedded device upgrade method, device, computer equipment and storage medium
CN105955842A (en) System partition structure and communication apparatus of embedded system
WO2013123703A1 (en) Data backup method and device, and data recovery method and device of network management system
CN115952520A (en) Big data platform data standardization processing system and method applied to data files
US10387054B2 (en) Secure element including a non-volatile memory and methods for saving and restoring data including defragmenting and compressing data stored in occupied and free regions
CN105528265B (en) A kind of method and electronic device of parameter preservation
CN112486918A (en) File processing method, device, equipment and medium
CN104063377A (en) Information processing method and electronic equipment using same
CN106909398B (en) Compression method and device for executable file
CN113590161A (en) Memory-controllable NB-IOT module differential upgrading method and system
CN102495838B (en) Data processing method and data processing device
CN106126555B (en) A kind of file management method and file system
CN111538702A (en) Hadoop-based massive small file processing method and device
CN113448888B (en) Device for storing data in a non-volatile memory
CN102567935A (en) Method and system for realizing compatibility of special-effect version
CN105657552A (en) Set top box upgrading method capable of reserving user configuration
CN112328389B (en) Memory allocation method for adding and deleting nodes in binary tree
JP2007141072A (en) Trace information output device
CN111026764B (en) Data storage method and device, electronic product and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 2, 202-B building, C building, Hua Han Innovation Park, No. 16, Lang Shan Road, Guangdong, Shenzhen, Nanshan District 518000, China

Applicant after: Shenzhen East micro smart Polytron Technologies Inc

Address before: 2, 202-B building, C building, Hua Han Innovation Park, No. 16, Lang Shan Road, Guangdong, Shenzhen, Nanshan District 518000, China

Applicant before: Shenzhen Tendzone Intelligent Technology Co., Ltd.

COR Change of bibliographic data
GR01 Patent grant
GR01 Patent grant
CP02 Change in the address of a patent holder

Address after: Room 401, Block D, Huahan Innovation Park, 16 Longshan Road, North District, Xili Street, Nanshan District, Shenzhen City, Guangdong Province, 518000

Patentee after: Shenzhen East micro smart Polytron Technologies Inc

Address before: 518000 202-B, 2 floor, block C, office building, Hua Han Innovation Park, 16 Langshan Road, Nanshan District, Shenzhen, Guangdong.

Patentee before: Shenzhen East micro smart Polytron Technologies Inc

CP02 Change in the address of a patent holder
CP02 Change in the address of a patent holder

Address after: 518000 R & D building 1601, block a, building 7, Wanke Yuncheng phase I, Xili community, Xili street, Nanshan District, Shenzhen City, Guangdong Province (16 / F, block a, building 1, international innovation Valley)

Patentee after: SHENZHEN TENDZONE INTELLIGENT TECHNOLOGY Co.,Ltd.

Address before: Room 401, Block D, Huahan Innovation Park, 16 Longshan Road, North District, Xili Street, Nanshan District, Shenzhen City, Guangdong Province, 518000

Patentee before: SHENZHEN TENDZONE INTELLIGENT TECHNOLOGY Co.,Ltd.

CP02 Change in the address of a patent holder