Network card device hot plug control method, device, electronic device and storage medium

By building a mapping relationship between software switches and physical buttons in the network card device and generating a multi-state linkage mechanism, the contradiction between the ease of use and prevention of accidental touches of the hot-swap function of the network card device and the security risk of pure software switches are resolved, thereby improving the security and reliability of the system.

CN120342794BActive Publication Date: 2025-09-16INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202510830701.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-20
Publication Date
2025-09-16
Estimated Expiration
2045-06-20

AI Technical Summary

Technical Problem

In the existing technology, the hot-swap function of network card devices has the contradiction between the usability of physical buttons and the prevention of accidental touches, as well as the potential security risks of pure software switches, which threatens the security and stability of the system.

Method used

By building a mapping relationship, combining software switches and physical buttons, a multi-state linkage mechanism is generated to ensure that the network card device is not directly powered off in the event of a malicious attack or misoperation.

Benefits of technology

It improves the security and reliability of the system, prevents accidental touches and malicious attacks from affecting network card devices, and ensures the safety and stability of operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120342794B_ABST
    Figure CN120342794B_ABST
Patent Text Reader

Abstract

The present application discloses a network card device hot-plug control method, apparatus, electronic device and storage medium, and relates to the field of computer technology. The present application combines software switches and physical buttons by constructing a mapping relationship to generate a network card device hot-plug control mechanism with a multi-state linkage mechanism. In this way, when the upper-layer software switch is maliciously conquered or the physical button is misoperated, the network card device will not be directly powered off, thereby improving the security and reliability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, electronic device, and storage medium for hot-plugging control of a network card device. Background Art

[0002] The hot-swap 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 the hardware circuit to start the step-by-step power-off process of the network card power supply, ensuring that the capacitor discharge and the data link are safely disconnected before unplugging, avoiding power surges or data damage. However, the physical button may be accidentally touched and cause the network card to lose power unexpectedly. To prevent the physical button from being accidentally touched, related technologies achieve the anti-accidental touch function by shortening the button or concave the button. However, this method increases the difficulty of operation for operators in scenarios where normal button operation is required. If the physical button is completely abandoned and replaced with a single software switch, there is a potential risk of being conquered by malicious software, which will pose a serious threat to the security and stability of the system. Summary of the Invention

[0003] The present application provides a method, apparatus, electronic device and storage medium for hot-plugging control of a network card device, in order to at least resolve the contradiction between the usability and the prevention of accidental touches of hot-plugging physical buttons in the related art, as well as the potential security risks of pure software switches.

[0004] The present application provides a method for controlling hot plugging of a network card device, comprising:

[0005] In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0006] Determining operation permission information of the first target hot-swap button based on the mapping relationship table and the identifier of the first target hot-swap button, wherein 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;

[0007] In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0008] The present application also provides a network card device hot plug control device, comprising:

[0009] an acquisition module, configured to acquire an identifier of the first target hot-swap button in response to receiving a trigger instruction of the first target hot-swap button;

[0010] a determination module, configured to determine the operation permission information of the first target hot-swappable key based on a mapping relationship table and an identifier of the first target hot-swappable key, wherein the mapping relationship table includes a mapping relationship generated based on the identifier of the hot-swappable key and the operation permission information of the hot-swappable key;

[0011] The hot plug control module is used to respond to the unlocked state of the operation permission information of the first target hot plug button and execute a power-off operation according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0012] The present application also provides an electronic device, comprising: a memory for storing a computer program; and a processor for implementing the following steps of a network card device hot plug control method when executing the computer program:

[0013] In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0014] Determining operation permission information of the first target hot-swap button based on the mapping relationship table and the identifier of the first target hot-swap button, wherein 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;

[0015] In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0016] The present application also provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein when the computer program is executed by a processor, the following steps of the method for controlling hot plugging of a network card device are implemented:

[0017] In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0018] Determining operation permission information of the first target hot-swap button based on the mapping relationship table and the identifier of the first target hot-swap button, wherein 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;

[0019] In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0020] The present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the following steps of the network card device hot plug control method:

[0021] In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0022] Determining operation permission information of the first target hot-swap button based on the mapping relationship table and the identifier of the first target hot-swap button, wherein 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;

