Network card control method and device, electronic equipment, storage medium and product

By detecting the data packet interaction in real time in the control device and automatically performing plug-in and unplugging operations, the problem of PXE frequent offline in computer board tests is solved, which improves testing efficiency and compatibility, and saves manpower and time costs.

CN120238466AActive Publication Date: 2025-07-01INSPUR SUZHOU INTELLIGENT TECH CO LTD

Patent Information

Application Number
CN202510705569.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-29
Publication Date
2025-07-01
Estimated Expiration
2045-05-29

AI Technical Summary

Technical Problem

During the large-scale computer board testing, the computer board to be tested has the problem of frequent PXE offline, which leads to the failure of the network card to be offline in time, resulting in the failure of the test and wasting labor and time costs.

Method used

The control device detects whether the image module has packet interaction in real time and determines whether the packet transmission between the computer board and the network card to be tested is normal. When a long time no packet interaction is detected, it detects whether the network card performs an over-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-plug-and-

Benefits of technology

It realizes timely detection of faults and automatic processing when abnormalities occur in network cards or offline, improves the testing efficiency of the board to be tested, saves labor and time costs, and realizes the testing of network cards compatible with different computer boards.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238466A_ABST
    Figure CN120238466A_ABST
Patent Text Reader

Abstract

The invention discloses a network card control method and device, electronic equipment, a storage medium and a product, and relates to the technical field of computers.The method comprises the steps that whether a mirror image module has data packet interaction or not is detected in real time, and a data packet is sent to a network card when a to-be-tested computer board card is subjected to a pre-start execution environment start test; the working mode of the network card is a first working mode; when it is detected that the data packet interaction does not exist in the mirror image module within the preset time period, detecting whether the network card in the first working mode executes an over-plugging operation or not; and if not, sending a first cut-off instruction to the link cut-off module, the first cut-off instruction being used for instructing the link cut-off module to execute a plugging operation on the network card in the first working mode. According to the embodiment of the invention, the problems of test failure and manpower and time cost waste caused by the fact that the offline of the network card cannot be found in time in the starting test process of the to-be-tested computer board card can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of servers, and particularly to a control method, device, electronic device, storage medium and product for a network card. Background Art

[0002] In the field of computer hardware manufacturing, with the explosive growth in the demand for data centers and cloud computing devices, the production scale of computer boards such as motherboards, graphics cards, and server boards has been expanding day by day. Therefore, the testing of computer boards is particularly important. Usually, when a factory tests a computer board, it needs to connect a Universal Serial Bus (USB) network card through a network cable to perform a Preboot Execution Environment (PXE) boot test using the network.

[0003] During the large-scale testing of computer boards, the computer boards to be tested have the problem of frequent PXE offline. Therefore, it is necessary to manually monitor the testing situation of the computer boards to be tested, and when an abnormality occurs in the test or PXE goes offline, the USB network card needs to be re-plugged. This method results in the inability to promptly detect PXE offline, and even test failures, wasting manpower and time costs. Summary of the Invention

[0004] This application provides a control method, device, electronic device, storage medium and product for a network card, so as to at least solve the problem in the related art that during the startup test of a computer board to be tested, the offline of the network card cannot be promptly detected, resulting in test failures and wasting manpower and time costs.

[0005] This application provides a control method for a network card, which is applied to a control module of a control device. The control device further includes a mirror module and a link cut-off module; one end of the control device is connected to a computer board to be tested, and the other end is connected to a network card; the method includes: detecting in real time whether there is data packet interaction in the mirror module, where the data packet is a data packet sent by the computer board to be tested to the network card during the PXE startup test, and the working mode of the network card is the first working mode; when it is detected that there is no data packet interaction in the mirror module within a preset time period, detecting whether the network card in the first working mode has been plugged or unplugged; if not, sending a first cut-off instruction to the link cut-off module, and the first cut-off instruction is used to instruct the link cut-off module to perform a plugging or unplugging operation on the network card in the first working mode.

[0006] The present application also provides a control device for a network card. One end of the control device for the network card is connected to a computer board to be tested, and the other end is connected to a network card. The control device for the network card includes: a detection module, configured to detect in real time whether there is data packet interaction in an image module, where the data packet is a data packet sent by the computer board to be tested to the network card during the pre-boot execution environment startup test, and the working mode of the network card is the first working mode; the detection module is further configured to, when it is detected that there is no data packet interaction in the image module within a preset time period, detect whether the network card in the first working mode has been plugged or unplugged; a transceiver module, configured to, if not, send a first cut-off instruction to a link cut-off module, where the first cut-off instruction is used to instruct the link cut-off module to perform a plugging or unplugging operation on the network card in the first working mode.

