Field configuration method and device and electronic equipment

By obtaining and storing the target field address information of the target device, the sharing problem of accessing configuration file memory between EDK2 modules is solved, and the synchronization and memory sharing of dynamic variables in the configuration file is realized.

CN118981340AActive Publication Date: 2024-11-19XIAMEN UNISOC TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

When running EDK2, dynamic variables in each configuration file cannot be accessed through memory sharing, resulting in the inability to synchronize variable fields in the configuration file between modules.

Method used

By obtaining field configuration requests, the target field address information and storage area of ​​the target device are determined, and stored in the target storage area, so that the EDK2 modules can add, delete, modify and search variable fields in the configuration file through device tree nodes to realize memory sharing.

Benefits of technology

It realizes memory sharing between various modules during EDK2 runtime, satisfying the synchronization of dynamic variables in the runtime configuration file.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118981340A_ABST
    Figure CN118981340A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a field configuration method and device and electronic equipment. The method comprises the following steps: acquiring a field configuration request, wherein the field configuration request is used for requesting to configure at least one target field of target equipment in at least one first configuration file set; determining at least one target field corresponding to the target equipment in the at least one first configuration file set according to the field configuration request; and 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 at least one target field is dynamically loaded according to the address information of the target storage area when a target device runs the EDK2. The memory can be shared among the modules in the electronic equipment when the EDK2 is operated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a field configuration method, device, and electronic device. Background Art

[0002] You can use the Extreme Density Kit, Version 2 (EDK2) to develop device drivers or applications corresponding to the Unified Extensible Firmware Interface (UEFI) in electronic devices.

[0003] Before running EDK2, EDK2 needs to be configured to suit different electronic devices. In the related art, the configuration can be performed in the following manner: compile multiple configuration files in EDK2 to obtain at least one configuration file. And set at least one configuration file in the firmware volume (FV) corresponding to EDK2. In this way, EDK2 can dynamically load the configuration file from the corresponding FV during runtime. In the above process, when the EDK2 modules call the public 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 of the invention

[0004] The embodiments of the present application provide a field configuration method, device and electronic device to solve the problem that dynamic variables in each configuration file cannot be shared in memory when a public access interface is called between EDK2 modules to access the memory corresponding to the configuration file.

[0005] In a first aspect, an embodiment of the present application provides a field configuration method, including:

[0006] Obtain a field configuration request, where 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;

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

[0008] 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 when the target device runs EDK2, the at least one target field is dynamically loaded according to the address information of the target storage area.

[0009] In a possible implementation, the field configuration request includes a device type of the target device, a set identifier of at least one first configuration file set, and a first file identifier of the device configuration file; and determining, according to the field configuration request, at least one target field corresponding to the target device in the at least one first configuration file set includes:

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

[0011] 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.

[0012] In a possible implementation, the target configuration file set includes at least one first configuration file; and determining the target configuration file in the target configuration file set according to the first file identifier of the device configuration file includes:

[0013] Determining a second file identifier for each first configuration file;

[0014] According to the second file identifier of each first configuration file, the target configuration file is determined in the at least one first configuration file, and the second file identifier of the target configuration file matches the first file identifier.

[0015] In a possible implementation, determining the at least one target field in the target configuration file according to the device type of the target device includes:

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

[0017] For any field in the target configuration file, if the field identifier of the field matches the target field identifier, the field is determined to be the target field.

[0018] In a possible implementation manner, determining whether a target configuration file set exists in the at least one first configuration file set includes:

[0019] Get the preset identifier;

[0020] If, in the at least one first configuration file set, there is a set identifier of the first configuration file that is the preset identifier, determining the first configuration file set as the target description set;

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

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

[0023] Get the 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] The memory address is used to determine address information of the at least one target field.

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

[0027] Get the preset algorithm;

[0028] The target storage area is determined in the target device through the preset algorithm.

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

