Server firmware upgrading method and device, electronic equipment and readable storage medium

By automatically identifying and selecting the appropriate upgrade data packet for firmware version update, the problem of inefficient upgrade efficiency caused by the differences in firmware version types of multiple core boards on the server is solved, and efficient and automated updates of the core board firmware version are achieved.

CN119271233APending Publication Date: 2025-01-07GEER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310836135.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-07
Publication Date
2025-01-07

AI Technical Summary

Technical Problem

When multiple core boards exist on the server, the difference between firmware version types leads to inefficient firmware upgrades, and users need to manually select the upgrade packet, and cannot automatically select the correct packet for upgrade.

Method used

By obtaining the upgrade firmware file, traverse each core board, determine its firmware version type, and automatically identify and select the corresponding target upgrade packet for firmware upgrade based on the preset mapping relationship, ensuring that each core board uses the appropriate upgrade packet for firmware upgrade. Firmware version update.

Benefits of technology

Improves the server's firmware upgrade efficiency, avoids the steps of manual selection by users, and ensures that each core board automatically recognizes and uses the correct upgrade packet, thereby improving the automation and accuracy of firmware updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119271233A_ABST
    Figure CN119271233A_ABST
Patent Text Reader

Abstract

The invention discloses a firmware upgrading method and device of a server, electronic equipment and a readable storage medium, and relates to the technical field of servers, the server comprises a plurality of core boards, and the firmware upgrading method of the server comprises the steps that an upgrading firmware file is obtained, and the upgrading firmware file comprises a plurality of upgrading data packages; traversing each core board in sequence, taking the traversed core board as a first core board, and determining a first firmware version type of the first core board; a target upgrading data packet corresponding to the first firmware version type is determined according to the upgrading data packets, firmware upgrading is conducted on the first core board according to the target upgrading data packet, and upgrading data packets corresponding to different firmware version types of the core board are different. According to the method and the device, the firmware upgrading efficiency of the server can be improved when the firmware version types of the multiple core boards on the server are different.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of servers, and in particular to a firmware upgrade method, device, electronic device and readable storage medium for a server. Background Art

[0002] The server contains two boards: BMC (Baseboard Management Controller) and core board. BMC is responsible for controlling and obtaining device information and data of the core board, and the core board supports specific business functions. BMC is used to update and upgrade the firmware version of the server during the OTA (Over-the-Air Technology) upgrade process. Specifically, the firmware of the core board (or business board) can be upgraded to achieve the update and upgrade of the server.

[0003] In the existing OTA upgrade process, since the version types of the firmware versions of all core boards included in the server are consistent, the same upgrade data packet is often used to uniformly upgrade the firmware versions of all core boards. However, when there are multiple core boards on the server and there are differences between the firmware version types of the core boards, such as some core boards on the server are of a firmware version type that supports Charger (charging), while other core boards are of a firmware version type that does not support Charger, at this time, the user is often required to manually select the upgrade data packet required for the firmware version upgrade of each core board. The BMC controls each core board to upgrade the firmware version according to the upgrade data packet selected by the user, but is unable to automatically select the correct upgrade data packet for the upgrade, resulting in low firmware upgrade efficiency of the server. Summary of the invention

[0004] The main purpose of this application is to provide a server firmware upgrade method, device, electronic device and readable storage medium, aiming to solve the technical problem of how to improve the firmware upgrade efficiency of the server when there are differences between the firmware version types of multiple core boards on the server.

[0005] To achieve the above object, the present application provides a method for upgrading the firmware of a server, wherein the server includes multiple core boards, and the method includes:

[0006] Acquire an upgrade firmware file, wherein the upgrade firmware file includes a plurality of upgrade data packets;

[0007] Traversing each of the core boards in turn, taking the traversed core board as the first core board, and determining the first firmware version type of the first core board;

[0008] A target upgrade data packet corresponding to the first firmware version type is determined according to each upgrade data packet, and the firmware of the first core board is upgraded according to the target upgrade data packet, wherein different firmware version types of the core board correspond to different upgrade data packets.

[0009] Optionally, the step of determining the first firmware version type of the first core board includes:

[0010] Acquire status information of the first core board, wherein the status information includes recording a function type to which the first core board belongs, and the function type includes at least one of a charging support function type, a charging non-support function type, a camera support function type, and a camera non-support function type;

[0011] The firmware version type corresponding to the status information is determined based on a preset mapping relationship, and the firmware version type is used as the first firmware version type of the first core board, wherein the preset mapping relationship includes a mapping relationship between the status information and the firmware version type.

[0012] Optionally, after the step of determining a target upgrade data packet corresponding to the first firmware version type according to each of the upgrade data packets, the method further includes:

[0013] Determine the upgrade package storage area corresponding to the first core board, and write the target upgrade data packet into the upgrade package storage area;

[0014] The attribute value of the upgrade identification status bit of the first core board is set to a first preset attribute value, wherein the upgrade identification status bit set to the first preset attribute value is used to identify that the first core board is to be upgraded in firmware.

[0015] Optionally, after determining the upgrade package storage area corresponding to the first core board, the method includes:

[0016] Determine the remaining memory of the upgrade package storage area, and determine the data packet length of the target upgrade data packet;

[0017] If the remaining memory is greater than or equal to the data packet length, executing the step of writing the target upgrade data packet into the upgrade packet storage area;

[0018] If the remaining memory is less than the data packet length, the target upgrade data packet is disassembled into multiple upgrade packages of preset length, and each of the upgrade packages is written to the upgrade package storage area in turn. Each time an upgrade package is written to the upgrade package storage area, the first core board is triggered to retrieve the upgrade package from the upgrade package storage area for firmware upgrade.

[0019] Optionally, the step of triggering the first core board to retrieve the upgrade package from the upgrade package storage area to perform firmware upgrade includes:

[0020] The upgrade package written into the upgrade package storage area is used as the current upgrade package;

[0021] Trigger the first core board to retrieve the current upgrade package from the upgrade package storage area for firmware upgrade, and after receiving the upgrade completion confirmation information of the current upgrade package, determine the next upgrade package corresponding to the current upgrade package, write the next upgrade package to the upgrade package storage area, and return to execute the step of using the upgrade package written to the upgrade package storage area as the current upgrade package, until all the upgrade packages are written to the upgrade package storage area one by one.

[0022] Optionally, after the step of setting the attribute value of the upgrade identification status bit of the target core board to a first preset attribute value, the method further includes:

[0023] If the working state of the first core board is idle, an upgrade thread corresponding to the first core board is created, and based on the upgrade thread corresponding to the first core board, the first core board is triggered to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade;

[0024] If a start upgrade signal for the first core board is received, the operation of the first core board is interrupted, an upgrade thread corresponding to the first core board is created, and based on the upgrade thread corresponding to the first core board, the first core board is triggered to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade.

[0025] Optionally, after the step of triggering the first core board to retrieve the target upgrade data packet from the upgrade package storage area to perform firmware upgrade, the method further includes:

[0026] Detect whether the firmware upgrade of the first core board is successful;

[0027] If the firmware upgrade of the first core board is successful, the attribute value of the upgrade identification status bit of the first core board is set to a second preset attribute value, wherein the upgrade identification status bit set to the second preset attribute value is used to identify that the first core board has completed the firmware upgrade;

[0028] If the firmware upgrade of the first core board fails, the cumulative number of upgrade failures of the first core board is increased by one. If the cumulative number is less than the preset error number threshold, the step of upgrading the firmware of the first core board according to the target upgrade data packet is re-executed.

[0029] The present application also provides a firmware upgrade device for a server, wherein the server includes multiple core boards, and the device includes:

[0030] An acquisition module, used to acquire an upgrade firmware file, wherein the upgrade firmware file includes a plurality of upgrade data packets;

[0031] A determination module, used for traversing each of the core boards in sequence, taking the traversed core board as the first core board, and determining a first firmware version of the first core board;

[0032] An upgrade module is used to determine a target upgrade data packet corresponding to the first firmware version based on each upgrade data packet, and perform firmware upgrade on the first core board based on the target upgrade data packet, wherein different firmware versions of the core board correspond to different upgrade data packets.

[0033] The present application also provides an electronic device, which is a physical device, and includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the steps of the server firmware upgrade method as described above.

[0034] The present application also provides a readable storage medium, which is a computer-readable storage medium, on which is stored a program for implementing a firmware upgrade method for a server, and the program for implementing a firmware upgrade method for a server is executed by a processor to implement the steps of the firmware upgrade method for the server as described above.

[0035] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned server firmware upgrade method when executed by a processor.

[0036] When BMC obtains the upgrade firmware file in this application, it traverses each core board in turn, takes the traversed core board as the first core board, determines the target upgrade data packet corresponding to the firmware version type of the first core board, and performs firmware upgrade on the first core board according to the target upgrade data packet, wherein the upgrade firmware file includes multiple upgrade data packets, and the upgrade data packets corresponding to the different firmware version types of the core board are different. In this way, compared with the firmware upgrade method in which the user needs to manually select the upgrade data packet in the prior art, each core board performs firmware version upgrade according to the upgrade data packet selected by the user, the implementation of this application is to set the different firmware version types of the core board to correspond to different upgrade data packets, and the corresponding target upgrade data packets can be automatically identified and selected according to the firmware version type of each core board, and each core board completes the firmware upgrade according to the selected target upgrade data packet, thereby, when there are differences between the firmware version types of multiple core boards on the server, the firmware upgrade efficiency of the server is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 This is a flow chart of the first embodiment of the firmware upgrade method of the server of the present application;

[0040] Figure 2 This is a detailed flow chart of step S20 in the second embodiment of the firmware upgrade method of the server of this application;

[0041] Figure 3 This is a flow chart of a third embodiment of a firmware upgrade method for a server of the present application;

[0042] Figure 4 This is a schematic diagram of the module structure of the firmware upgrade device of the server in the embodiment of the present application;

[0043] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the firmware upgrade device of the server in the embodiment of the present application.

[0044] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0045] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the scope of protection of the present invention.

[0046] Embodiment 1

[0047] Firmware upgrade refers to the manufacturer upgrading the embedded firmware of electronic devices to improve device functions, enhance device stability, and patch device vulnerabilities.

[0048] The server contains two boards: BMC (Baseboard Management Controller) and core board. BMC is responsible for controlling and obtaining device information and data of the core board, and the core board supports specific business functions. BMC is used to update and upgrade the firmware version of the server during the OTA (Over-the-Air Technology) upgrade process. Specifically, the firmware of the core board (or business board) can be upgraded to achieve the update and upgrade of the server.

[0049] In the existing OTA upgrade process, since the firmware versions of all core boards included in the server are consistent, the server often uses the same upgrade data packet to uniformly upgrade the firmware versions of all core boards. However, when there are multiple core boards on the server and there are differences between the firmware versions of the core boards, the user is often required to manually select the upgrade data packet required for the firmware version upgrade of each core board. Each core board upgrades the firmware version according to the upgrade data packet selected by the user, and the correct upgrade data packet cannot be automatically selected for the upgrade, resulting in low firmware upgrade efficiency of the server.

[0050] Furthermore, when there are differences in firmware version types between multiple core boards on the server, if an incorrect upgrade data packet is used for firmware upgrade, the user device will be unable to boot up. For example, the firmware version of some cores on the server is a version type that supports Charger, and the firmware version of some core boards is a version type that does not support Charger. In this case, after the core board with a firmware version type that does not support Charger uses the upgrade data packet corresponding to the firmware version type that supports Charger to perform a firmware upgrade, the user device will be unable to boot up.

[0051] Based on this, this application proposes a server firmware upgrade method of the first embodiment, please refer to Figure 1, the server includes multiple core boards, and the firmware upgrade method of the server includes:

[0052] Step S10, obtaining an upgrade firmware file, wherein the upgrade firmware file includes a plurality of upgrade data packets;

[0053] The execution subject of the server firmware upgrade method of this embodiment may be a BMC (Baseboard Management Controller).

[0054] In the present embodiment, the upgrade firmware file includes multiple upgrade data packets. Optionally, the upgrade firmware file includes the upgrade data packet corresponding to each different firmware version type of the core board on the server, and usually BMC will repackage multiple upgrade data packets into upgrade firmware files, and restore the upgrade firmware files to the pre-packaging state before executing the firmware upgrade. For example, assuming that 6 core boards are included on the server, namely core board A, core board B, core board C, core board D, core board E, core board F, and the corresponding firmware version types are respectively [type 1, type 1, type 1, type 2, type 2, type 2], then the upgrade firmware file includes the upgrade data packet 1 corresponding to firmware version type 1 and the upgrade data packet 2 corresponding to firmware version type 2. Assuming that upgrade data packet 1 is OTA_1.zip, and upgrade data packet 2 is OTA_2.zip, BMC can repackage OTA_1.zip and OTA_2.zip to obtain upgrade firmware file OTA.img. It should be noted that the naming of the core board, firmware version type, upgrade data package, upgrade firmware file, etc. in this application is for illustrative purposes only and does not limit the actual specific naming. For example, the naming of the upgrade data package, such as OTA_1.zip, OTA_2.zip, etc., is to distinguish two different upgrade data packages and does not limit the actual specific naming of the upgrade data package. Similarly, the naming of the upgrade firmware file, such as OTA.img, does not limit the actual specific naming of the upgrade firmware file.

