External card control method, device, computer equipment and storage medium

By allocating memory resource areas in the kernel-mode driver of the external card and mapping the firmware file with software, the restart and flash memory corruption problems caused by the external IO card firmware upgrade are solved, achieving efficient firmware upgrades and device operation.

CN119739652BActive Publication Date: 2025-09-26INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411894360.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-20
Publication Date
2025-09-26
Estimated Expiration
2044-12-20

AI Technical Summary

Technical Problem

After upgrading the firmware of the external IO card, the device restarts and the flash memory is damaged, affecting the device's operating efficiency. The hot-swap function is inefficient and cannot be quickly restored.

Method used

During the kernel-mode driver registration and loading process for the external card, a unique memory resource area is allocated in advance for the external card. The firmware file is mapped to the memory resource area through software, enabling firmware upgrades without restarting or burning.

Benefits of technology

This eliminates the need to restart the device or remove the flash memory for burning during the external card firmware upgrade process, improving device operating efficiency and reliability and reducing upgrade time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739652B_ABST
    Figure CN119739652B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment, and storage medium for controlling an external card. The present application installs a firmware file in a mapping area, sets a memory resource area in the external card, and transfers the data of the firmware file in the mapping area to the memory resource area when the external card is hot-plugged. This allows the external card to obtain the firmware file data from the connected device based on the mapping relationship during operation. This allows the external card to upgrade its firmware without removing its flash memory for burning or restarting the device, thus achieving hot-swappable operation, reducing upgrade time, and improving device operation efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of external plug-in cards, and in particular to an external plug-in card control method, device, computer equipment, and storage medium. Background Art

[0002] In large data centers, storage is a critical piece of infrastructure, carrying vast amounts of data and core enterprise applications. To ensure efficient and reliable storage systems, storage systems typically consist of multiple components, among which external I / O cards (I / O cards) are crucial. External I / O cards manage communication between the storage system and other hardware components (such as servers, disk arrays, and network devices), and therefore play a vital role in data centers. Their fundamental function is to provide a data transmission channel for storage devices. In modern storage architectures, external I / O cards are commonly used to connect servers and storage systems. They handle high-speed data read and write, network communication, and error detection and correction. There are various types of external I / O cards, including FC, NVMe, SAS, Ethernet, and Access Control. External I / O cards serve as the bridge between the data center network, storage system, and servers. Their stability, performance, and availability directly impact the overall data center's operational stability and data security.

[0003] After upgrading the firmware of an existing external IO card, the entire device will power off and restart for the current firmware to take effect. Furthermore, during hot-swapping and hot-expansion functions, when a new card is inserted, the firmware is upgraded to the latest version and the device restarts. Upgrading multiple external cards can result in slower boot times, lower hot-swapping efficiency, and slower response times. Furthermore, after programming invalid firmware, the external card becomes unusable, requiring the soldered flash memory to be removed and programmed using a programmer. This significantly increases device operating efficiency, debugging difficulty, and time costs. Summary of the Invention

[0004] Based on this, a method, device, computer equipment and storage medium for controlling an external card are provided to solve the technical problem that an external card cannot be used after an invalid firmware is burned after a firmware upgrade, and its flash memory needs to be removed and burned, resulting in low device operating efficiency and the need to restart the device, which increases time.

[0005] In one aspect, a method for controlling an external card is provided, the method comprising:

[0006] In response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card;

[0007] Storing a firmware file in a mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to a memory resource area of ​​the external card;

[0008] Verifying whether the external card matches the firmware file, and transferring data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file;

[0009] Detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully. In response to the firmware file running successfully, determine whether the external card is running normally. In response to the external card running normally, release the data of the firmware file in the mapping area.

[0010] In one embodiment, the checking whether the external card matches the firmware file includes:

[0011] Setting a hardware device check code in a configuration file array field in the firmware file;

[0012] Obtaining a hardware device unique identification information check value recorded in a virtual private database of the external card, calculating a target check code based on the hardware device unique identification information check value, and determining whether the target check code is the same as the hardware device check code;

[0013] In response to the target verification code being identical to the hardware device verification code, controlling the external card to pass the non-perception verification;

[0014] In response to the target verification code being different from the hardware device verification code, a non-original external card is prompted.

[0015] In one embodiment, the external card control method further includes:

[0016] In response to the fact that the external card does not match the firmware file, a reminder is given to replace the external card and the data of the firmware file in the mapping area is released.

[0017] In one embodiment, detecting whether the data of the firmware file corresponding to the memory resource area can be completely obtained includes:

[0018] Determining whether the external card successfully obtains the data of the firmware file;

[0019] In response to the external card failing to obtain the data of the firmware file, releasing the data of the firmware file in the mapping area;

[0020] In response to the external card successfully acquiring the data of the firmware file, acquiring the loading address and array length in the configuration file array field in the firmware file;