[0007] The present application also provides an electronic device, including: a memory, configured to store a computer program; a processor, configured to implement the steps of any of the above network card control methods when executing the computer program.

[0008] The present 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 steps of any of the above network card control methods are implemented.

[0009] The present application also provides a computer program product, including a computer program, which implements the steps of any of the above network card control methods when executed by a processor.

[0010] Through the present application, since it is possible to determine whether the data packet transmission between the computer board to be tested and the network card is normal during the pre-boot execution environment startup test by detecting whether there is data packet interaction in the image module, and then, when no data packet interaction is detected for a long time, that is, when the network card is abnormal or offline, the fault can be discovered in time, and the plugging or unplugging operation on the network card can be performed in time. It is impossible to manually monitor the test situation or perform plugging or unplugging processing, which improves the test efficiency of the board to be tested, saves labor costs and time costs, realizes the test of network cards compatible with different computer boards, and greatly improves the test efficiency and delivery through rate while reducing manual participation in the test. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] To more clearly illustrate the embodiments of the present application, the following will briefly introduce the drawings required in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0012] Figure 1 FIG. 1 is a topological structure diagram of a network card control system provided by an embodiment of the present application; Figure 2Structural block diagram of the control device provided by the embodiment of the present application; Figure 3 Schematic flow chart of a control method for a network card provided by the embodiment of the present application; Figure 4 Schematic flow chart of another control method for a network card provided by the embodiment of the present application; Figure 5 Structural block diagram of a control device provided by the embodiment of the present application; Figure 6 Schematic hardware structure diagram of an electronic device provided by the embodiment of the present application. Specific embodiments

[0013] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the protection scope of the present application.

[0014] It should be noted that in the description of the present application, the terms "including", "comprising" or any other variant 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 the present application are used to distinguish similar objects, rather than to describe a specific order or sequence.

[0015] In order to enable those skilled in the art of the present technology to better understand the solution of the present application, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0016] Combined with the specific application environment architecture or specific hardware architecture on which the execution of the control method of the network card depends, the specific application environment architecture or specific hardware architecture will be described herein.

[0017] The embodiment of the present application is applied to the scenario of using a USB network card for PXE boot to perform network boot testing on a computer board. Among them, the USB network card is used to support network packet processing during PXE boot.

[0018] In the related art, during the large-scale computer board testing process, it is necessary to manually monitor the testing situation of the computer board to be tested, and when an abnormality occurs in the test or the PXE goes offline, the USB network card needs to be re-plugged. This method results in the inability to promptly detect PXE offline, and even test failures, wasting human and time costs. In addition, different computer boards support different working modes of the Universal Serial Bus (USB) network card. Therefore, when actually testing and using the USB network card for PXE boot, it is necessary to manually switch the working modes of the USB network cards compatible with different computer boards.

[0019] To solve the above technical problems, the embodiments of the present application provide a method for controlling a network card. This method enables the control device to judge the situation of the computer board to be tested using the USB network card for PXE boot testing based on the data packet interaction situation, and then switch the working mode of the network card and simulate manual plugging and unplugging. In this way, not only can the network card be automatically plugged and unplugged, but also the working mode of the network card can be switched to match the computer board to be tested, improving the testing efficiency of the board to be tested and saving human and time costs.

[0020] Next, taking Figure 1 the network card control system shown as an example, the method provided by the embodiments of the present application will be described.

[0021] As Figure 1 shown, Figure 1 FIG. is a topological structure diagram of a network card control system provided by an embodiment of the present application. Figure 1 In it, the network card control system 100 includes a computer board 101 to be tested, a control device 102, a network card 103, and a server 104. The computer board 101 to be tested is connected to the control device 102 through a USB cable; the control device 102 is connected to the network card 103 through a USB cable. The network card 103 is connected to the server 104 through a network cable.

[0022] Among them, the computer board 101 to be tested can be a modular component with specific functions in a computer hardware system. Usually, it is carried on a printed circuit board and integrates various electronic components and integrated circuits to realize core functions such as data processing, signal transmission, and function expansion. For example, the computer board 101 to be tested can be a main control type board, an expansion type board, or a special type board.

[0023] The control device 102 can be a device with computing and communication capabilities. The control device 102 includes a control module 1021, a mirror module 1022, a link cut-off module 1023, a mode selection module 1024, a storage module 1025, and a dip switch 1026. As Figure 2 shown, Figure 2A structural block diagram of a control device provided in an embodiment of the present application; Figure 2 In the embodiment, the mode selection module 1024, the mirror module 1022, and the link disconnection module 1023 are connected in sequence; the control module 1021 is connected to the mode selection module 1024, the mirror module 1022, the link disconnection module 1023, and the storage module 1025 respectively; the mode selection module 1024 is also connected to the dip switch 1026.