[0023] In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0024] This application combines software switches and physical buttons by constructing a mapping relationship to generate a network card device hot-plug control mechanism with a multi-state linkage mechanism. This ensures that when the upper-level software switch is maliciously attacked or the physical button is operated incorrectly, the network card device will not be directly powered off, thereby improving the security and reliability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0026] Figure 1 An application environment diagram of a method for controlling hot plugging of a network card device is provided for an embodiment of the present application;

[0027] Figure 2 A schematic diagram of the overall process of a hot-swap control method for a network card device is provided for an embodiment of the present application;

[0028] Figure 3 A schematic diagram of the overall architecture of the execution components of a network card device hot-swap control method is provided for an embodiment of the present application;

[0029] Figure 4 A schematic diagram of the overall hot-plugging process of a network card device hot-plugging control method is provided for an embodiment of the present application;

[0030] Figure 5 A schematic diagram of the overall hot-plugging process of a network card device hot-plugging control method is provided for an embodiment of the present application;

[0031] Figure 6 A structural block diagram of a network card device hot-swap control device is provided for an embodiment of the present application;

[0032] Figure 7 FIG. 1 is a diagram showing the internal structure of an electronic device in one embodiment. DETAILED DESCRIPTION

[0033] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0034] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.

[0035] It should be noted that the terms "S1", "S2", etc. are used only for the purpose of describing the steps and do not specifically refer to the order or sequence, nor are they used to limit this application. They are merely for the convenience of describing the method of this application and should not be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0036] Hot swapping of network card devices is a function that allows you to replace or add network card devices while the server is running without shutting down the server power. This feature can greatly improve the server's availability, maintenance efficiency, and system flexibility. For example, when a network card device encounters a fault 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. This not only simplifies maintenance work but also reduces losses caused by downtime. The hot swapping function of network card devices is widely used in server environments that require high availability, flexibility, and easy maintenance, such as data centers. In scenarios such as cores, cloud computing platforms, and high-performance computing clusters, the hot-swap function can ensure that the server can quickly resume operation in the event of a network failure or network upgrade, thereby meeting business continuity requirements. In related technologies, the hot-swap function of network card devices is generally implemented as a notification-type hot-swap with a hot-swap button, which means that hot-swap preparation is first performed through a button, and then the plug-in action is performed. Therefore, there is a risk of accidentally touching the button. According to the background technology, the related technology does not have a good method to solve the contradiction between the ease of use of hot-swap physical buttons and the prevention of accidental touches, as well as the potential security risks of pure software switches.

[0037] To solve the above technical problems, the present application provides a network card device hot-plug control method, device, electronic device and storage medium. By constructing a mapping relationship, the software switch and physical button are combined to generate a network card device hot-plug control mechanism with a multi-state linkage mechanism. When the upper-layer software switch is maliciously attacked or the physical button is misoperated, the network card device will not be directly powered off, thereby improving the security and reliability of the system.

[0038] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0039] The network card device hot plug control method provided in this application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with a data processing platform provided on the server 104 via a network. The terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices. The server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0040] like Figure 2 As shown, the embodiment of the present application provides a network card device hot plug control method, which is applied to Figure 1 The following steps are used as an example to illustrate the terminal in the figure:

[0041] S1: In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button.

[0042] It should be noted that the first target hot-swap 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-swap button is used to identify the specific hot-swap button, which is displayed on the user interface.

[0043] S2: Determine 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, wherein the mapping relationship table includes a mapping relationship generated based on the identifier of the hot plug button and the operation permission information of the hot plug button.

[0044] It should be noted that a plurality of mapping relationships are stored in the mapping relationship table, each mapping relationship is used to describe the association relationship between a software application and a physical button, and one software application corresponds to one physical button; the operation permission information of the hot-swappable button includes a locked state and an unlocked state. When the hot-swappable button is in a locked state, it indicates that there is no permission to operate the corresponding hot-swappable button. When the hot-swappable button is in an unlocked state, it indicates that there is permission to operate the corresponding hot-swappable button. If there is permission, press the hot-swappable button to perform the power-off operation.

