External plug-in card control method and device, computer equipment and storage medium

By storing firmware files in the mapping area of ​​the hardware device and mapping them to the memory resource area of ​​the extraneous card, the problem of device restart and flash memory withdrawal and burning caused by the firmware upgrade of the extraneous IO card is solved, and efficient firmware upgrade and device operation are achieved.

CN119739652AActive Publication Date: 2025-04-01INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

After the firmware of the external IO card is upgraded, the device restarts, the hot plugging function is low and the response is slow. The external card cannot be used after burning the invalid firmware. The flash memory needs to be removed for burning, which increases the equipment's operating efficiency, debugging difficulty and time cost.

Method used

By storing firmware files in the mapping area of ​​the hardware device and mapping them to the memory resource area of ​​the extrapolation card, verifying whether the extrapolation card matches the firmware file, and transferring the data of the firmware file to the memory resource area when matching, realizing unaware checksum data transfer, avoiding the steps of device restarting and flash memory withdrawal and burning.

Benefits of technology

The firmware upgrade of the external card is realized without the need for device restart and flash memory withdrawal, which reduces the upgrade time, improves the operating efficiency of the device, simplifies the debugging process and reduces the time cost.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119739652A_ABST
    Figure CN119739652A_ABST
Patent Text Reader

Abstract

The invention relates to an external plug-in card control method and device, computer equipment and a storage medium. According to the method, the firmware file is installed in the mapping area, the memory resource area is arranged in the external plug-in card, and the data of the firmware file in the mapping area is transmitted to the memory resource area when the external plug-in card is hotly plugged, so that the data of the firmware file can be acquired from the connected equipment by depending on the mapping relationship in the running process of the external plug-in card; when the external plug-in card firmware is upgraded, the external plug-in card firmware does not need to be flashed out and burnt, and the hot plug operation is realized without restarting the equipment, so that the upgrading time is shortened, and the equipment operation efficiency is improved.
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 one of the key infrastructures, carrying massive amounts of data and core business applications of enterprises. In order to ensure that the storage system can work efficiently and reliably, the storage is usually composed of multiple components, among which the external IO card (input and output card) is one of the most important components. The external IO card is responsible for managing the communication between the storage system and other hardware components (such as servers, disk arrays, network devices, etc.), so it plays a vital role in the data center. The basic function of the external IO card is to provide a data transmission channel for the storage device. In modern storage architecture, the external IO card is usually used to connect the server and the storage system. It is responsible for high-speed data reading and writing, network communication, error detection and correction, etc. There are different types of external IO cards, such as FC card, NVME card, SAS card, ETH network card, ACC card, etc. The external IO card is a bridge between the data center network, storage system and server. Its stability, performance and availability are directly related to the business stability and data security of the entire data center.

[0003] After the firmware of the current external IO card is upgraded, the entire device will be powered off and restarted to make the current firmware effective. At the same time, in the hot plug-in and hot expansion functions, when a new card is inserted, the firmware will be upgraded to the latest version, and the device will restart. If multiple types of external cards are upgraded, the startup time will be slower, the hot plug-in function will be inefficient, and the response will be slow. At the same time, after the invalid firmware is burned, the external card cannot be used, and the flash memory (flash) soldered on the external card needs to be removed and burned using a burner, which greatly increases the equipment operation efficiency, debugging difficulty and time cost. 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 equipment operating efficiency and the need to restart the equipment, which increases time.

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

[0006] In response to the hardware device detecting the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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 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;

[0009] Check whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

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

[0011] Setting a hardware device verification 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 according to 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 the same as 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, the 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] Locate the storage location of the firmware file in the mapping area of ​​the hardware device according to the loading address, and obtain the 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 to 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 the same as the firmware unique verification code;

[0028] In response to the target firmware verification code being the same as the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card runs successfully;