[0024] The control module 1021 may be a Field-Programmable Gate Array (FPGA) integrated circuit, which is also called an FPGA module.

[0025] The mirror module 1022 can be a hardware device that extends the USB interface, for example, the mirror module 1022 can be a universal serial bus hub. The mirror module 1022 is used to capture and distribute USB data packets through firmware, copying and distributing USB data packets to the control module 1021 in one way and transmitting data packets to the network card 103 in another way.

[0026] The link disconnection module 1023 may be any switching integrated circuit having the function of disconnecting the power supply and reconnecting the power supply. The link disconnection module 1023 is used to implement the plug-in and pull-out operation of the network card.

[0027] The mode selection module 1024 can be any channel switching integrated circuit with a selection function and using the logic of a link switching switch. The mode selection module 1024 is used to implement the working mode switching of the network card.

[0028] The storage module 1025 can be any device with storage function. The storage module 1025 is used to store the firmware information of the FPGA module and save the working status of the network card so that the network card can work according to the memory content when the power is off and the network card is plugged in again.

[0029] The dip switch 1026 can be a mechanical switch that can be used to manually turn on and off a circuit or set a state by manually turning a dial block. The dip switch 1026 is an externally reserved dip switch that can manually select the working mode of the network card.

[0030] The network card 103 may be a network adapter connected to a computer via a USB interface. The network card 103 is also called a USB network card. The network card 103 is also provided with an indicator light. The indicator light is used to display an alarm signal. The network card 103 is used to receive a data packet sent by a computer board to be tested. The network card 103 may be used to implement conversion between a USB protocol and an Ethernet protocol.

[0031] Server 104 can be a network-based startup and deployment tool, mainly used to remotely boot computer boards through a local area network so that they can load an operating system or run a test program without local storage. Server 104 is also called a PXE server.

[0032] Figure 1 The control system of the network card shown is only for illustration and is not used to limit the technical solution of this application. Those skilled in the art should understand that in the specific implementation process, the control system of the network card may also include more devices, which are not limited.

[0033] An embodiment of this application provides a method for controlling a network card, which is applied to Figure 1 the control module shown, such as Figure 3 shown, Figure 3 is a schematic flowchart of a method for controlling a network card provided by an embodiment of this application. The method for controlling the network card includes the following steps: S301: Detect in real time whether there is data packet interaction in the mirror module.

[0034] Among them, the data packet is a data packet sent by the computer board to be tested to the network card during the pre-boot execution environment startup test.

[0035] The working mode of the network card is the first working mode.

[0036] The working modes include USB2.0 working mode or USB3.0 working mode. Among them, the maximum speed of the USB2.0 working mode is lower than that of the USB3.0 working mode. The transmission method of the USB2.0 working mode is half-duplex transmission, and the transmission method of the USB3.0 working mode is full-duplex transmission. The USB2.0 working mode is usually applicable to keyboards, mice, etc., and the USB3.0 working mode is usually applicable to external hard drives, external graphics cards, etc. The network card in the USB2.0 working mode is in a stable J / K state when idle. The network card in the USB3.0 working mode may have periodic TS1 / TS2 pulses when idle. Optionally, the working modes may also include more modes such as USB3.1 working mode or USB4.0 working mode, which are not limited.

[0037] Exemplarily, after the computer board to be tested is powered on and booted, the computer board to be tested starts to transmit data packets to the network card. First, the computer board to be tested transmits data packets to the mode selection module through the USB interface; after receiving the data packets, the mode selection module forwards the data packets to the mirror module; after receiving the data packets, the mirror module continues to transmit the data packets to the link cut-off control module on one hand, and copies and forwards the data packets to the control module on the other hand; if the control module can receive the data packets forwarded by the mirror module, it is detected that there is data packet interaction in the mirror module. On the contrary, if the control module cannot receive the data packets forwarded by the mirror module, it is detected that there is no data packet interaction in the mirror module.

[0038] S302: When it is detected that there is no data packet interaction in the mirror module within a preset time period, detect whether the network card in the first working mode has been plugged or unplugged.

[0039] Among them, the preset time period can be set according to actual needs. For example, the preset time period can be 180 seconds.

[0040] Exemplarily, if the control module cannot receive the data packets forwarded by the mirror module, the timing function is started. When the accumulated timing reaches 180 seconds and still no data packets forwarded by the mirror module are received, it is determined that there is no data packet interaction in the mirror module within the preset time period. At this time, read the number of times of plugging or unplugging operations performed stored in the storage module; if the number is 0, it is determined that the network card in the first working mode has not been plugged or unplugged; if the number is not 0, it is determined that the network card in the first working mode has been plugged or unplugged.

