Field configuration method, apparatus and electronic device

By acquiring and storing the target field address information of the target device, the memory sharing problem between EDK2 modules is solved, dynamic variable synchronization of the configuration file is realized, and the synchronization efficiency of the configuration file is improved.

CN118981340BActive Publication Date: 2025-11-28XIAMEN UNISOC TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410953883.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-16
Publication Date
2025-11-28
Estimated Expiration
2044-07-16

AI Technical Summary

Technical Problem

When calling the common access interface to access configuration files between EDK2 modules, the dynamic variables in each configuration file cannot be shared in memory, causing the configuration files to fail to synchronize.

Method used

By obtaining the field configuration request, the target field and its address information of the target device are determined and stored in the target storage area, so that the target fields can be dynamically loaded between EDK2 modules to achieve memory sharing.

Benefits of technology

It enables memory sharing between EDK2 modules, satisfies the synchronization of dynamic variables in runtime configuration files, and improves the synchronization efficiency of configuration files.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981340B_ABST
    Figure CN118981340B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a field configuration method and device and electronic equipment. The method comprises: obtaining a field configuration request, the field configuration request being used to request configuration of at least one target field of a target device in at least one first configuration file set; determining at least one target field corresponding to the target device in the at least one first configuration file set according to the field configuration request; determining address information and a target storage area of the at least one target field, and storing the address information to the target storage area, so that the target device runs EDK2 and dynamically loads the at least one target field according to the address information of the target storage area. The memory between each module in the electronic equipment can be shared when running EDK2.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present application relate to the technical field of computer, and particularly relate to a field configuration method and device, and electronic equipment. BACKGROUND

[0002] A device driver or application corresponding to a Unified Extensible Firmware Interface (UEFI) in an electronic device can be developed through an Extreme Density Kit, Version 2 (EDK2).

[0003] Before running the EDK2, the EDK2 needs to be configured to be suitable for different electronic devices. In the related art, the configuration can be performed in the following manner: a plurality of configuration files in the EDK2 are compiled to obtain at least one configuration file. The at least one configuration file is set in a firmware volume (FV) corresponding to the EDK2. In this way, the EDK2 can dynamically load the configuration file from the corresponding FV at runtime. In the above process, when the EDK2 modules call a common access interface to access the memory corresponding to the configuration file, the dynamic variables in each configuration file cannot be accessed through memory sharing. SUMMARY

[0004] Embodiments of the present application provide a field configuration method and device, and electronic equipment, to solve the problem that when the EDK2 modules call a common access interface to access the memory corresponding to the configuration file, the dynamic variables in each configuration file cannot be accessed through memory sharing.

[0005] In a first aspect, embodiments of the present application provide a field configuration method, comprising:

[0006] obtaining a field configuration request, the field configuration request being used to request configuration of at least one target field of a target device in at least one first configuration file set;

[0007] determining at least one target field corresponding to the target device in the at least one first configuration file set according to the field configuration request;

[0008] determining address information and a target storage area of the at least one target field, and storing the address information to the target storage area, so that the target device loads the at least one target field dynamically according to the address information of the target storage area when running the EDK2.

[0009] In a possible implementation, the field configuration request comprises a device type of the target device, a set identifier of at least one first profile set, and a first file identifier of a device profile; and the at least one target field corresponding to the target device is determined from the at least one first profile set according to the field configuration request, comprising:

[0010] determining whether there is a target profile set in the at least one first profile set;

[0011] If yes, the target profile is determined from the target profile set according to the first file identifier of the device profile, and the at least one target field is determined from the target profile according to the device type of the target device.

[0012] In a possible implementation, the target profile set comprises at least one first profile; and the target profile is determined from the target profile set according to the first file identifier of the device profile, comprising:

[0013] determining a second file identifier of each first profile;

[0014] the target profile is determined from the at least one first profile according to the second file identifier of each first profile, and the second file identifier of the target profile matches the first file identifier.

[0015] In a possible implementation, the at least one target field is determined from the target profile according to the device type of the target device, comprising:

[0016] determining a target field identifier corresponding to the device type;

[0017] for any one field in the target profile, if a field identifier of the field matches the target field identifier, the field is determined as the target field.

[0018] In a possible implementation, determining whether there is a target profile set in the at least one first profile set, comprising:

[0019] obtaining a preset identifier;

[0020] if the set identifier of the first profile in the at least one first profile set is the preset identifier, the first profile set is determined as the target profile set;

[0021] If there is no set identifier of the first configuration file in the at least one first configuration file set, it is determined that there is no target configuration file set.

[0022] In a possible implementation, determining the address information of the at least one target field comprises:

[0023] Obtaining a memory management list;

[0024] In the memory management list, obtaining a memory address of the at least one target field in the target configuration file set;

[0025] Determining the memory address as the address information of the at least one target field.

[0026] In a possible implementation, determining the target storage area comprises:

[0027] Obtaining a preset algorithm;

[0028] Determining the target storage area in the target device by using the preset algorithm.

[0029] In a possible implementation, the method further comprises:

[0030] Obtaining at least one initial description file;