[0055] In addition, the firmware version corresponding to the same firmware version type may be different, and the firmware version corresponding to the same firmware version type is different, and the core boards belonging to the same firmware version type can be upgraded to the corresponding latest firmware version. For example, assuming that the firmware versions corresponding to core board A, core board B, core board C, core board D, core board E, and core board F are respectively: [type 1_V1.0, type 1_V1.0, type 1_V2.0, type 2_V1.0, type 2_V2.0, type 2_V3.0], the latest firmware version in the upgrade data packet corresponding to type 1 is type 1_V3.0, and the latest firmware version in the upgrade data packet corresponding to type 2 is type 2_V4.0, then after the firmware upgrade of all core boards on the server is completed, the firmware versions corresponding to core board A, core board B, core board C, core board D, core board E, and core board F are: [type 1_V3.0, type 1_V3.0, type 1_V3.0, type 2_V4.0, type 2_V4.0, type 2_V4.0].

[0056] It is known to those skilled in the art that the upgrade data packet is used to perform a firmware upgrade on the core board, and the upgrade data packet can specifically be a full upgrade data packet or a differential upgrade data packet, and the present embodiment does not specifically limit this. Specifically, the upgrade data packet is used to upgrade the current firmware version of the core board to the target firmware version.

[0057] Step S20, traversing each of the core boards in turn, taking the traversed core board as the first core board, and determining the first firmware version type of the first core board;

[0058] After obtaining the upgrade firmware file in the present embodiment, the upgrade firmware file can be decompressed to obtain multiple data packets. For example, the upgrade firmware file obtained by BMC is OTA.img, and OTA.img can be decompressed to obtain multiple upgrade data packets, such as multiple .zip type data packets. Each core board included in the server is traversed sequentially, and for the core board (i.e., the first core board) traversed, its firmware version type is determined and step S30 is performed. Optionally, the status information of the first core board can be obtained, and the firmware version type (i.e., the first firmware version type) of the first core board is determined by the status information. Wherein, the status information is used to distinguish the firmware version type of the core board, such as the status information can include whether the core board supports Charger, if the core board A supports Charger, the firmware version type of the core board A is type 1, and if the core board D does not support Charger, the firmware version type of the core board D is type 2. After the core board is started, BMC can save the status information of whether each core board supports Charger to the core board device, such as being stored in an attribute or a database.

[0059] Step S30, determining a target upgrade data packet corresponding to the first firmware version type, and performing a firmware upgrade on the first core board according to the target upgrade data packet, wherein different firmware version types of the core board correspond to different upgrade data packets.

[0060] Optionally, a mapping relationship between firmware board types and upgrade data packets is preset, and different firmware version types of core boards correspond to different upgrade data packets. The target upgrade data packets corresponding to the firmware version types of each core board are determined, and the target upgrade data packets are burned onto the corresponding core board. The BMC controls each core board to perform firmware upgrades according to the target upgrade data packets burned thereon. For example, the server includes 6 core boards, namely core board A, core board B, core board C, core board D, core board E, and core board F, and the corresponding firmware version types are [Type 1, Type 1, Type 2, Type 2, Type 3, Type 3] respectively. The upgrade data packet corresponding to firmware version type 1 is OTA_1.zip, the upgrade data packet corresponding to firmware version type 2 is OTA_2.zip, and the upgrade data packet corresponding to firmware version type 3 is OTA_3.zip. Then, the target upgrade data packets burned by the 6 core boards on the server are [OTA_1.zip, OTA_1.zip, OTA_2.zip, OTA_2.zip, OTA_3.zip, OTA_3.zip] respectively. Core board A performs firmware upgrade according to the upgrade data packet OTA_1.zip, core board B performs firmware upgrade according to the upgrade data packet OTA_1.zip, core board C performs firmware upgrade according to the upgrade data packet OTA_2.zip, core board D performs firmware upgrade according to the upgrade data packet OTA_2.zip, core board E performs firmware upgrade according to the upgrade data packet OTA_3.zip, and core board F performs firmware upgrade according to the upgrade data packet OTA_3.zip.

[0061] In the present embodiment, when BMC obtains the upgrade firmware file, it traverses each core board in turn, takes the traversed core board as the first core board, determines the target upgrade data packet corresponding to the firmware version type of the first core board, and performs firmware upgrade on the first core board according to the target upgrade data packet, wherein the upgrade firmware file includes multiple upgrade data packets, and the upgrade data packets corresponding to the different firmware version types of the core board are different. In this way, compared with the firmware upgrade method in which the user needs to manually select the upgrade data packet in the prior art, each core board performs firmware version upgrade according to the upgrade data packet selected by the user, the present application implements the different upgrade data packets corresponding to the different firmware version types of the core board by setting the firmware version type of each core board, and can automatically identify and select the corresponding target upgrade data packet according to the firmware version type of each core board, and each core board completes the firmware upgrade according to the selected target upgrade data packet, thereby, when there are differences between the firmware version types of multiple core boards on the server, the firmware upgrade efficiency of the server is improved.

[0062] In one possible implementation, please refer to Figure 2 , the step of determining the first firmware version type of the first core board includes:

[0063] Step S21, obtaining the status information of the first core board, wherein the status information is used to record the function type to which the first core board belongs, wherein the function type includes at least one of supporting charging function type, not supporting charging function type, supporting camera function type, and not supporting camera function type;

[0064] Wherein, the status information can be stored on the first core board device, for example, stored in an attribute or a database.It is understandable that each core board is each stored with corresponding status information, and the firmware version type of each core board can be determined according to the status information corresponding to each core board.Further, when the core board is turned on or started, the status information of the core board can be updated, or the status information of a core board can be regularly updated, or the status information update conditions of other core boards can be preset, and when the status information update conditions of the core board are reached, the status information of the core board is updated, such as the cumulative number of failures in the core board firmware upgrade process is greater than the preset error number threshold, then the status information of the core board is updated.In addition, the status information update conditions corresponding to each core board can be the same or different, and the present embodiment does not limit the status information update conditions.

