CN113986337A - Method, device and equipment for setting firmware parameters and storage medium - Google Patents

Method, device and equipment for setting firmware parameters and storage medium Download PDF

Info

Publication number
CN113986337A
CN113986337A CN202111289009.5A CN202111289009A CN113986337A CN 113986337 A CN113986337 A CN 113986337A CN 202111289009 A CN202111289009 A CN 202111289009A CN 113986337 A CN113986337 A CN 113986337A
Authority
CN
China
Prior art keywords
file
parameter
information
firmware
configuration
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.)
Pending
Application number
CN202111289009.5A
Other languages
Chinese (zh)
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.)
Beijing Ziguang Zhanrui Communication Technology Co Ltd
Original Assignee
Beijing Ziguang Zhanrui Communication 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 Beijing Ziguang Zhanrui Communication Technology Co Ltd filed Critical Beijing Ziguang Zhanrui Communication Technology Co Ltd
Priority to CN202111289009.5A priority Critical patent/CN113986337A/en
Publication of CN113986337A publication Critical patent/CN113986337A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Stored Programmes (AREA)

Abstract

The method comprises the steps of obtaining parameter configuration information set by a user; the parameter configuration information is information of a first data format; acquiring at least one configuration file of firmware; determining a first file corresponding to the parameter configuration information in the at least one configuration file, and updating the parameter information contained in the first file according to the parameter configuration information; compiling the at least one updated configuration file into a second file, and storing the second file into a read-only memory; the updated at least one configuration file comprises an updated first file; the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device. The method is used for improving the setting convenience of the firmware parameters and reducing the maintenance complexity of the firmware.

Description