[0031] Compiling the at least one initial description file according to a first preset format to obtain the at least one first configuration file set, wherein the at least one first configuration file set comprises at least one configuration file;

[0032] Compiling the at least one initial description file according to a second preset format to obtain the at least one second configuration file set, wherein the at least one second configuration file set comprises at least one configuration file;

[0033] For any one second configuration file set, determining a first configuration file set corresponding to the second configuration file set and a first storage area;

[0034] Storing the second configuration file set and the first configuration file set corresponding to the second configuration file set into the first storage area corresponding to the second configuration file set.

[0035] In a second aspect, an embodiment of the present application provides a field configuration device, and the device comprises:

[0036] An obtaining module, configured to obtain a field configuration request, wherein the field configuration request is used to request configuration of at least one target field of a target device in at least one configuration file set;

[0037] a first determining module, configured to determine at least one target field corresponding to the target device from the at least one configuration file set according to the field configuration request;

[0038] a second determining module, configured to determine address information and a target storage area of the at least one target field, and store the address information into the target storage area, so that the target device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2.

[0039] In a possible implementation, the first determining module is specifically configured to:

[0040] determine whether there is a target configuration file set in the at least one first configuration file set;

[0041] if yes, determine the target configuration file from the target configuration file set according to the first file identifier of the device configuration file, and determine the at least one target field from the target configuration file according to the device type of the target device.

[0042] In a possible implementation, the first determining module is specifically configured to:

[0043] determine a second file identifier of each first configuration file;

[0044] determine the target configuration file from the at least one first configuration file according to the second file identifier of each first configuration file, the second file identifier of the target configuration file matching the first file identifier.

[0045] In a possible implementation, the first determining module is specifically configured to:

[0046] determine a target field identifier corresponding to the device type;

[0047] for any one field in the target configuration file, if a field identifier of the field matches the target field identifier, determine that the field is the target field.

[0048] In a possible implementation, the first determining module is specifically configured to:

[0049] obtain a preset identifier;

[0050] if there is a set identifier of the first configuration file set that matches the preset identifier in the at least one first configuration file set, determine the first configuration file set as the target description set;

[0051] If there is no set identifier of the first configuration file set as the preset identifier in the at least one first configuration file set, it is determined that there is no target configuration file set.

[0052] In a possible implementation, the second determining module is specifically configured to:

[0053] obtain a memory management list;

[0054] obtain, in the memory management list, a memory address of the at least one target field in the target configuration file set;

[0055] determine the memory address as address information of the at least one target field.

[0056] In a possible implementation, the second determining module is specifically configured to:

[0057] obtain a preset algorithm;

[0058] determine the target storage area in the target device by using the preset algorithm.

[0059] In a possible implementation, the apparatus further includes a storage module.

[0060] The storage module is configured to:

[0061] obtain at least one initial description file;

[0062] compile the at least one initial description file according to a first preset format to obtain at least one first configuration file set, the at least one first configuration file set including at least one configuration file;

[0063] compile the at least one initial description file according to a second preset format to obtain at least one second configuration file set, the at least one second configuration file set including at least one configuration file;

[0064] for any one second configuration file set, determine a first configuration file set and a first storage area corresponding to the second configuration file set;

[0065] store the second configuration file set and the first configuration file set corresponding to the second configuration file set into the first storage area corresponding to the second configuration file set.

[0066] In a third aspect, the present application provides a chip, and the chip stores a computer program. When the computer program is executed by the chip, the method in any one of the first aspect is implemented.

[0067] In a fourth aspect, the present application provides a chip module, wherein the chip module stores a computer program, and the computer program is executed by the chip module to implement the method in any one of the first aspect.

[0068] In a fifth aspect, the embodiments of the present application provide an electronic device, comprising:

[0069] at least one processor; and

[0070] a memory connected with the at least one processor; wherein

[0071] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method in any one of the first aspect.

[0072] In a sixth aspect, the embodiments of the present application provide a non-transitory computer readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the method in any one of the first aspect.

[0073] In a seventh aspect, the embodiments of the present application provide a computer program product comprising a computer program, wherein the computer program is executed by a processor to implement the method in any one of the first aspect.

[0074] The field configuration method, device and electronic device provided by the embodiments of the present application obtain a field configuration request, and the field configuration request is used to request configuration of at least one target field of a target device in at least one first configuration file set. According to the field configuration request, at least one target field corresponding to the target device is determined in the at least one first configuration file set. Address information of the at least one target field and a target storage area are determined, and the address information is stored in the target storage area, so that the electronic device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2. In the above process, at least one target field corresponding to the target device can be determined in the at least one first configuration file set according to the field configuration request. And the address information of the at least one target field is stored in the target storage area. In this way, the electronic device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2. The EDK2 module calls a public access interface to access the memory corresponding to the at least one target field, and the variable fields in the configuration file are added, deleted, modified or inquired through the access device tree node mode. It is realized that when running EDK2, the memory can be shared between the modules in the electronic device, and the synchronization of dynamic variables in the running configuration file is met. BRIEF DESCRIPTION OF DRAWINGS

[0075] Figure 1 The schematic diagram of the application scenario provided by the embodiments of the present application;