[0065] The status information of the core board is used to record the function type to which the core board belongs, wherein the function type includes but is not limited to supporting charging function type (i.e. supporting Charger), not supporting charging function type (i.e. not supporting Charger), supporting camera function type, and not supporting camera function type.

[0066] Step S22: determining the firmware version type corresponding to the status information based on a preset mapping relationship, and using the firmware version type as the first firmware version type of the first core board.

[0067] The firmware version type of each core board is distinguished by the status information of each core board. Among them, the preset mapping relationship can be set in advance by the user, which includes the correspondence between different status information and firmware version types. For example, the support charging function type and the support camera function type are recorded as status information 1, the unsupported charging function type and the support camera function type are recorded as status information 2, the support charging function type and the unsupported camera function type are recorded as status information 3, and the unsupported charging function type and the unsupported camera function type are recorded as status information 4. The preset mapping relationship can refer to Table 1.

[0068] Status Information Firmware version type Status information 1 Firmware version type 1 Status information 2 Firmware version type 2 Status message 3 Firmware version type 3 Status message 4 Firmware version type 4

[0069] Table 1

[0070] In this embodiment, the core firmware version type is determined based on the status information of the core board, and different firmware version types are distinguished by different status information, so that the present application can effectively and accurately obtain the firmware version type of each core board, thereby ensuring that the firmware version type of each core board automatically identifies and selects the correct upgrade data package, thereby ensuring that each core board completes the firmware upgrade according to the correct upgrade data package.

[0071] In order to help understand the technical concept or technical principle of the present application, a specific embodiment is listed:

[0072] The upgrade process in this specific embodiment is:

[0073] Take the firmware version types that support Charger and the firmware version types that do not support Charger as examples to illustrate the triggering of OTA upgrade actions and the management of upgrade packages. BMC often repackages multiple upgrade data packages (with the extension zip) to obtain an upgrade firmware file (with the extension changed to img). Before executing the upgrade, it is restored to the state before packaging, that is, the upgrade firmware file is decompressed to obtain multiple upgrade data packages.

[0074] (1) The upgrade data packages corresponding to the two types of firmware versions are marked as OTA_Charger.zip and OTA_Non_Charger.zip respectively. Only one upgrade firmware file is provided to the user, so the two upgrade data packages are packaged into the same upgrade firmware file OTA.img.

[0075] (2) After the core board is started, the status information of whether the Charger is supported is saved to the core board device, for example, in an attribute or a database.

[0076] (3) When the BMC performs an OTA upgrade, for example, after OTA.img is checked on the BMC, the upgrade firmware file OTA.img is restored to multiple upgrade data packages in zip format, and two upgrade data packages OTA_Charger.zip and OTA_Non_Charger.zip are obtained by decompressing them.

[0077] (4) Before BMC pushes the OTA upgrade data package to the core board, it can use the adb (Android DebugBridge) command to obtain the status information of whether Charger is supported saved in step (2). If Charger is supported, OTA_Charger.zip is pushed to the core board to execute the upgrade process. If Charger is not supported, OTA_Non_Charger.zip is pushed to the core board to execute the upgrade process.

[0078] Embodiment 2

[0079] Based on the first embodiment of the present application, in another embodiment of the present application, the same or similar contents as those in the above-mentioned embodiment 1 can be referred to the above introduction, and will not be repeated later. On this basis, after the step of determining the target upgrade data packet corresponding to the first firmware version type according to each of the upgrade data packets, the method further includes:

[0080] Step A10, determining the upgrade package storage area corresponding to the first core board, and writing the target upgrade data packet into the upgrade package storage area;

[0081] In the present embodiment, the upgrade package storage area is a storage area for storing upgrade data packets. It may belong to a sub-partition of an independent partition of the first core board, wherein the independent partition is a public use partition of the core board, and the data of the independent partition needs to be loaded when the core board is powered on, and the data of the independent partition will not cause data loss due to restart.

[0082] In addition, if the first core board has AB partitions, that is, the first core board includes the first static partition and the second static partition, that is to say, the first static partition is one of the partitions of A partition and B partition, and the second static partition is another partition of A partition and B partition. The upgrade package storage area may belong to the sub-partition in the first static partition or the sub-partition of the second static partition. Of course, the upgrade package storage area may also belong to the sub-partition of the independent partition independent of the first static partition and the second static partition, wherein the independent partition is the public use partition of the core board, that is, when the core board is powered on, whether it is the data of the first static partition or the second static partition, it is also necessary to load the data of the independent partition, and the data of the independent partition will not cause data loss due to restarting.

[0083] Step A20: setting the attribute value of the upgrade identification status bit of the first core board to a first preset attribute value, wherein the upgrade identification status bit set to the first preset attribute value is used to identify that the first core board is to be upgraded in firmware.

[0084] In the present embodiment, the upgrade identification status bit of the core board can be used to indicate whether the current core board needs to perform a firmware version upgrade. It should be noted that when the attribute value of the upgrade identification status bit of the core board is set to the first preset attribute value, it can be used to identify that the first core board is to be upgraded to firmware, and it can also trigger the core board to retrieve the target upgrade data packet from the upgrade package storage area to perform the firmware upgrade of the core board to perform the firmware version, and upgrade the firmware version of the core board to the target firmware version. Wherein, the first preset attribute value, those skilled in the art can set it according to actual conditions, and the present embodiment is not specifically limited. In an example, the first preset attribute value can be 1.

[0085] Furthermore, it is also possible to detect whether the target upgrade data packet is successfully written to the upgrade package storage area. If the target upgrade data packet is successfully written to the upgrade package storage area, the attribute value of the upgrade identification status bit of the first core board is set to a first preset attribute value. Otherwise, a request to re-acquire the target upgrade data packet can be sent to resend the target upgrade data packet and write it to the upgrade package storage area until the target upgrade data packet is successfully written to the upgrade package storage area. If the cumulative number of write failures to write the target upgrade data packet is greater than the preset maximum number of write errors, an alarm prompt message can also be output.

[0086] In addition, if the first core board has AB partitions, during an OTA upgrade of the first core board, the two partitions of the first core board can be upgraded synchronously to keep the software and firmware versions of the two partitions of the core board consistent, thereby improving the firmware upgrade efficiency of the server and avoiding the situation where a working partition of the core board crashes and cannot be started after the OTA upgrade due to inconsistent software and firmware versions of the AB partitions, and the server with the backup partition enabled is incompatible with the client system of the user device and causes conflicts. This ensures that after the OTA upgrade, the server using AB partitions (i.e., the core board of the server has AB partitions) is compatible with the client system of the user device.