[0041] Optionally, if the control module detects data packet interaction in the mirror module, continue to detect whether there is data packet interaction in the mirror module.

[0042] S303: If not, send the first cut-off instruction to the link cut-off module.

[0043] Among them, the first cut-off instruction is used to instruct the link cut-off module to perform plugging or unplugging operations on the network card in the first working mode.

[0044] Exemplarily, if the control module detects that the network card in the first working mode has not been plugged or unplugged, send the first cut-off instruction to the link cut-off module. After receiving the first cut-off instruction, the link cut-off module performs plugging or unplugging operations on the network card in the first working mode. Specifically, the link cut-off module first controls the signal cut-off of the network card, then cuts off the power supply of the network card to make the network card in a completely offline state. After a period of time, it controls the power supply connection of the network card, and then controls the signal connection of the network card to achieve the function of simulating plugging or unplugging.

[0045] It is understandable that when the control module detects that there is no data packet interaction between the mirror modules, that is, when there is a compatibility offline problem between the computer board and the network card, that is, when a USB network card is in an unconnected state, the control device needs to perform a plugging and unplugging operation on the network card.

[0046] In one example, before the link cutting module performs a plugging and unplugging operation on the network card, the control module obtains the working state of the network card; and stores the working state in the storage module.

[0047] It is understandable that after the network card performs a plugging and unplugging operation, the control module obtains the working state from the storage module and restores the working state.

[0048] In some alternative embodiments, if the control module detects that a network card in the first working mode has performed a plugging and unplugging operation, it obtains the first plugging and unplugging times of the network card having performed a plugging and unplugging operation; if the first plugging and unplugging times are less than or equal to the first threshold, it sends a first cutting instruction to the link switching module.

[0049] Among them, the first threshold can be set according to actual needs. For example, the first threshold can be 10 times.

[0050] Optionally, if the first plugging and unplugging times are greater than the first threshold, the control module sends a first selection instruction to the mode selection module.

[0051] Among them, the first selection instruction is used to instruct the mode selection module to switch the working mode of the network card from the first working mode to the second working mode.

[0052] It is understandable that if the first working mode is the USB2.0 working mode, the second working mode is the USB3.0 working mode. If the first working mode is the USB3.0 working mode, the second working mode is the USB2.0 working mode. If the network card can work for a period of time after being plugged and unplugged multiple times in the first working mode, but then cannot work after a period of time, and this state persists multiple times, it will be determined that there is a compatibility problem with the current USB protocol, and then the network card needs to be switched to the second working mode.

[0053] In some alternative embodiments, after the mode selection module switches the working mode of the network card from the first working mode to the second working mode, the control module sends a second cutting instruction to the link cutting module.

[0054] Among them, the second cutting instruction is used to instruct the link cutting module to perform a plugging and unplugging operation on the network card in the second working mode.

[0055] It is understandable that at this time, the second cutting instruction is used to make the second working mode effective. Therefore, at this time, the link cutting module performs a plugging and unplugging operation on the network card in the second working mode, which is not counted as the plugging and unplugging times of the network card having performed a plugging and unplugging operation.

[0056] In some alternative embodiments, when the working mode of the network card is the second working mode, the control module continues to detect whether there is data packet interaction in the mirror module; when it is detected that there is no data packet interaction in the mirror module within a preset time period, it is detected whether the network card in the second working mode has been plugged or unplugged; if not, a second cut-off instruction is sent to the link cut-off module.

[0057] Optionally, if the control module detects that the network card in the second working mode has been plugged or unplugged, the second plugging / unplugging times of the network card when it has been plugged or unplugged are obtained; if the second plugging / unplugging times are less than or equal to the first threshold, a second cut-off instruction is sent to the link switching module.

[0058] In some alternative embodiments, if the second plugging / unplugging times are greater than the first threshold, the control module sends a second selection instruction to the mode selection module.

[0059] Wherein, the second selection instruction is used to instruct the mode selection module to switch the working mode of the network card from the second working mode back to the first working mode.

[0060] In one example, the working mode of the network card is switched from the first working mode to the second working mode and then switched back from the second working mode to the first working mode, which is recorded as one mode switching round.

[0061] In some alternative embodiments, the control module obtains the number of mode switching rounds; when the control module detects that there is no data packet interaction in the mirror module within a preset time period and the number is greater than the second threshold, it is determined that the network card has an irreparable error.

[0062] Wherein, the second threshold can be set according to actual needs. For example, the second threshold can be 2 times.

[0063] Optionally, after the control module determines that the network card has an irreparable error, an alarm message is sent to the network card. Wherein, the alarm message is used to instruct the network card to display an alarm signal. The alarm signal can be displayed on the indicator light of the network card. For example, the indicator light of the network card is displayed in red.