[0076] Figure 2 A flowchart illustrating a field configuration method provided in an embodiment of this application;

[0077] Figure 3 This is a schematic diagram illustrating the process of obtaining the first configuration file set provided in an embodiment of this application;

[0078] Figure 4 A flowchart illustrating another field configuration method provided in an embodiment of this application;

[0079] Figure 5 A schematic diagram illustrating the field configuration process provided in this application embodiment;

[0080] Figure 6 This is a schematic diagram of the structure of a field configuration device provided in an embodiment of this application;

[0081] Figure 7 A schematic diagram of another field configuration device provided in an embodiment of this application;

[0082] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0083] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0084] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0085] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant laws, regulations and standards, and provide corresponding operation portal for user to choose authorization or refusal.

[0086] For ease of understanding, below, combined with Figure 1 , the application scenarios to which the embodiments of the present application are applied are described.

[0087] Figure 1 The application scenarios provided by the embodiments of the present application are illustrated. Please refer to Figure 1 , the electronic device 101. The electronic device 101 can be a mobile phone, a computer, a base station, etc. The electronic device 101 is provided with multiple chips and software interfaces, and the software interface can be UEFI. The user can develop the chip corresponding to UEFI in the electronic device 101 through EDK2. Before the electronic device 101 runs EDK2, EDK2 needs to be configured.

[0088] In the related art, the configuration can be performed in the following manner: multiple configuration files in the EDK2 are compiled and processed to obtain at least one configuration file. And the at least one configuration file is set in the corresponding FV of the EDK2. In this way, the EDK2 can dynamically load the DTB file from the corresponding FV at runtime. In the above process, when the EDK2 module calls the public access interface to access the memory corresponding to the DTB file, the dynamic variables in each configuration file cannot be shared in memory.

[0089] In the embodiment of the present application, a field configuration request is obtained, and the field configuration request is used to request configuration of at least one target field of a target device in at least one first configuration file set. According to the field configuration request, at least one target field corresponding to the target device is determined in the at least one first configuration file set. Address information of the at least one target field and a target storage area are determined, and the address information is stored in the target storage area, so that the electronic device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2. In the above process, at least one target field corresponding to the target device can be determined in the at least one first configuration file set according to the field configuration request. The address information of the at least one target field is stored in the target storage area. In this way, the electronic device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2. The EDK2 module calls a public access interface to access the memory corresponding to the at least one target field, and adds, deletes, modifies, inquires and checks the variable field in the configuration file through the device tree node mode. It is realized that the memory can be shared between modules in the electronic device when running EDK2, and the synchronization of dynamic variables in the configuration file at runtime is met.

[0090] In the following, the method shown in the present application is described through specific embodiments. It should be noted that the following embodiments can exist independently or be combined with each other. For the same or similar content, it will not be repeated in different embodiments.

[0091] Figure 2 A flowchart of a field configuration method provided in the embodiment of the present application is shown. Please refer to Figure 2 The method can include:

[0092] S201, obtaining a field configuration request.

[0093] The execution subject of the embodiment of the present application can be an electronic device, or a chip, a chip module or a field configuration device provided in the electronic device. The field configuration device can be realized by software, or by the combination of software and hardware. The electronic device can be a mobile phone, a computer, a base station, etc.

[0094] The field configuration request is used to request configuration of at least one target field of a target device in at least one first configuration file set.

[0095] The file format of the first configuration file in the first configuration file set is DTS format.

[0096] The field configuration can be performed after the field configuration device is installed in the electronic device and the electronic device is powered on. Before the field configuration is performed, each initial configuration file in the EDK2 of the electronic device needs to be processed to obtain the first configuration file set.

[0097] The first configuration file set can be obtained as follows: At least one initial description file is obtained; the at least one initial description file is compiled according to a first preset format to obtain at least one first configuration file set, wherein the at least one first configuration file set includes at least one configuration file; the at least one initial description file is compiled according to a second preset format to obtain at least one second configuration file set, wherein the at least one second configuration file set includes at least one configuration file; for any second configuration file set, the corresponding first configuration file set and a first storage area are determined; the second configuration file set and the corresponding first configuration file set are stored in the first storage area corresponding to the second configuration file set.

[0098] The first configuration file can be a Device Tree Blob (DTB) file.

[0099] The first preset format can be DTS format, and the second preset format can be DSC format. The first and second storage areas can be FV in the electronic device.

[0100] Below, in conjunction with Figure 3 The process of obtaining the first set of configuration files is explained. Figure 3 This is a schematic diagram illustrating the process of obtaining the first configuration file set as provided in an embodiment of this application. Please refer to [link / reference]. Figure 3 The system includes a first configuration file set 301, a second configuration file set 302, and a storage area 303. The storage area 303 includes multiple firmware volumes. At least one initial description file is obtained. The at least one initial description file is compiled to obtain at least one configuration file, which can be a DTB file. The at least one configuration file is synthesized using the mkdtimg tool to obtain at least one first configuration file set 301. The format of the first configuration file in the first configuration file set 301 can be DTS format. The at least one configuration file is then synthesized to obtain at least one second configuration file set 302. The format of the second configuration file in the second configuration file set 302 can be DSC format. At least one first configuration file set 301 and at least one second configuration file set 302 are stored in the respective firmware volumes of the storage area 303. Image files are generated based on the configuration file sets in the multiple firmware volumes of the storage area 303. During operation, the UEFI of the electronic device can dynamically load configuration files from the respective firmware volumes of the storage area. The first configuration file in the first configuration file set can be an image file of the corresponding second configuration file in the second configuration file set.