[0087] This embodiment first writes the target upgrade data packet to the upgrade package storage area of ​​the core board, and after the target upgrade data packet is completely written, sets the attribute value of the upgrade identification status bit of the core board to the first preset attribute value, wherein the upgrade identification status bit set to the first preset attribute is used to trigger the core board to retrieve the upgrade data packet from the upgrade package storage area to upgrade the firmware version, thereby avoiding the problem of the core board upgrading failing due to the phenomenon of packet loss (abnormal transmission of the upgrade data packet due to network instability and other reasons) caused by the firmware version upgrade of the core board being transmitted (i.e., transmitting the upgrade data packet to the core board) while upgrading (i.e., upgrading the firmware version of the core board), thereby enabling the embodiment of the present application to efficiently and stably upgrade the firmware version of the core board to the target firmware version.

[0088] Considering that when the core board of server is updated with firmware version, usually upgrade data packet is written into upgrade package storage area, and after the upgrade data packet is successfully written, the core board is controlled to perform firmware upgrade according to respective upgrade data packets. But if the remaining memory of upgrade package storage area is less than the size of upgrade data packet (i.e. the data packet length of upgrade data packet), it is impossible to write the upgrade data packet into the upgrade storage area at one time at this time, and it is often necessary to delete other files in the upgrade package storage area in the case of insufficient memory space in the upgrade package storage area and then upgrade or directly abandon the upgrade, and it is impossible to directly complete the firmware upgrade of the core board. Due to insufficient remaining memory space in the upgrade package storage area, it is impossible to write complete upgrade data packet into the upgrade package storage area, and the core board upgrade fails. Or it is necessary to release enough memory and rewrite the upgrade package storage area after deleting other files in the upgrade package storage area, complete the upgrade to the core board, and this upgrade mode also needs to wait for the release memory of the upgrade package storage area before the core board can be upgraded, and the upgrade efficiency is reduced.

[0089] Based on this, in an implementable manner, after determining the upgrade package storage area corresponding to the first core board, the method includes:

[0090] B10, determining the remaining memory of the upgrade package storage area and determining the data packet length of the target upgrade data packet;

[0091] B20, if the remaining memory is greater than or equal to the data packet length, executing the step of writing the target upgrade data packet into the upgrade packet storage area;

[0092] If the remaining memory in the upgrade package storage area is greater than or equal to the data packet length of the target upgrade data packet, step A10 is executed. At this time, the target upgrade data packet can be written into the upgrade package storage area at one time.

[0093] If the remaining memory in the upgrade package storage area is less than the data packet length of the target upgrade data packet, step B30 is executed.

[0094] B30, if the remaining memory is less than the data packet length, the target upgrade data packet is disassembled into multiple upgrade packages of preset length, and each of the upgrade packages is written to the upgrade package storage area in turn. Each time an upgrade package is written to the upgrade package storage area, the first core board is triggered to retrieve the upgrade package from the upgrade package storage area for firmware upgrade.

[0095] The length of the upgrade package formed by the disassembly can be set by the system developer, or it can be automatically adjusted by the server. For example, the data packet length of the complete target upgrade data packet is 1024M, and the complete target upgrade data packet can be disassembled into 4 upgrade packages with a length of 256M. For another example, the data packet length of the complete target upgrade data packet is 1024M, and the size of the remaining memory of the upgrade storage package is 100M. The server can disassemble the complete target upgrade data packet into 8 upgrade packages with a length of 128M according to the size of the remaining memory of the upgrade storage package. Of course, when disassembling the complete target upgrade data packet, the preset length of each upgrade package can be the same or different, that is, the length of the upgrade package obtained by disassembly can adopt a consistent length or an uneven length.

[0096] Furthermore, the upgrade packages that need to be written can be sorted according to the order of the upgrade content of each upgrade package. Each time an upgrade package is written to the upgrade package storage area, the core board is triggered to retrieve the data packet from the upgrade package storage area for firmware upgrade, and the next upgrade package is automatically written to the upgrade package storage area after the previous upgrade package is upgraded. After the previous upgrade package is upgraded, before writing the next upgrade package, the previous upgrade package in the upgrade package storage area can be deleted to free up storage space for the download of the next upgrade package, thereby ensuring that the upgrade proceeds normally.

[0097] In this embodiment, when the remaining memory in the upgrade package storage area is less than the data packet length of the target upgrade package data packet, the target upgrade package data packet is disassembled into multiple upgrade packages of preset length, and each of the upgrade packages is written to the upgrade package storage area in turn, and each time an upgrade package is written to the upgrade package storage area, the first core board is triggered to retrieve the upgrade package from the upgrade package storage area for firmware upgrade, and the firmware upgrade of the core board can be achieved without deleting other files in the upgrade package storage area, and the disassembly and upgrade process of the upgrade package is imperceptible to the user, thereby improving the user experience.

[0098] In a possible implementation, the step of triggering the first core board to retrieve the upgrade package from the upgrade package storage area to perform firmware upgrade includes:

[0099] Step C10, using the upgrade package written into the upgrade package storage area as the current upgrade package;

[0100] Step C20, triggering the first core board to retrieve the current upgrade package from the upgrade package storage area for firmware upgrade, and after receiving the upgrade completion confirmation information of the current upgrade package, determining the next upgrade package corresponding to the current upgrade package, writing the next upgrade package to the upgrade package storage area, and returning to execute the step of using the upgrade package written to the upgrade package storage area as the current upgrade package, until all the upgrade packages are written to the upgrade package storage area one by one.

[0101] In this embodiment, each time an upgrade package is written to the upgrade package storage area, the upgrade package written to the upgrade package storage area is used as the current upgrade package, triggering the first core board to retrieve the current upgrade package from the upgrade package storage area for firmware upgrade, and after the current upgrade package successfully completes the firmware upgrade, the core board can send an upgrade completion confirmation message to the BMC. After receiving the upgrade completion confirmation message sent by the current upgrade package, the BMC deletes the current upgrade package in the upgrade package storage area and writes the next upgrade package to the upgrade package storage area until all upgrade packages are written to the upgrade package storage area, thereby completing the firmware upgrade of the core board.