[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 includes at least one configuration file;

[0032] Compile 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 includes at least one configuration file;

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

[0034] The second configuration file set and a first configuration file set corresponding to the second configuration file set are stored in a 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, the device comprising:

[0036] An acquisition module, configured to acquire 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 determination module, configured to determine, according to the field configuration request, at least one target field corresponding to the target device in the at least one configuration file set;

[0038] The second determination 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 at least one target field can be dynamically loaded according to the address information of the target storage area when the target device runs EDK2.

[0039] In a possible implementation manner, 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 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.

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

[0043] Determining a second file identifier for each first configuration file;

[0044] According to the second file identifier of each first configuration file, the target configuration file is determined in the at least one first configuration file, and the second file identifier of the target configuration file matches the first file identifier.

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

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

[0047] For any field in the target configuration file, if the field identifier of the field matches the target field identifier, the field is determined to be the target field.

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

[0049] Get the preset identifier;

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

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

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

[0053] Get the memory management list;

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

[0055] The memory address is used to determine address information of the at least one target field.

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

[0057] Get the preset algorithm;

[0058] The target storage area is determined in the target device through the preset algorithm.

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

[0060] Wherein, the storage module is used for:

[0061] Obtaining at least one initial description file;

[0062] 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 includes at least one configuration file;

[0063] Compile 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 includes at least one configuration file;

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

[0065] The second configuration file set and a first configuration file set corresponding to the second configuration file set are stored in a first storage area corresponding to the second configuration file set.

[0066] In a third aspect, the present application provides a chip having a computer program stored thereon, wherein when the computer program is executed by the chip, the method as described in any one of the first aspects is implemented.

[0067] In a fourth aspect, the present application provides a chip module having a computer program stored thereon, wherein when the computer program is executed by the chip module, the method as described in any one of the first aspects is implemented.

[0068] In a fifth aspect, an embodiment of the present application provides an electronic device, including:

[0069] at least one processor; and

[0070] a memory communicatively connected to the at least one processor; wherein,

[0071] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any method described in the first aspect.

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

[0073] In a seventh aspect, an embodiment of the present application provides a computer program product, including a computer program, which implements any method in the first aspect when executed by a processor.

[0074] The field configuration method, device and electronic device provided in the embodiment of the present application obtain a field configuration request, and the field configuration request is used to request to configure at least one target field of the 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 at least one first configuration file set. The address information and target storage area of ​​at least one target field are determined, and the address information is stored in the target storage area, so that when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. In the above process, according to the field configuration request, at least one target field corresponding to the target device can be determined in at least one first configuration file set. And the address information of at least one target field is stored in the target storage area. In this way, when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. The EDK2 modules call the public access interface to access the memory corresponding to at least one target field, and add, delete, modify and query the variable field in the configuration file by accessing the device tree node. When running EDK2, it is realized that the modules in the electronic device can share memory to meet the synchronization of dynamic variables in the runtime configuration file. BRIEF DESCRIPTION OF THE DRAWINGS

[0075] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;

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

[0077] Figure 3 A schematic diagram of a process for obtaining a first configuration file set provided in an embodiment of the present application;

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

[0079] Figure 5 A schematic diagram of the process of field configuration provided in an embodiment of the present application;

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

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

[0082] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0083] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0084] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0085] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards, and provide corresponding operation entrances for users to choose to authorize or refuse.

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

[0087] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 , electronic device 101. Electronic device 101 may be a mobile phone, a computer, a base station, etc. Multiple chips and software interfaces are provided in electronic device 101, and the software interface may be UEFI. A user may develop a chip corresponding to UEFI in electronic device 101 through EDK2. Before electronic device 101 runs EDK2, EDK2 needs to be configured.

[0088] In the related art, the configuration can be performed in the following manner: compile multiple configuration files in EDK2 to obtain at least one configuration file. And set at least one configuration file in the corresponding FV of EDK2. In this way, EDK2 can dynamically load the DTB file from the corresponding FV when running. In the above process, since the EDK2 modules call 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 an 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 at least one first configuration file set. The address information and target storage area of ​​at least one target field are determined, and the address information is stored in the target storage area, so that when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. In the above process, according to the field configuration request, at least one target field corresponding to the target device can be determined in at least one first configuration file set. And the address information of at least one target field is stored in the target storage area. In this way, when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. The EDK2 modules call a public access interface to access the memory corresponding to at least one target field, and add, delete, modify and query the variable fields in the configuration file by accessing the device tree node. When running EDK2, it is realized that the modules in the electronic device can share memory to meet the synchronization of dynamic variables in the runtime configuration file.