[0021] Locating a storage location of the firmware file in a mapping area of ​​the hardware device according to the loading address, and obtaining a data length of the firmware file corresponding to the storage location;

[0022] Determining whether the acquired data of the firmware file is complete according to the array length;

[0023] In response to the acquired data length of the firmware file being less than the array length, determining that the data of the firmware file is incomplete, and releasing the data of the firmware file in the mapping area;

[0024] In response to the acquired data length of the firmware file being equal to the array length, it is determined that the data of the firmware file is complete.

[0025] In one embodiment, determining whether the firmware file is successfully executed includes:

[0026] Run the firmware file and obtain a firmware unique verification code in a configuration file array field in the firmware file;

[0027] Obtaining a target firmware verification code recorded in a virtual private database of the external card, and determining whether the target firmware verification code is identical to the firmware unique verification code;

[0028] In response to the target firmware verification code being identical to the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card has been successfully executed;

[0029] In response to the target firmware verification code being different from the firmware unique verification code, it is determined that the firmware corresponding to the memory resource area of ​​the external card fails to run, and the data of the firmware file in the mapping area is released.

[0030] In one embodiment, it further includes:

[0031] In response to the external card operating abnormally, a backup firmware file is imported into the mapping area, the backup firmware file in the mapping area is mapped to the memory resource area, the data of the backup firmware file in the mapping area is transferred to the memory resource area, and it is determined again whether the external card operates normally.

[0032] In one embodiment, it further includes:

[0033] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, the firmware unique check code is stored in the first field, the hardware device check code is stored in the second field, the load address is stored in the third field, the array length is stored in the fourth field, the firmware version information is stored in the fifth to eighth fields, the integrated circuit classification device information supporting the external card is stored in the ninth field, and the extended firmware attribute information is stored in the tenth field.

[0034] On the other hand, a device for controlling an external card is provided, the device comprising:

[0035] an external card matching management module, configured to, in response to a hardware device detecting a hot-insertion of an external card, control the execution of a command set corresponding to the external card and obtain a memory resource area in the external card;

[0036] A firmware mapping management module, configured to store firmware files in a mapping area of ​​the hardware device and map the firmware files in the mapping area to a memory resource area of ​​the external card;

[0037] a firmware matching management module, configured to verify whether the external card matches the firmware file, and transfer data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file;

[0038] The external card operation management module is used to detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained, and in response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully, and in response to the firmware file running successfully, determine whether the external card is running normally, and in response to the external card running normally, release the data of the firmware file in the mapping area.

[0039] In another aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:

[0040] In response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card;

[0041] Storing a firmware file in a mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to a memory resource area of ​​the external card;

[0042] Verifying whether the external card matches the firmware file, and transferring data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file;

[0043] Detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully. In response to the firmware file running successfully, determine whether the external card is running normally. In response to the external card running normally, release the data of the firmware file in the mapping area.

[0044] In another aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0045] In response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card;

[0046] Storing a firmware file in a mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to a memory resource area of ​​the external card;

[0047] Verifying whether the external card matches the firmware file, and transferring data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file;

[0048] Detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully. In response to the firmware file running successfully, determine whether the external card is running normally. In response to the external card running normally, release the data of the firmware file in the mapping area.

[0049] The above-mentioned external card control method, device, computer equipment and storage medium install the firmware file in the mapping area, set up a memory resource area in the external card, and transfer the data of the firmware file in the mapping area to the memory resource area when the external card is hot-plugged. This allows the external card to obtain the data of the firmware file from the connected device based on the mapping relationship during operation. When the external card firmware is upgraded, there is no need to remove its flash memory for burning, nor is there a need to restart the device, thus achieving hot-swappable operation, reducing upgrade time and improving device operation efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of 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 creative work.

[0051] Figure 1 This is an application environment diagram of the external card control method in one embodiment of the present application;

[0052] Figure 2 This is a flow chart of a method for controlling an external card in one embodiment of the present application;

[0053] Figure 3 This is a logic diagram of an external card control method in one embodiment of the present application;

[0054] Figure 4 This is a structural block diagram of an external card control device in one embodiment of the present application;

[0055] Figure 5 This is a diagram of the internal structure of a computer device in one embodiment of the present application. DETAILED DESCRIPTION

[0056] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0057] As described in the background art, when the firmware of the external IO card is upgraded, the device may be restarted or the flash memory of the external IO card may be damaged.

[0058] To address the aforementioned issues, the present invention creatively proposes a method for controlling add-in cards. During the kernel-mode driver registration and loading process for the add-in card, a unique direct memory access (DMA) pool of memory resources is pre-allocated to the card, and the firmware file data in the mapped area is transferred to the unique memory resource area. By running the firmware content directly from software resources, the add-in card is made available and recoverable, eliminating the need for manual intervention or reboots. ROM hardware stores the code required for the card to boot, ensuring data is permanently retained, even in power outages.