[0045] S3: In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0046] It should be noted that the network card device can be an OCP3.0 network card, etc.; the status information of the network card device includes the in-place state and the power-on state, among which the in-place state refers to whether the network card device is still in the card slot. If it is in place, it means that the network card device is in the card slot; if it is not in place, it means that the network card device is not in the card slot; the power-on state refers to judging whether the network card device has been powered on and is in a working ready state or a working state. If it is in the powered-on state, it means that the network card device has been powered on and is in a working ready state or a working state. If it is not in the powered-on state, it means that the network card device is not powered on and is not in a working ready state or a working state; when the network card device is in the powered-on state and in-place state, the power-off operation is performed, and after the power-off operation, the network card device is hot-unplugged.

[0047] Among them, Figure 3As shown, the user interface is provided by the upper-level software control unit, which also provides an upper-level API interface for configuring the hot-swap button operation permission. When the hot-swap button operation permission changes, the permission information is passed to the intermediate firmware logic unit; the intermediate firmware logic unit is used to receive and parse the permission change instruction information issued by the upper-level software control unit, and feedback the received signal to maintain data consistency. It is also used to monitor the operation status of the hardware physical button. When the button is triggered, it decides whether to power off 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 The plug-in and unplug button operation permission information, save the device in place and power-off status information; the power-on and power-off logic is controlled by the underlying hardware execution unit. The circuit design of the underlying hardware execution unit controls the level conversion during hot plug button operation and transmits the signal to the intermediate firmware logic unit. According to the signal sent by the firmware logic unit, the circuit design controls the on and off of the device power supply. According to the signal sent by the firmware logic unit, the circuit design controls the on, off, and flashing status of the LED light. The circuit design controls the level conversion of the network card device in place pin and transmits the signal to the key firmware logic unit. Specifically, the upper-level software application can choose to pass the BMC (baseboard The intermediate logic control unit can be implemented by an MCU (Microcontroller Unit) or a CPLD (Complex Programmable Logic Device). The BMC can exchange bidirectional information with the MCU or CPLD through an I2C (serial bus) link. The lock state of the hot-swappable physical button is controlled through the BMC's IPMI interface (Intelligent Platform Management Interface) / RESTful interface (WeB service interface) / Redfish interface (remote management and monitoring interface) / user interface. The default mode is locked, that is, the hot-swappable physical button is invalid.

[0048] In the above embodiment, by constructing a mapping relationship, the software switch and the physical button are combined to generate a network card device hot-swap control mechanism with a multi-state linkage mechanism, so that when the upper-level software switch is maliciously conquered or the physical button is misoperated, the network card device will not be directly powered off, thereby improving the security and reliability of the system.

[0049] In some specific implementations, the method for generating a mapping relationship table includes:

[0050] Obtain identifiers of multiple hot-swappable buttons, and configure operation permission information for each of the multiple hot-swappable buttons, wherein the operation permission information includes a locked state and an unlocked state;

[0051] Based on the identifier and operation permission information corresponding to the second target hot-swap button, a mapping relationship is generated, that is, a mapping relationship between the physical button and the corresponding software application is established;

[0052] Saving the multiple mapping relationships in a mapping table to generate a first mapping relationship table, wherein the operation permission information in the first mapping relationship table is generally set to a locked state, that is, the initial state of the physical button is generally a locked state;

[0053] In response to receiving an operation permission information update request, the operation permission information corresponding to the operation permission information update request is updated and saved, and a second mapping relationship table is generated. That is, when the user operates the corresponding software application button in the user interface or clicks the corresponding software application button under program control, 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.

[0054] In the above embodiment, a multi-level security protection linkage mechanism is realized by establishing a state mapping relationship between the software switch and the hardware physical button to solve the contradiction between the ease of use and prevention of accidental touch of the hot-swappable physical button, as well as the potential security risk problem of the pure software switch, thereby improving the safety and reliability of the system.

[0055] In some specific implementations, determining the operation permission information of the first target hot-swap button based on the mapping relationship table and the identifier of the first target hot-swap button includes:

[0056] In response to receiving the identifier of the first target hot-swap button, acquiring update information of the first mapping relationship table;

[0057] Based on the update information of the first mapping relationship table, determining whether the first mapping relationship table has been updated, that is, determining whether the software application has been clicked;

[0058] In response to the first mapping relationship table being updated, obtaining a second mapping relationship table;

[0059] Extracting multiple mapping relationships in the second mapping relationship table, and matching the identifier of the first target hot-swap button with the multiple mapping relationships in the second mapping relationship table;

[0060] In response to a successful match, determining the operation permission information corresponding to the identifier of the first target hot-swappable key as the operation permission information of the first target hot-swappable key; if the match is unsuccessful, indicating that no mapping relationship has been established for the first target hot-swappable key, in which case a corresponding mapping relationship can be established according to the above-mentioned method for constructing a mapping relationship table;

[0061] In response to the first mapping relationship table not being updated, obtaining the first mapping relationship table;

[0062] Extracting multiple mapping relationships in the first mapping relationship table, and matching the identifier of the first target hot-swap button with the multiple mapping relationships in the first mapping relationship table;

[0063] In response to a successful match, the operation authority information corresponding to the identifier of the first target hot-swap key is determined as the operation authority information of the first target hot-swap key.

[0064] In the above embodiment, whether the first target hot plug button is operable is determined by determining the operation permission information of the first target hot plug button. If it is operable and the first target hot plug button is pressed, the network card device can be powered off, thereby avoiding accidental touch and improving the reliability of the system.

[0065] In some embodiments, such as Figure 4 As shown, after determining the operation permission information of the first target hot-swap button, the method further includes:

[0066] Determine whether the operation permission information of the first target hot-swap button is in a locked state, that is, when the first target hot-swap 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-swap button through the MCU;

[0067] In response to the operation authority information of the first target hot-swap button being in a locked state, that is, not having the operation authority for the first target hot-swap button, issuing a first prompt message, wherein the first prompt message is used to indicate that the button is currently not authorized to be operated, such as by indicating the button is currently not authorized to be operated by an indicator light;

[0068] In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0069] In the above implementation, by judging the operation permission information, when there is no permission, a prompt message is issued to ensure that the user can receive the current operation permission information in time and determine the corresponding solution measures in time. When there is permission, the network card device corresponding to the hot-swap button is powered off to avoid the problem of accidental touch causing the network card device to be accidentally powered off, thereby further improving the security and reliability of the system.