[0090] The method shown in the present application is described below through specific embodiments. It should be noted that the following embodiments can exist independently or in combination with each other, and the same or similar contents will not be described repeatedly in different embodiments.

[0091] Figure 2 A flowchart of a field configuration method provided in an embodiment of the present application. Figure 2 , the method may include:

[0092] S201. Obtain a field configuration request.

[0093] The execution subject of the embodiment of the present application may be an electronic device, or a chip, chip module or field configuration device set in the electronic device. The field configuration device may be implemented by software, or by a combination of software and hardware. The electronic device may 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] In the first configuration file set, the file format of the first configuration file is the 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 performing the field configuration, each initial configuration file in the EDK2 of the electronic device needs to be processed to obtain a first configuration file set.

[0097] The first configuration file set can be obtained in the following manner: 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, wherein the at least one first configuration file set includes 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, wherein the at least one second configuration file set includes 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; 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.

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

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

[0100] Next, combine Figure 3 , a process of obtaining a first configuration file set is described. Figure 3 A schematic diagram of the process of obtaining the first configuration file set provided in an embodiment of the present application. Figure 3 , including 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. Obtain at least one initial description file. Compile and process at least one initial description file to obtain at least one configuration file, and the configuration file may be a DTB file. Synthesize and process at least one configuration file through the mkdtimg tool to obtain at least one first configuration file set 301. In the first configuration file set 301, the format of the first configuration file may be a DTS format. Synthesize and process at least one configuration file to obtain at least one second configuration file set 302. In the second configuration file set 302, the format of the second configuration file may be a DSC format. Store at least one first configuration file set 301 and at least one second configuration file set 302 in each firmware volume of the storage area 303. Generate an image file according to the configuration file set in the multiple firmware volumes of the storage area 303. The UEFI of the electronic device can dynamically load configuration files from each firmware volume of the storage area during operation. Among them, the first configuration file in the first configuration file set may be the image file of the second configuration file in the corresponding second configuration file set.

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

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

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

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

[0105] The target device may be an electronic device. The configuration files in the target configuration file set may be DTB files, and the file format of the DTB files 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 at least one first configuration file set includes configuration file set A1 to configuration file set A3. In at least one first configuration file set, there is a target configuration file set A2. According to the first file identification file A22 of the device configuration file, the target configuration file is determined to be file A22 in the configuration file set A2. It is assumed that the device type of the target device is a mobile terminal type. Then, in file A22, according to the mobile terminal type, it is determined that at least one target field corresponding to the target device includes fields A12 to A15.

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

[0109] The address information of at least one target field may be determined in the following manner: obtaining a memory management list; obtaining a memory address of at least one target field in a target configuration file set from the memory management list; and determining the address information of at least one target field from the memory address.

[0110] The memory management list may be a Hob list. The Hob list includes identifiers of multiple configuration files and the memory address corresponding to the identifier of each configuration file. The target device may initialize the memory and configure the Hob list in the PEI stage of EDK2.

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

[0112] The target storage area may be determined in the following manner: obtaining a preset algorithm; and determining the target storage area in the target device by using the preset algorithm.

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

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

[0115] The field configuration method provided in the embodiment of the present application obtains a field configuration request. According to the field configuration request, at least one target field corresponding to the target device is determined in at least one first configuration file set. The address information and target storage area of ​​at least one target field are determined, and the address information is stored in the target storage area, so that when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. In the above process, according to the field configuration request, at least one target field corresponding to the target device can be determined in at least one first configuration file set. And the address information of at least one target field is stored in the target storage area. The EDK2 modules call a public access interface to access the memory corresponding to at least one target field, and add, delete, modify and query the variable fields in the configuration file by accessing the device tree node. When running EDK2, the modules in the electronic device can share memory to meet the synchronization of dynamic variables in the runtime configuration file.

[0116] Based on any of the above embodiments, Figure 4 , which explains the detailed process of field configuration.