[0101] It should be noted that the file format of the first configuration file provided in the embodiments of the present application is DTS format. The syntax structure in DTS is tree structure. In this way, the configuration process can be simplified, and the need for configuring multiple definitions, declarations and reference relationships between each configuration file when configuring the file in DSC format is avoided. The efficiency of field configuration is improved.

[0102] S202, according to the field configuration request, determining at least one target field corresponding to the target device in the at least one first configuration file set.

[0103] The field configuration request includes the device type of the target device, the set identifier of the at least one first configuration file set, and the first file identifier of the device configuration file.

[0104] The at least one target field corresponding to the target device in the at least one first configuration file set can be determined according to the field configuration request in the following manner: judging whether there is a target configuration file set in the at least one first configuration file set; if yes, determining the target configuration file in the target configuration file set according to the first file identifier of the device configuration file, and determining at least one target field in the target configuration file according to the device type of the target device.

[0105] The target device can be an electronic device. The configuration file in the target configuration file set can be a DTB file, and the file format of the DTB file is DTS format.

[0106] The device type can be a mobile terminal type, a terminal type, a base station type, etc.

[0107] For example, it is assumed that the at least one first configuration file set includes configuration file set A1 to configuration file set A3. In the at least one first configuration file set, there is a target configuration file set, which is configuration file set A2. According to the first file identifier of the device configuration file, file A22 is determined as the target configuration file in the configuration file set A2. It is assumed that the device type of the target device is a mobile terminal type. Then, according to the mobile terminal type, at least one target field corresponding to the target device is determined in file A22, including fields A12 to A15.

[0108] S203, determining address information and a target storage area of the at least one target field, and storing the address information to the target storage area, so that the target device runs EDK2 according to the address information of the target storage area to dynamically load the at least one target field.

[0109] The address information of the at least one target field can be determined by: obtaining a memory management list; obtaining, in the memory management list, a memory address of the at least one target field in the target configuration file set; and determining the memory address as the address information of the at least one target field.

[0110] The memory management list can be a Hob list. The Hob list includes identifiers of a plurality of configuration files and memory addresses corresponding to the identifiers of the configuration files. The target device can initialize memory and configure the Hob list in a PEI stage of EDK2.

[0111] For example, according to the example described above, it is determined that the at least one target field of the target device includes fields A12 to A15. The target device obtains a memory management list and obtains, in the memory management list, a memory address of fields A12 to A15 in the target configuration file set as address A1. Therefore, the target device determines that the address information of the at least one target field is address A1.

[0112] The target storage area can be determined by: obtaining a preset algorithm; and determining, by the preset algorithm, the target storage area in the target device.

[0113] The preset algorithm can be a Malloc algorithm. The preset algorithm can be set in advance and stored in a preset storage space of the target device.

[0114] For example, according to the example described above, it is determined that the address information of the at least one target field is address A1. The target device obtains a preset algorithm in a preset storage space and determines, by the preset algorithm, that the target storage area is storage area A. The target device stores address A1 in storage area A. In this way, in a subsequent stage of EDK2, the target device can dynamically load the at least one target field according to the address information in the target storage area according to an instruction / request.

[0115] The field configuration method provided by the embodiment of the present application comprises the following steps: a field configuration request is acquired. At least one target field corresponding to a target device is determined in at least one first configuration file set according to the field configuration request. Address information of the at least one target field and a target storage area are determined, and the address information is stored in the target storage area, so that the electronic device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2. In the above process, the at least one target field corresponding to the target device can be determined in the at least one first configuration file set according to the field configuration request. The address information of the at least one target field is stored in the target storage area. The EDK2 module calls a public access interface to access the memory corresponding to the at least one target field, and the variable fields in the configuration file are added, deleted, modified or inquired through the access device tree node mode. It is realized that the memory can be shared between the modules in the electronic device when running EDK2, and the synchronization of the dynamic variables in the running configuration file is met.

[0116] On the basis of any one of the above embodiments, the following will be described in combination with Figure 4 The detailed process of field configuration is described.

[0117] Figure 4 The flowchart of another field configuration method provided by the embodiment of the present application is shown in the following figure. Figure 4 The method comprises the following steps:

[0118] S401, a field configuration request is acquired.

[0119] It should be noted that the execution process of S401 can refer to S201, which will not be described here.

[0120] S402, it is judged whether there is a target configuration file set in the at least one first configuration file set.

[0121] Whether there is a target configuration file set in the at least one first configuration file set can be judged by the following method: a preset identifier is acquired; if the set identifier of the first configuration file in the at least one first configuration file set is the preset identifier, the first configuration file set is determined as the target description set; if the set identifier of the first configuration file in the at least one first configuration file set is not the preset identifier, it is determined that there is no target configuration file set.