[0070] In some specific embodiments, in response to the operation permission information of the first target hot-swap button being in an unlocked state, performing a power-off operation according to the state information of the network card device corresponding to the first target hot-swap button to perform a hot-plug operation on the network card device includes:

[0071] In response to the operation authority information of the first target hot-swap button being in an unlocked state, obtaining status information of a network card device corresponding to the first target hot-swap button;

[0072] In response to the status information of the network card device being in the in-position state and in the powered-on state, a first power-off prompt message is issued, and a power-off operation is performed, wherein the powered-on state is acquired 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 by controlling an indicator light through 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 in-position state, the process is terminated. If the status information of the network card device is in the in-position 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 unplug operation.

[0073] In response to the completion of the power-off operation, a second power-off prompt message is issued, and a hot unplug operation is performed on the network card device, wherein the second power-off prompt message is used to indicate that the network card device is in a power-off state, such as by controlling an indicator light of the MCU to indicate that the network card device is in a power-off state, and the hot unplug operation can be manually unplugging the network card device or automatically ejecting the network card device through a configured device;

[0074] In response to the completion of the hot unplug operation, the in-place status value of the network card device is updated, and based on the updated result of the in-place status value, a second prompt message is issued. The second prompt message is used to describe that the network card device is not in the in-place state, such as controlling the indicator light to turn off by the MCU to indicate that the network card device is not in the in-place state, that is, when the MCU obtains a change in the in-place signal of the network card device, the MCU switches the in-place status value of the network card device and turns off the indicator light.

[0075] In some specific implementations, after performing a hot unplug operation on the network card device, the method further includes:

[0076] The operation permission information of the first target hot plug button corresponding to the network card device is updated to a locked state, that is, when the hot plug operation is completed, the locked state of the hot plug physical button is restored through the above user interface.