[0059] The external card control method provided in this application can be applied to Figure 1 In the application environment shown, the external card 102 communicates with the server 104 via a network. The server 104 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. It can also be implemented as an independent server or a server cluster consisting of multiple servers.

[0060] In one embodiment, Figure 2 、 Figure 3 As shown, a method for controlling an external card is provided, which is applied to Figure 1Taking the server 104 in the example as an example, the following steps are included:

[0061] Step S1, in response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card;

[0062] Step S2, storing the firmware file in the mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to the memory resource area of ​​the external card;

[0063] Step S3, checking whether the external card matches the firmware file, and in response to the external card matching the firmware file, transferring the data of the firmware file in the mapping area to the memory resource area;

[0064] Step S4, detecting whether the data of the firmware file corresponding to the memory resource area can be completely obtained, and in response to the data of the firmware file being completely obtained, determining whether the firmware file is running successfully, and in response to the firmware file running successfully, determining whether the external card is running normally, and in response to the external card running normally, releasing the data of the firmware file in the mapping area.

[0065] Among them, by installing the firmware file in the mapping area, setting a memory resource area in the external card, and transferring the data of the firmware file in the mapping area to the memory resource area when the external card is hot-plugged, the external card can obtain the data of the firmware file from the connected server based on the mapping relationship during operation, and when the external card firmware is upgraded, there is no need to remove its flash memory for burning, nor is there a need to restart the device, so hot-swappable operation is achieved, which reduces the upgrade time and improves the equipment operation efficiency.

[0066] Among them, the external IO card is referred to as the external card, and the external card includes FC card, NVME card, SAS card, network card, ACC card, NTB card, etc.

[0067] When a new card is inserted into the external card while it is powered on or hot-swappable, the basic program required for startup is stored in the ROM of the server to which the external card is connected. When the external card is powered on, the basic functions of the card's command set are run.

[0068] Based on the original firmware data, the required firmware can be customized with one click through the software package. At the same time, the command set load file and execution file instructions are customized and controlled through mbox.

[0069] In this embodiment, the checking whether the external card matches the firmware file includes:

[0070] Setting a hardware device check code in a configuration file array field in the firmware file;

[0071] Obtaining a hardware device unique identification information check value recorded in a virtual private database of the external card, calculating a target check code based on the hardware device unique identification information check value, and determining whether the target check code is the same as the hardware device check code;

[0072] In response to the target verification code being identical to the hardware device verification code, controlling the external card to pass the non-perception verification;

[0073] In response to the target verification code being different from the hardware device verification code, a non-original external card is prompted.

[0074] The system verifies the authenticity of the external card through encryption and decryption. The card's Virtual Private Database (VPD) records key hardware device information. The system retrieves the hardware device's unique identification information from the VPD and calculates a target checksum. This checksum is then compared with the hardware device checksum in the array field in the custom firmware. If they match, the system passes the verification. If they differ, the system indicates that the card is not genuine and recommends replacing the original card or seeking support from the vendor. This ensures the adaptability and compatibility of the external card.

[0075] like Figure 3 As shown, in this embodiment, the detecting whether the data of the firmware file corresponding to the memory resource area can be completely obtained includes:

[0076] Determining whether the external card successfully obtains the data of the firmware file;

[0077] In response to the external card failing to obtain the data of the firmware file, releasing the data of the firmware file in the mapping area;

[0078] In response to the external card successfully acquiring the data of the firmware file, acquiring the loading address and array length in the configuration file array field in the firmware file;

[0079] Locating a storage location of the firmware file in a mapping area of ​​the hardware device according to the loading address, and obtaining a data length of the firmware file corresponding to the storage location;

[0080] Determining whether the acquired data of the firmware file is complete according to the array length;

[0081] In response to the acquired data length of the firmware file being less than the array length, determining that the data of the firmware file is incomplete, and releasing the data of the firmware file in the mapping area;

[0082] In response to the acquired data length of the firmware file being equal to the array length, it is determined that the data of the firmware file is complete.

[0083] like Figure 3 As shown, in this embodiment, determining whether the firmware file is successfully executed includes:

[0084] Run the firmware file and obtain a firmware unique verification code in a configuration file array field in the firmware file;

[0085] Obtaining a target firmware verification code recorded in a virtual private database of the external card, and determining whether the target firmware verification code is identical to the firmware unique verification code;

[0086] In response to the target firmware verification code being identical to the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card has been successfully executed;

[0087] In response to the target firmware verification code being different from the firmware unique verification code, it is determined that the firmware corresponding to the memory resource area of ​​the external card fails to run, and the data of the firmware file in the mapping area is released.

[0088] By releasing the data of the firmware file in the mapping area, the burden on the server can be reduced and the operating speed can be improved.