[0122] The preset identifier can be set in advance and stored in the preset storage space of the target device.

[0123] For example, the field configuration request can be as shown in Table 1:

[0124] Table 1

[0125] Target device Device type Set identification First file identification Mobile phone B Mobile terminal type Identification B1-Identification B10 File B12

[0126] Suppose the preset identifier is identifier B2. In the field configuration request shown in Table 1, it can be determined that the at least one first configuration file set can include configuration file set B1 to configuration file set B10. In the at least one configuration file set B1 to configuration file set B10, the set identifier B2 of the first configuration file set exists as the preset identifier. Therefore, the mobile phone B determines that, in the configuration file set B1 to configuration file set B10, the target configuration file set is the configuration file set B2.

[0127] When it is determined that the target configuration file set does not exist in the at least one first configuration file set, a prompt information can be generated. The prompt information is used to indicate that the target configuration file set does not exist.

[0128] In actual application process, the first configuration file set and the second configuration file set can be generated simultaneously in the EDK2 compilation stage. In the EDK2 running stage, it can be determined according to the scene whether to determine the at least one target field in the first configuration file set.

[0129] S403, if yes, determining a target configuration file in the target configuration file set according to the first file identifier of the device configuration file.

[0130] The target configuration file in the target configuration file set can be determined according to the first file identifier of the device configuration file by the following method: determining the second file identifier of each first configuration file; determining the target configuration file in the at least one first configuration file according to the second file identifier of each first configuration file, the second file identifier of the target configuration file matching the first file identifier.

[0131] The target configuration file set includes at least one first configuration file. The file format of the first configuration file is a DTS format.

[0132] The file format of the first configuration file is a DTS format, which can avoid the file formats of the configuration files of the chips in the target device being different, causing the file format of the configuration file of the EDK2 to be unmatched with the file formats of the configuration files of the chips, and the DTB file may not be applicable to each chip in subsequent Bootloader running. Moreover, no translation processing is required before running the Bootloader, thereby improving the flexibility of running the EDK2.

[0133] For example, according to the example shown above, it is determined that the target profile set is profile set B2. Profile set B2 includes profiles B11-B20, and the second file identifiers of profiles B11-B20 are file B11-file B20, respectively. It is determined that the second file identifier of profile B12 matches the first file identifier shown in Table 1. Therefore, the mobile phone B determines that the target profile is profile B12.

[0134] S404, determining at least one target field in the target profile according to the device type of the target device.

[0135] The at least one target field in the target profile according to the device type of the target device can be determined by determining a target field identifier corresponding to the device type, and determining that a field in the target profile is a target field if the field identifier of the field matches the target field identifier.

[0136] A plurality of device types and a field identifier corresponding to each device type can be set in advance, and the plurality of device types and the field identifier corresponding to each device type can be stored in a preset storage space of the electronic device. The target profile includes at least one field corresponding to at least one device type. The at least one field is used to describe device information of a hardware device corresponding to each device type.

[0137] For example, according to the example shown above, it is determined that the target profile is profile B12. Profile B12 can be specifically as shown in Table 2:

[0138] Table 2

[0139] Device type Field identification Field Mobile terminal type MZ01 Field B1-Field B20 Terminal type ZZ00 Field B21-Field B35 Base station type JZ10 Field B36-Field B50

[0140] According to Table 1, it is determined that the device type is a mobile terminal type, and the target field identifier corresponding to the mobile terminal type is MZ01. The mobile phone B determines that the fields corresponding to the target field identifiers in the at least one field shown in Table 2 are fields B1-B20. Therefore, the mobile phone B determines that the at least one target field includes fields B1-B20.

[0141] S405, determining address information and a target storage area of the at least one target field.

[0142] For example, according to the example shown above, it is determined that the at least one target field includes fields B1-B20. The mobile phone B obtains the address information of fields B1-B20 as address B in the memory management list, and determines that the target storage area is storage area B in the mobile phone B through a preset algorithm.

[0143] S406, storing the address information to the target storage area.

[0144] If the electronic device needs to obtain at least one target field when the EDK2 is running, the address information of the at least one target field can be obtained from the target storage area. And the at least one target field is obtained according to the address information of the at least one target field. The process of matching and obtaining in the at least one first configuration file set is avoided each time the at least one target field is obtained. The efficiency of obtaining the at least one target field is improved.

[0145] The field configuration method provided by the embodiment of the present application obtains a field configuration request. It is judged whether there is a target configuration file set in the at least one first configuration file set. If yes, the target configuration file is determined in the target configuration file set according to the first file identifier of the device configuration file. At least one target field is determined in the target configuration file according to the device type of the target device. The address information of the at least one target field and the target storage area are determined, and the address information is stored to the target storage area, so that the electronic device runs the EDK2 according to the address information of the target storage area to dynamically load the at least one target field. In the above process, the at least one target field corresponding to the target device can be determined in the at least one first configuration file set according to the field configuration request. And the address information of the at least one target field is stored to the target storage area. In this way, the electronic device runs the EDK2 according to the address information of the target storage area to dynamically load the at least one target field. The EDK2 module calls the public access interface to access the memory corresponding to the at least one target field, and the variable field in the configuration file is added, deleted, modified, inquired and checked through the access device tree node mode. It is realized that the memory can be shared between the modules in the electronic device when the EDK2 is running, and the synchronization of the dynamic variable in the running configuration file is met.