[0077] In the above embodiment, when the server is powered on, if you want to hot-plug the network card device, you first need to unlock the hot-plug physical button through the above user interface / interface, and then operate the physical button. The network card device will enter the power-off process, and the indicator light can indicate the power-off process and the power-off result. When the indicator light indicates that the network card device is successfully powered off, you can unplug the network card device. If you do not unlock the hot-plug physical button through the above interface / interface first, and directly operate the physical button, the indicator light indicates that you currently have no permission to operate the physical button. After unplugging the device, you can immediately restore the lock state of the hot-plug physical button through the above user interface / interface to avoid the network card device being accidentally powered off due to accidental touching of the physical button. When the network card devices need to be hot-maintained in batches, the lock state of the hot-plug physical button can be unlocked / restored in batches through the above interface, thereby preventing devices that do not require hot maintenance from being accidentally powered off during batch operations, thereby improving the safety and reliability of the system.

[0078] In some embodiments, the method further comprises:

[0079] Obtain the duration of hot-swap button unlocking within multiple time periods, calculate and determine the average duration of hot-swap button unlocking corresponding to the same time period within multiple time periods, and obtain the number of occurrences of time periods with a duration greater than the average duration. The time period can be set according to actual needs, such as one month, and the time period can also be set according to actual needs, such as one day.

[0080] In response to the number of occurrences being greater than a preset threshold, obtaining a maximum duration, and taking the median corresponding to the maximum duration and the average duration as the standard duration;

[0081] In response to the number of occurrences being less than or equal to a preset threshold, defining the average duration as a standard duration, wherein the value of the preset threshold can be set according to actual needs;

[0082] When the hot-swap button is unlocked, a specific unlocking time is obtained, and the unlocking time is compared with a standard time;

[0083] In response to the unlocking time being longer than the standard time, an alarm message is issued through the BMC to prompt a technician to restore the hot-swap button to a locked state or check for system vulnerabilities in a timely manner.

[0084] In the above embodiment, by limiting the time duration for unlocking the hot-swap button, it is avoided that the hot-swap button is in an unlocked state for a long time, which may cause accidental touches, thereby further improving the safety and reliability of the system.

[0085] In some embodiments, such as Figure 5 As shown, the method further includes:

[0086] In response to receiving a presence signal from the network card device, determining whether the presence signal is stable;

[0087] In response to the in-position signal being stable, updating the in-position state value of the network card device, issuing a first power-on prompt message, and performing a power-on operation on the network card device, wherein the first power-on prompt message is used to describe that the network card device is being powered on, such as by controlling an indicator light of the MCU to indicate that the network card device is being powered on;

[0088] In response to the power-on operation being successfully executed, a second power-on prompt message is issued, wherein the second power-on prompt message is used to describe that the network card device is powered on successfully, such as turning off the indicator light through the MCU control;

[0089] In response to a power-on operation failure, issuing a third power-on prompt message and performing a hot unplug operation on the network card device, wherein the third power-on prompt message is used to describe that the network card device is in a power-off state, such as by controlling an indicator light of the MCU to indicate that the current network card device is in a power-off state. At this time, the network card device is in an abnormal state and needs to be unplugged;

[0090] In response to the completion of the hot unplug operation, the in-place status value of the network card device is updated. Based on the updated result of the in-place status value, a second prompt message is issued, that is, the network card device is not in the in-place state, the MCU switches the in-place signal of the network card device to change, and the indicator light goes out.

[0091] In the above embodiment, when the network card device is hot-plugged, the MCU judges the stability of the in-place signal and the power-on status to determine the execution result of the hot-plug operation, and displays the hot-plug operation process and results, thereby improving the safety and stability of the hot-plug operation and improving system performance.

[0092] In the above-mentioned network card device hot plug control method, the method includes: in response to receiving a trigger instruction of a first target hot plug button, obtaining the identifier of the first target hot plug button; based on a mapping relationship table and the identifier of the first target hot plug button, determining the operation permission information of the first target hot plug button, wherein the mapping relationship table includes a mapping relationship generated based on the identifier of the hot plug button and the operation permission information of the hot plug button; in response to the operation permission information of the first target hot plug button being 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 unplug operation on the network card device, the present application constructs a mapping relationship between a software switch and a physical case, and the software switch The default physical button is in a locked state, thus avoiding the problem of reduced security and reliability caused by accidental touch. In addition, the upper-level software control unit can be implemented through BMC, and the intermediate firmware logic unit can be implemented through MCU / CPLD. Only a few modifications need to be made on the link, and the cost is low. Furthermore, the present application realizes a multi-state linkage mechanism by combining software switches and physical buttons. If the upper-level software switch is conquered, the network card device will not be directly powered off, reducing the harm of being conquered. The upper-level software switch is closed by default. When hot maintenance is required, the switch is turned on and the switch is turned off after the operation is completed. The physical button remains in a locked state, and accidental touch of the button will not power off the network card device, increasing the security and reliability of the system.