Method, device and equipment for setting firmware parameters and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a storage medium for setting firmware parameters.
Background
Firmware (firmware) is typically stored in an electrically Erasable read-only memory eeprom (electrically Erasable Programmable rom) or FLASH chip in the device, and is typically a program that can be upgraded by the user by a specific refresh procedure.
With the rapid development of electronic products, people have increasingly high diversified demands on electronic devices. In order to meet the diversification of electronic equipment, manufacturers of different electronic equipment have different requirements on different applicable scenes and different setting parameters of each module in the firmware. At present, in order to meet the parameter requirements of manufacturers of different electronic devices for each module in firmware, a firmware manufacturer needs to individually configure the parameters of the corresponding module for the firmware for each manufacturer of the electronic device, thereby greatly increasing the working difficulty of the firmware manufacturer. Moreover, after the firmware runs in the electronic equipment, a user has no right to modify parameters in the firmware and can only modify the parameters through a manufacturer, so that the maintenance complexity of the firmware is increased.
Disclosure of Invention
In view of this, the present application provides a method, an apparatus, a device and a storage medium for setting firmware parameters, so as to solve the problem in the prior art that only a firmware manufacturer can modify firmware parameters.
In a first aspect, an embodiment of the present application provides a method for setting firmware parameters, including:
acquiring parameter configuration information set by a user; the parameter configuration information is information of a first data format;
acquiring at least one configuration file of firmware;
determining a first file corresponding to the parameter configuration information in the at least one configuration file, and updating the parameter information contained in the first file according to the parameter configuration information;
compiling the at least one updated configuration file into a second file, and storing the second file into a read-only memory; the updated at least one configuration file comprises an updated first file; the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device.
Preferably, the method further comprises the following steps:
acquiring the second file from the read-only memory;
and analyzing the second file, acquiring parameter values corresponding to different functional modules in the firmware, and storing the parameter values in the memory.
Preferably, the analyzing the second file, obtaining parameter values of different functional modules in the firmware, and storing the parameter values in the memory includes:
analyzing the second file to obtain parameter values of different functional modules in the firmware;
and storing parameter values of different functional modules in the firmware into the memory in a form of a linked list.
Preferably, the first data format is an XML format.
Preferably, the parameter configuration information includes parameter information of at least one functional module of the firmware, and the parameter information of each functional module includes a parameter value to be set of at least one parameter.
Preferably, the second file includes file header information and file body information; the file header information is used for describing data contained in the file body information; the file body information stores parameter information of each functional module in the firmware.
Preferably, the file body information records parameter information of each functional module in the firmware according to TLV format.
In a second aspect, an embodiment of the present application provides a device for setting firmware parameters, including:
the acquisition unit is used for acquiring parameter configuration information set by a user; the parameter configuration information is information of a first data format;
the acquisition unit is further used for acquiring at least one configuration file of the firmware;
the processing unit is used for determining a first file corresponding to the parameter configuration information in the at least one configuration file and updating the parameter information contained in the first file according to the parameter configuration information;
the compiling unit is used for compiling the updated at least one configuration file into a second file and storing the second file into a read-only memory; the updated at least one configuration file comprises an updated first file; the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device.
Preferably, the obtaining unit is further configured to obtain the second file from the read-only memory;
the processing unit is further configured to parse the second file, obtain parameter values corresponding to different functional modules in the firmware, and store the parameter values in the memory.
Preferably, the processing unit is specifically configured to parse the second file, and obtain parameter values of different functional modules in the firmware;
and storing parameter values of different functional modules in the firmware into the memory in a form of a linked list.
Preferably, the first data format is an XML format.
Preferably, the parameter configuration information includes parameter information of at least one functional module of the firmware, and the parameter information of each functional module includes a parameter value to be set of at least one parameter.
Preferably, the second file includes file header information and file body information; the file header information is used for describing data contained in the file body information; the file body information stores parameter information of each functional module in the firmware.
Preferably, the file body information records parameter information of each functional module in the firmware according to TLV format.
In a third aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory, the memory storing a computer program that, when executed, causes the electronic device to perform the method of the first aspect.
In a fourth aspect, an embodiment of the present application provides a storage medium, where the computer-readable storage medium includes a stored program, where when the program runs, the apparatus where the computer-readable storage medium is located is controlled to perform the method described in any one of the above first aspects.
By adopting the scheme provided by the embodiment of the application, the parameter configuration information set by a user is obtained, and at least one configuration file of the firmware is obtained; determining a first file corresponding to the parameter configuration information in at least one configuration file, updating the parameter information contained in the first file according to the parameter configuration information, compiling the updated configuration file into a second file, and storing the second file into the read-only memory. Therefore, when the parameters of the firmware need to be modified, the user can set the parameter configuration information, the electronic equipment can update the configuration file of the firmware according to the parameter configuration information, the updated configuration file is burnt into the read-only memory, the setting of the firmware parameters by the user is completed, a firmware manufacturer does not need to set the firmware parameters according to different users, the setting convenience of the firmware parameters is improved, and the maintenance complexity of the firmware is reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
Fig. 1 is a schematic flowchart illustrating a method for setting firmware parameters according to an embodiment of the present disclosure;
fig. 2 is a schematic view of a scene of a file structure according to an embodiment of the present application;
fig. 3 is a flowchart illustrating another firmware parameter setting method according to an embodiment of the present application;
FIG. 4 is a scene diagram of a linked list according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a device for setting firmware parameters according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
For better understanding of the technical solutions of the present application, the following detailed descriptions of the embodiments of the present application are provided with reference to the accompanying drawings.
It should be understood that the embodiments described are only a few embodiments of the present application, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terminology used in the embodiments of the present application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples of this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be understood that the term "and/or" as used herein is merely one type of associative relationship that describes an associated object, meaning that three types of relationships may exist, e.g., A and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
Before specifically describing the embodiments of the present application, terms applied or likely to be applied to the embodiments of the present application will be explained first.
Firmware: or a program written in an EPROM (erasable programmable read only memory) or an EEPROM (electrically erasable programmable read only memory). The firmware refers to a device "driver" stored in the device, and the operating system can realize the running action of a specific machine according to the standard device driver through the firmware.
Read-Only memories (ROMs) operate in a non-destructive manner, and Only Read-out information is written to. Information is fixed after being written once, and even if the power is turned off, the information is not lost, so that the information is also called a fixed memory.
Erasable Programmable Read-Only Memory (EPROM): and the read-only memory can not lose data after power failure. But the writing time is long and the speed is slow.
In the related art, the firmware needs to be pre-burned into the rom before the whole device is installed. And the parameter information of the firmware is set by the firmware manufacturer. In general, in order to make firmware more versatile, when setting firmware parameters, the parameter setting values of the firmware are set to values having versatility. Different manufacturers of electronic devices need to set different firmware parameters to adapt to different scenes. At this time, manufacturers of electronic devices need to adaptively adjust parameter information of firmware manufacturers, which greatly increases the work difficulty of the firmware manufacturers, and after the firmware runs in the electronic devices, users have no right to modify parameters in the firmware, and can only modify the parameters by the manufacturers, which increases the maintenance complexity of the firmware.
In order to solve the above problem, an embodiment of the present application provides a method for setting firmware parameters, which obtains parameter configuration information set by a user, and obtains at least one configuration file of a firmware; determining a first file corresponding to the parameter configuration information in at least one configuration file, updating the parameter information contained in the first file according to the parameter configuration information, compiling the updated configuration file into a second file, and storing the second file into the read-only memory. Therefore, when the parameters of the firmware need to be modified, the user can set the parameter configuration information, the electronic equipment can update the configuration file of the firmware according to the parameter configuration information, the updated configuration file is burnt into the read-only memory, the setting of the firmware parameters by the user is completed, a firmware manufacturer does not need to set the firmware parameters according to different users, the setting convenience of the firmware parameters is improved, and the maintenance complexity of the firmware is reduced. The details will be described below.
Fig. 1 is a schematic flowchart of a method for setting firmware parameters according to an embodiment of the present disclosure. As shown in fig. 1, the method includes:
and step S101, acquiring parameter configuration information set by a user.
The parameter configuration information is information of a first data format.
In the embodiment of the present application, when a user, for example, a manufacturer of an electronic device, needs to set parameters in firmware according to the electronic device produced by the user, the parameter configuration information of the firmware may be set. At this time, the setting means of the firmware parameter may receive the parameter configuration information set by the user.
Furthermore, the first data format is an XML format, the parameter configuration information in the XML format is convenient for a user to read and write, and the user can quickly and effectively set the parameter configuration information of the firmware.
In a possible embodiment, the parameter configuration information includes parameter information of at least one functional module of the firmware, and the parameter information of each functional module includes a parameter value to be set of the at least one parameter. That is, when setting the parameter configuration information, the user can set the parameter information of different functional modules in the firmware. When the parameter information of at least one functional module is set, the parameter value of at least one parameter of the parameter information in the functional module can be directly set. For example, the user may set the wifi function module in the firmware, and assume that it is necessary to set the switch parameter in the wifi function module to on, and set the rate parameter in the wifi function module to m bits per second. Wherein m is a positive number greater than 0. At this moment, the user can set the parameter value of the switching parameter of the wifi functional module to on, and set the parameter value of the rate parameter in the wifi functional module to m bits per second. At this moment, the parameter configuration information contains the parameter information of the wifi functional module, the parameter value of the switching parameter of the wifi functional module is on, and the parameter value of the rate parameter in the wifi functional module is m bits per second. The setting device of firmware parameters can receive the parameter configuration information in the XML format set by the user.
It should be noted that the parameter configuration information set by the user may be a parameter configuration file in an XML format, the user may set a plurality of parameter configuration files in the XML format for different function modules of the firmware, each file in the XML format is one piece of parameter configuration information, and at this time, the setting device for the firmware parameter may obtain a plurality of pieces of parameter configuration information.
As a possible implementation manner, in the embodiment of the present application, the parameter configuration file in the XML format may include nesting of 2-level elements, which is convenient to implement, has low complexity, and is beneficial to performance improvement. The method comprises the following specific steps:
Figure BDA0003334287940000041
the root _ name represents a file name corresponding to a functional module of the firmware to be provided with the parameter. property: indicating the beginning of an attribute segment of the function module for which the parameter is to be set. Property: indicating the end of an attribute segment of the function module to which the parameter is to be set. The parameter of only one attribute is set in one attribute segment, and at least one parameter value can be contained in the attribute segment. The ID indicates identification information of the function module to which the parameter is to be set. The name1 indicates the start of setting of the parameter 1 to be set of the function module to be set with the parameter, and the name1 is name information of the parameter 1 to be set. The/name 1 represents the end of the setting of the parameter 1 to be set of the function module of the parameter to be set. type represents a data type to be set to parameter 1. The name1 type is "xxx", and indicates that the data type to be set as parameter 1 is xxx. Xxxxxx in < name1 type ═ xxx "> xxxxxx </name1> represents the set parameter value of the parameter 1 to be set, i.e. the specific value of the set parameter 1 to be set. Similarly, name2 is name information of parameter 2 to be set, and name3 is name information of parameter 3 to be set. tag indicates some kind of special property that parameter 3 is to have.
In the above example, the name1, the name2, and the name3 are all in the same attribute segment, which indicates that the name1, the name2, and the name3 are set for parameters of the same attribute, and the name1, the name2, and the name3 represent different parameter values of the attribute.
In the embodiment of the present application, it may be considered that the functions implemented by the parameters with different attributes are different, and the functions implemented by the parameters with the same attributes are the same. For example, the rate parameter and the switch parameter in the wifi function module are parameters with different attributes. The function that the speed parameter in the wifi functional module realized is the speed of adjusting the wifi functional module, and the function of switching parameter marks whether to open wifi functional module, and the function that both realized is different.
As a possible implementation manner, the parameter of the same attribute may be set with a plurality of different parameter values through different attribute segments. The parameter value of the parameter of only one attribute can be set in the same attribute segment. For example, the rate parameter in the wifi function module may set different parameter values of the rate in one attribute segment. Different parameter values for the rate may also be set in different attribute segments. However, if the parameter value of the rate is set in one attribute segment, the parameter value of the parameter of the other attribute cannot be set in the attribute segment, for example, the parameter value of the switching parameter cannot be set in the attribute segment again, and the parameter value of the switching parameter can be set in a new attribute segment again. Thus, the realization is simpler and the complexity is lower.
Through the parameter configuration file in the XML format, the user can set parameters of different attributes of the functional module of the firmware to be set correspondingly. And sending the set XML format parameter configuration file to a setting device of the firmware parameters.
Step S102, at least one configuration file of the firmware is obtained.
In the embodiment of the application, the firmware comprises at least one preset configuration file, and parameter information in each functional module of the firmware is recorded in the configuration file. The setting device of firmware parameters can obtain the parameter information preset by each functional module of the firmware from the preset configuration file of the firmware. The parameter information of each functional module of the firmware recorded in the configuration file may be determined as default parameter information of each functional module.
Step S103, determining a first file corresponding to the parameter configuration information in the at least one configuration file, and updating the parameter information contained in the first file according to the parameter configuration information.
In this embodiment of the application, after the setting device of the firmware parameter obtains the at least one configuration file and the parameter configuration information, a first file corresponding to the parameter configuration information set by the user can be found in the at least one configuration file, that is, the first file whose parameter value needs to be set by the user is found in the at least one configuration file. And updating the parameter information in the first file according to the parameter configuration information. That is, the parameter value of the parameter in the parameter information in the first file, which is the same as the parameter configuration information, is updated to the parameter value in the parameter configuration information. If the parameter information in the parameter configuration information does not have the same related parameters in the first file, the parameter information in the parameter configuration information can be directly used as a newly added function attribute of the function module corresponding to the first file and added to the first file, and the parameter information in the first file is updated.
Illustratively, if the parameter configuration information set by the user is the parameter configuration information of the wifi function module. At this time, the setting means of the firmware parameters acquires the firmware preset configuration file. And finding out a configuration file corresponding to the wifi function module from the preset configuration file, wherein the configuration file is the first file. After the setting device of the firmware parameters determines the first file, the parameter information in the first file can be modified according to the parameter configuration information. Supposing that the parameter configuration information is that the parameter value of the switching parameter of the wifi functional module is on, and the parameter value of the rate parameter in the wifi functional module is m bits per second. After the setting device of the firmware parameters acquires the first file, whether the first file has the switch parameter information of the wifi functional module and the rate parameter information in the wifi functional module can be found out. If the first file has the switching parameter information of the wifi function module, and the switching parameter information of the wifi function module in the first file is off, at this moment, the setting device of the firmware parameter can update the switching parameter information of the wifi function module in the first file to be on according to the switching parameter information of the wifi function module in the parameter configuration information, wherein the parameter value of the switching parameter of the wifi function module is off. If the speed parameter information in the wifi functional module does not exist in the first file, at the moment, the setting device of the firmware parameter can enable the parameter value of the speed parameter in the wifi functional module in the parameter configuration information to be m bits per second and add the parameter value to the parameter information of the first file, at the moment, the parameter value of the wifi functional module recorded in the first file, which contains the switch parameter, is on, and the parameter value of the speed parameter in the wifi functional module is m bits per second and the parameter information of other wifi functional modules. The parameter information of other wifi function modules is preset and is not modified by a user.
In this way, the updated first file includes the parameter information modified by the user and the parameter information unmodified by the user, so that the integrity of the parameter information of the firmware can be ensured.
It should be noted that, a user may modify parameters of a plurality of functional modules, and at this time, the setting device of firmware parameters needs to search the first file corresponding to each piece of parameter configuration information according to each piece of parameter configuration information, so as to update the parameter information in each first file.
And step S104, compiling the updated at least one configuration file into a second file, and storing the second file into a read-only memory.
The updated at least one configuration file comprises an updated first file, and the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device.
In this embodiment, after the at least one first file is updated, the setting device for firmware parameters forms the updated at least one configuration file from the updated first file and other configuration files that are not updated, compiles the updated at least one configuration file into a second file in a second data format that can be recognized by an operating system, and stores the second file in a read-only memory, so that when the operating system of the electronic device runs, the second file is obtained from the read-only memory, and parameter information of each functional module in the firmware is obtained by parsing the second file.
In a possible implementation, the second data format is a binary format, in which case the second file may be a bin file.
In a possible implementation manner, the second file includes header information and body information. The file header information is used for describing data contained in the file body information; the file body information stores parameter information of each functional module in the firmware.
Specifically, in the embodiment of the present application, the second file includes header information and body information. The file header information is used for describing the second file and marking the functions and positions of all parts in the second file. Further, the file header information at least includes a name, a version number, a size of the file header information, and an offset of parameter information of a first functional module of the file body information, that is, a position of the file body information, and the file body information includes parameter information of several functional modules.
In a possible implementation manner, the file body information records parameter information of each functional module in the firmware according to TLV format, as shown in fig. 2. Referring to fig. 2, the file body information includes segment information, property information, and parameter value information. Each part of the file body information is recorded in TLV format. The segment information is file information of each functional module, and the property information is different parameter information in each functional module. The parameter value is a specific attribute value of a parameter in each parameter information of the function module. A piece of segment information is a configuration file of a functional module of the firmware, at this time, the segment information includes at least one property information, that is, parameter information including at least one functional module, and each property information includes a parameter value of at least one parameter, that is, an attribute value including at least one parameter.
Therefore, when the segment information is recorded according to the TLV format, because the TLV format contains the type, the length and the numerical value, when the segment information is recorded, the type can be the type of the segment information, the length is the length of the name of the segment information, and the numerical value is the name of the segment. The content after the segment information is different parameter information contained in the segment information, and each parameter information can be recorded in sequence. Namely, the at least one property information contained in the segment information is recorded in sequence. Wherein each property information is recorded according to TLV format. When recording each property information, the type may be the type of the property information, the length is the property information name, and the value is the property information name. The property information is followed by parameter values of parameters included in the property information. That is, the parameter value of at least one parameter included in the property information. At this time, the parameter values of each parameter are sequentially recorded. Wherein the parameter value of each parameter is recorded according to TLV format. When recording the parameter value of each parameter, the type may be the type of the parameter value, the length is the length of the parameter value, and the value is the parameter value. After the recording of the parameter value of at least one parameter of the property information is completed, the related recording of the next property information can be continued according to the above-mentioned manner until the recording of each segment information according to the TLV format is completed, so as to form a file body.
Therefore, the parameter information of each functional module in the firmware is recorded according to the TLV format, so that the query is convenient, the required parameter information can be quickly found, the realization complexity is low, and the performance is favorably improved.
Of course, the parameter information of each functional module in the firmware can also be recorded in other ways according to the TLV format. For example, when the segment information is recorded according to the TLV format, since the TLV format includes a type, a length, and a numerical value, when the segment information is recorded, the type may be the type of the segment information, the length is the length of at least one property information included in the segment information, and the numerical value is at least one property information included therein. Or in other ways, which are not limiting per se.
As a possible implementation manner, the embodiment of the present application is applied to a TEE (Trusted Execution Environment).
Illustratively, the user sets the parameter of the a-function module in the firmware, sets the parameter 1 in the a-function module to m, and sets the parameter 2 in the a-function module to n. The user also sets the parameters of the b function module in the firmware, sets the parameter 1 in the b function module to k, and sets the parameter 2 to l. The user can set up through a file in XML format. At this time, the firmware parameter setting device may obtain two XML-format parameter configuration files, which are the XML-format parameter configuration file corresponding to the a function module and the parameter configuration file corresponding to the b function module. In the parameter configuration file in the XML format corresponding to the a function module, the parameter 1 and the parameter 2 of the a function module set by the user are both set to the parameter of the same attribute, for example, both set to the rate parameter, that is, the parameter 1 and the parameter 2 are both set to the rate parameter, and at this time, the parameter 1 and the parameter 2 may be set in the same attribute segment, that is, in the same property information. In the parameter configuration file in the XML format corresponding to the function b module, the parameter 1 and the parameter 2 of the function b set by the user are set for parameters of different attributes, and at this time, the parameter 1 and the parameter 2 are in different attribute segments, that is, in two property information.
After the setting device of the firmware parameters obtains the parameter configuration files in the two XML formats, the configuration files of the firmware can be obtained. Suppose that the 3 configuration files preset with firmware are the configuration file of the a function module, the configuration file of the b function module, and the configuration file of the c function module, respectively. At this time, the setting device of the firmware parameters may determine two first files from the 3 configuration files according to the two obtained XML-formatted parameter configuration files, that is, the configuration file of the a function module and the configuration file of the b function module are determined as the first files. And updating the configuration file of the a function module according to the parameter configuration file in the XML format corresponding to the a function module, namely updating the parameter value of the parameter 1 in the configuration file of the a function module to m, updating the parameter value of the parameter 2 to n, and keeping the parameter values of other parameters in the configuration file of the a function module different to obtain the updated configuration file of the a function module. Similarly, the configuration file of the b function module is updated according to the parameter configuration file in the XML format corresponding to the b function module, that is, the parameter value of the parameter 1 in the configuration file of the b function module is updated to k, and the configuration file of the b function module does not have the related parameter information of the parameter 2. That is, a function, that is, a function realized by the parameter 2, is newly added in the b function module, and at this time, the parameter information of the parameter 2 may be added in the configuration file of the b function module, so as to obtain the updated configuration file of the b function module. After the configuration file of the a function module and the configuration file of the b function module are updated, the setting device of the firmware parameters can obtain the updated configuration file, which contains the updated configuration file of the a function module, the updated configuration file of the b function module and the updated configuration file of the c function module. And the firmware parameter setting device compiles the updated configuration file to obtain a second file. Wherein the second file is a bin file.
The second file includes header information and body information. The file header information of the second file records the name, version number, size of the file header information, and offset of the parameter information of the first functional module of the file body information, that is, the position of the file body information, and the file body information contains the parameter information of several functional modules. In this example, the file body information includes parameter information of 3 functional modules. And the file body information records the parameter information of each functional module in the firmware according to the TLV format. That is, the file body information records the parameter information of each function module in the updated configuration file according to the TLV format. As shown with reference to fig. 2. The segment1 records the type of the configuration file of the a function module, the length of the name of the configuration file, and the name of the configuration file. The information after segment1 is parameter information of parameters of different attributes contained in the configuration file of the a function module. Referring to fig. 2, the information after segment1 is parameter information of the parameter of attribute 1 of the a-function module. The parameter information is recorded in the information of property 1. The information of property1 is recorded in TLV format. The type of the parameter of attribute 1, the name of the parameter of attribute 1, and the length of the name are recorded therein. The property1 information is followed by parameter information contained in the parameters of property 1. The parameters of attribute 1 include two parameters, namely parameter 1 and parameter 2. Referring to fig. 2, the property1 information is followed by parameter information of parameter 1 and parameter information of parameter 2, and the parameter information of parameter 1 and the parameter information of parameter 2 are recorded in TLV format. The parameter information of the parameter 1 records the type of the parameter 1, the name of the parameter 1 and the parameter value of the parameter 1 according to the TLV format. The parameter information of the parameter 2 records the type of the parameter 2, the name of the parameter 2 and the parameter value of the parameter 2 according to the TLV format. The recording of the information of property1 is completed. The information of property2 begins to be recorded. Similarly, reference may be made to the recording process of property1, which is not described in detail herein. After the recording of the parameter information of the parameter of the different attribute contained in the segment1 is completed, the recording of the segment1 is completed. Recording of segment2 is continued. The segment2 records the type of the configuration file of the b-function module, the length of the name of the configuration file, and the name of the configuration file. The segment3 records the type of the configuration file of the c-function module, the length of the name of the configuration file, and the name of the configuration file. The recording process of segment2 and segment3 is the same as that of segment1, and is not described herein again.
And the firmware parameter setting device burns the compiled second file into the read-only memory.
Fig. 3 is a flowchart illustrating another firmware parameter setting method according to an embodiment of the present application. The method is applied to the electronic device, and as shown in fig. 3, the method includes:
and S301, acquiring parameter configuration information set by a user.
The parameter configuration information is information of a first data format.
Specifically, reference to step S101 is not repeated herein.
Step S302, at least one configuration file of the firmware is obtained.
Specifically, the step S102 may be referred to and will not be described herein again.
Step S303, determining a first file corresponding to the parameter configuration information in the at least one configuration file, and updating the parameter information included in the first file according to the parameter configuration information.
Specifically, it is not described herein with reference to step S103.
Step S304, compiling the updated at least one configuration file into a second file, and storing the second file into a read-only memory.
Wherein the updated at least one configuration file comprises an updated first file; the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device.
Specifically, reference to step S104 is not repeated herein.
And step S305, acquiring a second file from the read-only memory.
Specifically, when the operating system of the electronic device runs, the second file is acquired from the read-only memory.
Step S306, analyzing the second file, obtaining parameter values corresponding to different functional modules in the firmware, and storing the parameter values in the memory.
Specifically, after the electronic device acquires the second file, the electronic device may parse the second file, acquire parameter information of different functional modules of the firmware in the second file, and store the acquired parameter information in the memory so as to be used in subsequent operation.
Further, analyzing the second file, obtaining parameter values of different functional modules in the firmware, and storing the parameter values in the memory, wherein the parameter values comprise:
analyzing the second file to obtain parameter values of different functional modules in the firmware; and storing parameter values of different functional modules in the firmware into a memory in a form of a linked list.
That is, the second file includes file header information and file body information, and the file body information records parameter information of different functional modules in the firmware according to the TLV format, so that the operating system of the electronic device parses the second file after acquiring the second file, and acquires the file header information and the file body information. And the offset position of the parameter information of the first functional module contained in the file body information can be obtained by analyzing the file header information, and the file body information contains the parameter information of several functional modules. The parameter information of the first functional module is searched in the file body information through the offset position of the parameter information of the first functional module, the parameter information of the functional module can be obtained through analyzing the parameter information, the parameter information of other functional modules can be obtained through analyzing subsequent data, and then parameter values of different parameters of each functional module are obtained. For convenience of searching, the searching speed is increased, and the response time is shortened, when the parameter values of each parameter of different functional modules are stored, the parameter values can be stored in a linked list form, as shown in fig. 4.
In the linked list, the parameter information of different functional modules is stored as different nodes, so that the stored parameter values can be classified and stored according to the functional modules, the quick search is facilitated, and the response time can be shortened.
In this way, in the embodiment of the present application, parameter configuration information set by a user is obtained, and at least one configuration file of the firmware is obtained; determining a first file corresponding to the parameter configuration information in at least one configuration file, updating the parameter information contained in the first file according to the parameter configuration information, compiling the updated configuration file into a second file, and storing the second file into the read-only memory. Therefore, when the parameters of the firmware need to be modified, the user can set the parameter configuration information, the electronic equipment can update the configuration file of the firmware according to the parameter configuration information, the updated configuration file is burnt into the read-only memory, the setting of the firmware parameters by the user is completed, a firmware manufacturer does not need to set the firmware parameters according to different users, the setting convenience of the firmware parameters is improved, and the maintenance complexity of the firmware is reduced.
Fig. 5 is a schematic structural diagram of a device for setting firmware parameters according to an embodiment of the present disclosure. As shown in fig. 5, the apparatus includes:
an obtaining unit 501, configured to obtain parameter configuration information set by a user.
The parameter configuration information is information of a first data format.
In one possible embodiment, the first data format is an XML format.
In a possible embodiment, the parameter configuration information includes parameter information of at least one functional module of the firmware, and the parameter information of each functional module includes a parameter value to be set of the at least one parameter.
The obtaining unit 501 is further configured to obtain at least one configuration file of the firmware.
The processing unit 502 is configured to determine a first file corresponding to the parameter configuration information in the at least one configuration file, and update the parameter information included in the first file according to the parameter configuration information.
The compiling unit 503 is configured to compile the updated at least one configuration file into a second file, and store the second file in the read only memory.
Wherein the updated at least one configuration file comprises an updated first file; the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device.
In a possible embodiment, the second file includes header information and body information; the file header information is used for describing data contained in the file body information; the file body information stores parameter information of each functional module in the firmware.
In one possible embodiment, the file body information records parameter information of each functional module in the firmware according to TLV format.
Further, the obtaining unit 501 is further configured to obtain the second file from the read-only memory.
The processing unit 502 is further configured to parse the second file, obtain parameter values corresponding to different functional modules in the firmware, and store the parameter values in the memory.
Specifically, the processing unit 502 is specifically configured to parse the second file, and obtain parameter values of different functional modules in the firmware; and storing parameter values of different functional modules in the firmware into a memory in a form of a linked list.
Corresponding to the embodiment, the application further provides the electronic equipment. Fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device 600 may include: a processor 601, a memory 602, and a communication unit 603. The components communicate over one or more buses, and those skilled in the art will appreciate that the configuration of the servers shown in the figures are not meant to limit embodiments of the present invention, and may be in the form of buses, stars, more or fewer components than those shown, some components in combination, or a different arrangement of components.
The communication unit 603 is configured to establish a communication channel, so that the storage device can communicate with other devices. Receiving the user data sent by other devices or sending the user data to other devices.
The processor 601, which is a control center of the storage device, connects various parts of the entire electronic device using various interfaces and lines, and executes various functions of the electronic device and/or processes data by running or executing software programs and/or modules stored in the memory 602 and calling data stored in the memory. The processor may be composed of Integrated Circuits (ICs), for example, a single packaged IC, or a plurality of packaged ICs connected to the same or different functions. For example, the processor 601 may include only a Central Processing Unit (CPU). In the embodiment of the present invention, the CPU may be a single operation core, or may include multiple operation cores.
The memory 602 is used for storing instructions executed by the processor 601, and the memory 602 may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
The execution instructions in the memory 602, when executed by the processor 601, enable the embedded device 600 to perform some or all of the steps in the embodiment shown in FIG. 3.
In specific implementation, the present invention further provides a computer storage medium, where the computer storage medium may store a program, and the program may include some or all of the steps in the embodiments of the firmware parameter setting method provided by the present invention when executed. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), a Random Access Memory (RAM), or the like.
Those skilled in the art will readily appreciate that the techniques of the embodiments of the present invention may be implemented as software plus a required general purpose hardware platform. Based on such understanding, the technical solutions in the embodiments of the present invention may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The same and similar parts in the various embodiments in this specification may be referred to each other. Especially, as for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant points can be referred to the description in the method embodiment.