[0102] In this embodiment, each time an upgrade package is written to the upgrade package storage area, the upgrade package written to the upgrade package storage area is used as the current upgrade package, triggering the first core board to retrieve the current upgrade package from the upgrade package storage area for firmware upgrade, and after receiving the upgrade completion confirmation information of the current upgrade package, the next upgrade package is written to the upgrade package storage area, and the next upgrade package is written to the upgrade storage area only after confirming that the previous upgrade package has been successfully upgraded. In this way, it is ensured that the firmware upgrade of the core board is completed in sequence according to the writing order of the upgrade packages, and the core board successfully completes the firmware upgrade.

[0103] Embodiment 3

[0104] Based on the first embodiment and the second embodiment of the present application, in another embodiment of the present application, the same or similar content as the above-mentioned embodiment one or embodiment two can be referred to the above introduction, and no further description will be given later. On this basis, after the step of setting the attribute value of the upgrade identification status bit of the target core board to the first preset attribute value, the method further includes:

[0105] Step E10, if the working state of the first core board is idle, create an upgrade thread corresponding to the first core board, and based on the upgrade thread corresponding to the first core board, trigger the first core board to retrieve the target upgrade data packet from the upgrade package storage area to perform firmware upgrade;

[0106] As an example, the working state includes an idle state and an occupied state. The idle state refers to the state of the core board when there is no running task in the core board. At this time, if there is a running task in the first core board, the working state of the first core board is an occupied state; if there is no running task in the first core board, the working state of the first core board is an idle state.

[0107] As another example, a task tag can be inserted into the core board, which is used to record whether the core board is occupied, so that the idle state refers to the core board state when the task tag of the core board is not occupied. At this time, if the task tag in the first core board is occupied, the working state of the first core board is occupied; if the task tag in the first core board is not occupied, the working state of the first core board is idle. This example does not limit this.

[0108] It should be noted that the upgrade thread is used to control the core board to perform firmware upgrade.

[0109] In this embodiment, before the upgrade firmware data is retrieved from the storage area of ​​the core board upgrade package for firmware upgrade, it is ensured that the core board to be upgraded is in an idle state, and an upgrade process is created for it, so as to prevent the process of firmware upgrade from being affected by the running tasks in the core board, or the process of firmware upgrade from causing the current running tasks of the core board to be interrupted, so as to avoid process conflicts during the firmware upgrade process and improve the stability of the firmware upgrade.

[0110] Step E20, if a start upgrade signal for the first core board is received, interrupt the operation of the first core board, create an upgrade thread corresponding to the first core board, and based on the upgrade thread corresponding to the first core board, trigger the first core board to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade.

[0111] As an example, the start upgrade signal may be that the user needs to force the core board to perform a firmware upgrade, and a start upgrade signal to the core board is sent through a button on the corresponding function interface. As another example, when the server detects that the core board needs to be upgraded immediately, a start upgrade signal to the first core board is sent. This embodiment does not limit this.

[0112] It can also be a signal to interrupt the operation of the first core board. If the first core board feedback can interrupt the operation, the operation of the first core board is interrupted to create an upgrade thread corresponding to the first core board. Based on the upgrade thread corresponding to the first core board, the first core board is triggered to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade. If the first core board feedback cannot interrupt the operation, wait until the working state of the first core board is idle and execute step E10.

[0113] In this embodiment, before the upgrade firmware data is retrieved from the storage area of ​​the trigger core board upgrade package for firmware upgrade, a start upgrade signal for the first core board is received, the operation of the first core board is interrupted, and an upgrade process is created for it, so that in the scenario where the core board needs to be upgraded immediately, the operation of the core board can be interrupted by sending a start upgrade signal to upgrade it, thereby improving the flexibility of firmware upgrade.

[0114] In one possible implementation, refer to Figure 3 After the step of triggering the first core board to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade, the method further includes:

[0115] Step F10, detecting whether the firmware upgrade of the first core board is successful;

[0116] Step F20, if the firmware upgrade of the first core board is successful, setting the attribute value of the upgrade identification status bit of the first core board to a second preset attribute value, wherein the upgrade identification status bit set to the second preset attribute value is used to identify that the first core board has completed the firmware upgrade;

[0117] In the present embodiment, the upgrade identification status bit of the core board can be used to indicate whether the current core board needs to perform a firmware version upgrade. If the current firmware upgrade of the first core board is successful, the attribute value of the upgrade identification status bit of the first core board is set to the second preset attribute value, it should be noted that when the attribute value of the upgrade identification status bit of the core board is set to the second preset attribute value, it is explained that the core board does not need to perform a firmware upgrade. Wherein, the second preset attribute value, those skilled in the art can set it according to actual conditions, and the present embodiment is not specifically limited. In an example, the second preset attribute value can be 0.

[0118] Step F30, if the firmware upgrade of the first core board fails, the cumulative number of upgrade failures of the first core board is increased by one. If the cumulative number is less than the preset error number threshold, the step of upgrading the firmware of the first core board according to the target upgrade data packet is re-executed.

[0119] In this embodiment, the preset error number threshold value can be set by those skilled in the art according to actual conditions, and this embodiment does not make specific limitations. In one example, the preset error number threshold value is 3. If the firmware upgrade to the first core board fails this time, the cumulative number of upgrade failures of the first core board is increased by one, and the cumulative number is less than the preset error number threshold value, the firmware of the first core board can be upgraded again. If the firmware upgrade to the first core board is successful this time, the attribute value of the upgrade identification status bit of the first core board is set to the second preset attribute value, and the cumulative number of upgrade failures of the first core board is cleared.

[0120] Furthermore, if the cumulative number of upgrade failures of the first core board is greater than or equal to a preset error number threshold, that is, the first core board fails to upgrade for multiple consecutive times, it is judged as an upgrade abnormality, and then warning information of firmware upgrade failure can be reported.

[0121] This embodiment increases the cumulative number of upgrade failures of the first core board by one after determining that the current firmware upgrade of the first core board has failed, and resets the cumulative number of upgrade failures of the first core board to zero after determining that the second firmware version has been upgraded successfully. If it is identified that the statistical number is less than the preset error number threshold, the firmware upgrade is re-performed; if it is identified that the statistical number is greater than or equal to the preset error number threshold, a warning message of firmware upgrade failure is output, thereby avoiding repeated requests for re-upgrade of the first core board due to problems with the upgrade data packet itself, abnormalities in the core board itself, or network instability, and promptly reminding the staff that the first core board cannot be successfully upgraded, thereby further improving the robustness of the server's firmware upgrade method.

[0122] Embodiment 4

[0123] The embodiment of the present invention also provides a server firmware upgrade device, please refer to Figure 4 , the server includes a plurality of core boards, and the device includes:

[0124] An acquisition module 10 is used to acquire an upgrade firmware file, wherein the upgrade firmware file includes a plurality of upgrade data packets;

[0125] A determination module 20 is used to traverse each of the core boards in sequence, take the traversed core board as the first core board, and determine the first firmware version of the first core board;

[0126] The upgrade module 30 is used to determine the target upgrade data packet corresponding to the first firmware version based on each upgrade data packet, and perform firmware upgrade on the first core board based on the target upgrade data packet, wherein different firmware versions of the core board correspond to different upgrade data packets.

[0127] Optionally, the determining module 20 is further configured to:

[0128] Acquire status information of the first core board, wherein the status information is used to record the function type to which the first core board belongs, wherein the function type includes at least one of a charging support function type, a charging non-support function type, a camera support function type, and a camera non-support function type;

[0129] The firmware version type corresponding to the status information is determined based on a preset mapping relationship, and the firmware version type is used as the first firmware version type of the first core board.

[0130] Optionally, the device further comprises a writing module, wherein the writing module is configured to:

[0131] Determine the upgrade package storage area corresponding to the first core board, and write the target upgrade data packet into the upgrade package storage area;

[0132] The attribute value of the upgrade identification status bit of the first core board is set to a first preset attribute value, wherein the upgrade identification status bit set to the first preset attribute value is used to identify that the first core board is to be upgraded in firmware.

[0133] Optionally, the writing module is further used for:

[0134] Determine the remaining memory of the upgrade package storage area, and determine the data packet length of the target upgrade data packet;

[0135] If the remaining memory is greater than or equal to the data packet length, executing the step of writing the target upgrade data packet into the upgrade packet storage area;

[0136] If the remaining memory is less than the data packet length, the target upgrade data packet is disassembled into multiple upgrade packages of preset length, and each of the upgrade packages is written to the upgrade package storage area in turn. Each time an upgrade package is written to the upgrade package storage area, the first core board is triggered to retrieve the upgrade package from the upgrade package storage area for firmware upgrade.

[0137] Optionally, the writing module is further used for:

[0138] The upgrade package written into the upgrade package storage area is used as the current upgrade package;

[0139] Trigger the first core board to retrieve the current upgrade package from the upgrade package storage area for firmware upgrade, and after receiving the upgrade completion confirmation information of the current upgrade package, determine the next upgrade package corresponding to the current upgrade package, write the next upgrade package to the upgrade package storage area, and return to execute the step of using the upgrade package written to the upgrade package storage area as the current upgrade package, until all the upgrade packages are written to the upgrade package storage area one by one.

[0140] Optionally, the device further comprises a creation module, wherein the creation module is configured to:

[0141] If the working state of the first core board is an idle state, an upgrade thread corresponding to the first core board is created, and based on the upgrade thread corresponding to the first core board, the first core board is triggered to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade;

[0142] If a start upgrade signal for the first core board is received, the operation of the first core board is interrupted, an upgrade thread corresponding to the first core board is created, and based on the upgrade thread corresponding to the first core board, the first core board is triggered to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade.

[0143] Optionally, the device further comprises a detection module, wherein the detection module is configured to:

[0144] Detect whether the firmware upgrade of the first core board is successful;

[0145] If the firmware upgrade of the first core board is successful, the attribute value of the upgrade identification status bit of the first core board is set to a second preset attribute value, wherein the upgrade identification status bit set to the second preset attribute value is used to identify that the first core board has completed the firmware upgrade;

[0146] If the firmware upgrade of the first core board fails, the cumulative number of upgrade failures of the first core board is increased by one. If the cumulative number is less than the preset error number threshold, the step of upgrading the firmware of the first core board according to the target upgrade data packet is re-executed.

[0147] The server firmware upgrade device provided by the present invention adopts the server firmware upgrade method in the above-mentioned embodiment 1, embodiment 2 or embodiment 3, and can solve the technical problem of low efficiency of the server firmware upgrade when there are differences between the firmware version types of multiple core boards on the server. Compared with the prior art, the beneficial effects of the server firmware upgrade device provided by the embodiment of the present invention are the same as the beneficial effects of the server firmware upgrade method provided by the above-mentioned embodiment, and the other technical features in the server firmware upgrade device are the same as the features disclosed in the previous embodiment method, which will not be repeated here.

[0148] Embodiment 5

[0149] An embodiment of the present invention provides an electronic device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the firmware upgrade method of the server in the above-mentioned embodiment one.

[0150] Reference below Figure 5 , which shows a schematic diagram of the structure of an electronic device suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may be a BMC (Baseboard Management Controller) or the like. Figure 5 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0151] like Figure 5 As shown, the electronic device may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM 1002) or a program loaded from a storage device into a random access memory (RAM 1004). In RAM 1004, various programs and data required for the operation of the electronic device are also stored. The processing device 1001, ROM 1002, and RAM 1004 are connected to each other via a bus 1005. An input / output (I / O) interface is also connected to the bus 1005.

[0152] Typically, the following systems can be connected to the I / O interface 1006: input devices 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; output devices 1008 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 1003 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 1009. The communication device 1009 can allow the electronic device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows an electronic device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems may be implemented or have alternatively.

[0153] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0154] The electronic device provided by the present invention adopts the firmware upgrade method of the server in the above embodiment, which can solve the technical problem of low efficiency of the firmware upgrade of the server when there are differences between the firmware version types of multiple core boards on the server. Compared with the prior art, the beneficial effects of the electronic device provided by the embodiment of the present invention are the same as the beneficial effects of the firmware upgrade method of the server provided by the above embodiment, and other technical features in the electronic device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.

[0155] It should be understood that the various parts of the present disclosure can be implemented with hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.

[0156] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0157] Embodiment 6

[0158] An embodiment of the present invention provides a computer-readable storage medium having computer-readable program instructions stored thereon, and the computer-readable program instructions are used to execute the firmware upgrade method of the server in the above-mentioned embodiment 1.

[0159] The computer-readable storage medium provided in the embodiment of the present invention may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.

[0160] The computer-readable storage medium may be included in the electronic device, or may exist independently without being installed in the electronic device.

[0161] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by an electronic device, the electronic device: obtains an upgrade firmware file, wherein the upgrade firmware file includes multiple upgrade data packets; traverses each of the core boards in turn, takes the traversed core board as the first core board, and determines the first firmware version type of the first core board; determines a target upgrade data packet corresponding to the first firmware version type based on each of the upgrade data packets, and performs firmware upgrade on the first core board based on the target upgrade data packet, wherein different firmware version types of the core boards correspond to different upgrade data packets.