[0146] On the basis of any one of the above embodiments, the following will be combined with Figure 5 The process of field configuration is exemplified.

[0147] Figure 5 The process of field configuration provided by the embodiment of the present application is shown in the figure. Please refer to Figure 5, including an electronic device 501. The electronic device 501 can be a mobile phone, a tablet computer, a computer, a base station, etc. The electronic device 501 is provided with a field configuration apparatus and an EDK2, which can be arranged in a chip. After the electronic device 501 is powered on, the EDK2 is run, and the EDK2 can be compiled to generate at least one first configuration file set and at least one second configuration file set. The file format of the first configuration file in the first configuration file set is DTS format, and the file format of the second configuration file in the second configuration file set is DSC format. The electronic device 501 stores the at least one first configuration file set and the at least one second configuration file set into corresponding FVs. The electronic device 501 acquires a field configuration request, which can be as shown in Table 3:

[0148] Table 3

[0149] Target device Device type Set identification First file identification Electronic device 501 Mobile terminal type Identification C1-Identification C5 File C23

[0150] According to Table 3, the field configuration apparatus of the electronic device 501 determines that the at least one first configuration file set includes configuration file set C1 to configuration file set C5. The field configuration apparatus of the electronic device 501 acquires a preset identifier as identifier C1, and determines that the set identifier of the configuration file set C1 matches the preset identifier. Therefore, the field configuration apparatus of the electronic device 501 determines that the target configuration file set is the configuration file set C1. The field configuration apparatus of the electronic device 501 determines that the configuration file set C1 includes files C1 to C25. According to Table 3, the field configuration apparatus of the electronic device 501 determines that the identifier of the file C23 matches the first file identifier. Therefore, the field configuration apparatus of the electronic device 501 determines that the target configuration file is the file C23.

[0151] According to Table 3, the field configuration apparatus of the electronic device 501 determines that the device type of the target device is a mobile terminal type, and determines that the target field identifier corresponding to the device type is MC12. The field configuration apparatus of the electronic device 501 determines that the at least one target field corresponding to the target field identifier in the file C23 includes fields C1 to C5. The field configuration apparatus of the electronic device 501 acquires a memory management list, and acquires the address information of the fields C1 to C5 in the memory management list as address C. The field configuration apparatus of the electronic device 501 determines that the target storage area is a storage area C in the electronic device 501 by a preset algorithm. Therefore, the field configuration apparatus of the electronic device 501 stores the fields C1 to C5 to the storage area C.

[0152] When the electronic device 501 runs the EDK2, the address information of the storage area C can be acquired according to an instruction, and the at least one target field can be acquired according to the address information.

[0153] The field configuration process provided by the embodiments of the present application obtains a field configuration request. It is judged whether a target configuration file set exists in at least one first configuration file set. If yes, a target configuration file is determined in the target configuration file set according to a first file identifier of a device configuration file. At least one target field is determined in the target configuration file according to a device type of a target device. Address information of the at least one target field and a target storage area are determined, and the address information is stored to the target storage area, so that the target device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2. In the above process, the at least one target field corresponding to the target device can be determined in the at least one first configuration file set according to the field configuration request. The address information of the at least one target field is stored to the target storage area. In this way, the target device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2. The EDK2 module calls a public access interface to access the memory corresponding to the at least one target field, and adds, deletes, modifies or inquires the variable field in the configuration file through the access device tree node mode. It is realized that the memory can be shared between the modules in the electronic device when running EDK2, and the synchronization of the dynamic variable in the running configuration file is met.

[0154] Figure 6 The structure diagram of a field configuration device provided by the embodiments of the present application is shown. The field configuration device can be a chip or a chip module. Please refer to Figure 6 The field configuration device 10 can include:

[0155] The obtaining module 11 is configured to obtain a field configuration request, and the field configuration request is used to request at least one target field of a target device in at least one configuration file set;

[0156] The first determining module 12 is configured to determine at least one target field corresponding to the target device in the at least one configuration file set according to the field configuration request;

[0157] The second determining module 13 is configured to determine address information of the at least one target field and a target storage area, and store the address information to the target storage area, so that the target device loads the at least one target field dynamically according to the address information of the target storage area when running EDK2.

[0158] In a possible implementation, the first determining module 12 is specifically configured to:

[0159] judge whether a target configuration file set exists in the at least one first configuration file set;

[0160] If yes, the target configuration file is determined in the target configuration file set according to the first file identifier of the device configuration file, and the at least one target field is determined in the target configuration file according to the device type of the target device.

[0161] In a possible implementation, the first determining module 12 is specifically configured to:

[0162] determine a second file identifier of each first configuration file;