Claims (10)

1. A method for setting firmware parameters is characterized by comprising the following steps:
acquiring parameter configuration information set by a user; the parameter configuration information is information of a first data format;
acquiring at least one configuration file of firmware;
determining a first file corresponding to the parameter configuration information in the at least one configuration file, and updating the parameter information contained in the first file according to the parameter configuration information;
compiling the at least one updated configuration file into a second file, and storing the second file into a read-only memory; the updated at least one configuration file comprises an updated first file; the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device.
2. The method of claim 1, further comprising:
acquiring the second file from the read-only memory;
and analyzing the second file, acquiring parameter values corresponding to different functional modules in the firmware, and storing the parameter values in the memory.
3. The method of claim 2, wherein parsing the second file, obtaining parameter values of different functional modules in the firmware, and storing the parameter values in the memory comprises:
analyzing the second file to obtain parameter values of different functional modules in the firmware;
and storing parameter values of different functional modules in the firmware into the memory in a form of a linked list.
4. The method of claim 1, wherein the first data format is an XML format.
5. The method according to claim 1, wherein the parameter configuration information includes parameter information of at least one functional module of the firmware, and the parameter information of each functional module includes a parameter value to be set of the at least one parameter.
6. The method according to any one of claims 1-5, wherein the second file comprises header information and body information; the file header information is used for describing data contained in the file body information; the file body information stores parameter information of each functional module in the firmware.
7. The method of claim 6, wherein the file body information records parameter information of each functional module in the firmware according to TLV format.
8. An apparatus for setting firmware parameters, comprising:
the acquisition unit is used for acquiring parameter configuration information set by a user; the parameter configuration information is information of a first data format;
the acquisition unit is further used for acquiring at least one configuration file of the firmware;
the processing unit is used for determining a first file corresponding to the parameter configuration information in the at least one configuration file and updating the parameter information contained in the first file according to the parameter configuration information;
the compiling unit is used for compiling the updated at least one configuration file into a second file and storing the second file into a read-only memory; the updated at least one configuration file comprises an updated first file; the second file is a file in a second data format; the second data format is a data format that is recognizable by an operating system of the electronic device.
9. An electronic device, comprising: a processor and a memory, the memory storing a computer program that, when executed, causes the electronic device to perform the method of any of claims 1-7.
10. A storage medium, comprising a stored program, wherein the program, when executed, controls an apparatus in which the computer-readable storage medium resides to perform the method of any one of claims 1-7.
CN202111289009.5A 2021-11-02 2021-11-02 Method, device and equipment for setting firmware parameters and storage medium Pending CN113986337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111289009.5A CN113986337A (en) 2021-11-02 2021-11-02 Method, device and equipment for setting firmware parameters and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111289009.5A CN113986337A (en) 2021-11-02 2021-11-02 Method, device and equipment for setting firmware parameters and storage medium