[0089] like Figure 3 As shown, in this embodiment, the method further includes:

[0090] In response to the external card operating abnormally, a backup firmware file is imported into the mapping area, the backup firmware file in the mapping area is mapped to the memory resource area, the data of the backup firmware file in the mapping area is transferred to the memory resource area, and it is determined again whether the external card operates normally.

[0091] If there's a problem with the current firmware, you can quickly switch to the backup firmware, achieving efficient and safe switching to restore the external card to normal operation. If the external card still doesn't work properly and needs to be restored, you can also use the above method to restore it. In this case, there's no need for a programmer or a device reboot to restore the device.

[0092] In this embodiment, the method further includes:

[0093] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, the firmware unique check code is stored in the first field, the hardware device check code is stored in the second field, the load address is stored in the third field, the array length is stored in the fourth field, the firmware version information is stored in the fifth to eighth fields, the integrated circuit classification device information supporting the external card is stored in the ninth field, and the extended firmware attribute information is stored in the tenth field.

[0094] like Figure 3 As shown, by customizing the firmware format, the data segment containing the firmware data is placed in the unique memory space allocated to the external card. Based on the information of the third 32-bit word risc addr (address) in the array field and the fourth 32-bit word risc_size in the array field, the external IO card obtains the firmware data through the LOAD_RSIC_RAM instruction. The firmware is verified based on the first 32-bit word checksum in the array field, and the firmware is directly run using the EXEC_FIRMW ARE instruction, and the external card works. At the same time, the unique information of the external card is customized to record the key information of the hardware device. When customizing the firmware, the value of the second 32-bit word in the array field is used to feedback the hardware device identification information checksum value to ensure the original external IO card, realize the encryption function of the external IO card, and ensure the quality and compatibility of the external IO card. Through the optimization of software and hardware, the security control and recovery of the external IO card are achieved, greatly optimizing the reliability of the external IO card.

[0095] Use stat to obtain the file size, permissions, modification time, and other information of the custom firmware file / compass / firmware / xx.bin. Based on the size, mmap the firmware file into memory. Set the permissions to PROT_READ for read-only and MAP_PRIVATE for private mapping to ensure that modifications to the mapped area do not affect the original file content.

[0096] Based on the information of the third 32-bit word risc addr (address) in the array field and the fourth 32-bit word risc_size in the array field, the LOAD_RSIC_RAM instruction is sent to the inmbox to detect the mbox status. If the outmbox returns COMMAND_COMPLETE, the external card successfully obtains the firmware data.

[0097] The firmware is verified based on the first 32-bit checksum in the array field and sent to the inmbox using the EXEC_FIRMWARE command to check the mbox status. If the outmbox returns COMMAND_COMPLETE, the firmware is running successfully and the add-in card is actually working.

[0098] When the external card firmware is upgraded, the traditional firmware burning method is changed and replaced with a faster and safer solution. The present invention uses a hardware and software customization method. On the basis of the basic functions of the program stored in ROM, the software package customizes the firmware with one click, maps the file to the memory, and imports it into the mapping area unique to the external card. The mbox instruction is operated to realize the rapid upgrade and replacement of the firmware without restarting the device. Even if there is a problem with the source file, the external card hardware is still available and can be directly re-run through the software. Even if the power is off or interrupted unexpectedly, it can also self-recover, which is safe and reliable. There is no risk of flash burning, no need for burner burning, low debugging cost, and saving testing and material costs.

[0099] It is understood that the method further comprises:

[0100] Detecting the functional type of the port, and obtaining the functional type of the port to which the external card is connected;

[0101] According to the function type of the port to which the external card is connected, a corresponding software package is obtained, and a firmware file is installed in the mapping area using the software package.

[0102] Among them, the corresponding software package is obtained according to the functional type of the port to which the external card is connected to install the corresponding firmware file. The same external card is operated on different ports through software import into the memory, and the same type of firmware with different functions is imported. The processing of controlling multiple functions and behaviors of different ports needs to be protected, so that external cards with different functions can be adapted to install firmware with different functions.

[0103] Hot-swapping an external card is only one of the usage scenarios. There is also the case where the external card is powered on normally and the corresponding functions are realized according to the burned firmware, which accounts for the vast majority of cases.

[0104] In the above-mentioned external card control method, by installing the firmware file in the mapping area, setting the memory resource area in the external card, and transferring the data of the firmware file in the mapping area to the memory resource area when the external card is hot-plugged, the external card can obtain the data of the firmware file from the connected device based on the mapping relationship during operation, and when the external card firmware is upgraded, there is no need to remove its flash memory for burning, nor is there a need to restart the device, so hot-plug operation is achieved, which reduces the upgrade time and improves the operation efficiency of the device.

[0105] In one embodiment, Figure 4 As shown, an external card control device 10 is provided, comprising: an external card matching management module 1, a firmware mapping management module 2, a firmware matching management module 3, and an external card operation management module 4.