[0064] It can be understood that when the number of mode switching rounds executed by the network card reaches the second threshold, it indicates that data packets between the network card and the computer board to be tested in different working modes cannot be transmitted normally. At this time, it is determined that the network card has an irreparable error, and an alarm message needs to be sent to prompt the tester to perform fault recovery on the network card.

[0065] In some alternative embodiments, when the control module detects that there is no data packet interaction in the mirror module within a preset time period and the number is less than or equal to the second threshold, a third selection instruction is sent to the mode selection module.

[0066] Among them, the third selection instruction is used to instruct the mode selection module to switch the working mode of the network card.

[0067] Optionally, the control module receives a transmission request from the server; obtains a first weight value for the amount of transmitted data, a second weight value for the expected transmission duration, and a third weight value for the expected device power consumption value; determines, according to the amount of transmitted data, the expected transmission duration, and the expected device power consumption limit of the data packet to be transmitted, the degree to which each mode among multiple modes meets the amount of transmitted data, the maximum value of the degree of meeting the amount of data among all modes, the degree to which each mode meets the transmission duration, the maximum value of the degree of meeting the transmission duration among all modes, the degree to which the power consumption of each mode is within the limit, and the maximum value of the degree of power consumption within the limit among all modes; determines the score of each mode according to the degree to which each mode among multiple modes meets the amount of transmitted data, the maximum value of the degree of meeting the amount of data among all modes, the first weight value, the degree to which each mode meets the transmission duration, the maximum value of the degree of meeting the transmission duration among all modes, the second weight value, the degree to which the power consumption of each mode is within the limit, the maximum value of the degree of power consumption within the limit among all modes, and the third weight value; and determines the mode with the highest score as the target mode.

[0068] Among them, the transmission request carries the amount of transmitted data, the expected transmission duration, and the expected device power consumption limit of the data packet to be transmitted.

[0069] Among them, the control module determines the score of each mode based on a preset formula according to the degree to which each mode among multiple modes meets the amount of transmitted data, the maximum value of the degree of meeting the amount of data among all modes, the first weight value, the degree to which each mode meets the transmission duration, the maximum value of the degree of meeting the transmission duration among all modes, the second weight value, the degree to which the power consumption of each mode is within the limit, the maximum value of the degree of power consumption within the limit among all modes, and the third weight value.

[0070] The preset formula can be: .

[0071] Among them, is the score of each mode. is the maximum value of the degree of meeting the amount of data among all modes; is the maximum value of the degree of meeting the transmission duration among all modes; is the maximum value of the degree of power consumption within the limit among all modes.

[0072] is the first weight value; is the second weight value; is the third weight value. The sum of the first weight value, the second weight value, and the third weight value is 1.

[0073] is the degree to which each mode meets the amount of transmitted data; The degree to which each mode meets the transmission duration; The degree to which the power consumption of each mode is within the limit.

[0074] Among them, the degree to which each mode meets the amount of transmitted data satisfies . Among them, is the amount of transmitted data, is the expected transmission duration, is the transmission rate of each mode.

[0075] The degree to which each mode meets the transmission duration satisfies . Among them, . and are respectively the longest duration and the shortest duration of the amount of transmitted data for all modes. is the duration required for each mode to transmit the amount of data.

[0076] The degree to which the power consumption of each mode is within the limit satisfies . Among them, is the expected device power consumption limit; is the power consumption limit of each mode; is the minimum power consumption limit among all modes.

[0077] Optionally, after determining the target mode, the control module sends a selection instruction to the mode selection module, so that the mode selection module switches the working mode of the network card to the target mode.

[0078] It can be understood that for common USB working modes such as USB2.0 (high-speed mode, theoretical maximum transmission rate 480Mbps), USB3.0 (super high-speed mode, theoretical maximum transmission rate 5Gbps), USB3.1 (further improved transmission rate, USB3.1 Gen1 is USB3.0, USB3.1 Gen2 theoretical maximum transmission rate 10Gbps), USB3.2 (up to 20 Gbps), and USB4 (up to 40 Gbps), etc., and there are also different power supply modes such as USB PD (power transmission) mode, etc. Different modes have differences in terms of transmission speed, power support, etc. Therefore, the control module can comprehensively consider the degree to which each mode in multiple modes meets the amount of transmitted data, the maximum value of the degree to which all modes meet the amount of data, the first weight value of the amount of transmitted data, the degree to which each mode meets the transmission duration, the maximum value of the degree to which all modes meet the transmission duration, the second weight value of the transmission duration, the degree to which each mode's power consumption is within the limit, the maximum value of the degree to which all modes' power consumption is within the limit, and the third weight value of the power consumption limit, to determine the score of each mode, so that the determined target mode is more matched with the computer board to be tested, and the test efficiency is improved.