[0163] determine the target configuration file in the at least one first configuration file according to the second file identifier of each first configuration file, the second file identifier of the target configuration file matching the first file identifier.

[0164] In a possible implementation, the first determining module 12 is specifically configured to:

[0165] determine a target field identifier corresponding to the device type;

[0166] for any field in the target configuration file, if the field identifier of the field matches the target field identifier, the field is determined as the target field.

[0167] In a possible implementation, the first determining module 12 is specifically configured to:

[0168] obtain a preset identifier;

[0169] if the set identifier of the first configuration file is the preset identifier in the at least one first configuration file set, the first configuration file set is determined as the target description set;

[0170] if the set identifier of the first configuration file is not the preset identifier in the at least one first configuration file set, it is determined that the target configuration file set does not exist.

[0171] In a possible implementation, the second determining module 13 is specifically configured to:

[0172] obtain a memory management list;

[0173] obtain the memory address of the at least one target field in the target configuration file set in the memory management list;

[0174] determine the memory address as the address information of the at least one target field.

[0175] In a possible implementation, the second determining module 13 is specifically configured to:

[0176] acquire a preset algorithm;

[0177] determine the target storage area in the target device through the preset algorithm.

[0178] The field configuration device provided by the embodiments of the present application can execute the technical solutions shown in the method embodiments, and has similar implementation principles and beneficial effects, which will not be repeated here.

[0179] Figure 7 Another structure diagram of a field configuration device provided by the embodiments of the present application is shown in FIG. 2. Based on the embodiments shown in FIG. 1, Figure 6 the field configuration device 10 further includes a storage module 14, as shown in the embodiment shown in FIG. 2. Figure 7

[0180] The storage module 14 is configured to:

[0181] acquire at least one initial description file;

[0182] compile the at least one initial description file according to a first preset format to obtain at least one first configuration file set, the at least one first configuration file set including at least one configuration file;

[0183] compile the at least one initial description file according to a second preset format to obtain at least one second configuration file set, the at least one second configuration file set including at least one configuration file;

[0184] for any one second configuration file set, determine the first configuration file set and the first storage area corresponding to the second configuration file set;

[0185] store the second configuration file set and the first configuration file set corresponding to the second configuration file set into the first storage area corresponding to the second configuration file set.

[0186] The field configuration device provided by the embodiments of the present application can execute the technical solutions shown in the method embodiments, and has similar implementation principles and beneficial effects, which will not be repeated here.

[0187] Figure 8 A structure diagram of an electronic device provided by the embodiments of the present application is shown in FIG. 3. Referring to FIG. 3, Figure 8 the electronic device 20 can include a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are connected with each other through a bus 23.

[0188] The memory 21 is configured to store program instructions.

[0189] ​The processor 22 is configured to execute program instructions stored in the memory to cause the electronic device 20 to perform the method shown in the above method embodiments.

[0190] The electronic device provided by the embodiments of the present application can perform the technical solutions shown in the above method embodiments, and the implementation principles and beneficial effects are similar, which will not be described here again.

[0191] The embodiments of the present application provide a computer readable storage medium, which stores computer execution instructions, and the computer execution instructions are used to implement the above method when executed by a processor.

[0192] The embodiments of the present application can also provide a computer program product, which includes a computer program, and the computer program can implement the above method when executed by a processor.

[0193] All or part of the steps of the above method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a readable memory. When the program is executed, the steps of the above method embodiments are executed; and the foregoing memory (storage medium) includes: read-only memory (read-only memory, ROM), random access memory (Random Access Memory, RAM), flash memory, hard disk, solid state disk, magnetic tape, floppy disk, optical disc, and any combination thereof.

[0194] The embodiments of the present application are described with reference to flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one flow or multiple flows and / or blocks

[0195] These computer program instructions can also be stored in a computer readable memory that can guide the computer or other programmable data processing devices to work in a specific way, so that the instructions stored in the computer readable memory produce a manufactured product including instruction devices, which implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1the function specified in the one or more blocks.

[0196] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operational steps are performed on the computer or other programmable data processing devices to generate a computer implemented process, so that the instructions executed on the computer or other programmable data processing devices provide a process for implementing the flow Figure 1 one or more flows and / or blocks Figure 1 the function specified in the one or more blocks.

[0197] Obviously, those skilled in the art can make various modifications and variations to the embodiments of the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalent technologies, the present application also intends to include these modifications and variations.

[0198] In the present application, the term "comprising" and its variants can refer to non-limiting inclusion; the term "or" and its variants can refer to "and / or". In the present application, the terms "first", "second" and the like are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence. In the present application, "a plurality of" refers to two or more. "And / or", which describes the relationship between the associated objects, means that there can be three relationships, for example, A and / or B can represent: A exists alone, A and B exist together, and B exists alone. The character " / " generally represents a "or" relationship between the associated objects.

Claims