[0162] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).

[0163] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0164] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0165] The readable storage medium provided by the present invention is a computer-readable storage medium, which stores computer-readable program instructions for executing the firmware upgrade method of the above-mentioned server, and can solve the technical problem that after OTA upgrade, the server using AB partitions is easily incompatible with the client system of the user device. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the embodiment of the present invention are the same as the beneficial effects of the firmware upgrade method of the server provided in the above-mentioned embodiment 1 or embodiment 2, and will not be repeated here.

[0166] Embodiment 7

[0167] An embodiment of the present invention further provides a computer program product, including a computer program, wherein when the computer program is executed by a processor, the steps of the above-mentioned server firmware upgrade method are implemented.

[0168] The computer program product provided by the present application can solve the technical problem of low efficiency of firmware upgrade of the server when there are differences between the firmware version types of multiple core boards on the server. Compared with the prior art, the beneficial effects of the computer program product provided by the embodiment of the present invention are the same as the beneficial effects of the firmware upgrade method of the server provided by the above-mentioned embodiment 1 or embodiment 2, and will not be repeated here.

[0169] The above are only preferred embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.

Claims

1. A method for upgrading server firmware, characterized in that: The server includes a plurality of core boards, and the firmware upgrade method of the server includes: Acquire an upgrade firmware file, wherein the upgrade firmware file includes a plurality of upgrade data packets; Traversing each of the core boards in turn, taking the traversed core board as the first core board, and determining the first firmware version type of the first core board; A target upgrade data packet corresponding to the first firmware version type is determined according to each upgrade data packet, and the firmware of the first core board is upgraded according to the target upgrade data packet, wherein different firmware version types of the core board correspond to different upgrade data packets.

2. The server firmware upgrade method according to claim 1, characterized in that: The step of determining the first firmware version type of the first core board includes: Acquire status information of the first core board, wherein the status information includes recording a function type to which the first core board belongs, and the function type includes at least one of a charging support function type, a charging non-support function type, a camera support function type, and a camera non-support function type; The firmware version type corresponding to the status information is determined based on a preset mapping relationship, and the firmware version type is used as the first firmware version type of the first core board, wherein the preset mapping relationship includes a mapping relationship between the status information and the firmware version type.

3. The server firmware upgrade method according to claim 1, characterized in that: After the step of determining the target upgrade data packet corresponding to the first firmware version type according to each of the upgrade data packets, the method further includes: Determine the upgrade package storage area corresponding to the first core board, and write the target upgrade data packet into the upgrade package storage area; The attribute value of the upgrade identification status bit of the first core board is set to a first preset attribute value, wherein the upgrade identification status bit set to the first preset attribute value is used to identify that the first core board is to be upgraded in firmware.

4. The server firmware upgrade method according to claim 3, characterized in that: After determining the upgrade package storage area corresponding to the first core board, the method includes: Determine the remaining memory of the upgrade package storage area, and determine the data packet length of the target upgrade data packet; If the remaining memory is greater than or equal to the data packet length, executing the step of writing the target upgrade data packet into the upgrade packet storage area; If the remaining memory is less than the data packet length, the target upgrade data packet is disassembled into multiple upgrade packages of preset length, and each of the upgrade packages is written to the upgrade package storage area in turn. Each time an upgrade package is written to the upgrade package storage area, the first core board is triggered to retrieve the upgrade package from the upgrade package storage area for firmware upgrade.

5. The server firmware upgrade method according to claim 4, characterized in that: The step of triggering the first core board to retrieve the upgrade package from the upgrade package storage area to perform firmware upgrade includes: The upgrade package written into the upgrade package storage area is used as the current upgrade package; Trigger the first core board to retrieve the current upgrade package from the upgrade package storage area for firmware upgrade, and after receiving the upgrade completion confirmation information of the current upgrade package, determine the next upgrade package corresponding to the current upgrade package, write the next upgrade package to the upgrade package storage area, and return to execute the step of using the upgrade package written to the upgrade package storage area as the current upgrade package, until all the upgrade packages are written to the upgrade package storage area one by one.

6. The server firmware upgrade method according to claim 3, characterized in that: After the step of setting the attribute value of the upgrade identification status bit of the target core board to the first preset attribute value, the method further includes: If the working state of the first core board is an idle state, an upgrade thread corresponding to the first core board is created, and based on the upgrade thread corresponding to the first core board, the first core board is triggered to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade; If a start upgrade signal for the first core board is received, the operation of the first core board is interrupted, an upgrade thread corresponding to the first core board is created, and based on the upgrade thread corresponding to the first core board, the first core board is triggered to retrieve the target upgrade data packet from the upgrade package storage area for firmware upgrade.

7. The server firmware upgrade method according to claim 6, characterized in that: After the step of triggering the first core board to retrieve the target upgrade data packet from the upgrade package storage area to perform firmware upgrade, the method further includes: Detect whether the firmware upgrade of the first core board is successful; If the firmware upgrade of the first core board is successful, the attribute value of the upgrade identification status bit of the first core board is set to a second preset attribute value, wherein the upgrade identification status bit set to the second preset attribute value is used to identify that the first core board has completed the firmware upgrade; If the firmware upgrade of the first core board fails, the cumulative number of upgrade failures of the first core board is increased by one. If the cumulative number is less than the preset error number threshold, the step of upgrading the firmware of the first core board according to the target upgrade data packet is re-executed.

8. A server firmware upgrade device, characterized in that: The server includes a plurality of core boards, and the device includes: An acquisition module, used to acquire an upgrade firmware file, wherein the upgrade firmware file includes a plurality of upgrade data packets; A determination module, used for traversing each of the core boards in sequence, taking the traversed core board as the first core board, and determining a first firmware version of the first core board; An upgrade module is used to determine a target upgrade data packet corresponding to the first firmware version based on each upgrade data packet, and perform firmware upgrade on the first core board based on the target upgrade data packet, wherein different firmware versions of the core board correspond to different upgrade data packets.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the steps of the firmware upgrade method of the server according to any one of claims 1 to 7.

10. A readable storage medium, characterized in that: The readable storage medium is a computer-readable storage medium, on which is stored a program for implementing a firmware upgrade method for a server, and the program for implementing a firmware upgrade method for a server is executed by a processor to implement the steps of the firmware upgrade method for a server as described in any one of claims 1 to 7.