[0079] Based on Figure 3 the method shown in the figure, the control module detects in real time whether there is data packet interaction in the mirror module, and when it detects that there is no data packet interaction in the mirror module within a preset time period, it detects whether the network card in the first working mode has been plugged or unplugged; and if the network card has not been plugged or unplugged, it sends a first cut-off instruction to the link cut-off module to perform a re-plugging operation on the network card.

[0080] Since it is possible to judge whether the data packet transmission between the computer board to be tested and the network card is normal when the pre-boot execution environment start-up test is performed by detecting whether there is data packet interaction in the mirror module, and then in the case of detecting no data packet interaction for a long time, that is, when the network card has an abnormality or is offline, the fault can be discovered in time, and the network card can be plugged or unplugged in time. It is impossible to manually monitor the test situation or perform plugging or unplugging processing, which improves the test efficiency of the board to be tested, saves labor costs and time costs, realizes the test of different computer boards compatible with network cards, and while reducing the manual participation in the test, greatly improves the test efficiency and delivery straight-through rate.

[0081] An embodiment of the present application provides another method for controlling a network card, as Figure 4 shown Figure 4 is a schematic flowchart of another method for controlling a network card provided by an embodiment of the present application. The method for controlling the network card includes the following steps: S401: Power on and boot the computer board to be tested.

[0082] S402: Detect in real time whether there is data packet interaction in the mirror module.

[0083] For details, please refer to Figure 3 step S301 of the embodiment shown in the figure, which will not be elaborated here.

[0084] S403: If so, maintain the current state and continue to detect.

[0085] S404: If it is detected that there is no data packet interaction in the mirror module, it is detected whether the time when there is no data packet interaction in the mirror module is greater than a preset time period. If not, continue to detect whether there is data packet interaction in the mirror module.

[0086] S405: If so, detect whether the network card has been plugged or unplugged.

[0087] Among them, for S403 to S405, please refer to Figure 3 step S302 of the embodiment shown in the figure, which will not be elaborated here.

[0088] S406: If the network card has not been plugged or unplugged, send a cut-off instruction to the link cut-off module to perform a plugging or unplugging operation on the network card.

[0089] S407: If so, check whether the number of times the network card is plugged and unplugged is greater than the first threshold. If not, execute S406.

[0090] S408: If the number of times the network card is plugged and unplugged is greater than the first threshold, check whether the number of mode polling times is greater than the second threshold.

[0091] S409: If not, send a selection command to the mode selection module to switch the working mode of the network card.

[0092] S410: If the number of mode polling times is greater than the second threshold, determine that an irreparable error has occurred in the network card, and the indicator light of the network card shows a red light.

[0093] Among them, for the details of S406 to S410, please refer to Figure 3 Step S303 of the embodiment shown, which will not be elaborated here.

[0094] It can be understood that the control module can automatically switch the working mode of the USB network card and simulate the function of automatically plugging and unplugging the USB network card, which can solve the problem of unstable connection of the USB network card caused by project compatibility during the production process. In addition, when problems such as frequent offline and accidental offline of the computer board to be tested occur, there is no need to wait for manual inspection to find the abnormality and then deal with it, which greatly reduces the monitoring work of engineers. At the same time, there is no need for the monitoring personnel to notify the on-site workers for on-site operations, reducing the operations of the production line workers. When the computer board to be tested is under pressure testing, it often takes more than 48 hours. Therefore, during the production of the computer board to be tested, if the PXE offline is not detected in time, it will often delay for several hours. Especially during the night pressure testing, it may even delay for dozens of hours. For the computer board to be tested with poor compatibility and prone to frequent PXE offline problems, it will seriously affect the operation and delivery. Therefore, the control module can automatically switch the working mode of the USB network card and simulate the function of automatically plugging and unplugging the USB network card in time, which can greatly improve the delivery efficiency.

[0095] 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.

[0096] The embodiment of the present application also provides a control device, as Figure 5 shown, Figure 5 is a structural block diagram of a control device provided by an embodiment of the present application; one end of the control device of the network card is connected to the computer board to be tested, and the other end is connected to the network card; the control device of the network card includes: The detection module 501 is used to detect in real time whether there is data packet interaction in the mirror module. The data packet is the one sent by the network card when the computer board to be tested starts the pre-boot execution environment test, and the working mode of the network card is the first working mode.

[0097] The detection module 501 is also used to detect whether the network card in the first working mode has been plugged and unplugged when it is detected that there is no data packet interaction in the mirror module within a preset time period.