[0093] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus the necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method.

[0094] It should be understood that although Figure 2-Figure 5 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. In addition, Figure 2-Figure 5 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0095] The embodiment of the present application also provides a network card device hot plug control device, such as Figure 6 As shown, it includes an acquisition module, a determination module and a hot-swap control module, wherein:

[0096] an acquisition module, configured to acquire an identifier of the first target hot-swap button in response to receiving a trigger instruction of the first target hot-swap button;

[0097] a determination module, configured to determine the operation permission information of the first target hot-swappable key based on a mapping relationship table and an identifier of the first target hot-swappable key, wherein the mapping relationship table includes a mapping relationship generated based on the identifier of the hot-swappable key and the operation permission information of the hot-swappable key;

[0098] The hot plug control module is used to respond to the unlocked state of the operation permission information of the first target hot plug button and execute a power-off operation according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0099] As a preferred implementation, in an embodiment of the present invention, the determination module is specifically configured to:

[0100] Obtain identifiers of multiple hot-swap buttons, and configure operation permission information for each of the multiple hot-swap buttons;

[0101] generating a mapping relationship based on the identifier and operation permission information corresponding to the second target hot-swap button;

[0102] Saving the multiple mapping relationships into a mapping table to generate a first mapping relationship table;

[0103] In response to receiving the operation authority information update request, the operation authority information corresponding to the operation authority information update request is updated and saved, and a second mapping relationship table is generated.

[0104] As a preferred implementation, in an embodiment of the present invention, the determination module is specifically configured to:

[0105] In response to receiving the identifier of the first target hot-swap button, acquiring update information of the first mapping relationship table;

[0106] Determining whether the first mapping relationship table has been updated based on the update information of the first mapping relationship table;

[0107] In response to the first mapping relationship table being updated, obtaining a second mapping relationship table;

[0108] Extracting multiple mapping relationships in the second mapping relationship table, and matching the identifier of the first target hot-swap button with the multiple mapping relationships in the second mapping relationship table;

[0109] In response to a successful match, determining the operation permission information corresponding to the identifier of the first target hot-swap key as the operation permission information of the first target hot-swap key;

[0110] In response to the first mapping relationship table not being updated, obtaining the first mapping relationship table;

[0111] Extracting multiple mapping relationships in the first mapping relationship table, and matching the identifier of the first target hot-swap button with the multiple mapping relationships in the first mapping relationship table;

[0112] In response to a successful match, the operation authority information corresponding to the identifier of the first target hot-swap key is determined as the operation authority information of the first target hot-swap key.

[0113] As a preferred implementation, in an embodiment of the present invention, the hot-swap control module is specifically configured to:

[0114] Determining whether the operation permission information of the first target hot-swap button is in a locked state;

[0115] In response to the operation authority information of the first target hot-swap button being in a locked state, issuing a first prompt message;

[0116] In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0117] As a preferred implementation, in an embodiment of the present invention, the hot-swap control module is specifically configured to:

[0118] In response to the operation authority information of the first target hot-swap button being in an unlocked state, obtaining status information of a network card device corresponding to the first target hot-swap button;

[0119] In response to the status information of the network card device being in the in-position state and in the powered-on state, issuing a first power-off prompt message and performing a power-off operation;

[0120] In response to the completion of the power-off operation, a second power-off prompt message is issued, and a hot unplug operation is performed on the network card device;

[0121] In response to the completion of the hot unplug operation, the in-place status value of the network card device is updated, and a second prompt message is issued based on the update result of the in-place status value.

[0122] As a preferred implementation, in an embodiment of the present invention, the hot-swap control module is specifically configured to:

[0123] The operation permission information of the first target hot-swap button corresponding to the network card device is updated to a locked state.

[0124] As a preferred implementation, in an embodiment of the present invention, the hot-swap control module is specifically configured to:

[0125] In response to receiving a presence signal from the network card device, determining whether the presence signal is stable;

[0126] In response to the presence signal being stable, updating the presence status value of the network card device, issuing a first power-on prompt message, and performing a power-on operation on the network card device;

[0127] In response to the power-on operation being successfully executed, issuing a second power-on prompt message;

[0128] In response to a power-on operation failure, issuing a third power-on prompt message and performing a hot unplug operation on the network card device;

[0129] In response to the completion of the hot unplug operation, the in-place status value of the network card device is updated, and a second prompt message is issued based on the update result of the in-place status value.

[0130] For a description of the features of the embodiments corresponding to the network card device hot-swap control device, please refer to the description of the embodiments corresponding to the network card device hot-swap control method, and will not be repeated here. Each module in the aforementioned network card device hot-swap control device can be implemented in whole or in part through software, hardware, or a combination thereof. Each of the aforementioned modules can be embedded in or independent of a processor in an electronic device in hardware form, or can be stored in a memory in the electronic device in software form, so that the processor can call and execute the operations corresponding to each of the aforementioned modules.

[0131] In one embodiment, an electronic device is provided. The electronic device may be a terminal, and its internal structure diagram may be as follows: Figure 7 As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected via a system bus. 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 via a network connection. When the computer program is executed by the processor, a method for hot-plugging and controlling a network card device is implemented. The display screen of the electronic device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device may be a touch layer covering the display screen, or a button, trackball or touchpad provided on the housing of the electronic device, or an external keyboard, touchpad or mouse.

[0132] Those skilled in the art will understand that Figure 7 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 electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0133] An embodiment of the present application provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor is configured to run the computer program to perform the steps of an embodiment of a method for controlling hot plugging of a network card device, including:

[0134] S1: In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0135] S2: Determine operation permission information of the first target hot-swap button based on a mapping relationship table and an identifier of the first target hot-swap button, wherein 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;

[0136] S3: In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0137] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the steps of the embodiment of the network card device hot plug control method when running, including:

[0138] S1: In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0139] S2: Determine operation permission information of the first target hot-swap button based on a mapping relationship table and an identifier of the first target hot-swap button, wherein 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;

[0140] S3: In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0141] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.

[0142] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the steps in the embodiment of the method for controlling hot plugging of a network card device are implemented, including:

[0143] S1: In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0144] S2: Determine operation permission information of the first target hot-swap button based on a mapping relationship table and an identifier of the first target hot-swap button, wherein 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;

[0145] S3: In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0146] An embodiment of the present application further provides another computer program product, including a non-volatile computer-readable storage medium, wherein the non-volatile computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the steps in the embodiment of the network card device hot plug control method are implemented, including:

[0147] S1: In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button;

[0148] S2: Determine operation permission information of the first target hot-swap button based on a mapping relationship table and an identifier of the first target hot-swap button, wherein 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;

[0149] S3: In response to the operation authority information of the first target hot plug button being in the unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

[0150] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the above description has generally described the components and steps of each example according to their functions. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0151] The above is a detailed introduction to a network card device hot-plug control method, device, electronic device, and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and core ideas of the present application. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the present application.

Claims