[0117] Figure 4 A flowchart of another field configuration method provided in an embodiment of the present application. Figure 4 , the method comprising:

[0118] S401: Get a field configuration request.

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

[0120] S402: Determine whether there is a target configuration file set in at least one first configuration file set.

[0121] Whether there is a target configuration file set in at least one first configuration file set can be determined in the following manner: obtaining a preset identifier; if in at least one first configuration file set, a set identifier of a first configuration file exists as a preset identifier, determining the first configuration file set as a target description set; if in at least one first configuration file set, no set identifier of a first configuration file exists as a preset identifier, determining that there is no target configuration file set.

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

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

[0124] Table 1

[0125] Target devices Device Type Collection ID First file identifier Mobile Phone B Mobile terminal type Mark B1 to Mark B10 File B12

[0126] Assume that the preset identifier is identifier B2. In the field configuration request shown in Table 1, it can be determined that at least one first configuration file set may include configuration file sets B1 to B10. In at least one configuration file set B1 to B10, there is a first configuration file set whose set identifier B2 is the preset identifier. Therefore, mobile phone B determines that in configuration file sets B1 to B10, there is a target configuration file set which is 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, prompt information may be generated, wherein the prompt information is used to indicate that the target configuration file set does not exist.

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

[0129] S403: If yes, determine the target configuration file in the target configuration file set according to the first file identifier of the device configuration file.

[0130] The target profile can be determined in the target profile set according to the first file identifier of the device profile in the following manner: determine the second file identifier of each first profile; and determine the target profile in at least one first profile according to the second file identifier of each first profile, wherein the second file identifier of the target profile matches 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 DTS format.

[0132] The file format of the first configuration file is DTS format, which can avoid the different file formats of the configuration files of each chip in the target device, resulting in the mismatch between the file format of the EDK2 configuration file and the file format of the configuration files of each chip. When the Bootloader is run later, there may be a situation where the DTB file is not applicable to each chip. And no translation processing is required before running the Bootloader, which improves the flexibility of running EDK2.

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

[0134] S404: Determine at least one target field in the target configuration file according to the device type of the target device.

[0135] At least one target field can be determined in the target configuration file according to the device type of the target device in the following manner: determine the target field identifier corresponding to the device type; for any field in the target configuration file, if the field identifier of the field matches the target field identifier, determine that the field is the target field.

[0136] Multiple device types and field identifiers corresponding to each device type may be set in advance. Multiple device types and field identifiers corresponding to each device type are stored in a preset storage space of the electronic device. The target configuration file includes at least one field corresponding to at least one device type. 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 above example, the target configuration file is determined to be configuration file B12. Configuration file B12 may be specifically as shown in Table 2:

[0138] Table 2

[0139] Device Type Field Tags Fields Mobile terminal type MZ01 Field B1 to Field B20 Terminal Type ZZ00 Field B21 to Field B35 Base station type JZ10 Field B36 to Field B50

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

[0141] S405: Determine address information and a target storage area of ​​at least one target field.

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

[0143] S406: Store the address information into the target storage area.

[0144] If the electronic device needs to obtain at least one target field when 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. This avoids the need to traverse the matching and obtaining process in at least one first configuration file set each time the acquisition is performed. This improves the efficiency of obtaining at least one target field.

[0145] The field configuration method provided in the embodiment of the present application obtains a field configuration request. It is determined whether there is a target configuration file set in 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. At least one target field is determined in the target configuration file according to the device type of the target device. The address information and target storage area of ​​at least one target field are determined, and the address information is stored in the target storage area, so that when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. In the above process, at least one target field corresponding to the target device can be determined in at least one first configuration file set according to the field configuration request. And the address information of at least one target field is stored in the target storage area. In this way, when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. The EDK2 modules call a public access interface to access the memory corresponding to at least one target field, and add, delete, modify and query the variable field in the configuration file by accessing the device tree node. When running EDK2, it is realized that the modules in the electronic device can share memory to meet the synchronization of dynamic variables in the runtime configuration file.

[0146] Based on any of the above embodiments, Figure 5 , the process of field configuration is illustrated with examples.