Publications (1)

Publication Number Publication Date
CN113986337A true CN113986337A (en) 2022-01-28

Family

ID=79745829

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111289009.5A Pending CN113986337A (en) 2021-11-02 2021-11-02 Method, device and equipment for setting firmware parameters and storage medium

Country Status (1)

Country Link
CN (1) CN113986337A (en)

Similar Documents

Publication Publication Date Title
CN104065637B (en) Web-game running method and device
CN108920365B (en) WebUI automatic testing method based on docker
CN112099800A (en) Code data processing method and device and server
CN107426041B (en) Method and device for analyzing command
CN108681504A (en) Automated testing method, test server and computer readable storage medium
US20230315213A1 (en) Program download method for intelligent terminal and intelligent terminal
CN111666220A (en) Method and device for generating Web page object test file
CN111752582A (en) Software updating method and device in local area network and electronic equipment
CN107577506B (en) Data preloading method and system
CN108255735A (en) Associated environment test method, electronic device and computer readable storage medium
CN105988943B (en) A kind of method and device driving wireless adapter
CN110262828A (en) System business module configuration method, system, readable storage medium storing program for executing and equipment
US6708229B2 (en) Configuring computer components
CN113986337A (en) Method, device and equipment for setting firmware parameters and storage medium
CN111858018B (en) Cgroup configuration method and device, computer equipment and storage medium
CN110928753A (en) Method and device for controlling log output of browser console, computer equipment and computer readable storage medium
CN110502238A (en) A kind of method and device of front and back end joint debugging
CN107562440B (en) Eeprom version updating method and device
CN111736858B (en) Upgrading method of terminal equipment, storage medium and terminal equipment
CN110730168B (en) Communication control method and device and server equipment
CN115437740A (en) Zygote heap space adjusting method, application program running method and electronic equipment
CN113741966A (en) Method, system, equipment and storage medium for Kickstart file conversion
CN113656006A (en) Rich text rendering method and rendering equipment
CN111625302A (en) Function time consumption tracking method, device and storage medium
CN112423117A (en) Web end video playing method and device and computer equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination