Firmware upgrading method, electronic device, and storage medium
By receiving firmware upgrade requests and determining the target power status, firmware upgrades are performed on devices in the server, solving the problem of low firmware upgrade efficiency in existing technologies. This achieves standardized multi-device firmware upgrades, improving efficiency and reducing costs.
Patent Information
- Application Number
- CN202510998993.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-18
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2045-07-18
AI Technical Summary
In the existing technology, the firmware upgrade efficiency of the baseboard management controller (BMC) for devices in the server is relatively low, and different firmware upgrade methods need to be developed for different devices.
By receiving firmware upgrade requests, determining the target power state, and performing firmware upgrades on the devices based on device identifiers and target power states, a standardized firmware upgrade method is provided, applicable to multiple devices.
This improved the efficiency of firmware upgrades for multiple devices, reduced firmware upgrade costs, and avoided the need to develop different firmware upgrade methods for different devices.
Smart Images

Figure CN120508307B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of server technology, and in particular to a firmware upgrade method, electronic device, and storage medium. Background Technology
[0002] A Baseboard Management Controller (BMC) manages devices within a server and can upgrade their firmware. These devices can include, for example, sensors, complex programmable logic devices (CPLDs), or hard disk controllers.
[0003] Currently, BMC can upgrade the firmware of corresponding devices using different firmware upgrade methods. However, the firmware upgrade efficiency of the methods mentioned above is relatively low. Summary of the Invention
[0004] This application provides a firmware upgrade method, electronic device, and storage medium to at least address the problem of low firmware upgrade efficiency in related technologies.
[0005] In a first aspect, this application provides a firmware upgrade method applied to an electronic device, the method comprising:
[0006] Receive firmware upgrade request. The firmware upgrade request includes device identifier and firmware. The firmware upgrade request is used to request firmware upgrade of the device corresponding to the device identifier based on the firmware.
[0007] Based on the device identifier, determine the target power status. The target power status is the power status of the operating system during the firmware upgrade process. The target power status is either on or off.
[0008] Based on the firmware upgrade request and the target power status, perform a firmware upgrade on the device.
[0009] Secondly, this application provides a firmware upgrade device applied to electronic devices. The firmware upgrade device includes a receiving module, a determining module, and an upgrade module, wherein...
[0010] The receiving module is used to receive firmware upgrade requests, which include device identifiers and firmware. The firmware upgrade request is used to request firmware upgrades for the device corresponding to the device identifier based on the firmware.
[0011] The determination module is used to determine the target power state based on the device identifier. The target power state is the power state of the operating system during the firmware upgrade process, and the target power state is either on or off.
[0012] The upgrade module is used to perform firmware upgrades on the device based on the firmware upgrade request and the target power state.
[0013] Thirdly, this application also provides an electronic device, including:
[0014] Memory, used to store computer programs;
[0015] A processor for executing computer programs to implement the firmware upgrade method provided in any of the first aspects above.
[0016] Fourthly, this application also provides a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, it implements the steps of the firmware upgrade method provided in any of the first aspects above.
[0017] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the firmware upgrade method provided in any of the first aspects above.
[0018] The technical solution provided in this application allows an electronic device to receive a firmware upgrade request. The firmware upgrade request includes a device identifier and firmware. The request requests a firmware upgrade for the device corresponding to the device identifier. A target power state can be determined based on the device identifier; this target power state is the power state of the operating system during the firmware upgrade process. The device can then be upgraded using the firmware upgrade request and the target power state. Through this method, the electronic device can perform firmware upgrades on any device within the device. In other words, this method is applicable to upgrading firmware on multiple devices. This achieves the goal of upgrading firmware on multiple devices using a standardized method, improving firmware upgrade efficiency. Furthermore, this method eliminates the need to develop different firmware upgrade methods for different devices, resulting in lower firmware upgrade costs. Attached Figure Description
[0019] To more clearly illustrate the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application;
[0021] Figure 2 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 1 ;
[0022] Figure 3 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 2 ;
[0023] Figure 4 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 3 ;
[0024] Figure 5 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 4 ;
[0025] Figure 6 This is a schematic diagram of the firmware upgrade device provided in the embodiments of this application;
[0026] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Detailed Implementation
[0027] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of this application.
[0028] It should be noted that, in the description of this application, 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. The terms "first," "second," etc., in this application are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0029] To facilitate understanding, the following will be combined with Figure 1 The application scenarios involved in the embodiments of this application are illustrated by way of example.
[0030] Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. Please refer to... Figure 1 A server may include a BMC, a Basic Input / Output System (BIOS), a CPLD, and a Network Interface Card (NIC). It should be noted that a server may also include more or fewer components. Figure 1This is merely an illustrative example and does not constitute a limitation on the technical solutions provided in the embodiments of this application.
[0031] BMC can manage devices such as BIOS, CPLD, and NIC, and can perform firmware upgrades on these devices.
[0032] It should be noted that different devices have different firmware upgrade requirements. For example, some BIOS manufacturers require firmware upgrades to be performed while the operating system (OS) is powered on, while others require firmware upgrades to be performed while the OS is powered off.
[0033] In related technologies, different firmware upgrade methods need to be developed for different devices in the server, resulting in low firmware upgrade efficiency.
[0034] In view of this, embodiments of this application provide a firmware upgrade method to solve the technical problem of low firmware upgrade efficiency.
[0035] To enable those skilled in the art to better understand the present application, the present application will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0036] Figure 2 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 1 .like Figure 2 As shown, this application provides a firmware upgrade method. The execution subject of this method can be an electronic device or a controller within the electronic device. For example, the electronic device can be a server, and the controller can be a BMC (Browser Control Center). For ease of understanding, the following description uses an electronic device as the execution subject. The method may include:
[0037] S201. Receive firmware upgrade request. The firmware upgrade request includes device identifier and firmware.
[0038] Device identifiers can be used to uniquely identify a component within an electronic device. For example, a component can be a BIOS, CPLD, or BMC.
[0039] A firmware upgrade request is used to request a firmware upgrade for the device corresponding to the device identifier. It should be noted that after upgrading the firmware of the device corresponding to the device identifier, the firmware included in the firmware upgrade request can be all the firmware running on that device, or the firmware included in the firmware upgrade request can be a portion of the firmware running on that device. This application embodiment does not impose such limitations.
[0040] In this embodiment, the electronic device can receive firmware upgrade requests sent by other electronic devices, such as computers. Alternatively, the electronic device can also receive firmware upgrade requests input by the user through input operations, such as clicking a button.
[0041] S202. Determine the target power supply status based on the device identifier.
[0042] The target power state refers to the operating system's power state during the firmware upgrade process; the target power state is either on or off. In other words, the device corresponding to the device identifier needs to undergo a firmware upgrade when the operating system's power state is the target power state.
[0043] In this embodiment, the electronic device may store the correspondence between devices and power states. This correspondence may include multiple device identifiers and the power states corresponding to each device identifier. Specifically, the power state corresponding to a device identifier may be the power state of the operating system during a firmware upgrade process for the device corresponding to that device.
[0044] In practice, electronic devices can identify the target power state by determining the power state corresponding to the device identifier in the correspondence between the device and the power state.
[0045] S203. Based on the firmware upgrade request and the target power status, upgrade the firmware of the device.
[0046] In this embodiment, the electronic device can perform firmware upgrades when the operating system's power state is the target power state.
[0047] Specifically, the electronic device can determine that the operating system's power state is the target power state, and can perform a firmware upgrade on the device based on the firmware included in the firmware upgrade request when the operating system's power state is the target power state.
[0048] In the firmware upgrade method provided in this embodiment, the electronic device can receive a firmware upgrade request. The firmware upgrade request includes a device identifier and firmware. The firmware upgrade request is used to request a firmware upgrade for the device corresponding to the device identifier based on the firmware. A target power state can be determined based on the device identifier; the target power state is the power state of the operating system during the firmware upgrade process. The device can then be firmware upgraded based on the firmware upgrade request and the target power state. Through this method, the electronic device can perform firmware upgrades on any device within the electronic device. In other words, the above method is applicable to firmware upgrades on multiple devices. This achieves the goal of performing firmware upgrades on multiple devices using a standardized method, improving firmware upgrade efficiency. Furthermore, the above method eliminates the need to develop different firmware upgrade methods for different devices, resulting in lower firmware upgrade costs.
[0049] Based on any of the above embodiments, the following is combined with Figure 3 The firmware upgrade method provided in the embodiments of this application will be further described.
[0050] Figure 3 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 2 .like Figure 3 As shown, this application provides a firmware upgrade method. The execution subject of this method can be an electronic device or a controller within the electronic device. For example, the electronic device can be a server, and the controller can be a BMC (Browser Control Center). For ease of understanding, the following description uses an electronic device as the execution subject. The method may include:
[0051] S301. Receive firmware upgrade request. The firmware upgrade request includes device identifier and firmware.
[0052] S302. Determine the target power supply status based on the device identifier.
[0053] It should be noted that the specific implementation methods of S301-S302 can be found in S201-S202, and will not be repeated here.
[0054] S303. Store the firmware in the storage space.
[0055] The storage space can be memory or a hard drive in the electronic device. Optionally, the storage space can be random access memory (RAM) in the electronic device.
[0056] In this embodiment, before performing a firmware upgrade, the electronic device can store the firmware in the firmware upgrade request to the storage space to avoid losing the firmware, thereby making the firmware more reliable and thus making the firmware upgrade more reliable.
[0057] It should be noted that S302 can be executed before S303; or, S302 can be executed after S303; or, S303 can be executed simultaneously with S302. This embodiment does not limit this.
[0058] S304. Create an upgrade task. The upgrade task includes the device identifier, target power status, firmware storage address, and the first state of the upgrade task.
[0059] The first state indicates that the upgrade task is pending execution.
[0060] In this embodiment, the electronic device can create upgrade tasks in the storage space, and the upgrade tasks can exist in the form of JavaScript Object Notation (JSON) files.
[0061] For example, assuming the firmware upgrade request is used to request a firmware upgrade for the BIOS, and the target power state is on, the upgrade task can be as follows:
[0062] {
[0063] "upgrade_target": "bios",
[0064] "firmware_path": " / ram / firmware / hard_drive_controller_fw.bin",
[0065] "power_condition": "system_on",
[0066] "upgrade_task_status": "initial",
[0067] "timestamp": "2025-02-25T08:30:00Z"
[0068] }
[0069] S305. Perform firmware upgrade on the device according to the upgrade task.
[0070] Specifically, if the operating system's current power state is the target power state, the electronic device can obtain the firmware from the firmware storage address in the upgrade task and perform a firmware upgrade based on the firmware. If the operating system's current power state is not the target power state, the electronic device can obtain the firmware from the firmware storage address in the upgrade task, and perform a firmware upgrade based on the firmware, provided that the operating system's power state is adjusted to the target power state.
[0071] It should be noted that, in the technical solution provided in this application embodiment, if the electronic device receives multiple firmware upgrade requests, the electronic device can create multiple upgrade tasks in the storage space. In this way, the electronic device can execute multiple upgrade tasks serially, further improving firmware upgrade efficiency.
[0072] In the firmware upgrade method provided in this embodiment, the electronic device can receive a firmware upgrade request, which includes a device identifier and firmware. The target power state can be determined based on the device identifier. The firmware can be stored in storage space. An upgrade task can be created, which includes the device identifier, the target power state, the firmware storage address, and the first state of the upgrade task. The device can then undergo a firmware upgrade based on the upgrade task. This method is a standardized firmware upgrade method, allowing firmware upgrades to be performed on multiple devices within the electronic device without requiring different firmware upgrade methods for different devices. This simplifies the firmware upgrade process in the server and improves firmware upgrade efficiency.
[0073] Based on any of the above embodiments, the following is combined with Figure 4 This document provides a detailed explanation of the method for performing firmware upgrades on devices based on upgrade tasks.
[0074] Figure 4 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 3 .like Figure 4 As shown, this application provides a firmware upgrade method. The execution subject of this method can be an electronic device or a controller within the electronic device. For example, the electronic device can be a server, and the controller can be a BMC (Browser Control Center). For ease of understanding, the following description uses an electronic device as the execution subject. The method may include:
[0075] S401. Based on the upgrade task, determine whether the operating system's power state is the target power state.
[0076] Specifically, electronic devices can determine whether the current power state of the operating system matches the target power state. For example, if the target power state is on, the electronic device can determine whether the current power state of the operating system is on.
[0077] If the operating system's power state is the target power state, execute S402;
[0078] If the operating system's power state is not the target power state, execute S403.
[0079] S402. Update the first state in the upgrade task to the second state, and perform firmware upgrade on the device according to the updated upgrade task.
[0080] The second state is used to indicate that the operating system's power state meets the device's firmware upgrade conditions. For example, if the target power state is ON and the operating system's current power state is also ON, the electronic device can update the first state in the upgrade task to the second state.
[0081] In this embodiment, when upgrading the firmware of a device according to the updated upgrade task, the electronic device can obtain the firmware from the storage space according to the firmware's storage address, and can upgrade the device according to the firmware. It should be noted that the specific process of upgrading the device according to the firmware can be found in related technologies, and will not be elaborated here.
[0082] S403, Waiting for power operation request. The power operation request is used to request that the operating system's power state be updated to the requested power state.
[0083] In this embodiment, the requested power state can be the same as the target power state, or the requested power state can be different from the target power state. This application embodiment does not limit this.
[0084] In this embodiment, the user can input a power operation request to the electronic device through an input operation, or the user can input a power operation request to the electronic device through another electronic device.
[0085] S404. After receiving a power operation request, upgrade the firmware of the device according to the power operation request.
[0086] In this embodiment, the electronic device can determine whether the requested power state is the same as the target power state.
[0087] If the requested power state is the same as the target power state, execute S405;
[0088] If the requested power state differs from the target power state, execute S406.
[0089] S405. Update the first state in the upgrade task to the second state, and perform firmware upgrade on the device according to the updated upgrade task.
[0090] It should be noted that the specific implementation of S405 can be found in S402, and will not be repeated here.
[0091] S406. Perform firmware upgrade on the device based on the requested power status and upgrade task.
[0092] In this embodiment, the electronic device can update the power state of the operating system to the target power state; it can create a state update task, which is used to indicate that the power state is updated to the requested power state; it can update the first state in the upgrade task to the second state, and perform firmware upgrade on the device according to the updated upgrade task.
[0093] Specifically, when the requested power state differs from the target power state, the electronic device can first update the operating system's power state to the target power state and create a state update task. The state update task is used to instruct the operating system's power state to be updated to the requested power state.
[0094] For example, suppose the target power state is off, the current power state is on, and the requested power state is reboot. The reboot state can be achieved by first setting the power state to off and then back to on. The electronic device can first update the operating system's power state to off and create a state update task to instruct the operating system's power state to be updated to on.
[0095] In this embodiment, the electronic device can create a status update task in the storage space, and the status update task can also exist in the form of a JSON file.
[0096] For example, suppose a state update task is used to instruct the operating system's power state to be updated to a powered-off state; the state update task could be as follows:
[0097] {
[0098] "target_status": "shutdown",
[0099] "timestamp": "2025-02-25T10:30:00Z"
[0100] }
[0101] In addition, after the electronic device updates the operating system's power state to the target power state, it can update the first state in the upgrade task to the second state, and perform a firmware upgrade on the device according to the updated upgrade task. It should be noted that detailed instructions on performing a firmware upgrade on the device according to the updated upgrade task can be found in S402, and will not be repeated here.
[0102] In this embodiment, after the electronic device performs a firmware upgrade on the device, it can update the power state to the requested power state according to the state update task, so as to achieve the purpose of updating the power state of the operating system to the requested power state according to the power operation request.
[0103] Optionally, before upgrading the device according to the firmware, the electronic device can update the second state in the upgrade task to a third state, which indicates that the firmware upgrade has begun. After upgrading the device according to the firmware, the electronic device can update the third state in the upgrade task to a fourth state, which indicates that the firmware upgrade has been completed. In this way, the electronic device can determine whether the firmware upgrade task is complete based on the state in the upgrade task, and can execute a state update task if it determines that the firmware upgrade task is complete. This method avoids changing the operating system's power state during the firmware upgrade process, resulting in higher reliability of the firmware upgrade.
[0104] In the firmware upgrade method provided in this embodiment, the electronic device can upgrade the firmware according to the upgrade task and power operation request. The above method is applicable to multiple devices in a server, eliminating the need to develop different firmware upgrade methods for different devices, thus improving firmware upgrade efficiency and reducing firmware upgrade costs.
[0105] Based on any of the above embodiments, the electronic device may include a firmware upgrade request processing module, a power control module, a firmware upgrade module, and a storage module. Specifically, the controller of the electronic device may include a firmware upgrade request processing module, a power control module, a firmware upgrade module, and a storage module. The following describes... Figure 5 The firmware upgrade methods performed by the above modules will be explained through specific examples.
[0106] Figure 5 A flowchart illustrating the firmware upgrade method provided in this application embodiment. Figure 4 Please see. Figure 5 The method may include:
[0107] S501, Firmware upgrade request processing module receives firmware upgrade requests.
[0108] The firmware upgrade request includes the device identifier and the firmware.
[0109] S502, the firmware upgrade request processing module determines the target power status based on the device identifier.
[0110] S503, the firmware upgrade request processing module stores the firmware to the storage module.
[0111] S504, the firmware upgrade request processing module creates upgrade tasks in the storage module.
[0112] The upgrade task includes device identification, target power status, firmware storage address, and the first state of the upgrade task.
[0113] S505, the power control module detected an upgrade task in the storage module.
[0114] In this embodiment, the power control module can detect in real time whether there are new upgrade tasks in the storage module.
[0115] S506 The power control module determines whether the operating system's power state is the target power state based on the upgrade task.
[0116] If the operating system's power state is the target power state, execute S507;
[0117] If the operating system's power state is not the target power state, execute S512.
[0118] S507, the power control module updates the first state in the upgrade task to the second state.
[0119] The second state is used to indicate that the operating system's power state meets the device's firmware upgrade requirements.
[0120] S508, the firmware upgrade module detected the second state in the upgrade task.
[0121] In this embodiment, the firmware upgrade module can detect the status of the upgrade task in real time. The status of the upgrade task can include a first status, a second status, a third status, and a fourth status.
[0122] S509, the firmware upgrade module updates the second state in the upgrade task to the third state.
[0123] The third state is used to indicate the start of a firmware upgrade for the device.
[0124] The S510 firmware upgrade module performs firmware upgrades on the device according to the upgrade task.
[0125] S511, the firmware upgrade module updates the third state in the upgrade task to the fourth state.
[0126] The fourth state indicates that the firmware upgrade for the device has been completed.
[0127] S512 The power control module receives a power operation request, which includes a request for power status.
[0128] S513, The power control module determines whether the requested power state is the same as the target power state.
[0129] If the requested power state is the same as the target power state, execute S507-S511;
[0130] If the requested power state differs from the target power state, execute S514.
[0131] S514 The power control module updates the operating system's power state to the target power state.
[0132] S515 The power control module creates a status update task in the storage module. The status update task is used to indicate that the power status should be updated to the requested power status.
[0133] S516, the power control module updates the first state in the upgrade task to the second state.
[0134] S517, the firmware upgrade module detected the second state in the upgrade task.
[0135] S518, the firmware upgrade module updates the second state in the upgrade task to the third state.
[0136] S519, Firmware upgrade module performs firmware upgrades on the device according to the upgrade task.
[0137] S520 firmware upgrade module updates the third state in the upgrade task to the fourth state.
[0138] S521, The power control module detected the fourth state in the upgrade task.
[0139] In this embodiment, the power control module can monitor the status of the upgrade task in real time. The status of the upgrade task can include a first status, a second status, a third status, and a fourth status.
[0140] S522: The power control module updates the operating system's power status to the requested power status based on the status update task.
[0141] In the firmware upgrade method provided in this embodiment, an electronic device can perform firmware upgrades on any component within the device using the above method. That is, the method is applicable to firmware upgrades on multiple components. This achieves the goal of performing firmware upgrades on multiple components using a standardized method, improving firmware upgrade efficiency. Furthermore, the above method eliminates the need to develop different firmware upgrade methods for different components, resulting in lower firmware upgrade costs.
[0142] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0143] Figure 6 This is a schematic diagram of the firmware upgrade device provided in an embodiment of this application. The firmware upgrade device is applied to electronic devices, such as... Figure 6As shown, the firmware upgrade device 10 includes a receiving module 11, a determining module 12, and an upgrade module 13. The receiving module 11 can... Figure 5 The firmware upgrade request processing module shown in the embodiment can also be determined by module 12. Figure 5 The firmware upgrade request processing module shown in the embodiment is implemented, and the upgrade module 13 can be implemented through... Figure 5 The power control module, storage module, and firmware upgrade module shown in the embodiment are implemented. Among them,
[0144] The receiving module 11 is used to receive a firmware upgrade request, which includes a device identifier and firmware. The firmware upgrade request is used to request a firmware upgrade for the device corresponding to the device identifier based on the firmware.
[0145] The determination module 12 is used to determine the target power state based on the device identifier. The target power state is the power state of the operating system during the firmware upgrade process. The target power state is either on or off.
[0146] The upgrade module 13 is used to perform firmware upgrades on the device based on the firmware upgrade request and the target power status.
[0147] The firmware upgrade device provided in this embodiment can execute the method shown in any of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0148] In one possible implementation, upgrade module 13 is specifically used for,
[0149] Store the firmware in the storage space;
[0150] Create an upgrade task. The upgrade task includes device identifier, target power status, firmware storage address, and first status of the upgrade task. The first status is used to indicate that the upgrade task is to be executed.
[0151] Based on the upgrade task, perform firmware upgrades on the devices.
[0152] In one possible implementation, upgrade module 13 is specifically used for,
[0153] Based on the upgrade task, determine whether the operating system's power state is the target power state;
[0154] If the operating system's power state is the target power state, the first state in the upgrade task is updated to the second state, and the device is upgraded with firmware according to the updated upgrade task. The second state is used to indicate that the operating system's power state meets the device's firmware upgrade conditions.
[0155] If the operating system's power state is not the target power state, wait for a power operation request. After receiving the power operation request, upgrade the device's firmware according to the power operation request. The power operation request is used to request that the operating system's power state be updated to the requested power state.
[0156] In one possible implementation, upgrade module 13 is specifically used for,
[0157] Determine if the requested power state is the same as the target power state;
[0158] If the requested power state is the same as the target power state, update the first state in the upgrade task to the second state, and perform a firmware upgrade on the device according to the updated upgrade task.
[0159] If the requested power state differs from the target power state, the device will be firmware upgraded based on the requested power state and the upgrade task.
[0160] In one possible implementation, upgrade module 13 is specifically used for,
[0161] Update the operating system's power state to the target power state;
[0162] Create a status update task, which is used to instruct the power state to be updated to the requested power state.
[0163] Update the first state in the upgrade task to the second state, and perform a firmware upgrade on the device according to the updated upgrade task.
[0164] In one possible implementation, upgrade module 13 is specifically used for,
[0165] Retrieve firmware from storage space based on firmware storage address;
[0166] Upgrade the device's firmware based on the firmware specifications.
[0167] In one possible implementation, upgrade module 13 is specifically used for,
[0168] Before upgrading the device's firmware, the method also includes:
[0169] Update the second state in the upgrade task to the third state, which indicates that the firmware upgrade of the device is to begin.
[0170] After upgrading the device's firmware according to the firmware, the method also includes:
[0171] Update the third state in the upgrade task to the fourth state, which indicates that the firmware upgrade of the device has been completed.
[0172] In one possible implementation, upgrade module 13 is specifically used for,
[0173] After the device is upgraded with firmware, the power status is updated to the requested power status according to the status update task.
[0174] The firmware upgrade device provided in this embodiment can execute the method shown in any of the above method embodiments. Its implementation principle and technical effect are similar, and will not be described in detail here.
[0175] Figure 7 A schematic diagram of the structure of the electronic device provided in this application. Figure 7 As shown, the electronic device 20 provided in this embodiment includes at least one processor 201 and a memory 202. Optionally, the electronic device 20 further includes a communication component 203. The processor 201, memory 202, and communication component 203 are connected via a bus.
[0176] In a specific implementation, at least one processor 201 executes computer execution instructions stored in memory 202, causing at least one processor 201 to execute the firmware upgrade method shown in any of the above method embodiments.
[0177] The specific implementation process of processor 201 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0178] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0179] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0180] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0181] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the firmware upgrade method embodiments described above when running.
[0182] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0183] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the firmware upgrade method embodiments described above.
[0184] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the firmware upgrade method embodiments described above.
[0185] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0186] The firmware upgrade method, electronic device, and storage medium provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are only for the purpose of helping to understand the method and its core ideas. It should be noted that those skilled in the art can make several improvements and modifications to this application without departing from the principles of this application, and these improvements and modifications also fall within the protection scope of the claims of this application.
Claims
1. A firmware upgrade method, characterized in that, Applied to electronic devices, the method includes: Receive a firmware upgrade request, the firmware upgrade request including a device identifier and firmware, the firmware upgrade request being used to request a firmware upgrade for the device corresponding to the device identifier based on the firmware; Based on the device identifier, query the preset correspondence between device identifier and power state, and determine the target power state corresponding to the device identifier. The target power state is the power state of the operating system during the firmware upgrade process. The target power state is either on or off. Based on the firmware upgrade request and the target power state, the device is upgraded with firmware. When multiple firmware upgrade requests are received, the step of upgrading the device's firmware based on the firmware upgrade requests and the target power state includes: Store the firmware in the storage space; An upgrade task is created, the upgrade task including the device identifier, the target power state, the storage address of the firmware, and a first state of the upgrade task, the first state being used to indicate that the upgrade task is to be executed; Based on the upgrade task, determine whether the power state of the operating system is the target power state; If the power state of the operating system is the target power state, the first state in the upgrade task is updated to the second state, and the device is upgraded with firmware according to the updated upgrade task. The second state is used to indicate that the power state of the operating system meets the firmware upgrade conditions of the device. If the power state of the operating system is not the target power state, wait for a power operation request, and after receiving the power operation request, perform a firmware upgrade on the device according to the power operation request. The power operation request is used to request that the power state of the operating system be updated to the requested power state.
2. The method according to claim 1, characterized in that, The step of upgrading the firmware of the device according to the power operation request includes: Determine whether the requested power state is the same as the target power state; If the requested power state is the same as the target power state, the first state in the upgrade task is updated to the second state, and the device is upgraded with firmware according to the updated upgrade task. If the requested power state differs from the target power state, the device is upgraded with firmware based on the requested power state and the upgrade task.
3. The method according to claim 2, characterized in that, The firmware upgrade of the device based on the requested power state and the upgrade task includes: Update the power state of the operating system to the target power state; Create a status update task, which is used to instruct the power state to be updated to the requested power state; The first state in the upgrade task is updated to the second state, and the device is then upgraded with firmware according to the updated upgrade task.
4. The method according to any one of claims 1-3, characterized in that, The firmware upgrade of the device according to the updated upgrade task includes: The firmware is retrieved from the storage space according to the storage address of the firmware; The device is upgraded using the firmware described above.
5. The method according to claim 4, characterized in that, Before upgrading the device according to the firmware, the method further includes: The second state in the upgrade task is updated to a third state, which indicates that the firmware upgrade of the device is to be started; After upgrading the device according to the firmware, the method further includes: The third state in the upgrade task is updated to the fourth state, which indicates that the firmware upgrade of the device has been completed.
6. The method according to claim 3, characterized in that, The method further includes: After the device is upgraded with firmware, the power state is updated to the requested power state according to the status update task.
7. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the firmware upgrade method as described in any one of claims 1 to 6 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein the computer program, when executed by a processor, implements the steps of the firmware upgrade method as described in any one of claims 1 to 6.
Citation Information
Patent Citations
Power management method and device, firmware updating method and device, equipment, medium and product
CN112527091A
Firmware upgrading method and system, computer equipment and storage medium
CN119363822A