[0098] The transceiver module 502 is used to, if not, send a first cut-off instruction to the link cut-off module. The first cut-off instruction is used to instruct the link cut-off module to perform a plugging and unplugging operation on the network card in the first working mode.

[0099] In some alternative embodiments, the detection module 501 is also used to, if it is detected that the network card in the first working mode has been plugged and unplugged, obtain the first plugging and unplugging times of the network card. The transceiver module 502 is also used to, if the first plugging and unplugging times are less than or equal to the first threshold, send a first cut-off instruction to the link switching module.

[0100] In some alternative embodiments, the transceiver module 502 is also used to, if the first plugging and unplugging times are greater than the first threshold, send a first selection instruction to the mode selection module. The first selection instruction is used to instruct the mode selection module to switch the working mode of the network card from the first working mode to the second working mode.

[0101] In some alternative embodiments, after the mode selection module switches the working mode of the network card from the first working mode to the second working mode, the transceiver module 502 is also used to send a second cut-off instruction to the link cut-off module. The second cut-off instruction is used to instruct the link cut-off module to perform a plugging and unplugging operation on the network card in the second working mode.

[0102] In some alternative embodiments, the detection module 501 is also used to detect whether there is data packet interaction in the mirror module when the working mode of the network card is the second working mode. When it is detected that there is no data packet interaction in the mirror module within a preset time period, it is detected whether the network card in the second working mode has been plugged and unplugged. The transceiver module 502 is also used to, if not, send a second cut-off instruction to the link cut-off module.

[0103] In some alternative embodiments, the detection module 501 is also used to, if it is detected that the network card in the second working mode has been plugged and unplugged, obtain the second plugging and unplugging times of the network card. The transceiver module 502 is also used to, if the second plugging and unplugging times are less than or equal to the first threshold, send a second cut-off instruction to the link switching module.

[0104] In some alternative embodiments, the transceiver module 502 is further configured to, if the second plugging / unplugging times is greater than the first threshold, send a second selection instruction to the mode selection module, where the second selection instruction is used to instruct the mode selection module to switch the working mode of the network card back from the second working mode to the first working mode.

[0105] In some alternative embodiments, when the working mode of the network card switches from the first working mode to the second working mode and then back from the second working mode to the first working mode, it is recorded as one mode switching round.

[0106] In some alternative embodiments, the detection module 501 is further configured to obtain the number of mode switching rounds; when it detects that there is no data packet interaction in the mirror module within a preset time period and the number is greater than the second threshold, it determines that the network card has an irreparable error.

[0107] In some alternative embodiments, the transceiver module 502 is further configured to, when it detects that there is no data packet interaction in the mirror module within a preset time period and the number is less than or equal to the second threshold, send a third selection instruction to the mode selection module, where the third selection instruction is used to instruct the mode selection module to switch the working mode of the network card.

[0108] In some alternative embodiments, the detection module 501 is further configured to obtain the working state of the network card before the link disconnection module performs a plugging / unplugging operation on the network card; and store the working state in the storage module.

[0109] In some alternative embodiments, the transceiver module 502 is further configured to, after determining that the network card has an irreparable error, send an alarm message to the network card, where the alarm message is used to instruct the network card to display an alarm signal.

[0110] For the descriptions of the features in the embodiments corresponding to the network card control device, reference may be made to the relevant descriptions in the embodiments corresponding to the network card control method, which will not be elaborated here one by one.

[0111] Embodiments of the present application further provide an electronic device, as Figure 6 shown, Figure 6 is a schematic hardware structure diagram of an electronic device provided by an embodiment of the present application. The electronic device includes a processor 10 and a memory 20. The memory 20 stores a computer program, and the processor 10 is configured to run the computer program to execute the steps in any of the above embodiments of the network card control method.

[0112] Embodiments of the present application further provide a computer-readable storage medium, which stores a computer program, where the computer program is configured to execute the steps in any of the above embodiments of the network card control method when running.

[0113] In an exemplary embodiment, the above computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs such as USB flash drives, read-only memory (ROM for short), random access memory (RAM for short), mobile hard disks, magnetic disks, or optical discs.

[0114] The embodiments of the present application also provide a computer program product. The above computer program product includes a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the control method of the network card are implemented.

[0115] The embodiments of the present application also provide another computer program product, including a non-volatile computer-readable storage medium. The non-volatile computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in any of the above embodiments of the control method of the network card are implemented.

[0116] Those skilled in the art can further realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. To clearly illustrate the interchangeability of hardware and software, the components 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 the present application.

[0117] The above has introduced in detail a control method, device, electronic device, storage medium, and product of a network card provided by the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. It should be noted that for those of ordinary skill in the art in the technical field, without departing from the principle of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the protection scope of the claims of the present application.