1. A method for controlling hot plugging of a network card device, characterized in that: The method comprises: In response to receiving a trigger instruction of a first target hot-swap button, obtaining an identifier of the first target hot-swap button, where the first target hot-swap button is a physical button; Determining operation permission information of the first target hot-swappable key based on a mapping relationship table and an identifier of the first target hot-swappable key, wherein the mapping relationship table includes a mapping relationship generated based on the identifier of the hot-swappable key and the operation permission information of the hot-swappable key, the mapping relationship being used to describe an association relationship between a software application and a physical key; In response to the operation permission information of the first target hot-swap button being in an unlocked state, performing a power-off operation according to the state information of the network card device corresponding to the first target hot-swap button to perform a hot-plug operation on the network card device; The method for generating the mapping relationship table includes: Obtain identifiers of multiple hot-swappable buttons, and configure operation permission information for each of the multiple hot-swappable buttons, where the operation permission information includes a locked state and an unlocked state; generating a mapping relationship based on the identifier corresponding to the second target hot-swap button and the operation permission information; Saving the plurality of mapping relationships into a mapping table to generate a first mapping relationship table; In response to receiving an operation permission information update request, that is, the software application has been clicked, updating and saving the operation permission information corresponding to the operation permission information update request, and generating a second mapping relationship table; Determining the operation authority information of the first target hot-swappable key based on the mapping relationship table and the identifier of the first target hot-swappable key, that is, determining whether the first target hot-swappable key is operable by determining the operation authority information of the first target hot-swappable key, includes: In response to receiving the identifier of the first target hot-swap button, acquiring update information of the first mapping relationship table; Determining whether the first mapping relationship table has been updated based on the update information of the first mapping relationship table; In response to the first mapping relationship table being updated, acquiring the second mapping relationship table; Extracting multiple mapping relationships in the second mapping relationship table, and matching the identifier of the first target hot-swap button with the multiple 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-swappable key as the operation permission information of the first target hot-swappable key; In response to the first mapping relationship table not being updated, acquiring the first mapping relationship table; Extracting multiple mapping relationships in the first mapping relationship table, and matching the identifier of the first target hot-swap button with the multiple 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-swappable key as the operation permission information of the first target hot-swappable key; After determining the operation permission information of the first target hot-swap button, the method further includes: Determining whether the operation permission information of the first target hot-swap button is in a locked state; In response to the operation authority information of the first target hot-swap button being in a locked state, issuing a first prompt message; In response to the operation authority information of the first target hot plug button being in an unlocked state, a power-off operation is performed according to the state information of the network card device corresponding to the first target hot plug button to perform a hot plug operation on the network card device.

2. The method for controlling hot plugging of a network card device according to claim 1, wherein: In response to the operation permission information of the first target hot-swap button being in an unlocked state, performing a power-off operation according to the state information of the network card device corresponding to the first target hot-swap button to perform a hot-plug operation on the network card device includes: In response to the operation permission information of the first target hot-swap button being in an unlocked state, obtaining status information of a network card device corresponding to the first target hot-swap button; In response to the state information of the network card device being in an in-position state and in a powered-on state, issuing a first power-off prompt message and performing a power-off operation; In response to the completion of the power-off operation, issuing a second power-off prompt message and performing a hot unplug operation on the network card device; In response to the completion of the hot unplug operation, the in-place status value of the network card device is updated, and a second prompt message is issued based on the update result of the in-place status value.

3. The network card device hot plug control method according to claim 1, characterized in that: After performing a hot unplug operation on the network card device, the method further includes: The operation permission information of the first target hot-swap button corresponding to the network card device is updated to a locked state.

4. The method for controlling hot plugging of a network card device according to claim 1, wherein: The method further comprises: In response to receiving a presence signal from the network card device, determining whether the presence signal is stable; In response to the presence signal being stable, updating the presence status value of the network card device, issuing a first power-on prompt message, and performing a power-on operation on the network card device; In response to the power-on operation being successfully executed, issuing a second power-on prompt message; In response to a power-on operation failure, issuing a third power-on prompt message and performing a hot unplug operation on the network card device; In response to the completion of the hot unplug operation, the in-place status value of the network card device is updated, and a second prompt message is issued based on the update result of the in-place status value.

5. A network card device hot-plug control device for implementing the network card device hot-plug control method according to any one of claims 1 to 4, characterized in that: The device comprises: an acquiring 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 determining module, configured to determine the operation permission information of the first target hot-swappable key based on a mapping relationship table and an identifier of the first target hot-swappable key, wherein the mapping relationship table includes a mapping relationship generated based on the identifier of the hot-swappable key and the operation permission information of the hot-swappable key; The hot-swap control module is configured to, in response to the operation permission information of the first target hot-swap button being in the unlocked state, execute a power-off operation according to the state information of the network card device corresponding to the first target hot-swap button to perform a hot-plug operation on the network card device.

6. An electronic device, characterized in that: include: memory for storing computer programs; A processor is configured to implement the steps of the network card device hot plug control method according to any one of claims 1 to 4 when executing the computer program.

7. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the network card device hot plug control method according to any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • Hot-plug protection system and method

    CN101271411A

  • Hot plug stabilizing equipment and computer

    CN113448416A

  • Hot plug method and computer system

    CN116860681A