Equipment upgrading method, system and equipment and computer readable storage medium
By pre-establishing the correspondence between component identification, firmware identification and link information in the server, and automatically matching and executing the upgrade process, the upgrade error problem caused by manual operations is solved, and efficient sensing-free upgrade is achieved.
Patent Information
- Application Number
- CN202510513824.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-23
- Publication Date
- 2025-07-25
AI Technical Summary
In the prior art, the firmware upgrade operation of embedded MCU components in the server relies on manual operations, and there are model misjudgment and script call errors, resulting in low upgrade efficiency and high error rate.
By pre-establishing the correspondence between component identification, firmware identification, component link information and upgrade process, automatically matching and executing the upgrade process, avoiding manual screening of scripts and configuring communication parameters, and realizing sensorless upgrades.
It improves the upgrade efficiency, reduces the risk of script call errors and link parameter input errors, and realizes sensorless upgrade of the control unit of the reference component.
Smart Images

Figure CN120371352A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of embedded device upgrades, and in particular, to a device upgrade method, system, device, and computer-readable storage medium. Background Art
[0002] In the technical field of intelligent operation and maintenance of server systems, for the firmware upgrade operation of the embedded MCU (Microcontroller Unit) components in servers, it mainly relies on manual operations at present. Users need to pre-match specific upgrade scripts according to the specific models of the MCUs and deploy the operating environment. During the execution process, key information such as the MCU communication link parameters also need to be manually input. For MCUs with different models or different communication links, different upgrade scripts need to be manually called and different commands need to be executed. This manual upgrade method has problems such as a high operation error rate and low upgrade efficiency.
[0003] Therefore, how to provide a solution to the above technical problems is what those skilled in the art need to solve currently. Summary of the Invention
[0004] The present invention provides a device upgrade method, system, device, and computer-readable storage medium to at least solve the technical problem of upgrade errors caused by misjudgment of models and incorrect script calls in related technologies.
[0005] The present invention provides a device upgrade method, including:
[0006] When receiving an upgrade image file, determining the firmware identifier to be upgraded and the component identifier to be upgraded in the upgrade image file;
[0007] Matching the reference firmware identifier, the link information of the reference component, and the reference upgrade process corresponding to the component identifier to be upgraded in a preset relationship; the preset relationship includes the corresponding relationship between the component identifier, the firmware identifier, the link information of the component, and the upgrade process;
[0008] In response to the reference firmware identifier being the same as the firmware identifier to be upgraded, executing the reference upgrade process with the link information of the reference component written therein, so as to send the upgrade image file to the control unit of the reference component for upgrade.
[0009] The present invention also provides a device upgrade system, including:
[0010] A determination module, configured to determine the firmware identifier to be upgraded and the component identifier to be upgraded in the upgrade image file when receiving the upgrade image file;
[0011] A matching module, used to match the reference firmware identifier, the link information of the reference component and the reference upgrade process corresponding to the identifier of the component to be upgraded in a preset relationship; the preset relationship includes the corresponding relationship between the component identifier, the firmware identifier, the link information of the component and the upgrade process;
[0012] The upgrade module is used to execute the reference upgrade process written with the link information of the reference component in response to the reference firmware identifier being the same as the firmware identifier to be upgraded, so as to send the upgrade image file to the control unit of the reference component for upgrading.
[0013] The present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the steps of the device upgrading method as described above when executing the computer program.
[0014] The present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the device upgrading method described above are implemented.
[0015] Through the present invention, since the corresponding relationship between each component identification, firmware identification, link information of the component and the upgrade process in the server is pre-established, after receiving the upgrade image file uploaded by the user, the upgrade image file is parsed to automatically extract the firmware identification to be upgraded and the component identification to be upgraded, and the reference upgrade process and the link information of the reference component are matched in the pre-stored corresponding relationship by the identification of the component to be upgraded. After the firmware identification consistency check, the link information of the reference component is embedded in the reference upgrade process and automatically executed, without the need for operation and maintenance personnel to manually screen scripts and configure communication parameters, avoiding the risk of script call errors and link parameter input errors. The technical problem of upgrade errors caused by model misjudgment and script call errors in the manual upgrade process is solved, and the technical effect of non-sensing upgrade of the control unit of the reference component and improving the upgrade efficiency is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 A schematic diagram of the structure of a system applicable to a device upgrading method provided in an embodiment of the present invention;
[0018] Figure 2 A flowchart of a device upgrade method provided by an embodiment of the present invention;
[0019] Figure 3 A schematic diagram of the transmission of an upgrade image file provided by an embodiment of the present invention;
[0020] Figure 4 A schematic diagram of the structure of a device upgrade system provided by an embodiment of the present invention;
[0021] Figure 5 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0022] Figure 6 A schematic diagram of the structure of a computer-readable storage medium provided by an embodiment of the present invention. Detailed implementation manners
[0023] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0024] It should be noted that in the description of the present invention, the terms "include", "comprise" or any other variation thereof are intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in the present invention are used to distinguish similar objects and not to describe a specific order or sequence.
[0025] In order to enable those skilled in the art of the present technology to better understand the solution of the present invention, the present invention will be further described in detail below in conjunction with the accompanying drawings and specific implementation manners.
[0026] Please refer to Figure 1, the system applicable to the device upgrade method provided by the embodiments of the present invention is described. The system includes a client, a management controller, and a control unit embedded in a server component. The management controller includes, but is not limited to, a BMC (Baseboard Management Controller), and the control unit includes, but is not limited to, an MCU. Among them, the client is a user operation terminal, including, but not limited to, functions such as providing an upgrade image file upload, upgrade task trigger, and status monitoring interface. The client establishes communication with the management controller through an out-of-band management network and can use an encrypted channel to ensure transmission security. The management controller receives the upgrade image file uploaded by the client and parses it, and executes the corresponding upgrade process based on the parsed upgrade image file. The management controller and the control unit of the server component can be connected through a communication bus and / or an interface. The control unit runs the current firmware version to implement hardware control of the server component, such as fan speed regulation, power load balancing, etc. The control unit in this embodiment includes, but is not limited to, a power module MCU, a fan controller MCU, a storage backplane MCU, a sensor array MCU, etc.
[0027] Embodiments of the present invention provide a device upgrade method. Combining with the execution flow of the device upgrade method as shown in Figure 2 , the method is described in detail. For ease of understanding, the following takes the control unit as an MCU as an example for description. The device upgrade method includes:
[0028] S101: When receiving an upgrade image file, determine the firmware identifier to be upgraded and the component identifier to be upgraded in the upgrade image file;
[0029] In this embodiment, the upgrade image file can specifically be an upgrade image file uploaded by the user through the client. The upgrade image file includes the identifier information of the image to be upgraded and the upgrade data.
[0030] After the management controller receives the upgrade image file, it parses the upgrade image file to obtain the identifier information of the image to be upgraded. The identifier information here includes at least the firmware identifier to be upgraded and the component identifier to be upgraded. Among them, the firmware identifier to be upgraded can specifically be the identifier information of the MCU to be upgraded, which is used to identify the hardware model and / or firmware compatibility range of the MCU, such as MCU12345; the component identifier to be upgraded can specifically be the identifier information of the server component where the MCU to be upgraded is located in the server system, including, but not limited to, a chip ID (Identifier), a component number, etc., which is used to identify a specific physical component in the server, such as .
[0031] S102: Match the reference firmware ID, the link information of the reference component, and the reference upgrade process corresponding to the component ID to be upgraded in the preset relationship; the preset relationship includes the corresponding relationship between the component ID, the firmware ID, the link information of the component, and the upgrade process;
[0032] Before performing this step, it also includes the operation of pre - establishing the corresponding relationship between the component ID, the firmware ID, the link information of the component, and the upgrade process. Among them, the component ID is the identification information of the server component including the MCU in the server system, used to identify the physical components (such as power modules, fan controllers, etc.) containing the MCU in the server, including but not limited to pre - burned by the device manufacturer or system - assigned. For example, represents the fifth power module, represents the third fan controller. The firmware ID is the identification information of the MCU in the server system, used to identify the compatibility range or hardware model (such as chip ID) of the MCU firmware, which can ensure the matching of the firmware and the MCU. For example, MCU12345, which is the model code of the MCU defined by the manufacturer. Another example is FW_PSU_V2.x, which is the 2.x version component supporting the PSU module. The link information of the component is the information of the communication link of the server component including the MCU in the server system, used to describe the protocol, address, and corresponding parameter configuration required for the management controller to communicate with the MCU. The communication protocols include but not limited to IIC (Inter - Integrated Circuit, internal integrated circuit bus), SPI (Serial Peripheral Interface, serial peripheral interface), UART (Universal Asynchronous Receiver / Transmitter, universal asynchronous transceiver), etc. Slave address: such as 0x50 for IIC, chip select signal CS1 for SPI, etc. The upgrade process is the firmware upgrade operation sequence for a certain MCU, including but not limited to scripts, commands, and verification logic.
[0033] Specifically, when the management controller starts, it reads the identification information of the MCU on the component through the communication interface (such as IIC, SPI, UART), and then stores the corresponding relationship between the obtained firmware identification information, its corresponding upgrade process, the identification of the component where it is located, and the link information of the component where it is located into the memory, centrally managing all the parameters and operation logics required for the upgrade, so as to facilitate subsequent calls. There is no need for the operation and maintenance personnel to manually search for scripts or input address parameters, avoiding upgrade failures caused by selecting the wrong script (such as using the fan script for the power module) or incorrect address configuration (such as mistakenly inputting 0x60 instead of 0x50). There is no need to develop independent upgrade tools for MCUs with different protocols or interfaces, and unified management is carried out through the preset relationship, seamlessly adapting to the diversity of devices. Among them, the above - mentioned corresponding relationship can be stored in the form of a table, as shown in Table 1.
[0034] Table 1 Correspondence Table of Component Identification, Firmware Identification, Link Information of Components, and Upgrade Process
[0035]
[0036] Of course, in addition to describing the correspondence between component identification, firmware identification, link information of components, and upgrade process in the above form, it can also be described in other forms, which are not specifically limited in this embodiment.
[0037] After the management controller parses the upgrade image file to obtain the firmware identification to be upgraded and the component identification to be upgraded, it automatically matches through the component identification to be upgraded in the pre-established preset relationship, determines the firmware identification corresponding to the component identification to be upgraded in the preset relationship as the reference firmware identification, determines the link information of the component corresponding to the component identification to be upgraded in the preset relationship as the reference component link information, and determines the upgrade process corresponding to the component identification to be upgraded in the preset relationship as the reference upgrade process. Taking Table 1 as an example, assuming the component identification to be upgraded is , the reference firmware identification is MCU12345, the reference component link information includes I2C, 0x50, and the reference upgrade process is psu_fw_update.sh.
[0038] It can be understood that the above preset relationship can be dynamically updated to quickly adapt to new hardware, such as adding server components ( ). Only need to add a row of records (component identification, firmware identification, link information, upgrade script) in the preset relationship, without modifying the core code of the management controller, reducing the complexity of operation and maintenance. As an optional embodiment, the preset relationship can also support manual entry or interface import, so as to flexibly cope with heterogeneous hardware environments.
[0039] S103: In response to the reference firmware identification being the same as the firmware identification to be upgraded, execute the reference upgrade process with the link information of the reference component written therein, so as to send the upgrade image file to the control unit of the reference component for upgrade.
[0040] It can be understood that the link information of the component is a parameter in the upgrade process. The component link information (such as IIC, 0x50) in the preset relationship is used as an input parameter of the upgrade script and is automatically loaded when the script is executed. When the reference firmware identification is the same as the firmware identification to be upgraded, the management controller writes the obtained link information of the reference component into the reference upgrade process. After ensuring communication adaptation, execute the reference upgrade process to send the upgrade image file to the MCU of the reference component for upgrade.
[0041] In this embodiment, first, the firmware identifier is verified. When the verification passes, that is, when the reference firmware identifier and the firmware identifier to be upgraded are exactly the same, subsequent operations are performed. If they are different, an upgrade error is reported to prevent incompatible firmware (such as an image designed for the firmware identifier MCU67890 from being accidentally flashed into an MCU with the firmware identifier MCU12345), avoiding hardware damage or abnormal functions. During the upgrade process, the user does not need to care whether the MCU uses the I2C or SPI protocol. The management controller can automatically adapt the communication driver and avoid communication failures caused by incorrect manual input of addresses (such as accidentally entering 0x60 instead of 0x50). Through the solution of this embodiment, the customer only needs to upload the upgrade image file, and the management controller realizes the functions of dynamic hardware recognition and one-key seamless upgrade.
[0042] As an optional embodiment, on the basis of firmware identifier matching, the firmware version number can also be verified. When the firmware version number is higher than the current version, subsequent operations are performed to reduce the risk of accidental downgrade and avoid function regression or recurrence of security vulnerabilities caused by downgrade operations. If the mirror firmware identifier is the same as the current version, the upgrade can be directly skipped to reduce unnecessary communication overhead.
[0043] Through the present invention, since the corresponding relationships among the component identifiers, firmware identifiers, component link information, and upgrade processes in the server are established in advance, after receiving the upgrade image file uploaded by the user, the upgrade image file is parsed to automatically extract the firmware identifier to be upgraded and the component identifier to be upgraded. The reference upgrade process and the link information of the reference component matched by using the component identifier to be upgraded in the pre-stored corresponding relationships are used. After passing the firmware identifier consistency verification, the link information of the reference component is embedded into the reference upgrade process and then automatically executed, without the need for operation and maintenance personnel to manually screen scripts and configure communication parameters, avoiding the risks of script call errors and link parameter input mistakes. It solves the technical problem of upgrade errors caused by misjudgment of models and script call errors during the manual upgrade process, achieving the seamless upgrade of the control unit of the reference component and improving the upgrade efficiency at the same time.
[0044] Based on the above embodiments:
[0045] In an exemplary embodiment, the control unit includes multiple storage partitions;
[0046] The process of sending the upgrade image file to the control unit of the reference component for upgrade includes:
[0047] Sending the upgrade image file to the target storage partition in the control unit of the reference component; the target storage partition is not the currently running partition of the control unit;
[0048] In response to successful verification of the upgrade image file in the target storage partition, controlling the control unit to start from the target storage partition.
[0049] In this embodiment, considering that the MCU may fail to be upgraded due to its running state or environmental factors during the upgrade process, after the upgrade fails, the MCU cannot work properly, which will cause the server components where it is located to not work properly, resulting in some abnormal functions of the server. Based on this, this embodiment adopts a multi-backup and rollback mechanism for upgrading. This mechanism divides the storage medium in the MCU into multiple storage partitions. After the upgrade fails, it will roll back to the backup version, and multiple storage partitions are backed up to each other. As an alternative embodiment, the storage medium in the storage unit can be flash.
[0050] For ease of understanding, this embodiment takes the flash of the MCU being divided into two storage partitions as an example for illustration. The two storage partitions are partition A and partition B respectively. After the firmware identifier verification passes, the management controller sends the mirror upgrade file to the target storage partition of the MCU of the reference component. The target storage partition is the backup partition of the current running partition of the MCU. If the MCU is currently running in partition A, that is, partition A is the current running partition, then partition B is the target storage partition in this embodiment, and the management controller sends the mirror upgrade file to partition B of the MCU. After the mirror upgrade file is written into partition B, the MCU verifies the written mirror upgrade file and feeds back the verification result to the management controller. The verification includes signature and CRC verification. Among them, the signature verification is used to verify the legality of the mirror upgrade file to prevent malicious code or tampered firmware from being written. CRC (Cyclic Redundancy Check) verification is used to ensure that the data transmitted to partition B is complete and error-free, to prevent firmware damage caused by transmission errors. It can be understood that the dual verification intercepts invalid upgrades from the two dimensions of security and reliability, reducing the risk of startup failure caused by data errors.
[0051] In response to the successful verification of the upgrade mirror file, the management controller controls the MCU to start from the target storage partition, that is, partition B, after the next power-on. This embodiment ensures that the process of writing and verifying the new firmware will not interfere with the normal operation of the current running partition through physically isolated storage partitions. For example, when the mirror upgrade file is written into the backup partition (such as partition B), the MCU still executes the code from the current running partition (partition A), and the business logic is not affected by the upgrade operation.
[0052] Of course, in addition to being divided into two storage partitions A and B, it can also be extended to multiple partitions A, B, and C to retain multiple historical versions and enhance the flexibility of version rollback. The storage medium can be other non-volatile storage media in addition to flash, such as EEPROM (Electrically Erasable Programmable Read-Only Memory), NVMe (Non-Volatile Memory Express), etc.
[0053] In an exemplary embodiment, in response to successful verification of the upgrade image file in the target storage partition, the process of controlling the control unit to start from the target storage partition includes:
[0054] In response to successful verification of the upgrade image file in the target storage partition, modify the boot identifier to the identifier of the target storage partition so that the control unit starts from the target storage partition.
[0055] In this embodiment, after the upgrade image file in the target storage partition is successfully verified, the management controller modifies the boot identifier to the identifier of the target storage partition, that is, points the boot identifier to the target storage partition, so as to control the MCU to switch to the new storage partition (i.e., the target storage partition in this embodiment) when starting up next time. The user can independently select the restart timing to avoid service interruption. When the upgrade image file in the target storage partition fails to be verified, the management controller does not modify the boot identifier.
[0056] It can be understood that if the server system accidentally loses power during the upgrade process and only part of the data is written to the target storage partition during the power outage, since the management controller does not receive the information that the upgrade image file in partition B is successfully verified, the management controller will not modify the boot identifier, and the boot identifier still points to partition A. After power-on again, partition A is still selected to start.
[0057] Adopting the solution of this embodiment realizes continuous service operation during the upgrade process, seamless switching after restart, automatic rollback to the stable version after upgrade failure without manual intervention, and the effect of avoiding the writing of invalid or malicious firmware by the dual verification mechanism.
[0058] In an exemplary embodiment, the device upgrade method further includes:
[0059] In response to the failure of verifying the upgrade image file in the target storage partition, write the current image file in the current running partition to the target storage partition;
[0060] In response to successful verification of the upgrade image file in the target storage partition, update the upgrade image file to other storage partitions that meet the writing conditions except the target storage partition.
[0061] In this embodiment, when the verification of the upgrade image file in partition B fails, the current image file in partition A (i.e., the image file currently running on the MCU) is written to partition B to update the image file in partition B, ensuring that the two partitions are always valid backups of each other, so as to ensure that when partition A is abnormal, it can also be normally switched to partition B for startup.
[0062] If the verification of the upgrade image file in partition B is successful and meets the writing conditions, the upgrade image file is updated to other storage partitions including partition A to ensure that the firmware versions in all storage partitions are the latest versions. Even if a certain storage partition cannot be started due to physical damage, other storage partitions can still provide the latest functions, and the partition versions can be kept consistent without manual intervention, avoiding the management complexity caused by version fragmentation. Among them, the writing conditions include but are not limited to that the resources of the MCU allow, the CPU load of the MCU is lower than the threshold, the status of the storage partition is a backup partition, etc., so as to avoid affecting the current running state of the MCU.
[0063] As an alternative embodiment, during the process of the MCU starting from the target storage partition, the running state of the MCU is monitored. If the running state of the MCU is abnormal, at this time, the boot flag is reset to the identifier of the historical storage partition, and the historical storage partition is the storage partition where the MCU was running normally last time, so that the MCU rolls back to the image of the historical storage partition. Exemplarily, the management controller can monitor the startup progress of the MCU. If it still does not enter the ready state after exceeding the preset timeout (such as 30 seconds), it is forced to roll back to the historical storage partition to ensure the high availability and business continuity of the system through the automated exception recovery mechanism.
[0064] As another alternative embodiment, when synchronizing the image between each storage partition, the management controller can send a trigger command to the MCU, and the MCU responds to the trigger command to synchronize the image files in each storage partition. It can also be directly synchronized by the management controller for the image files in each storage partition, which can be selected according to the actual engineering needs, and this embodiment does not make specific limitations here.
[0065] In an exemplary embodiment, the process of sending the upgrade image file to the control unit of the reference component includes:
[0066] The data of the upgrade image file is split into multiple data packets, and the data packets are sequentially sent to the control unit of the reference component through the target command, and the audit log recording operation of the target command is triggered each time a data packet is sent, so as to determine the sending status of each data packet;
[0067] The device upgrade method further includes:
[0068] During the execution of the reference upgrade process for writing link information of reference components, a recording operation is performed, and the recording operation includes:
[0069] Record the commands and their parameters running in the reference upgrade process in the process log;
[0070] Record the interfaces called by each command and the call status of the interfaces in the interface call log.
[0071] In this embodiment, the target command can specifically be an IPMI (Intelligent Platform Management Interface) command. When the MCU starts the upgrade, the management controller calls the log recording interface to record the MCU upgrade start log. During the upgrade process, the management controller real-time obtains the MCU upgrade progress. When the upgrade is interrupted or abnormal (the MCU will add corresponding flags when the upgrade is interrupted or abnormal), record the upgrade failure log. If the upgrade is successful, record the upgrade success log. When the management controller writes the upgrade image file to the storage partition corresponding to the MCU, it sends the data of the upgrade image file in data packets through the IPMI command and modifies the code to make the IPMI command record the audit log, so that the sending status of each data packet can be determined through the log. During the upgrade process, each command executed during the upgrade and its return are recorded in the upgrade process log and saved to the file system of the management controller. All interfaces provided by the management controller called during the upgrade need to record logs.
[0072] The process log and interface call log recorded during the upgrade in this embodiment can be collected at one key through the one-key log collection function of the management controller. According to the two collected logs, problems can be located more conveniently and quickly, thereby improving the problem-solving efficiency.
[0073] In an exemplary embodiment, the preset relationship includes a first correspondence and a second correspondence, and the device upgrade method further includes:
[0074] Establish a first correspondence between the component identifier, firmware identifier, and link information of the component in advance, and a second correspondence between the component identifier, firmware identifier, and upgrade process;
[0075] The process of matching the reference firmware identifier, reference component link information, and reference upgrade process corresponding to the component identifier to be upgraded in the preset relationship includes:
[0076] Match the reference firmware identifier and reference component link information corresponding to the component identifier to be upgraded in the first correspondence;
[0077] In response to the reference firmware identifier being the same as the firmware identifier to be upgraded, match the reference upgrade process corresponding to the component identifier to be upgraded in the second correspondence.
[0078] In this embodiment, the preset relationship includes a first correspondence and a second correspondence. The first correspondence is the mapping relationship among the component identifier, the firmware identifier, and the link information of the component. The second correspondence is the mapping relationship among the component identifier, the firmware identifier, and the upgrade process. Therefore, both the firmware identifier and / or the component identifier can be matched in the two correspondences. In this embodiment, the relationships among the component identifier, the firmware identifier, and the link information of the component, and among the component identifier, the firmware identifier, and the upgrade process are established separately, so that the system can handle different upgrade scenarios more flexibly. If the link information or the upgrade process of a certain component changes, only the corresponding relationship needs to be updated, without affecting other parts.
[0079] When matching the reference firmware identifier, the link information of the reference component, and the reference upgrade process corresponding to the component identifier to be upgraded, it can be carried out step by step. First, match the reference firmware identifier and the link information of the reference component in the first correspondence, and then match the reference upgrade process in the second correspondence. By step-by-step matching, it is ensured that before entering the upgrade process, the firmware version and link information of the component are accurate, thereby reducing the risk of upgrade failure or system instability and reducing errors in the matching process. If a mismatch is found in a certain step, it can be adjusted in time without affecting the entire matching process.
[0080] This way of establishing the correspondence separately makes the system more efficient and reliable in dealing with complex upgrade requirements by improving the flexibility of the system, simplifying the matching process, enhancing maintainability and scalability, reducing errors and improving efficiency, supporting complex upgrade scenarios, and enhancing the adaptability of the system.
[0081] In an exemplary embodiment, the process of sending the upgrade image file to the control unit of the reference component for upgrade includes:
[0082] Judge whether the running state of the control unit meets the dynamic upgrade condition;
[0083] If so, determine the current transmission length, split the data in the upgrade image file that has not been transmitted into data packets that meet the current transmission length, send the data packets to the control unit, and execute the operation of judging whether the running state of the control unit meets the dynamic upgrade condition until all the data in the upgrade image file are sent to the control unit of the reference component.
[0084] Considering that during the MCU upgrade process, the operating state of the MCU is not stable and is affected by factors such as the environment and task conditions. When the operating state of the MCU is not good and the user triggers the MCU upgrade operation, if the management controller still upgrades according to the original plan without performing other processing on the data sent to the MCU, this may affect the current processing ability of the MCU, resulting in task delays of the MCU, thereby affecting the implementation of certain functions of the server. Therefore, to solve this problem, this embodiment proposes an upgrade strategy based on the operating state of the MCU.
[0085] In this embodiment, the data sub-packages of the upgrade image file are sequentially sent to the MCU of the reference component for upgrade, and the length of the data packet is dynamically adjustable according to the operating state of the MCU. When the operating state of the MCU does not meet the dynamic upgrade condition, the untransmitted data in the upgrade image file is split into at least one data packet that meets the preset transmission length for transmission. The preset transmission length can be the maximum allowable packet length to achieve fast transmission and improve the upgrade efficiency. When the operating state of the MCU meets the dynamic upgrade condition, the current transmission length is determined. The current transmission length is less than the preset transmission length, reducing the amount of data transmitted at one time and reducing the instantaneous processing pressure. The untransmitted data in the upgrade image file is split into at least one data packet that meets the current transmission length. If there is only one data packet, the data packet is sent to the storage partition corresponding to the MCU. If there are multiple data packets, they are sequentially sent to the storage partition corresponding to the MCU, and during the sending process, the operating state of the MCU is continuously detected, and the current transmission length of the data packet is dynamically updated. By dynamically adjusting the data packet length, it can timely adapt to the changes in the operating state of the MCU, ensure the stable progress of the upgrade process, and avoid potential risks caused by a fixed data packet length.
[0086] The operating state includes but is not limited to the ambient temperature near the MCU. Hardware-wise, a temperature sensor is added near the MCU in advance to monitor the ambient temperature near the MCU. Correspondingly, the dynamic upgrade condition includes that the ambient temperature exceeds the preset threshold. It can be understood that the ambient temperature exceeding the preset threshold will affect the performance of the MCU. When the user triggers the MCU upgrade, the management controller obtains the ambient temperature of the MCU in real time, detects whether the ambient temperature exceeds the preset threshold, and performs different operations according to the detection result. If the ambient temperature exceeds the preset threshold, the management controller reduces the data sent to the MCU by reducing the current transmission length to relieve the pressure on the MCU to process data and ensure the normal operation of other functions. When the temperature does not exceed the threshold, the current upgrade process continues.
[0087] Of course, as another optional embodiment, in a high-load state, the packet sending interval can also be extended to avoid occupying too much bus bandwidth or CPU time slices. By dynamically adjusting the packet length and interval, it is possible to prevent the MCU response delay or task packet loss caused by the sudden burst of upgrade traffic.
[0088] Reference Figure 3 As shown, during the transmission process, the ambient temperature of the control unit is polled to determine whether the ambient temperature is greater than a preset threshold. If so, the current transmission length is set If not, set the current transmission length , The management controller sends a data packet of length len to the control unit to determine whether all data of the upgrade image file has been transmitted. If so, stop polling to obtain the ambient temperature of the control unit. If not, repeat the operation of determining whether the ambient temperature is greater than a preset threshold.
[0089] As an optional embodiment, during the upgrade process, if the transmission is suspended due to link interruption, the management controller can record the amount of data transmitted, and after detecting that the link is restored, the transmission can be continued from the breakpoint without starting over.
[0090] In summary, when upgrading the MCU, the present invention does not require the user to select an upgrade script according to the MCU model, but only needs to upload the corresponding image. The BMC will dynamically match the MCU and its upgrade process, which makes the operation simpler and can achieve one-click seamless upgrade. During the MCU upgrade process, the upgrade process log and the interface call log can be recorded at the same time, which can be collected with one click, making it more convenient to analyze the problem. During the MCU upgrade process, the upgrade process can be dynamically adjusted according to the MCU operating status, which can ensure that the MCU upgrade process is more stable and the server-related functions are more stable.
[0091] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method.
[0092] Please refer to Figure 4 , an embodiment of the present invention further provides a device upgrade system, comprising:
[0093] The determination module 11 is used to determine the to-be-upgraded firmware identifier and the to-be-upgraded component identifier in the upgrade image file when the upgrade image file is received;
[0094] A matching module 12, used to match the reference firmware identifier, the link information of the reference component and the reference upgrade process corresponding to the identifier of the component to be upgraded in a preset relationship; the preset relationship includes the corresponding relationship between the component identifier, the firmware identifier, the link information of the component and the upgrade process;
[0095] The upgrade module 13 is configured to execute a reference upgrade process of writing link information of a reference component in response to the same reference firmware identifier and the firmware identifier to be upgraded, so as to send an upgrade image file to a control unit of the reference component for upgrade.
[0096] In an exemplary embodiment, the control unit includes a plurality of storage partitions;
[0097] The process of sending the upgrade image file to the control unit of the reference component for upgrade includes:
[0098] Sending the upgrade image file to a target storage partition in the control unit of the reference component; the target storage partition is not the currently running partition of the control unit;
[0099] In response to successful verification of the upgrade image file in the target storage partition, control the control unit to start from the target storage partition.
[0100] In an exemplary embodiment, the process of controlling the control unit to start from the target storage partition in response to successful verification of the upgrade image file in the target storage partition includes:
[0101] In response to successful verification of the upgrade image file in the target storage partition, modify the boot identifier to the identifier of the target storage partition, so that the control unit starts from the target storage partition.
[0102] In an exemplary embodiment, the device upgrade system further includes:
[0103] A first writing module, configured to write the current image file in the currently running partition to the target storage partition in response to failure of verifying the upgrade image file in the target storage partition;
[0104] A second writing module, configured to update the upgrade image file to other storage partitions that meet the writing conditions except the target storage partition in response to successful verification of the upgrade image file in the target storage partition.
[0105] In an exemplary embodiment, the process of sending the upgrade image file to the control unit of the reference component includes:
[0106] Split the data of the upgrade image file into multiple data packets, and sequentially send the data packets to the control unit of the reference component through a target command, and trigger an audit log recording operation of the target command each time a data packet is sent, so as to determine the sending status of each data packet;
[0107] The device upgrade system further includes:
[0108] A log recording module, configured to perform a recording operation during the execution of the reference upgrade process of writing link information of a reference component, and the recording operation includes:
[0109] Record the commands and their parameters running in the reference upgrade process in the process log;
[0110] Record the interfaces called by each command and the call status of the interfaces in the interface call log.
[0111] In an exemplary embodiment, the preset relationship includes a first correspondence and a second correspondence, and the device upgrade system further includes:
[0112] A relationship establishment module, configured to pre - establish a first correspondence among component identifiers, firmware identifiers, and link information of components, and a second correspondence among component identifiers, firmware identifiers, and upgrade processes;
[0113] The process of matching the reference firmware identifier, the link information of the reference component, and the reference upgrade process corresponding to the component identifier to be upgraded in the preset relationship includes:
[0114] Match the reference firmware identifier and the link information of the reference component corresponding to the component identifier to be upgraded in the first correspondence;
[0115] In response to the same reference firmware identifier and the firmware identifier to be upgraded, match the reference upgrade process corresponding to the component identifier to be upgraded in the second correspondence.
[0116] In an exemplary embodiment, the process of sending the upgrade image file to the control unit of the reference component for upgrade includes:
[0117] Determine whether the operating state of the control unit meets the dynamic upgrade condition;
[0118] If so, determine the current transmission length, split the data in the upgrade image file that has not been transmitted into data packets that meet the current transmission length, send the data packets to the control unit, and perform the operation of determining whether the operating state of the control unit meets the dynamic upgrade condition until all the data in the upgrade image file is sent to the control unit of the reference component.
[0119] For the description of the features in the embodiments corresponding to the device upgrade system, reference can be made to the relevant descriptions in the embodiments corresponding to the device upgrade method, which will not be elaborated here one by one.
[0120] Please refer to Figure 5 , embodiments of the present invention further provide an electronic device, including:
[0121] A memory 21, configured to store a computer program;
[0122] A processor 22, configured to implement the steps of the device upgrade method as described in any one of the above when executing the computer program.
[0123] This electronic device further includes:
[0124] The input interface 23 is connected to the processor 22 via the communication bus 26 and is used to obtain externally imported computer programs, parameters, and instructions, and store them in the memory 21 under the control of the processor 22. This input interface can be connected to an input device to receive parameters or instructions manually input by the user. The input device can be a touch layer covering the display screen, or buttons, trackballs, or touchpads provided on the terminal housing.
[0125] The display unit 24 is connected to the processor 22 via the communication bus 26 and is used to display the data sent by the processor 22. The display unit can be a liquid crystal display screen or an electronic ink display screen, etc.
[0126] The network port 25 is connected to the processor 22 via the communication bus 26 and is used to establish communication connections with various external terminal devices. The communication technology used for this communication connection can be a wired communication technology or a wireless communication technology, such as Mobile High-Definition Link (MHL) technology, Universal Serial Bus (USB), High-Definition Multimedia Interface (HDMI), Wi-Fi technology, Bluetooth communication technology, Bluetooth Low Energy (BLE) communication technology, communication technology based on IEEE 802.11s, etc.
[0127] Please refer to Figure 6 , an embodiment of the present invention further provides a computer-readable storage medium 30. A computer program 31 is stored on the computer-readable storage medium 30. When the computer program 31 is executed by a processor, the steps of the device upgrade method as described in any one of the above are implemented.
[0128] In an exemplary embodiment, the above computer-readable storage medium 30 may include, but is not limited to: USB flash drives, read-only memory (ROM), random access memory (RAM), external hard drives, magnetic disks, or optical discs, etc., various media that can store the computer program 31.
[0129] An embodiment of the present invention further provides a computer program product. The above computer program product includes a computer program. When the computer program is executed by a processor, the steps in any one of the above embodiments of the device upgrade method are implemented.
[0130] An embodiment of the present invention further provides another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps in any one of the above embodiments of the device upgrade method are implemented.
[0131] Those skilled in the art may further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner 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 as exceeding the scope of the present invention.
[0132] The above has introduced in detail a device upgrade method, system, device, and computer-readable storage medium provided by the present invention. Specific examples are used herein to elaborate on the principles and implementation manners of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the protection scope of the claims of the present invention.
Claims
1. A device upgrade method, characterized in that, Including: When receiving an upgrade image file, determining the firmware identifier to be upgraded and the component identifier to be upgraded in the upgrade image file; Matching, in a preset relationship, the reference firmware identifier, the link information of the reference component, and the reference upgrade process corresponding to the component identifier to be upgraded; The preset relationship includes the corresponding relationship between the component identifier, the firmware identifier, the link information of the component, and the upgrade process; In response to the reference firmware identifier being the same as the firmware identifier to be upgraded, executing the reference upgrade process with the link information of the reference component written therein, so as to send the upgrade image file to the control unit of the reference component for upgrade.
2. The device upgrade method according to claim 1, wherein The control unit includes multiple storage partitions; The process of sending the upgrade image file to the control unit of the reference component for upgrade includes: Sending the upgrade image file to a target storage partition in the control unit of the reference component; the target storage partition is not the currently running partition of the control unit; In response to the upgrade image file in the target storage partition being successfully verified, controlling the control unit to start from the target storage partition.
3. The device upgrade method according to claim 2, characterized in that The process of controlling the control unit to start from the target storage partition in response to the upgrade image file in the target storage partition being successfully verified includes: In response to the upgrade image file in the target storage partition being successfully verified, modifying the boot identifier to the identifier of the target storage partition, so that the control unit starts from the target storage partition.
4. The device upgrade method according to claim 2, wherein The device upgrade method further includes: In response to the upgrade image file in the target storage partition being verified as failed, writing the current image file in the currently running partition to the target storage partition; In response to the upgrade image file in the target storage partition being successfully verified, updating the upgrade image file to other storage partitions that meet the writing conditions except the target storage partition.
5. The device upgrade method according to claim 1, characterized in that The process of sending the upgrade image file to the control unit of the reference component includes: Splitting the data of the upgrade image file into multiple data packets, sequentially sending the data packets to the control unit of the reference component through a target command, and triggering the audit log recording operation of the target command each time the data packet is sent, so as to determine the sending status of each data packet; The device upgrade method further includes: Performing a recording operation during the execution of the reference upgrade process with the link information of the reference component written therein, and the recording operation includes: Recording the commands and their parameters running in the reference upgrade process in a process log; Recording the interfaces called by each command and the call status of the interfaces in an interface call log.
6. The device upgrade method according to claim 1, wherein The preset relationship includes a first corresponding relationship and a second corresponding relationship, and the device upgrade method further includes: Pre-establishing the first corresponding relationship between the component identifier, the firmware identifier, and the link information of the component, and the second corresponding relationship between the component identifier, the firmware identifier, and the upgrade process; The process of matching the reference firmware identifier, the link information of the reference component, and the reference upgrade process corresponding to the component identifier to be upgraded in the preset relationship includes: Match the reference firmware identifier corresponding to the component identifier to be upgraded and the link information of the reference component in the first corresponding relationship; In response to the same reference firmware identifier and the firmware identifier to be upgraded, match the reference upgrade process corresponding to the component identifier to be upgraded in the second corresponding relationship.
7. The device upgrade method according to any one of claims 1-6, characterized in that, The process of sending the upgrade image file to the control unit of the reference component for upgrade includes: Determine whether the operating state of the control unit meets the dynamic upgrade condition; If so, determine the current transmission length, split the data in the upgrade image file that has not been transmitted into data packets that meet the current transmission length, send the data packets to the control unit, and perform the operation of determining whether the operating state of the control unit meets the dynamic upgrade condition until all the data in the upgrade image file is sent to the control unit of the reference component.
8. An equipment upgrade system, characterized in that, Include: A determination module, configured to determine the firmware identifier to be upgraded and the component identifier to be upgraded in the upgrade image file when receiving the upgrade image file; A matching module, configured to match the reference firmware identifier corresponding to the component identifier to be upgraded, the link information of the reference component, and the reference upgrade process in a preset relationship; The preset relationship includes the corresponding relationship between the component identifier, the firmware identifier, the link information of the component, and the upgrade process; An upgrade module, configured to, in response to the same reference firmware identifier and the firmware identifier to be upgraded, execute the reference upgrade process with the link information of the reference component written therein, so as to send the upgrade image file to the control unit of the reference component for upgrade.
9. An electronic device, characterized in that, Include: A memory, configured to store a computer program; A processor, configured to implement the steps of the device upgrade method according to any one of claims 1-7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the device upgrade method according to any one of claims 1-7 are implemented.
Citation Information
Cited By
Underwater propeller lease cabinet internal communication system and method, lease cabinet and medium
CN120856759A