[0147] Figure 5 A schematic diagram of the process of field configuration provided in the embodiment of this application. 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. A field configuration device and EDK2 are provided in the electronic device 501, and the field configuration device and EDK2 can be provided in a chip. Before running EDK2 after power-on, the electronic device 501 can compile EDK2 to generate at least one first configuration file set and at least one second configuration file set. Among them, the file format of the first configuration file in the first configuration file set is the DTS format, and the file format of the second configuration file in the second configuration file set is the DSC format. The electronic device 501 stores at least one first configuration file set and at least one second configuration file set in the corresponding FV. The electronic device 501 obtains the field configuration request specifically as shown in Table 3:

[0148] Table 3

[0149] Target devices Device Type Collection ID First file identifier Electronic Equipment 501 Mobile terminal type Mark C1 to Mark C5 File C23

[0150] As shown in Table 3, the field configuration device of the electronic device 501 determines that at least one first configuration file set includes configuration file set C1 to configuration file set C5. The field configuration device of the electronic device 501 obtains the 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 of the electronic device 501 determines that the target configuration file set is the configuration file set C1. The field configuration device of the electronic device 501 determines that the configuration file set C1 includes files C1 to C25. As shown in Table 3, the field configuration device of the electronic device 501 determines that the identifier of file C23 matches the first file identifier. Therefore, the field configuration device of the electronic device 501 determines that the target configuration file is file C23.

[0151] As shown in Table 3, the field configuration device 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 device of the electronic device 501 determines in file C23 that at least one target field corresponding to the target field identifier includes fields C1 to C5. The field configuration device of the electronic device 501 obtains a memory management list, and in the memory management list, obtains the address information of fields C1 to C5 as address C. The field configuration device of the electronic device 501 determines that the target storage area is storage area C in the electronic device 501 through a preset algorithm. Therefore, the field configuration device of the electronic device 501 stores fields C1 to C5 in storage area C.

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

[0153] The field configuration process provided in the embodiment of the present application obtains a field configuration request. It is determined whether there is a target configuration file set in 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. At least one target field is determined in the target configuration file according to the device type of the target device. The address information and target storage area of ​​at least one target field are determined, and the address information is stored in the target storage area, so that when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. In the above process, at least one target field corresponding to the target device can be determined in at least one first configuration file set according to the field configuration request. And the address information of at least one target field is stored in the target storage area. In this way, when the electronic device runs EDK2, at least one target field is dynamically loaded according to the address information of the target storage area. The EDK2 modules call a public access interface to access the memory corresponding to at least one target field, and add, delete, modify and query the variable field in the configuration file by accessing the device tree node. When running EDK2, it is realized that the modules in the electronic device can share memory to meet the synchronization of dynamic variables in the runtime configuration file.

[0154] Figure 6 This is a schematic diagram of the structure of a field configuration device provided in an embodiment of the present application. The field configuration device may be a chip or a chip module. Figure 6 , the field configuration device 10 may include:

[0155] An acquisition module 11 is used to acquire a field configuration request, where 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;

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

[0157] The second determination module 13 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 at least one target field can be dynamically loaded according to the address information of the target storage area when the target device runs EDK2.

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

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

[0160] 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.

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

[0162] Determining a second file identifier for each first configuration file;

[0163] According to the second file identifier of each first configuration file, the target configuration file is determined in the at least one first configuration file, and the second file identifier of the target configuration file matches the first file identifier.

[0164] In a possible implementation manner, 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 to be the target field.

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

[0168] Get the preset identifier;

[0169] If, in the at least one first configuration file set, there is a set identifier of the first configuration file that is the preset identifier, determining the first configuration file set as the target description set;

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

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

[0172] Get the memory management list;

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

[0174] The memory address is used to determine address information of the at least one target field.

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

[0176] Get the preset algorithm;

[0177] The target storage area is determined in the target device through the preset algorithm.

[0178] The field configuration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0179] Figure 7 A schematic diagram of the structure of another field configuration device provided in an embodiment of the present application. Figure 6 Based on the examples shown, see Figure 7 The field configuration device 10 also includes a storage module 14.

[0180] Wherein, the storage module 14 is used for:

[0181] Obtaining at least one initial description file;