Claims

1. A control method for a network card, characterized in that, A control module applied to a control device, the control device further comprising a mirroring module and a link cutting module; One end of the control device is connected to a computer board to be tested, and the other end is connected to a network card; the method includes: Real-time detecting whether there is packet interaction in the mirroring module, the packet being a packet sent by the computer board to be tested during a pre-boot execution environment startup test to the network card, and the working mode of the network card being a first working mode; When it is detected that there is no such packet interaction in the mirroring module within a preset time period, detecting whether the network card in the first working mode has been plugged and unplugged; If not, sending a first cut-off instruction to the link cutting module, the first cut-off instruction being used to instruct the link cutting module to perform the plugging and unplugging operation on the network card in the first working mode.

2. The method according to claim 1, characterized in that, The method further includes: If it is detected that the network card in the first working mode has been plugged and unplugged, obtaining a first plugging and unplugging count of the network card having been plugged and unplugged; If the first plugging and unplugging count is less than or equal to a first threshold, sending the first cut-off instruction to the link switching module.

3. The method according to claim 2, characterized in that, The control device further includes a mode selection module; the method further includes: If the first plugging and unplugging count is greater than the first threshold, sending a first selection instruction to the mode selection module, the first selection instruction being used to instruct the mode selection module to switch the working mode of the network card from the first working mode to a second working mode.

4. The method according to claim 3, wherein After the mode selection module switches the working mode of the network card from the first working mode to the second working mode, the method further includes: Sending a second cut-off instruction to the link cutting module, the second cut-off instruction being used to instruct the link cutting module to perform the plugging and unplugging operation on the network card in the second working mode.

5. The method according to claim 4, wherein The method further includes: When the working mode of the network card is the second working mode, detecting whether there is packet interaction in the mirroring module; When it is detected that there is no such packet interaction in the mirroring module within the preset time period, detecting whether the network card in the second working mode has been plugged and unplugged; If not, sending the second cut-off instruction to the link cutting module.

6. The method according to claim 5, wherein The method further includes: If it is detected that the network card in the second working mode has been plugged and unplugged, obtaining a second plugging and unplugging count of the network card having been plugged and unplugged; If the second plugging and unplugging count is less than or equal to the first threshold, sending the second cut-off instruction to the link switching module.

7. The method according to claim 6, characterized in that, The method further includes: If the second plugging and unplugging count is greater than the first threshold, sending a second selection instruction to the mode selection module, the second selection instruction being used to instruct the mode selection module to switch the working mode of the network card from the second working mode back to the first working mode.

8. The method according to claim 7, wherein The working mode of the network card switching from the first working mode to the second working mode and then back from the second working mode to the first working mode is recorded as one mode switching round.

9. The method according to claim 8, characterized in that, The method further includes: Obtaining the count of the mode switching rounds; When it is detected that there is no data packet interaction of the mirror module within the preset time period and the number of times is greater than the second threshold, it is determined that there is an irreparable error in the network card.

10. The method according to claim 9, wherein The method further includes: When it is detected that there is no data packet interaction of the mirror module within the preset time period and the number of times is less than or equal to the second threshold, a third selection instruction is sent to the mode selection module, and the third selection instruction is used to instruct the mode selection module to switch the working mode of the network card.

11. The method according to claim 1, characterized in that, The control device further includes a storage module, and the method further includes: Before the link disconnection module performs the plugging and unplugging operation on the network card, obtain the working state of the network card; Store the working state in the storage module.

12. The method according to claim 9, wherein The method further includes: After determining that there is an irreparable error in the network card, an alarm message is sent to the network card, and the alarm message is used to instruct the network card to display an alarm signal.

13. An electronic device, characterized in that, It includes: A memory for storing a computer program; A processor for implementing the steps of the control method of the network card according to any one of claims 1 to 12 when executing the computer program.

14. A computer-readable storage medium, characterized in that, A computer program is stored in the computer-readable storage medium, wherein the computer program implements the steps of the control method of the network card according to any one of claims 1 to 12 when executed by a processor.

15. A computer program product comprising a computer program, characterized in that, The computer program implements the steps of the control method of the network card according to any one of claims 1 to 12 when executed by a processor.

Citation Information

Patent Citations

  • Test box for board card and complete machine diagnosis test

    CN110647431A

  • PXE starting method, system and device and readable storage medium

    CN114860271A

  • Network card pressure measurement method, device and equipment based on network card mode and medium

    CN118449895A

  • Testing Network Equipment

    US20110182191A1

Cited By

  • Network card fault detection method and electronic equipment

    CN120768749A

  • A network card fault detection method and electronic equipment

    CN120768749B