[0106] The external card matching management module 1 is used for controlling the execution of a command set corresponding to the external card and acquiring a memory resource area in the external card in response to a hardware device detecting a hot-insertion of the external card.

[0107] The firmware mapping management module 2 is used to store firmware files in the mapping area of ​​the hardware device and map the firmware files in the mapping area to the memory resource area of ​​the external card.

[0108] The firmware matching management module 3 is used to check whether the external card matches the firmware file, and transfer the data of the firmware file in the mapping area to the memory resource area in response to the external card matching the firmware file.

[0109] The external card operation management module 4 is used to detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, it is judged whether the firmware file is running successfully. In response to the firmware file running successfully, it is judged whether the external card is running normally. In response to the external card running normally, the data of the firmware file in the mapping area is released.

[0110] In this embodiment, the checking whether the external card matches the firmware file includes:

[0111] Setting a hardware device check code in a configuration file array field in the firmware file;

[0112] Obtaining a hardware device unique identification information check value recorded in a virtual private database of the external card, calculating a target check code based on the hardware device unique identification information check value, and determining whether the target check code is the same as the hardware device check code;

[0113] In response to the target verification code being identical to the hardware device verification code, controlling the external card to pass the non-perception verification;

[0114] In response to the target verification code being different from the hardware device verification code, a non-original external card is prompted.

[0115] In this embodiment, the firmware matching management module 3 is configured to prompt a user to replace the external card and release the data of the firmware file in the mapping area in response to the external card not matching the firmware file.

[0116] In this embodiment, if Figure 4 As shown, the external card control device 10 further includes a firmware data acquisition and detection module 5 .

[0117] The firmware data acquisition and detection module 5 is used to:

[0118] Determining whether the external card successfully obtains the data of the firmware file;

[0119] In response to the external card failing to obtain the data of the firmware file, releasing the data of the firmware file in the mapping area;

[0120] In response to the external card successfully acquiring the data of the firmware file, acquiring the loading address and array length in the configuration file array field in the firmware file;

[0121] Locating a storage location of the firmware file in a mapping area of ​​the hardware device according to the loading address, and obtaining a data length of the firmware file corresponding to the storage location;

[0122] Determining whether the acquired data of the firmware file is complete according to the array length;

[0123] In response to the acquired data length of the firmware file being less than the array length, determining that the data of the firmware file is incomplete, and releasing the data of the firmware file in the mapping area;

[0124] In response to the acquired data length of the firmware file being equal to the array length, it is determined that the data of the firmware file is complete.

[0125] In this embodiment, if Figure 4 As shown, the external card control device 10 further includes a firmware operation detection module 6 .

[0126] The firmware running detection module 6 is used to: run the firmware file and obtain the firmware unique verification code in the configuration file array field in the firmware file;

[0127] Obtaining a target firmware verification code recorded in a virtual private database of the external card, and determining whether the target firmware verification code is identical to the firmware unique verification code;

[0128] In response to the target firmware verification code being identical to the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card has been successfully executed;

[0129] In response to the target firmware verification code being different from the firmware unique verification code, it is determined that the firmware corresponding to the memory resource area of ​​the external card fails to run, and the data of the firmware file in the mapping area is released.

[0130] In this embodiment, the external card operation management module 4 is used to: in response to an abnormal operation of the external card, import a backup firmware file in the mapping area, map the backup firmware file in the mapping area to the memory resource area, transfer the data of the backup firmware file in the mapping area to the memory resource area, and again determine whether the external card is operating normally.

[0131] In this embodiment, if Figure 4 As shown, the external card control device 10 further includes: a firmware file configuration field management module 7.

[0132] The firmware file configuration field management module 7 is used to set the configuration file array field in the firmware file to include multiple fields, each field includes a 32-bit word, the firmware unique check code is stored in the first field, the hardware device check code is stored in the second field, the load address is stored in the third field, the array length is stored in the fourth field, the firmware version information is stored in the fifth to eighth fields, the integrated circuit classification device information supporting the external card is stored in the ninth field, and the extended firmware attribute information is stored in the tenth field.

[0133] In the above-mentioned external card control device, by installing the firmware file in the mapping area and setting the memory resource area in the external card, the data of the firmware file in the mapping area is transferred to the memory resource area when the external card is hot-plugged, so that the data of the firmware file can be obtained from the connected device based on the mapping relationship during the operation of the external card. When the external card firmware is upgraded, there is no need to remove its flash memory for burning, and there is no need to restart the device, so hot-plug operation is achieved, which reduces the upgrade time and improves the operation efficiency of the device.

[0134] The specific definitions of the external card control device can be found in the definitions of the external card control method above and will not be repeated here. Each module in the external card control device described above can be implemented in whole or in part via software, hardware, or a combination thereof. Each of these modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a computer device memory in software form, allowing the processor to call and execute the corresponding operations of each module.