1. A field configuration method, characterized in that, include: A field configuration request is obtained, which is used to request configuration of at least one target field of a target device in at least one first configuration file set. The field configuration is performed after the field configuration device is installed in the electronic device and the electronic device is powered on. The process of obtaining the first configuration file set is as follows: obtaining at least one initial description file; compiling the at least one initial description file according to a first preset format to obtain at least one first configuration file set, the at least one first configuration file set including at least one configuration file; compiling the at least one initial description file according to a second preset format to obtain at least one second configuration file set, the at least one second configuration file set including at least one configuration file; for any second configuration file set, determining the first configuration file set and the first storage area corresponding to the second configuration file set. The second configuration file set and the corresponding first configuration file set are stored in the first storage area corresponding to the second configuration file set; the initial description file is from EDK2 of the electronic device; the first configuration file is a DTB file; The first storage area is the firmware volume in the electronic device; During operation, the UEFI of the electronic device dynamically loads configuration files from various firmware volumes in the storage area; Based on the field configuration request, at least one target field corresponding to the target device is determined in the at least one first configuration file set. The field configuration request includes the device type of the target device, the set identifier of the at least one first configuration file set, and the first file identifier of the device configuration file. The process involves determining the address information and target storage area of ​​at least one target field, and storing the address information in the target storage area. This allows the target device to dynamically load the at least one target field based on the address information of the target storage area when running EDK2. Determining the address information of the at least one target field includes: obtaining a memory management list; obtaining the memory address of the at least one target field in a target configuration file set from the memory management list; and determining the memory address as the address information of the at least one target field. The memory management list is a Hob list, which includes identifiers of multiple configuration files and the memory address corresponding to the identifier of each configuration file. During the PEI stage of EDK2, the target device initializes memory and configures the Hob list.

2. The method according to claim 1, characterized in that, Based on the field configuration request, at least one target field corresponding to the target device is determined from the at least one first configuration file set, including: Determine whether a target configuration file set exists in the at least one first configuration file set; If so, the target configuration file is determined in the target configuration file set according to the first file identifier of the device configuration file, and the at least one target field is determined in the target configuration file according to the device type of the target device.

3. The method according to claim 2, characterized in that, The target configuration file set includes at least one first configuration file; Based on the first file identifier of the device configuration file, the target configuration file is determined from the target configuration file set, including: Determine the second file identifier for each first configuration file; Based on the second file identifier of each first configuration file, the target configuration file is determined in the at least one first configuration file, wherein the second file identifier of the target configuration file matches the first file identifier.

4. The method according to claim 2 or 3, characterized in that, Based on the device type of the target device, the at least one target field is determined in the target configuration file, including: Determine the target field identifier corresponding to the device type; If the field identifier of any field in the target configuration file matches the target field identifier, then the field is determined to be the target field.

5. The method according to claim 2, characterized in that, Determining whether a target configuration file set exists in the at least one first configuration file set includes: Obtain the preset identifier; If, in the at least one set of first configuration files, there exists a set identifier for the first configuration files that is the preset identifier, then the first set of configuration files is determined as the target set of configuration files; If none of the at least one set of first configuration files has a set identifier that is the preset identifier, then it is determined that the target configuration file set does not exist.

6. The method according to any one of claims 1-3, characterized in that, Determine the target storage area, including: Obtain the preset algorithm; The target storage area is determined in the target device using the preset algorithm.

7. A field configuration device, characterized in that, The device includes: An acquisition module is used to acquire a field configuration request. The field configuration request is used to request configuration of at least one target field of a target device in at least one first configuration file set. Field configuration is performed after the field configuration device is installed in the electronic device and the electronic device is powered on. The process of obtaining the first configuration file set specifically includes: acquiring at least one initial description file; compiling the at least one initial description file according to a first preset format to obtain at least one first configuration file set, the at least one first configuration file set including at least one configuration file; compiling the at least one initial description file according to a second preset format to obtain at least one second configuration file set, the at least one second configuration file set including at least one configuration file; for any second configuration file set, determining the first configuration file set and a first storage area corresponding to the second configuration file set; storing the second configuration file set and the first configuration file set corresponding to the second configuration file set in the first storage area corresponding to the second configuration file set; the initial description file is in the EDK2 of the electronic device; the first configuration file is a DTB file; the first storage area is a firmware volume in the electronic device; the UEFI of the electronic device dynamically loads configuration files from each firmware volume in the storage area during operation. The first determining module is configured to determine at least one target field corresponding to the target device in the at least one first configuration file set according to the field configuration request, wherein the field configuration request includes the device type of the target device, the set identifier of the at least one first configuration file set, and the first file identifier of the device configuration file; The second determining module is used to determine the address information and target storage area of ​​the at least one target field, and store the address information in the target storage area so that the target device dynamically loads the at least one target field according to the address information of the target storage area when running EDK2. Determining the address information of the at least one target field includes: obtaining a memory management list; obtaining the memory address of the at least one target field in the target configuration file set in the memory management list; determining the memory address as the address information of the at least one target field; the memory management list is a Hob list, which includes the identifiers of multiple configuration files and the memory address corresponding to the identifier of each configuration file; the target device initializes memory and configures the Hob list during the PEI stage of EDK2.

8. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, in, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 6.

Citation Information

Patent Citations

  • Method of updating unified extensible firmware interface

    CN108536453A

  • Interface processing method, interface processing device, electronic equipment and storage medium

    CN114035864A