Network card equipment hot plug control method and device, electronic equipment and storage medium
By building a mapping relationship between software switches and physical buttons, a multi-state linkage mechanism is generated, which solves the contradiction between ease of use and anti-miss touch during hot plugging of network card devices, and improves the safety, reliability and stability of the system.
Patent Information
- Application Number
- CN202510830701.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-20
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-20
AI Technical Summary
In the prior art, the contradiction between the ease of use of hot-swap physical buttons of network card devices and the prevention of accidental touch, as well as the potential security risks of pure software switches, have not been effectively solved.
By building mapping relationships, combining software switches and physical buttons, a multiple state linkage mechanism is generated to ensure that when the upper software switch is maliciously conquered or the physical buttons are misoperated, the power-off operation is not directly performed on the network card device.
It improves the safety and reliability of the system, avoids accidental power loss of network card equipment caused by accidental touch, and enhances the stability and security of the system.
Smart Images

Figure CN120342794A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technologies, and particularly to a method, device, electronic device, and storage medium for controlling hot plugging of network card devices. Background Art
[0002] The hot plugging function of a network card generally requires the use of a physical button. The main function of this button is to send a signal to the system through a hardware circuit to initiate the step-by-step power-off process of the network card power supply, ensuring that capacitor discharge and data link disconnection are completed before unplugging, and avoiding electrical surges or data damage. However, the physical button may be accidentally touched, resulting in accidental power-off of the network card. To prevent accidental touching of the physical button, related technologies achieve the anti-accidental-touch function through physical methods such as shortening the button or making the button concave. However, this method increases the operation difficulty of the operator in scenarios where the button needs to be operated normally. If the physical button is completely abandoned and only a software switch is used, there is a potential risk of being attacked by malicious software, which poses a serious threat to the security and stability of the system. Summary of the Invention
[0003] The present application provides a method, device, electronic device, and storage medium for controlling hot plugging of network card devices, so as to at least solve the contradiction between the usability and anti-accidental-touch of the hot plugging physical button in related technologies, as well as the potential security risk problem of a pure software switch.
[0004] The present application provides a method for controlling hot plugging of network card devices, including: Responding to a trigger instruction received by a first target hot plugging button, and obtaining an identifier of the first target hot plugging button; Based on a mapping relationship table and the identifier of the first target hot plugging button, determining operation permission information of the first target hot plugging button, where the mapping relationship table includes a mapping relationship generated based on the identifier of the hot plugging button and the operation permission information of the hot plugging button; Responding to the operation permission information of the first target hot plugging button being in an unlocked state, and performing a power-off operation according to the status information of the network card device corresponding to the first target hot plugging button, so as to perform a hot unplugging operation on the network card device.
[0005] The present application further provides a device for controlling hot plugging of network card devices, including: An obtaining module, configured to respond to a trigger instruction received by a first target hot plugging button, and obtain an identifier of the first target hot plugging button; A determining module, configured to determine operation permission information of the first target hot plugging button based on a mapping relationship table and the identifier of the first target hot plugging button, where the mapping relationship table includes a mapping relationship generated based on the identifier of the hot plugging button and the operation permission information of the hot plugging button; A hot-swap control module, which is configured to perform a power-down operation according to the status information of the network card device corresponding to the first target hot-swap button in response to the operation permission information of the first target hot-swap button being in an unlocked state, so as to perform a hot-removal operation on the network card device.
[0006] This application also provides an electronic device, including: a memory for storing a computer program; a processor for implementing the following steps of the network card device hot-swap control method when executing the computer program: In response to receiving a trigger instruction of the first target hot-swap button, obtain the identifier of the first target hot-swap button; Based on the mapping relationship table and the identifier of the first target hot-swap button, determine the operation permission information of the first target hot-swap button, where the mapping relationship table includes a mapping relationship generated based on the identifier of the hot-swap button and the operation permission information of the hot-swap button; In response to the operation permission information of the first target hot-swap button being in an unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot-swap button, so as to perform a hot-removal operation on the network card device.
[0007] This application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the following steps of the network card device hot-swap control method are implemented: In response to receiving a trigger instruction of the first target hot-swap button, obtain the identifier of the first target hot-swap button; Based on the mapping relationship table and the identifier of the first target hot-swap button, determine the operation permission information of the first target hot-swap button, where the mapping relationship table includes a mapping relationship generated based on the identifier of the hot-swap button and the operation permission information of the hot-swap button; In response to the operation permission information of the first target hot-swap button being in an unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot-swap button, so as to perform a hot-removal operation on the network card device.
[0008] This application also provides a computer program product, including a computer program. When the computer program is executed by a processor, the following steps of the network card device hot-swap control method are implemented: In response to receiving a trigger instruction of the first target hot-swap button, obtain the identifier of the first target hot-swap button; Based on the mapping relationship table and the identifier of the first target hot-swap button, determine the operation permission information of the first target hot-swap button, where the mapping relationship table includes a mapping relationship generated based on the identifier of the hot-swap button and the operation permission information of the hot-swap button; In response to the operation permission information of the first target hot-plug button being in the unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot-plug button, so as to perform a hot-removal operation on the network card device.
[0009] In this application, by constructing a mapping relationship and combining software switches and physical buttons, a hot-plug control mechanism for network card devices with a multi-state linkage mechanism is generated, so that in the case where the upper-layer software switch is maliciously compromised or the physical button is misoperated, a power-down operation is not directly performed on the network card device, improving the security and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] To more clearly illustrate the embodiments of this application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of this application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.
[0011] Figure 1 It is an application environment diagram of a method for controlling hot plugging of network card devices provided by an embodiment of this application; Figure 2 It is a schematic overall flow diagram of a method for controlling hot plugging of network card devices provided by an embodiment of this application; Figure 3 It is a schematic overall architecture diagram of an execution component of a method for controlling hot plugging of network card devices provided by an embodiment of this application; Figure 4 It is a schematic overall flow diagram of hot removal of a method for controlling hot plugging of network card devices provided by an embodiment of this application; Figure 5 It is a schematic overall flow diagram of hot insertion of a method for controlling hot plugging of network card devices provided by an embodiment of this application; Figure 6 It is a structural block diagram of a device for controlling hot plugging of network card devices provided by an embodiment of this application; Figure 7 It is an internal structure diagram of an electronic device in one embodiment. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0012] The following will clearly and completely describe the technical solutions in the embodiments of this application with reference to the drawings in the embodiments of this application. Obviously, the described embodiments are only some embodiments of this application, rather than all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of this application.
[0013] It should be noted that in the description of this application, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. The terms "first", "second", etc. in this application are used to distinguish similar objects, rather than to describe a specific order or sequence.
[0014] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing steps, and do not particularly refer to the meaning of order or sequence, nor are they used to limit this application. They are only used to conveniently describe the method of this application and should not be construed as indicating the order of steps. In addition, the technical solutions between various embodiments can be combined with each other, but it must be based on the ability of those of ordinary skill in the art to implement. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0015] Hot plugging of network card devices is a function that allows the replacement or addition of network card devices without shutting down the server power during the operation of the server. This feature can greatly improve the availability, maintenance efficiency, and system flexibility of the server. For example, when a network card device fails or the network requirements change, the administrator can replace the faulty network card device without shutting down the server or flexibly add or remove network card devices according to the changed network requirements, which not only simplifies the maintenance work but also reduces the losses caused by downtime. The hot plugging function of network card devices is widely used in server environments that require high availability, flexibility, and easy maintenance, such as data centers, cloud computing platforms, and high-performance computing clusters. In these scenarios, the hot plugging function can ensure that the server can quickly resume operation in case of network failures or network upgrades, thus meeting the requirements of business continuity. In the related art, the implementation method of the hot plugging function of network card devices is generally notification-based hot plugging with a hot plugging button, that is, first perform hot plugging pre-preparation through the button, and then perform the plugging and unplugging actions. Therefore, there is a risk of accidental button touch. According to the background technology, there is no good method in the related art to solve the contradiction between the usability and anti-accidental touch of the hot plugging physical button, as well as the potential security risk problem of the pure software switch.
[0016] To solve the above technical problems, this application provides a method, device, electronic device, and storage medium for controlling the hot plugging of network card devices. By constructing a mapping relationship and combining software switches and physical buttons, a hot plugging control mechanism for network card devices with a multi-state linkage mechanism is generated, so that when the upper-layer software switch is maliciously cracked or the physical button is misoperated, the power-down operation will not be directly performed on the network card device, improving the security and reliability of the system.
[0017] To enable those skilled in the art of the present technology to better understand the solution of this application, the following provides a further detailed description of this application in conjunction with the accompanying drawings and specific embodiments.
[0018] The method for controlling hot plugging of network card devices provided by this application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the data processing platform set on the server 104 through the network. Among them, the terminal 102 can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0019] As Figure 2 shown, the embodiments of this application provide a method for controlling hot plugging of network card devices. Taking the terminal in Figure 1 as an example for description, it includes the following steps: S1: In response to receiving a trigger instruction of the first target hot plug button, obtain the identifier of the first target hot plug button.
[0020] It should be noted that the first target hot plug button is a physical button; the trigger instruction can be generated when the user presses the physical button; the identifier of the first target hot plug button is used to identify the specific hot plug button, and it is displayed on the user interface.
[0021] S2: Based on the mapping relation table and the identifier of the first target hot plug button, determine the operation permission information of the first target hot plug button, where the mapping relation table includes a mapping relation generated based on the identifier of the hot plug button and the operation permission information of the hot plug button.
[0022] It should be noted that multiple mapping relations are stored in the mapping relation table. Each mapping relation is used to describe the association relationship between the software application and the physical button. One software application corresponds to one physical button; the operation permission information of the hot plug button includes a locked state and an unlocked state. When the hot plug button is in the locked state, it means there is no permission to operate the corresponding hot plug button. When the hot plug button is in the unlocked state, it means there is permission to operate the corresponding hot plug button. When there is permission, pressing the hot plug button can perform a power-off operation.
[0023] S3: In response to the operation permission information of the first target hot plug button being in the unlocked state, perform a power-off operation according to the status information of the network card device corresponding to the first target hot plug button, so as to perform a hot unplug operation on the network card device.
[0024] It should be noted that the network card device can be an OCP 3.0 network card, etc.; the status information of the network card device includes the presence status and the power-on status. Among them, the presence status refers to whether the network card device is still in the card slot. If it is present, it means the network card device is in the card slot; if it is not present, it means the network card device is not in the card slot. The power-on status refers to determining whether the network card device has been powered on and is in a working preparation state or a working state. If it is in the power-on status, it means the network card device has been powered on and is in a working preparation state or a working state. If it is not in the power-on status, it means the network card device has not been powered on and is not in a working preparation state or a working state. When the network card device is in the power-on status and the presence status, a power-off operation is performed, and after the power-off operation, a hot plug operation is performed on the network card device.
[0025] Among them, as Figure 3 shown, the user interface is provided by the upper-layer software control unit, which also provides an upper-layer API interface for configuring the hot plug button operation permission. When the hot plug button operation permission changes, the permission information is transmitted to the middle firmware logic unit. The middle firmware logic unit is used to receive and parse the permission change instruction information sent by the upper-layer software control unit, feedback the received signal to maintain data consistency, and is also used to monitor the operation status of the hardware physical button. When the button is triggered, it decides whether to perform a power-off operation on the network card device according to the button operation permission. It is further used to control the hardware power-on and power-off logic, control the hardware LED light status logic, and save the hot plug button operation permission information, save the device presence and power-off status information. The power-on and power-off logic is controlled by the bottom-layer hardware execution unit. The circuit design of the bottom-layer hardware execution unit controls the level conversion during the hot plug button operation, transmits the signal to the middle firmware logic unit, controls the on and off of the device power supply according to the signal sent by the firmware logic unit, controls the on, off, and flash status of the LED light according to the signal sent by the firmware logic unit, and controls the level conversion of the network card device presence pin, transmits the signal to the key firmware logic unit. Specifically, the upper-layer software application can be implemented by BMC (Baseboard Management Controller), and the middle logic control unit can be implemented by MCU (Microcontroller Unit) or CPLD (Complex Programmable Logic Device). BMC can perform two-way information interaction with MCU or CPLD through the I2C (Serial Bus) link, and control the locking state of the hot plug physical button through the ipmi interface (Intelligent Platform Management Interface) / restful interface (Web Service Interface) / redfish interface (Remote Management and Monitoring Interface) / user interface of BMC. The default is the locked mode, that is, the hot plug physical button is in the invalid mode.
[0026] In the above embodiment, by constructing a mapping relationship, the software switch and the physical button are combined to generate a hot-plug control mechanism for the network card device with a multi-state linkage mechanism, so that in the case where the upper-layer software switch is maliciously cracked or the physical button is misoperated, the network card device will not be directly powered off, improving the security and reliability of the system.
[0027] In some specific embodiments, the method for generating the mapping relationship table includes: Obtain the identifiers of multiple hot-plug buttons, and respectively configure operation permission information for the multiple hot-plug buttons, where the operation permission information includes a locked state and an unlocked state; Based on the identifier and the operation permission information corresponding to the second target hot-plug button, generate a mapping relationship, that is, establish a mapping relationship between the physical button and the corresponding software application; Save multiple mapping relationships into a mapping table to generate a first mapping relationship table, where the operation permission information in the first mapping relationship table is generally set to the locked state, that is, the initial state of the physical button is generally the locked state; In response to receiving an operation permission information update request, update and save the operation permission information corresponding to the operation permission information update request to generate a second mapping relationship table, that is, when the user operates the corresponding software application button on the user interface or the program controls the click of the corresponding software application button, an operation permission information update request is generated, and the operation permission information corresponding to the operation permission information update request is updated, such as updating the locked state to the unlocked state.
[0028] In the above embodiment, a multi-level security protection linkage mechanism is implemented by establishing a state mapping relationship between the software switch and the hardware physical button to solve the contradiction between the usability of the hot-plug physical button and anti-misoperation, as well as the potential security risk problem of the pure software switch, thereby improving the security and reliability of the system.
[0029] In some specific embodiments, determining the operation permission information of the first target hot-plug button based on the mapping relationship table and the identifier of the first target hot-plug button includes: In response to receiving the identifier of the first target hot-plug button, obtain the update information of the first mapping relationship table; Based on the update information of the first mapping relationship table, determine whether the first mapping relationship table has been updated, that is, determine whether the software application has been clicked; In response to the first mapping relationship table having been updated, obtain the second mapping relationship table; Extract multiple mapping relationships in the second mapping relationship table, and match the identifier of the first target hot-plug button with the multiple mapping relationships in the second mapping relationship table; In response to a successful match, determine the operation permission information corresponding to the identifier of the first target hot-plug button as the operation permission information of the first target hot-plug button. If the match is unsuccessful, it means that the first target hot-plug button has not established a mapping relationship. At this time, the corresponding mapping relationship can be established according to the above mapping relationship table construction method; In response to the first mapping relationship table not being updated, obtain the first mapping relationship table; Extract multiple mapping relationships from the first mapping relationship table, and match the identifier of the first target hot-plug button with the multiple mapping relationships in the first mapping relationship table; In response to a successful match, determine the operation permission information corresponding to the identifier of the first target hot-plug button as the operation permission information of the first target hot-plug button.
[0030] In the above embodiment, by determining the operation permission information of the first target hot-plug button to determine whether the first target hot-plug button is operable. When it is operable and the first target hot-plug button is pressed, the power-down operation can be performed on the network card device, avoiding the situation of accidental touch and improving the reliability of the system.
[0031] In some specific embodiments, as Figure 4 shown, after determining the operation permission information of the first target hot-plug button, the method further includes: Determine whether the operation permission information of the first target hot-plug button is in a locked state, that is, when the first target hot-plug button is pressed, transmit the electrical signal change of the button to the MCU, and obtain the operation permission information of the first target hot-plug button through the MCU; In response to the operation permission information of the first target hot-plug button being in a locked state, that is, there is no operation permission for the first target hot-plug button, send a first prompt message, where the first prompt message is used to indicate that there is no permission to operate the button currently, such as indicating that there is no permission to operate the button currently through an indicator light; In response to the operation permission information of the first target hot-plug button being in an unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot-plug button to perform a hot plug-out operation on the network card device.
[0032] In the above embodiment, by judging the operation permission information, when there is no permission, a prompt message is sent to ensure that the user can receive the current operation permission information in time and determine the corresponding solution in time. When there is permission, a power-down operation is performed on the network card device corresponding to the hot-plug button to avoid the problem that the network card device is accidentally powered down due to accidental touch, further improving the safety and reliability of the system.
[0033] In some specific embodiments, in response to the operation permission information of the first target hot-plug button being in an unlocked state, according to the status information of the network card device corresponding to the first target hot-plug button, performing a power-off operation to perform a hot-remove operation on the network card device includes: In response to the operation permission information of the first target hot-plug button being in an unlocked state, obtaining the status information of the network card device corresponding to the first target hot-plug button; In response to the status information of the network card device being in the inserted state and in the powered-on state, sending a first power-off prompt message and performing a power-off operation, wherein the powered-on state is obtained by the MCU, and the first power-off prompt message is used to indicate that the network card device is being powered off, such as controlling an indicator light by the MCU to indicate that the network card device is being powered off. If the status information of the network card device is not in the inserted state, the process ends. If the status information of the network card device is in the inserted state and not in the powered-on state, the MCU controls the indicator light to indicate that the network card device is in the powered-off state and performs a hot-remove operation; In response to the completion of the power-off operation, sending a second power-off prompt message and performing a hot-remove operation on the network card device, wherein the second power-off prompt message is used to indicate that the network card device is in the powered-off state, such as controlling an indicator light by the MCU to indicate that the network card device is in the powered-off state. The hot-remove operation can be manually pulling out the network card device or automatically ejecting the network card device through a set device, etc.; In response to the completion of the hot-remove operation, updating the on-site state value of the network card device, and based on the update result of the on-site state value, sending a second prompt message, where the second prompt message is used to describe that the network card device is not in the inserted state, such as controlling the indicator light to go out by the MCU to indicate that the network card device is not in the inserted state, that is, when the MCU obtains that the on-site signal of the network card device changes, the MCU switches the on-site state value of the network card device and turns off the indicator light.
[0034] In some specific embodiments, after performing a hot-remove operation on the network card device, the method further includes: Updating the operation permission information of the first target hot-plug button corresponding to the network card device to the locked state, that is, after the hot-remove operation is completed, restoring the locked state of the hot-plug physical button through the above-mentioned user interface.
[0035] In the above embodiment, when the server is powered on and it is desired to hot-plug a network card device, first, unlock the hot-plug physical button through the above user interface, and then operate the physical button. The network card device will enter the power-down process, and the indicator light can indicate the power-down process and the power-down result. After the indicator light indicates that the power-down of the network card device is successful, this network card device can be unplugged. If the hot-plug physical button is not unlocked through the above interface first and the physical button is directly operated, the indicator light indicates that there is no permission to operate the physical button currently. After the device is unplugged, the hot-plug physical button can be immediately locked through the above user interface to avoid accidental power-down of the network card device caused by accidental touch of the physical button. When batch hot maintenance of network card devices is required, the hot-plug physical button locking state can be batch-unlocked / restored through the above interface, thereby preventing accidental power-down of devices that do not require hot maintenance during batch operations and improving the security and reliability of the system.
[0036] In some specific embodiments, the method further includes: Obtain the unlocking duration of the hot-plug button within multiple time periods, calculate and determine the average value of the unlocking duration of the hot-plug button corresponding to the same time period within multiple time periods, and obtain the occurrence times of the time periods corresponding to the duration greater than the average value. The time period can be set according to actual needs, such as one month, etc., and the time period can also be set according to actual needs, such as one day, etc.; In response to the occurrence times being greater than a preset threshold, obtain the maximum duration, and take the median of the maximum duration and the average value of the duration as the standard duration; In response to the occurrence times being less than or equal to the preset threshold, define the average value of the duration as the standard duration, where the size of the preset threshold can be set according to actual needs; When the hot-plug button is unlocked, obtain its specific unlocking duration, and compare the unlocking duration with the standard duration; In response to the unlocking duration being greater than the standard duration, send an alarm message through BMC to prompt the technician to promptly restore the hot-plug button to the locked state or check for system vulnerabilities.
[0037] In the above embodiment, by limiting the unlocking duration of the hot-plug button, the situation of accidental touch caused by the hot-plug button being in the unlocked state for a long time is avoided, and the security and reliability of the system are further improved.
[0038] In some specific embodiments, as Figure 5 shown, the method further includes: In response to receiving the presence signal of the network card device, determine whether the presence signal is stable; In response to the stable presence signal, update the presence status value of the network card device, and send a first power-on prompt message to perform a power-on operation on the network card device. The first power-on prompt message is used to describe that the network card device is being powered on, for example, the MCU controls the indicator light to indicate that the network card device is being powered on; In response to the successful execution of the power-on operation, send a second power-on prompt message. The second power-on prompt message is used to describe that the network card device has been successfully powered on, for example, the MCU controls the indicator light to turn off; In response to the failure of the power-on operation, send a third power-on prompt message and perform a hot plug-out operation on the network card device. The third power-on prompt message is used to describe that the network card device is in a powered-off state, for example, the MCU controls the indicator light to indicate that the current network card device is in a powered-off state. At this time, the network card device is in an abnormal state and the abnormal network card device needs to be removed; In response to the completion of the hot plug-out operation, update the presence status value of the network card device. Based on the update result of the presence status value, send a second prompt message, that is, the network card device is not in the presence state, the MCU switches the change of the presence signal of the network card device, and the indicator light turns off.
[0039] In the above embodiment, when performing a hot insertion on the network card device, the MCU judges the stability of the presence signal and the power-on state to judge the execution result of the hot insertion operation, and displays the hot insertion operation process and result, thereby improving the safety and stability of the hot insertion operation execution and improving the system performance.
[0040] In the above method for controlling hot plugging of network card devices, the method includes: in response to receiving a trigger instruction of a first target hot plugging button, obtaining an identifier of the first target hot plugging button; based on a mapping relationship table and the identifier of the first target hot plugging button, determining operation permission information of the first target hot plugging button, where the mapping relationship table includes a mapping relationship generated based on the identifier of the hot plugging button and the operation permission information of the hot plugging button; in response to the operation permission information of the first target hot plugging button being in an unlocked state, performing a power-down operation according to the status information of the network card device corresponding to the first target hot plugging button, so as to perform a hot unplugging operation on the network card device. In this application, by constructing a mapping relationship between a software switch and a physical button, and the software switch defaults that the physical button is in a locked state, the problem of reduced safety and reliability caused by accidental touch is avoided. In addition, the upper-layer software control unit can be implemented through BMC, and the middle firmware logic unit can be implemented through MCU / CPLD. Only a little modification needs to be made on the link, and the cost is relatively low. Further, by combining the software switch and the physical button, this application realizes a multi-state linkage mechanism. If the upper-layer software switch is cracked, it will not directly power down the network card device, reducing the harm of being cracked. The upper-layer software switch is default closed. When hot maintenance is required, the switch is opened, and after the operation is completed, the switch is closed. Then the physical button remains in a locked state, and accidentally touching the button will not power down the network card device, increasing the safety and reliability of the system.
[0041] Through the description of the above embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform. Of course, it can also be implemented by hardware, but in many cases, the former is a better implementation method.
[0042] It should be understood that although Figures 2 - 5 the steps in the flowchart of Figures 2 - 5 are shown in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover,
[0043] The embodiments of this application also provide a device for controlling hot plugging of network card devices, as Figure 6 shown, including an acquisition module, a determination module, and a hot plugging control module, where: An acquisition module, configured to acquire an identifier of a first target hot-swap button in response to receiving a trigger instruction of the first target hot-swap button; A determination module, configured to determine operation permission information of the first target hot-swap button based on a mapping relation table and the identifier of the first target hot-swap button, where the mapping relation table includes a mapping relation generated based on the identifier of the hot-swap button and the operation permission information of the hot-swap button; A hot-swap control module, configured to, in response to the operation permission information of the first target hot-swap button being in an unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot-swap button, so as to perform a hot-remove operation on the network card device.
[0044] As a preferred implementation manner, in the embodiment of the present invention, the determination module is specifically configured to: Acquire identifiers of multiple hot-swap buttons, and respectively configure operation permission information for the multiple hot-swap buttons; Generate a mapping relation based on the identifier and the operation permission information corresponding to the second target hot-swap button; Save multiple mapping relations into a mapping table to generate a first mapping relation table; In response to receiving an operation permission information update request, update and save the operation permission information corresponding to the operation permission information update request to generate a second mapping relation table.
[0045] As a preferred implementation manner, in the embodiment of the present invention, the determination module is specifically configured to: In response to receiving the identifier of the first target hot-swap button, acquire update information of the first mapping relation table; Based on the update information of the first mapping relation table, determine whether the first mapping relation table has been updated; In response to the first mapping relation table having been updated, acquire the second mapping relation table; Extract multiple mapping relations in the second mapping relation table, and match the identifier of the first target hot-swap button with the multiple mapping relations in the second mapping relation table; In response to a successful match, determine the operation permission information corresponding to the identifier of the first target hot-swap button as the operation permission information of the first target hot-swap button; In response to the first mapping relation table not being updated, acquire the first mapping relation table; Extract multiple mapping relations in the first mapping relation table, and match the identifier of the first target hot-swap button with the multiple mapping relations in the first mapping relation table; In response to a successful match, determine the operation permission information corresponding to the identifier of the first target hot-swap button as the operation permission information of the first target hot-swap button.
[0046] As a preferred embodiment, in the embodiment of the present invention, the hot plug control module is specifically configured to: Determine whether the operation permission information of the first target hot plug button is in a locked state; In response to the operation permission information of the first target hot plug button being in a locked state, issue a first prompt message; In response to the operation permission information of the first target hot plug button being in an unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot plug button, so as to perform a hot plug-out operation on the network card device.
[0047] As a preferred embodiment, in the embodiment of the present invention, the hot plug control module is specifically configured to: In response to the operation permission information of the first target hot plug button being in an unlocked state, obtain the status information of the network card device corresponding to the first target hot plug button; In response to the status information of the network card device being in the in-place state and powered on, issue a first power-down prompt message and perform a power-down operation; In response to the completion of the power-down operation, issue a second power-down prompt message and perform a hot plug-out operation on the network card device; In response to the completion of the hot plug-out operation, update the in-place state value of the network card device, and based on the update result of the in-place state value, issue a second prompt message.
[0048] As a preferred embodiment, in the embodiment of the present invention, the hot plug control module is specifically configured to: Update the operation permission information of the first target hot plug button corresponding to the network card device to the locked state.
[0049] As a preferred embodiment, in the embodiment of the present invention, the hot plug control module is specifically configured to: In response to receiving the in-place signal of the network card device, determine whether the in-place signal is stable; In response to the in-place signal being stable, update the in-place state value of the network card device, issue a first power-on prompt message, and perform a power-on operation on the network card device; In response to the successful execution of the power-on operation, issue a second power-on prompt message; In response to the failure of the power-on operation, issue a third power-on prompt message and perform a hot plug-out operation on the network card device; In response to the completion of the hot plug-out operation, update the in-place state value of the network card device, and based on the update result of the in-place state value, issue a second prompt message.
[0050] For the description of the features in the corresponding embodiments of the network card device hot plug and play control device, reference can be made to the relevant description of the corresponding embodiments of the network card device hot plug and play control method, which will not be elaborated here one by one. Each module in the above network card device hot plug and play control device can be implemented in whole or in part by software, hardware, and their combination. Each of the above modules can be embedded in the processor of the electronic device in hardware form or independent of it, or stored in the memory of the electronic device in software form, so that the processor can call and execute the operations corresponding to each of the above modules.
[0051] In one embodiment, an electronic device is provided. The electronic device can be a terminal, and its internal structure diagram can be as Figure 7 shown. The electronic device includes a processor, a memory, a network interface, a display screen, and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it implements a network card device hot plug and play control method. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen. The input device of the electronic device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the electronic device, or an external keyboard, a touchpad, or a mouse, etc.
[0052] Those skilled in the art can understand that Figure 7 the structure shown in
[0053] is only a block diagram of some structures related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine some components, or have different component arrangements. S1: In response to receiving a trigger instruction of a first target hot plug and play button, obtain the identifier of the first target hot plug and play button; S2: Based on the mapping relationship table and the identifier of the first target hot plug and play button, determine the operation permission information of the first target hot plug and play button, where the mapping relationship table includes a mapping relationship generated based on the identifier of the hot plug and play button and the operation permission information of the hot plug and play button; S3: In response to the operation permission information of the first target hot plug button being in the unlocked state, perform a power-off operation according to the status information of the network card device corresponding to the first target hot plug button, so as to perform a hot plug-out operation on the network card device.
[0054] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored. The computer program is configured to execute the steps in the embodiment of the network card device hot plug control method when running, including: S1: In response to receiving a trigger instruction of the first target hot plug button, obtain the identifier of the first target hot plug button; S2: Based on the mapping relation table and the identifier of the first target hot plug button, determine the operation permission information of the first target hot plug button, where the mapping relation table includes a mapping relation generated based on the identifier of the hot plug button and the operation permission information of the hot plug button; S3: In response to the operation permission information of the first target hot plug button being in the unlocked state, perform a power-off operation according to the status information of the network card device corresponding to the first target hot plug button, so as to perform a hot plug-out operation on the network card device.
[0055] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media such as a USB flash drive, a read-only memory (ROM for short), a random access memory (RAM for short), a mobile hard disk, a magnetic disk, or an optical disc that can store a computer program.
[0056] An embodiment of the present application further provides a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, it implements the steps in the embodiment of the network card device hot plug control method, including: S1: In response to receiving a trigger instruction of the first target hot plug button, obtain the identifier of the first target hot plug button; S2: Based on the mapping relation table and the identifier of the first target hot plug button, determine the operation permission information of the first target hot plug button, where the mapping relation table includes a mapping relation generated based on the identifier of the hot plug button and the operation permission information of the hot plug button; S3: In response to the operation permission information of the first target hot plug button being in the unlocked state, perform a power-off operation according to the status information of the network card device corresponding to the first target hot plug button, so as to perform a hot plug-out operation on the network card device.
[0057] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium storing a computer program, where the computer program, when executed by a processor, implements the steps in the embodiment of the network card device hot plug and unplug control method, including: S1: In response to receiving a trigger instruction of a first target hot plug and unplug button, obtain an identifier of the first target hot plug and unplug button; S2: Based on the mapping relation table and the identifier of the first target hot plug and unplug button, determine the operation permission information of the first target hot plug and unplug button, where the mapping relation table includes a mapping relation generated based on the identifier of the hot plug and unplug button and the operation permission information of the hot plug and unplug button; S3: In response to the operation permission information of the first target hot plug and unplug button being in an unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot plug and unplug button, so as to perform a hot unplug operation on the network card device.
[0058] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in this article can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described according to functions in the above description. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Skilled professionals can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of this application.
[0059] The above has introduced in detail a network card device hot plug and unplug control method, device, electronic device, and storage medium provided by this application. Specific examples are used in this article to elaborate on the principle and implementation manner of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of this application, several improvements and modifications can be made to this application, and these improvements and modifications also fall within the protection scope of this application.
Claims
1. A method for controlling hot plugging of a network card device, characterized in that, The method includes: In response to receiving a trigger instruction of a first target hot pluggable button, obtaining an identifier of the first target hot pluggable button; Based on a mapping relationship table and the identifier of the first target hot pluggable button, determining operation permission information of the first target hot pluggable button, wherein the mapping relationship table includes a mapping relationship generated based on an identifier of a hot pluggable button and the operation permission information of the hot pluggable button; In response to the operation permission information of the first target hot pluggable button being in an unlocked state, performing a power-down operation according to the status information of the network card device corresponding to the first target hot pluggable button, so as to perform a hot plug-out operation on the network card device.
2. The method for hot plugging control of a network card device according to claim 1, wherein The method for generating the mapping relationship table includes: Obtaining identifiers of a plurality of hot pluggable buttons, and respectively configuring operation permission information for the plurality of hot pluggable buttons; Generating a mapping relationship based on the identifier and the operation permission information corresponding to a second target hot pluggable button; Saving a plurality of the mapping relationships into a mapping table to generate a first mapping relationship table; In response to receiving an operation permission information update request, updating and saving the operation permission information corresponding to the operation permission information update request to generate a second mapping relationship table.
3. The method for controlling hot plugging of a network card device according to claim 2, wherein Determining the operation permission information of the first target hot pluggable button based on the mapping relationship table and the identifier of the first target hot pluggable button includes: In response to receiving the identifier of the first target hot pluggable button, obtaining update information of the first mapping relationship table; Based on the update information of the first mapping relationship table, determining whether the first mapping relationship table has been updated; In response to the first mapping relationship table having been updated, obtaining the second mapping relationship table; Extracting a plurality of mapping relationships in the second mapping relationship table, and matching the identifier of the first target hot pluggable button with the plurality of mapping relationships in the second mapping relationship table; In response to a successful match, determining the operation permission information corresponding to the identifier of the first target hot pluggable button as the operation permission information of the first target hot pluggable button; In response to the first mapping relationship table not being updated, obtaining the first mapping relationship table; Extracting a plurality of mapping relationships in the first mapping relationship table, and matching the identifier of the first target hot pluggable button with the plurality of mapping relationships in the first mapping relationship table; In response to a successful match, determining the operation permission information corresponding to the identifier of the first target hot pluggable button as the operation permission information of the first target hot pluggable button.
4. The hot-plug control method for the network card device according to claim 1, characterized in that, After determining the operation permission information of the first target hot pluggable button, the method further includes: Determining whether the operation permission information of the first target hot pluggable button is in a locked state; In response to the operation permission information of the first target hot pluggable button being in a locked state, sending a first prompt message; In response to the operation permission information of the first target hot pluggable button being in an unlocked state, performing a power-down operation according to the status information of the network card device corresponding to the first target hot pluggable button, so as to perform a hot plug-out operation on the network card device.
5. The hot-plug control method for network card devices according to claim 1 or 4, characterized in that In response to the operation permission information of the first target hot-plug button being in the unlocked state, perform a power-down operation according to the status information of the network card device corresponding to the first target hot-plug button, so as to perform a hot-plug operation on the network card device, including: In response to the operation permission information of the first target hot-plug button being in the unlocked state, obtain the status information of the network card device corresponding to the first target hot-plug button; In response to the status information of the network card device being in the installed state and powered on, send a first power-down prompt message and perform a power-down operation; In response to the completion of the power-down operation, send a second power-down prompt message and perform a hot-plug operation on the network card device; In response to the completion of the hot-plug operation, update the installed state value of the network card device, and based on the update result of the installed state value, send a second prompt message.
6. The hot-plug control method for a network card device according to claim 1, wherein, After performing the hot-plug operation on the network card device, the method further includes: Update the operation permission information of the first target hot-plug button corresponding to the network card device to the locked state.
7. The method for hot plugging control of a network card device according to claim 1, wherein The method further includes: In response to receiving the installed signal of the network card device, determine whether the installed signal is stable; In response to the installed signal being stable, update the installed state value of the network card device, send a first power-on prompt message, and perform a power-on operation on the network card device; In response to the successful execution of the power-on operation, send a second power-on prompt message; In response to the failure of the power-on operation, send a third power-on prompt message and perform a hot-plug operation on the network card device; In response to the completion of the hot-plug operation, update the installed state value of the network card device, and based on the update result of the installed state value, send a second prompt message.
8. A hot plug control device for a network card device, characterized in that, The device includes: An acquisition module, configured to obtain the identifier of the first target hot-plug button in response to receiving a trigger instruction of the first target hot-plug button; A determination module, configured to determine the operation permission information of the first target hot-plug button based on the mapping relation table and the identifier of the first target hot-plug button, where the mapping relation table includes a mapping relation generated based on the identifier of the hot-plug button and the operation permission information of the hot-plug button; A hot-plug control module, configured to perform a power-down operation according to the status information of the network card device corresponding to the first target hot-plug button in response to the operation permission information of the first target hot-plug button being in the unlocked state, so as to perform a hot-plug operation on the network card device.
9. An electronic device, characterized in that, Includes: A memory, configured to store a computer program; A processor, configured to implement the steps of the network card device hot-plug control method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, where the computer program, when executed by a processor, implements the steps of the network card device hot-plug control method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Hot-plug protection system and method
CN101271411A
Hot plug stabilizing equipment and computer
CN113448416A
Hot plug method, PCIE device and computer system
CN116860680A
Hot plug method and computer system
CN116860681A
Hot plug control method and device of external equipment, storage medium and electronic equipment
CN119088742A