[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 also 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 also includes:

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

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

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

[0036] A firmware mapping management module, used for storing firmware files in the mapping area of ​​the hardware device, and mapping the firmware files in the mapping area to the memory resource area of ​​the external card;

[0037] a firmware matching management module, used for checking whether the external card matches the firmware file, and transferring 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;

[0038] The external card operation management module is used to verify whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

[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 the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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 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;

[0043] Check whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

[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 the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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 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;

[0048] Check whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

[0049] The above-mentioned external card control method, device, computer equipment and storage medium install the firmware file in the mapping area, set the 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, so that the data of the firmware file can be obtained from the connected device by relying on the mapping relationship during the operation of the external card, and when the external card firmware is upgraded, there is no need to remove the flash memory of the external card for burning, and there is no need to restart the device, so hot-swappable operation is achieved, which reduces the upgrade time and improves the operation efficiency of the device. 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 an external card control method in one embodiment of the present application;

[0052] Figure 2 This is a flow chart of an external card control method 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 solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present 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 of the external IO card may be damaged.

[0058] To solve the above problems, an embodiment of the present invention creatively proposes a method for controlling an external card. During the registration and loading process of the kernel-mode driver of the external card, a unique direct memory access memory pool (dma memory pool) memory resource is allocated to the external card in advance, and the firmware file data in the mapping area is transferred to the unique memory resource area. The firmware content is run directly from the software resources to achieve the availability and recoverability of the external card without manual intervention and restart. The ROM hardware stores the code required for the startup of the external card to ensure that the data is permanently retained and not lost even if the power is off.

[0059] The external card control method provided in this application can be applied to Figure 1 In the application environment shown, the plug-in card 102 communicates with the server 104 through a network. The server 104 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and may also be implemented using 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, and the method is applied to Figure 1 Taking the server 104 in the example as an example, the following steps are included:

[0061] Step S1, in response to the hardware device detecting the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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, checking whether the external card matches the firmware file, 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, and in response to the external card operating 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 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, it is achieved that during the operation of the external card, the data of the firmware file can be obtained from the connected server by relying on the mapping relationship, and 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-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 during power-on or hot-swap operation, 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, and the command set load file and execution file instructions can be customized at the same time, and controlled through mbox.

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

[0070] Setting a hardware device verification 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 according to 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 the same as 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] Among them, the external card is verified to be original through encryption and decryption. The virtual private database (VPD) of the external card records the key information of the hardware device. The system obtains the unique identification information of the hardware device from the virtual private database (VPD) and calculates the target verification code, and compares it with the hardware device verification code in the array field in the customized firmware. If they are the same, the non-perception verification passes. If they are different, it prompts that it is not an original external card. Please replace the original card or seek support from the supplier to ensure 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] Locate the storage location of the firmware file in the mapping area of ​​the hardware device according to the loading address, and obtain the 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, the step of determining whether the firmware file is successfully executed includes:

[0084] Run the firmware file to 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 the same as the firmware unique verification code;

[0086] In response to the target firmware verification code being the same as the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card runs successfully;

[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 is a problem with the firmware used, you can quickly switch to the backup firmware to achieve efficient and safe switching to make the external card normal. If the external card still does not work properly and the external card failure needs to be restored, it can also be restored in the above way. In this case, there is no need to use a burner, and the device can run without restarting.

[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, a firmware unique check code is stored in the first field, a hardware device check code is stored in the second field, a loading address is stored in the third field, an array length is stored in the fourth field, firmware version information is stored in the fifth field to the eighth field, integrated circuit classification device information supporting external cards is stored in the ninth field, and extended firmware attribute information is stored in the tenth field.

[0094] like Figure 3As shown, by customizing the firmware format, the data segment where the firmware data is located is placed in the unique memory space allocated by the external card. Based on 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, verifies the firmware based on the first 32-bit word checksum in the array field, and uses the EXEC_FIRMW ARE instruction to directly run the firmware, 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 realized, and the reliability of the external IO card is greatly optimized.

[0095] Get the size, permissions, modification time and other information of the custom firmware file / compass / firmware / xx.bin through stat, and map the firmware file to the memory based on the size. The permissions are PROT_READ for read-only and MAP_PRIVATE for private mapping, ensuring that the modification of the mapping area does 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 inmbox to detect the mbox status. If 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 the EXEC_FIRMWARE instruction is sent to the inmbox to detect the mbox status. If the outmbox returns COMMAND_COMPLETE, the firmware is successfully run and the external card is truly working.

[0098] When the firmware of the external card of the present invention is upgraded, the traditional firmware burning method is changed and replaced with a faster and safer solution. The present invention uses a software and hardware 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, and the device does not need to be restarted. Even if there is a problem with the source file, the hardware of the external card is still available, and it can be directly re-run through the software. Even if the power is off or interrupted unexpectedly, it can also recover by itself, which is safe and reliable. There is no risk of flash burning, no need for burner burning, low debugging cost, 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 through the software package.

[0102] Among them, the corresponding software package is obtained according to the function type of the port to which the external card is connected to install the corresponding firmware file, and different ports of the same external card are operated by software importing 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 must be protected, so that external cards with different functions can be adapted to install firmware with different functions.

[0103] Hot-swapping of external cards is only one of the usage scenarios. There is also the case where the external card is powered on normally and used to implement corresponding functions according to the burned firmware, and this situation accounts for the vast majority.

[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 data of the firmware file can be obtained from the connected device by relying on the mapping relationship during the operation of the external card, and 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-swappable 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 to obtain a memory resource area in the external card in response to the 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 in response to the external card matching the firmware file, transfer the data of the firmware file in the mapping area to the memory resource area.

[0109] The external card operation management module 4 is used to verify whether the external card matches the firmware file. In response to the external card matching the firmware file, the data of the firmware file in the mapping area is transferred to the memory resource area. In response to the normal operation of the external card, 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 verification 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 according to 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 the same as 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 used to prompt 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 detection module 5 .

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

[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] Locate the storage location of the firmware file in the mapping area of ​​the hardware device according to the loading address, and obtain the 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 the same as the firmware unique verification code;

[0128] In response to the target firmware verification code being the same as the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card runs successfully;

[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 loading 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 field to the eighth field, 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, setting the memory resource area in the external card, when the external card is hot-plugged, the data of the firmware file in the mapping area is transferred to the memory resource area, so that the data of the firmware file can be obtained from the connected device depending on the mapping relationship during the operation of the external card, and 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-swappable operation is achieved, which reduces the upgrade time and improves the operation efficiency of the device.

[0134] For the specific definition of the external card control device, please refer to the definition of the external card control method above, which will not be repeated here. Each module in the above-mentioned external card control device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[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 the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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 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;

[0139] Check whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

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

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

[0142] Setting a hardware device verification 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 according to 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 the same as 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 also 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] Locate the storage location of the firmware file in the mapping area of ​​the hardware device according to the loading address, and obtain the 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 also implemented:

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

[0157] Run the firmware file to 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 the same as the firmware unique verification code;

[0159] In response to the target firmware verification code being the same as the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card runs successfully;

[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 also 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 also implemented:

[0164] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, a firmware unique check code is stored in the first field, a hardware device check code is stored in the second field, a loading address is stored in the third field, an array length is stored in the fourth field, firmware version information is stored in the fifth field to the eighth field, integrated circuit classification device information supporting external cards is stored in the ninth field, and 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 limitations on the method for controlling the external card above, 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 through a system bus. Among them, 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 the 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 through a network connection. When the computer program is executed by the processor, an external card control method 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 those shown in the figure, or combine certain components, or have a different arrangement of components.

[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, wherein the processor implements the following steps when executing the computer program:

[0169] In response to the hardware device detecting the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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 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;

[0172] Check whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

[0173] In one embodiment, when the processor executes the computer program, the following steps are also implemented:

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

[0175] Setting a hardware device verification 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 according to 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 the same as 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 following steps are also implemented:

[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] Locate the storage location of the firmware file in the mapping area of ​​the hardware device according to the loading address, and obtain the 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 following steps are also implemented:

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

[0190] Run the firmware file to 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 the same as the firmware unique verification code;

[0192] In response to the target firmware verification code being the same as the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card runs successfully;

[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 following steps are also implemented:

[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 following steps are also implemented:

[0197] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, a firmware unique check code is stored in the first field, a hardware device check code is stored in the second field, a loading address is stored in the third field, an array length is stored in the fourth field, firmware version information is stored in the fifth field to the eighth field, integrated circuit classification device information supporting external cards is stored in the ninth field, and 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 limitations on the method for controlling the external card above, which will not be repeated here.

[0199] In one embodiment, 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:

[0200] In response to the hardware device detecting the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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 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;

[0203] Check whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

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

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

[0206] Setting a hardware device verification 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 according to 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 the same as 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 also 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] Locate the storage location of the firmware file in the mapping area of ​​the hardware device according to the loading address, and obtain the 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 also implemented:

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

[0221] Run the firmware file to 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 the same as the firmware unique verification code;

[0223] In response to the target firmware verification code being the same as the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card runs successfully;

[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 also 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 also implemented:

[0228] The configuration file array field in the firmware file is set to include multiple fields, each field includes a 32-bit word, a firmware unique check code is stored in the first field, a hardware device check code is stored in the second field, a loading address is stored in the third field, an array length is stored in the fourth field, firmware version information is stored in the fifth field to the eighth field, integrated circuit classification device information supporting external cards is stored in the ninth field, and 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 limitations on the method for controlling the external card above, which will not be repeated here.

[0230] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and 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. As an illustration and not limitation, RAM is available in many 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 may 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-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for controlling an external card, characterized in that: include: In response to the hardware device detecting the hot insertion of an external card, controlling the command set corresponding to the external card to run, and acquiring the 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 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; 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: The checking whether the external card matches the firmware file includes: Setting a hardware device verification 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 according to 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 the same as 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, characterized in that: 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, characterized in that: 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; Locate the storage location of the firmware file in the mapping area of ​​the hardware device according to the loading address, and obtain the 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 to 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 the same as the firmware unique verification code; In response to the target firmware verification code being the same as the firmware unique verification code, determining that the firmware corresponding to the memory resource area of ​​the external card runs successfully; 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 an abnormal operation of the external card, 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 is operating 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, a firmware unique check code is stored in the first field, a hardware device check code is stored in the second field, a loading address is stored in the third field, an array length is stored in the fourth field, firmware version information is stored in the fifth field to the eighth field, integrated circuit classification device information supporting external cards is stored in the ninth field, and extended firmware attribute information is stored in the tenth field.

8. An external card control device, characterized in that: The device comprises: The external card matching management module is used to control the execution of a command set corresponding to the external card and obtain a memory resource area in the external card in response to the hardware device detecting the hot insertion of the external card; A firmware mapping management module, used for storing firmware files in the mapping area of ​​the hardware device, and mapping the firmware files in the mapping area to the memory resource area of ​​the external card; a firmware matching management module, used for checking whether the external card matches the firmware file, and transferring 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; The external card operation management module is used to verify whether the external card matches the firmware file, 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, and release the data of the firmware file in the mapping area in response to the normal operation of the external card.

9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: 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

  • Apparatus and method for rebooting PC card when the firmware upgrade

    KR1020090011860A

  • Firmware upgrading method for an interface card

    US20090083725A1

  • Updating software in multiple adapter cards

    US20190163462A1