[0182] 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 includes at least one configuration file;

[0183] Compile 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 includes at least one configuration file;

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

[0185] The second configuration file set and a first configuration file set corresponding to the second configuration file set are stored in a first storage area corresponding to the second configuration file set.

[0186] The field configuration device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0187] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 The electronic device 20 may include: a memory 21 and a processor 22. Exemplarily, the memory 21 and the processor 22 are interconnected via a bus 23.

[0188] The memory 21 is used to store program instructions;

[0189] The processor 22 is used to execute the program instructions stored in the memory, so as to enable the electronic device 20 to execute the method shown in the above method embodiment.

[0190] The electronic device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.

[0191] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the above method.

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

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

[0194] The embodiments of the present application are described with reference to the 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 process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processing unit of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0195] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1A function specified in one or more boxes.

[0196] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0197] Obviously, those skilled in the art can make various changes and modifications 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 equivalents, the present application is also intended to include these modifications and variations.

[0198] In the present application, the term "include" and its variations may refer to non-restrictive inclusion; the term "or" and its variations may refer to "and / or". The terms "first", "second", etc. in the present application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. In the present application, "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the previously associated objects are in an "or" relationship.

Claims

1. A field configuration method, characterized in that: include: Obtain a field configuration request, where 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; Determine, according to the field configuration request, at least one target field corresponding to the target device in the at least one first configuration file set; 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 when the target device runs EDK2, the at least one target field is dynamically loaded according to the address information of the target storage area.

2. The method according to claim 1, characterized in that: The field configuration request includes a device type of the target device, a set identifier of at least one first configuration file set, and a first file identifier of a device configuration file; Determining, according to the field configuration request, at least one target field corresponding to the target device in the at least one first configuration file set includes: Determine whether there is a target configuration file set 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 profile set includes at least one first profile; Determining the target configuration file in the target configuration file set according to the first file identifier of the device configuration file includes: Determining a second file identifier for each first configuration file; According to the second file identifier of each first configuration file, the target configuration file is determined in the at least one first configuration file, and 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: Determining the at least one target field in the target configuration file according to the device type of the target device includes: Determine a target field identifier corresponding to the device type; For any field in the target configuration file, if the field identifier of the field matches the target field identifier, the field is determined to be the target field.

5. The method according to any one of claims 2 to 4, characterized in that: Determining whether a target configuration file set exists in the at least one first configuration file set includes: Get the preset identifier; If, in the at least one first configuration file set, there is a set identifier of the first configuration file that is the preset identifier, determining the first configuration file set as the target description set; If, in the at least one first configuration file set, there is no set identifier of the first configuration files that is the preset identifier, it is determined that the target configuration file set does not exist.

6. The method according to any one of claims 1 to 5, characterized in that: Determining address information of the at least one target field includes: Get the memory management list; In the memory management list, obtaining a memory address of the at least one target field in the target configuration file set; The memory address is used to determine address information of the at least one target field.

7. The method according to any one of claims 1 to 6, characterized in that: Identify target storage areas, including: Get the preset algorithm; The target storage area is determined in the target device through the preset algorithm.

8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: Obtaining at least one initial description file; 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 includes at least one configuration file; Compile 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 includes at least one configuration file; For any second configuration file set, determining a first configuration file set and a first storage area corresponding to the second configuration file set; The second configuration file set and a first configuration file set corresponding to the second configuration file set are stored in a first storage area corresponding to the second configuration file set.

9. A field configuration device, characterized in that: The device comprises: An acquisition module, configured to acquire 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; A first determination module, configured to determine, according to the field configuration request, at least one target field corresponding to the target device in the at least one configuration file set; The second determination 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 at least one target field can be dynamically loaded according to the address information of the target storage area when the target device runs EDK2.

10. 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, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.

11. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: in, The computer instructions are used to make a computer execute the method according to any one of claims 1 to 8.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Method of updating unified extensible firmware interface

    CN108536453A

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

    CN114035864A

  • Firmware management method, flash memory, host and storage medium

    CN114995893A

  • Process running method and device and terminal equipment

    CN117519824A

  • Method, device and computer program product to backup data

    US20210133045A1