[0135] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:

[0136] In response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card;

[0137] Storing a firmware file in a mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to a memory resource area of ​​the external card;

[0138] Verifying whether the external card matches the firmware file, and transferring data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file;

[0139] Detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully. In response to the firmware file running successfully, determine whether the external card is running normally. In response to the external card running normally, release the data of the firmware file in the mapping area.

[0140] In one embodiment, the computer program further performs the following steps when executed by a processor:

[0141] Verifying whether the external card matches the firmware file includes:

[0142] Setting a hardware device check code in a configuration file array field in the firmware file;

[0143] Obtaining a hardware device unique identification information check value recorded in a virtual private database of the external card, calculating a target check code based on the hardware device unique identification information check value, and determining whether the target check code is the same as the hardware device check code;

[0144] In response to the target verification code being identical to the hardware device verification code, controlling the external card to pass the non-perception verification;

[0145] In response to the target verification code being different from the hardware device verification code, a non-original external card is prompted.

[0146] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0147] The detecting whether the data of the firmware file corresponding to the memory resource area can be completely obtained includes:

[0148] Determining whether the external card successfully obtains the data of the firmware file;

[0149] In response to the external card failing to obtain the data of the firmware file, releasing the data of the firmware file in the mapping area;

[0150] In response to the external card successfully acquiring the data of the firmware file, acquiring the loading address and array length in the configuration file array field in the firmware file;

[0151] Locating a storage location of the firmware file in a mapping area of ​​the hardware device according to the loading address, and obtaining a data length of the firmware file corresponding to the storage location;

[0152] Determining whether the acquired data of the firmware file is complete according to the array length;

[0153] In response to the acquired data length of the firmware file being less than the array length, determining that the data of the firmware file is incomplete, and releasing the data of the firmware file in the mapping area;

[0154] In response to the acquired data length of the firmware file being equal to the array length, it is determined that the data of the firmware file is complete.

[0155] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0156] Determining whether the firmware file is successfully executed includes:

[0157] Run the firmware file and obtain a firmware unique verification code in a configuration file array field in the firmware file;

[0158] Obtaining a target firmware verification code recorded in a virtual private database of the external card, and determining whether the target firmware verification code is identical to the firmware unique verification code;

[0159] In response to the target firmware verification code being identical to the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card has been successfully executed;

[0160] In response to the target firmware verification code being different from the firmware unique verification code, it is determined that the firmware corresponding to the memory resource area of ​​the external card fails to run, and the data of the firmware file in the mapping area is released.

[0161] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0162] In response to the external card operating abnormally, a backup firmware file is imported into the mapping area, the backup firmware file in the mapping area is mapped to the memory resource area, the data of the backup firmware file in the mapping area is transferred to the memory resource area, and it is determined again whether the external card operates normally.

[0163] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0164] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, the firmware unique check code is stored in the first field, the hardware device check code is stored in the second field, the load address is stored in the third field, the array length is stored in the fourth field, the firmware version information is stored in the fifth to eighth fields, the integrated circuit classification device information supporting the external card is stored in the ninth field, and the extended firmware attribute information is stored in the tenth field.

[0165] For specific limitations on the steps implemented when the computer program is executed by the processor, please refer to the above limitations on the method for controlling the external card, which will not be repeated here.

[0166] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5 As shown. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the computer device is used to store external card control data. The network interface of the computer device is used to communicate with an external external card via a network connection. When the computer program is executed by the processor, a method for controlling an external card is implemented.

[0167] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0168] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the following steps are performed:

[0169] In response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card;

[0170] Storing a firmware file in a mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to a memory resource area of ​​the external card;

[0171] Verifying whether the external card matches the firmware file, and transferring data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file;

[0172] Detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully. In response to the firmware file running successfully, determine whether the external card is running normally. In response to the external card running normally, release the data of the firmware file in the mapping area.

[0173] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0174] Verifying whether the external card matches the firmware file includes:

[0175] Setting a hardware device check code in a configuration file array field in the firmware file;

[0176] Obtaining a hardware device unique identification information check value recorded in a virtual private database of the external card, calculating a target check code based on the hardware device unique identification information check value, and determining whether the target check code is the same as the hardware device check code;

[0177] In response to the target verification code being identical to the hardware device verification code, controlling the external card to pass the non-perception verification;

[0178] In response to the target verification code being different from the hardware device verification code, a non-original external card is prompted.

[0179] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0180] The detecting whether the data of the firmware file corresponding to the memory resource area can be completely obtained includes:

[0181] Determining whether the external card successfully obtains the data of the firmware file;

[0182] In response to the external card failing to obtain the data of the firmware file, releasing the data of the firmware file in the mapping area;

[0183] In response to the external card successfully acquiring the data of the firmware file, acquiring the loading address and array length in the configuration file array field in the firmware file;

[0184] Locating a storage location of the firmware file in a mapping area of ​​the hardware device according to the loading address, and obtaining a data length of the firmware file corresponding to the storage location;

[0185] Determining whether the acquired data of the firmware file is complete according to the array length;

[0186] In response to the acquired data length of the firmware file being less than the array length, determining that the data of the firmware file is incomplete, and releasing the data of the firmware file in the mapping area;

[0187] In response to the acquired data length of the firmware file being equal to the array length, it is determined that the data of the firmware file is complete.

[0188] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0189] Determining whether the firmware file is successfully executed includes:

[0190] Run the firmware file and obtain a firmware unique verification code in a configuration file array field in the firmware file;

[0191] Obtaining a target firmware verification code recorded in a virtual private database of the external card, and determining whether the target firmware verification code is identical to the firmware unique verification code;

[0192] In response to the target firmware verification code being identical to the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card has been successfully executed;

[0193] In response to the target firmware verification code being different from the firmware unique verification code, it is determined that the firmware corresponding to the memory resource area of ​​the external card fails to run, and the data of the firmware file in the mapping area is released.

[0194] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0195] In response to the external card operating abnormally, a backup firmware file is imported into the mapping area, the backup firmware file in the mapping area is mapped to the memory resource area, the data of the backup firmware file in the mapping area is transferred to the memory resource area, and it is determined again whether the external card operates normally.

[0196] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0197] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, the firmware unique check code is stored in the first field, the hardware device check code is stored in the second field, the load address is stored in the third field, the array length is stored in the fourth field, the firmware version information is stored in the fifth to eighth fields, the integrated circuit classification device information supporting the external card is stored in the ninth field, and the extended firmware attribute information is stored in the tenth field.

[0198] For specific limitations on the steps implemented when the processor executes the computer program, please refer to the above limitations on the method for controlling the external card, which will not be repeated here.

[0199] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:

[0200] In response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card;

[0201] Storing a firmware file in a mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to a memory resource area of ​​the external card;

[0202] Verifying whether the external card matches the firmware file, and transferring data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file;

[0203] Detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully. In response to the firmware file running successfully, determine whether the external card is running normally. In response to the external card running normally, release the data of the firmware file in the mapping area.

[0204] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0205] Verifying whether the external card matches the firmware file includes:

[0206] Setting a hardware device check code in a configuration file array field in the firmware file;

[0207] Obtaining a hardware device unique identification information check value recorded in a virtual private database of the external card, calculating a target check code based on the hardware device unique identification information check value, and determining whether the target check code is the same as the hardware device check code;

[0208] In response to the target verification code being identical to the hardware device verification code, controlling the external card to pass the non-perception verification;

[0209] In response to the target verification code being different from the hardware device verification code, a non-original external card is prompted.

[0210] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0211] The detecting whether the data of the firmware file corresponding to the memory resource area can be completely obtained includes:

[0212] Determining whether the external card successfully obtains the data of the firmware file;

[0213] In response to the external card failing to obtain the data of the firmware file, releasing the data of the firmware file in the mapping area;

[0214] In response to the external card successfully acquiring the data of the firmware file, acquiring the loading address and array length in the configuration file array field in the firmware file;

[0215] Locating a storage location of the firmware file in a mapping area of ​​the hardware device according to the loading address, and obtaining a data length of the firmware file corresponding to the storage location;

[0216] Determining whether the acquired data of the firmware file is complete according to the array length;

[0217] In response to the acquired data length of the firmware file being less than the array length, determining that the data of the firmware file is incomplete, and releasing the data of the firmware file in the mapping area;

[0218] In response to the acquired data length of the firmware file being equal to the array length, it is determined that the data of the firmware file is complete.

[0219] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0220] Determining whether the firmware file is successfully executed includes:

[0221] Run the firmware file and obtain a firmware unique verification code in a configuration file array field in the firmware file;

[0222] Obtaining a target firmware verification code recorded in a virtual private database of the external card, and determining whether the target firmware verification code is identical to the firmware unique verification code;

[0223] In response to the target firmware verification code being identical to the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card has been successfully executed;

[0224] In response to the target firmware verification code being different from the firmware unique verification code, it is determined that the firmware corresponding to the memory resource area of ​​the external card fails to run, and the data of the firmware file in the mapping area is released.

[0225] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0226] In response to the external card operating abnormally, a backup firmware file is imported into the mapping area, the backup firmware file in the mapping area is mapped to the memory resource area, the data of the backup firmware file in the mapping area is transferred to the memory resource area, and it is determined again whether the external card operates normally.

[0227] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented:

[0228] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, the firmware unique check code is stored in the first field, the hardware device check code is stored in the second field, the load address is stored in the third field, the array length is stored in the fourth field, the firmware version information is stored in the fifth to eighth fields, the integrated circuit classification device information supporting the external card is stored in the ninth field, and the extended firmware attribute information is stored in the tenth field.

[0229] For specific limitations on the steps implemented when the computer program is executed by the processor, please refer to the above limitations on the method for controlling the external card, which will not be repeated here.

[0230] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0231] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0232] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art may make various modifications and improvements without departing from the scope of the present application, and such modifications and improvements are all within the scope of protection of the present application.

Claims

1. A method for controlling an external card, characterized in that: include: In response to the hardware device detecting that an external card is hot-plugged, controlling the execution of a command set corresponding to the external card to obtain a memory resource area in the external card; Storing a firmware file in a mapping area of ​​the hardware device, and mapping the firmware file in the mapping area to a memory resource area of ​​the external card; Verifying whether the external card matches the firmware file, and transferring data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file; Detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained. In response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully. In response to the firmware file running successfully, determine whether the external card is running normally. In response to the external card running normally, release the data of the firmware file in the mapping area.

2. The external card control method according to claim 1, characterized in that: Verifying whether the external card matches the firmware file includes: Setting a hardware device check code in a configuration file array field in the firmware file; Obtaining a hardware device unique identification information check value recorded in a virtual private database of the external card, calculating a target check code based on the hardware device unique identification information check value, and determining whether the target check code is the same as the hardware device check code; In response to the target verification code being identical to the hardware device verification code, controlling the external card to pass the non-perception verification; In response to the target verification code being different from the hardware device verification code, a non-original external card is prompted.

3. The external card control method according to claim 1, wherein: Also includes: In response to the fact that the external card does not match the firmware file, a reminder is given to replace the external card and the data of the firmware file in the mapping area is released.

4. The external card control method according to claim 1, wherein: The detecting whether the data of the firmware file corresponding to the memory resource area can be completely obtained includes: Determining whether the external card successfully obtains the data of the firmware file; In response to the external card failing to obtain the data of the firmware file, releasing the data of the firmware file in the mapping area; In response to the external card successfully acquiring the data of the firmware file, acquiring the loading address and array length in the configuration file array field in the firmware file; Locating a storage location of the firmware file in a mapping area of ​​the hardware device according to the loading address, and obtaining a data length of the firmware file corresponding to the storage location; Determining whether the acquired data of the firmware file is complete according to the array length; In response to the acquired data length of the firmware file being less than the array length, determining that the data of the firmware file is incomplete, and releasing the data of the firmware file in the mapping area; In response to the acquired data length of the firmware file being equal to the array length, it is determined that the data of the firmware file is complete.

5. The external card control method according to claim 1, characterized in that: Determining whether the firmware file is successfully executed includes: Run the firmware file and obtain a firmware unique verification code in a configuration file array field in the firmware file; Obtaining a target firmware verification code recorded in a virtual private database of the external card, and determining whether the target firmware verification code is identical to the firmware unique verification code; In response to the target firmware verification code being identical to the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card has been successfully executed; In response to the target firmware verification code being different from the firmware unique verification code, it is determined that the firmware corresponding to the memory resource area of ​​the external card fails to run, and the data of the firmware file in the mapping area is released.

6. The external card control method according to claim 1, characterized in that: Also includes: In response to the external card operating abnormally, a backup firmware file is imported into the mapping area, the backup firmware file in the mapping area is mapped to the memory resource area, the data of the backup firmware file in the mapping area is transferred to the memory resource area, and it is determined again whether the external card operates normally.

7. The external card control method according to claim 1, characterized in that: Also includes: The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, the firmware unique check code is stored in the first field, the hardware device check code is stored in the second field, the load address is stored in the third field, the array length is stored in the fourth field, the firmware version information is stored in the fifth to eighth fields, the integrated circuit classification device information supporting the external card is stored in the ninth field, and the extended firmware attribute information is stored in the tenth field.

8. An external card control device, characterized in that: The device comprises: an external card matching management module, configured to, in response to a hardware device detecting a hot-insertion of an external card, control the execution of a command set corresponding to the external card and obtain a memory resource area in the external card; A firmware mapping management module, configured to store firmware files in a mapping area of ​​the hardware device and map the firmware files in the mapping area to a memory resource area of ​​the external card; a firmware matching management module, configured to verify whether the external card matches the firmware file, and transfer data of the firmware file in the mapping area to the memory resource area in response to a match between the external card and the firmware file; The external card operation management module is used to detect whether the data of the firmware file corresponding to the memory resource area can be completely obtained, and in response to the data of the firmware file being completely obtained, determine whether the firmware file is running successfully, and in response to the firmware file running successfully, determine whether the external card is running normally, and in response to the external card running normally, release the data of the firmware file in the mapping area.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Network card firmware management method and device, medium and terminal

    CN118672615A

  • PXE starting method and device for unified extensible firmware interface, equipment and medium

    CN118819652A