Physical layer detection method and device, equipment and computer readable storage medium
By reading the register data of the physical layer chip and performing verification and anomaly repair, network problems caused by false carriers were resolved, improving the reliability and stability of the network.
Patent Information
- Application Number
- CN202410868025.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-29
- Publication Date
- 2025-12-30
AI Technical Summary
During communication between the physical layer chip of 100Mbps network and other devices, issues such as cable plugging and unplugging and electromagnetic interference can cause false carrier waves, leading to abnormal network data transmission, increased transmission latency, decreased network performance, and communication interruption. Existing technologies cannot automatically recover from this.
Register data is read through the serial communication bus interface connecting the intellectual property core and the physical layer chip. Based on the preset error carrier threshold, the system performs verification and anomaly repair, including operations such as auto-negotiation linking, digital circuit reset, and hardware reset.
Eliminating false carriers in a timely manner improves network reliability and stability, and restores normal communication.
Smart Images

Figure CN121239601A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of embedded software, and more particularly to a physical layer detection method, apparatus, device, and computer-readable storage medium. Background Technology
[0002] Currently, during network communication between the physical layer (PHY) chip of 100Mbps Ethernet and other devices, false carrier errors may occur due to issues such as cable plugging and unplugging and electromagnetic interference (such as static electricity and surges). This can lead to abnormal network data reception and communication failures, potentially resulting in increased transmission latency, decreased network performance, and communication interruptions.
[0003] Current network upper-layer protocols or PHY chips cannot eliminate connection drops caused by spurious carrier waves, and these drops cannot be automatically recovered over time. Spurious carrier wave errors can cause network data transmission errors, increased transmission latency, degraded network performance, and communication interruptions, thus affecting network reliability and stability. Summary of the Invention
[0004] This application aims to provide a physical layer detection method, apparatus, device, and computer-readable storage medium that can promptly eliminate spurious carriers and improve network reliability and stability.
[0005] The technical solution of this application is implemented as follows:
[0006] This application provides a method for detecting a physical layer, the method comprising:
[0007] If the connection status of the network card information read is normal, the data in the registers of the physical layer chip is read through the serial communication bus interface connected to the intellectual property core and the physical layer chip to obtain the register data; among them, the network card information is generated after registration by the physical layer chip;
[0008] Based on a preset error carrier threshold, the register data is verified to obtain the verification result; if the verification result indicates that the register data is abnormal, the physical layer chip is repaired based on the register data.
[0009] Understandably, when the network interface card (NIC) information indicates a normal connection status, reading the physical layer chip's register data via the serial communication bus interface connecting the NIC and the physical layer chip allows for the elimination of connection-related faults, improving the efficiency of physical layer detection. Simultaneously, a preset error carrier threshold is used to verify the register data, yielding a verification result. If the verification result indicates an anomaly in the register data, the physical layer chip is repaired based on this data. Because this process only targets the physical layer chip for detection and anomaly repair, spurious carriers from the physical layer chip can be eliminated promptly, improving network reliability and stability.
[0010] The above solution involves fault repair of the physical layer chip based on register data, including:
[0011] By leveraging the connection between the intellectual property core and the physical layer chip, configuration parameters in the device tree can be obtained.
[0012] By configuring parameters and combining them with register data, anomalies in the physical layer chip can be repaired.
[0013] Understandably, configuration parameters in the device tree can be obtained from the device tree parameters based on the connection relationship between the intellectual property core and the physical layer chip. These configuration parameters can then be used to directly determine the parameters required for anomaly repair in the physical layer chip. After obtaining these parameters, and combining them with register data, anomaly repair can be performed directly on the physical layer chip. Because the anomaly repair is performed directly on the physical layer chip, spurious carriers can be eliminated promptly, improving network reliability and stability.
[0014] In the above scheme, the register data includes: first register data and / or second register data;
[0015] Based on a preset error carrier threshold, the register data is verified to obtain the verification results, including:
[0016] The data in the first register is verified to obtain a first verification result, and / or the data in the second register is verified using a preset error carrier threshold to obtain a second verification result;
[0017] The verification result is determined based on the first verification result and / or the second verification result.
[0018] It is understandable that the first register data is verified to obtain the first verification result, and / or the second register data is verified using a preset error carrier threshold to obtain the second verification result. Then, the verification result is determined by the first verification result and / or the second verification result. In this process, two verifications are performed, which can make the verification result more accurate.
[0019] If the network card information indicates a normal connection status, the data in the physical layer chip's registers is read via the serial communication bus interface connecting the intellectual property core and the physical layer chip. The resulting register data includes:
[0020] If the connection status of the network card information read is normal, the data of the status bit register of the physical layer chip is read from the network card device through the serial communication bus interface to obtain the first register data;
[0021] The second register data is obtained by reading the error carrier count register data of the physical layer chip from the network card device through the serial communication bus interface.
[0022] Understandably, when the network card information reads a normal connection status, data from different types of registers in the physical layer chip is read to obtain different types of register data, which is convenient for subsequent judgment of whether there are any abnormalities and for abnormality repair.
[0023] In the above scheme, the data in the first register is verified to obtain a first verification result, and / or, the data in the second register is verified using a preset error carrier threshold to obtain a second verification result, including:
[0024] The data in the first register is verified. If the flag bit of the first register data contains abnormal information, then the first verification result is determined to be abnormal; and / or,
[0025] The second register data is verified using a preset error carrier threshold. If the second register data is greater than the preset error carrier threshold, the second verification result is determined to be abnormal. The abnormality of the first verification result and the abnormality of the second verification result both indicate that the physical layer chip has an error carrier.
[0026] It is understandable that by verifying the data in the first register, if there is abnormal information in the flag bit of the data in the first register, it is determined that the first verification result is abnormal; by verifying the data in the second register, if the data in the second register is greater than the preset error carrier threshold, it is determined that the second verification result is abnormal. This can facilitate the accurate determination of the verification result and the repair of the abnormality.
[0027] In the above scheme, the data of the error carrier count register of the physical layer chip is read from the network card device through the serial communication bus interface to obtain the second register data, including:
[0028] The error carriers are counted using string manipulation instructions, shift instructions, and loop instructions in the error carrier count register to obtain the count value of the error carrier count register;
[0029] The error carrier count register of the physical layer chip is read from the serial communication bus interface to obtain the second register data.
[0030] It is understandable that the error carriers are counted by the string operation instructions, shift instructions and loop instructions in the error carrier count register, and the count value of the error carrier count register is obtained. The count value of the error carrier count register of the physical layer chip is read to obtain the data of the second register, which is convenient for subsequent determination of the verification result.
[0031] The above solution involves configuring parameters and combining them with register data to perform anomaly repair on the physical layer chip, including:
[0032] If the verification result indicates that the register data is abnormal, then the abnormal data type of the register data is determined.
[0033] Based on the abnormal data type, at least one abnormal repair operation is determined; wherein, at least one abnormal repair operation includes: auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip;
[0034] By configuring parameters, at least one of the following can be performed: auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip, to repair the physical layer chip abnormally.
[0035] Understandably, if the verification result indicates that there is an anomaly in the register data, then the abnormal data type of the register data is determined; based on the abnormal data type, at least one anomaly repair operation is determined among auto-negotiation link, physical layer chip digital circuit reset, and physical layer chip hardware reset; by performing anomaly repair on the physical layer chip through at least one of auto-negotiation link, physical layer chip digital circuit reset, and physical layer chip hardware reset, the reliability and stability of the network can be improved.
[0036] In the above scheme, by configuring parameters, at least one of the following is performed: auto-negotiation link, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip, to perform anomaly repair on the physical layer chip, including:
[0037] By configuring parameters, a self-negotiation link is established. If the self-negotiation link is successful, erroneous carrier information is eliminated, completing the anomaly repair of the physical layer chip; and / or,
[0038] By configuring parameters, the digital circuitry of the physical layer chip is reset. If the digital circuitry reset is successful, erroneous carrier information is eliminated, thus completing the anomaly repair of the physical layer chip; and / or,
[0039] By configuring parameters, the physical layer chip is hardware reset. If the hardware reset is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0040] It is understandable that by configuring parameters and performing at least one of the following anomaly repair methods—auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip—to repair anomalies in the physical layer chip, the reliability and stability of the network can be improved, and normal network communication can be restored.
[0041] In the above scheme, a self-negotiation link is established by configuring parameters. If the self-negotiation link is successful, erroneous carrier information is eliminated, completing the anomaly repair of the physical layer chip, including:
[0042] By configuring parameters and filtering them, the first parameter corresponding to the self-negotiation link can be determined.
[0043] Driven by the kernel, the same operating parameters in the devices at both ends of the link are determined by the interaction information between the first parameter and the devices at both ends of the link; among them, the operating parameters include the operating mode and the running rate.
[0044] By rapidly connecting pulse signals, information about the working mode and the operating speed are exchanged to obtain the exchanged information;
[0045] A self-negotiation link is established when the exchanged information between the devices at both ends of the link is consistent.
[0046] If the auto-negotiation link is successful, erroneous carrier information is eliminated, and the anomaly repair of the physical layer chip is completed.
[0047] Understandably, repairing physical layer chips through auto-negotiation can improve network reliability and stability and restore normal network communication.
[0048] In the above scheme, the digital circuit of the physical layer chip is reset by configuring parameters. If the digital circuit reset is successful, the erroneous carrier information is eliminated, and the anomaly repair of the physical layer chip is completed, including:
[0049] By configuring parameters and filtering them, the second parameter corresponding to the self-negotiation link can be determined.
[0050] Under kernel drive, the circuit logic module or first register of the physical layer chip is digitally reset by using the second parameter and the acquired reset signal, thereby realizing digital communication of the physical layer chip;
[0051] If the digital circuit is successfully reset, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0052] It is understandable that resetting the physical layer chip via digital circuits can improve network reliability and stability and restore normal network communication.
[0053] In the above scheme, the physical layer chip is hardware reset by configuring parameters. If the hardware reset is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed, including:
[0054] By configuring parameters and filtering them, the third parameter corresponding to hardware reset can be determined.
[0055] Under kernel-driven operation, the physical layer chip is hardware reset via the third parameter and the chip reset pin of the physical layer chip.
[0056] If the hardware reset is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0057] Understandably, repairing physical layer chips through hardware reset can improve network reliability and stability and restore normal network communication.
[0058] The above scheme also includes the following methods:
[0059] When performing anomaly repair on the physical layer chip, record the anomaly repair information and upload it to the log management system. The anomaly repair information includes: anomaly repair time, anomaly repair method, and anomaly repair process.
[0060] It is understandable that when performing anomaly repair on the physical layer chip, relevant anomaly repair information should be recorded and uploaded to the log management system for easy anomaly query in the future.
[0061] In the above scheme, when performing anomaly repair on the physical layer chip, anomaly repair-related information is recorded, including:
[0062] If auto-negotiation linking is performed, record the time of successful auto-negotiation linking, the operating parameters selected during chip auto-negotiation linking, and the auto-negotiation linking process.
[0063] If the digital circuit of the physical layer chip is reset, record the type of reset signal, the circuit logic module or register that is reset, the digital circuit reset process, and the time it takes for the physical layer chip to return to normal working state.
[0064] If a hardware reset of the physical layer chip is performed, the chip reset pin corresponding to the hardware reset of the physical layer chip, the hardware reset process, and the time it takes for the physical layer chip to return to normal working state are recorded.
[0065] It is understandable that when performing fault repair on physical layer chips, recording fault repair information related to auto-negotiation links, digital circuit resets, and hardware resets facilitates subsequent fault lookup.
[0066] The above scheme also includes the following methods:
[0067] By traversing the registered network interface card (NIC) information, the connection status in the registered NIC information is read;
[0068] When the connection status is normal, the register status of the physical layer chip is detected based on a preset detection time; the preset detection time is data that is set in advance before the detection is performed.
[0069] It is understandable that by traversing the registered network interface card (NIC) information and reading the connection status within the registered NIC information, and if the connection status is normal, the register status of the physical layer chip can be detected based on a preset detection time, which can reduce unnecessary traversal and improve the detection efficiency of the physical layer.
[0070] This application provides a physical layer detection device, which includes: an acquisition unit and a repair unit; wherein...
[0071] The acquisition unit is used to read the data in the registers of the physical layer chip through the serial communication bus interface connected to the intellectual property core and the physical layer chip when the link status of the network card information is normal. The network card information is generated after registration with the physical layer chip. The register data is verified based on a preset error carrier threshold to obtain the verification result.
[0072] The repair unit is used to repair the physical layer chip based on the register data if the verification result indicates that there is an anomaly in the register data.
[0073] This application provides a physical layer detection device, including: a processor and a memory, wherein,
[0074] Memory, used to store computer programs;
[0075] The processor is used to retrieve and run computer programs from memory to perform the physical layer detection methods described above.
[0076] This application provides a computer-readable storage medium storing executable instructions for inducing a processor to execute the aforementioned physical layer detection method.
[0077] This application provides a physical layer detection method, apparatus, device, and computer-readable storage medium. The method includes: when the link status of the read network interface card (NIC) information is normal, reading data from the registers of the physical layer chip through a serial communication bus interface connected to the NIC core and the physical layer chip to obtain register data; wherein the NIC information is generated after registration by the physical layer chip; verifying the register data based on a preset error carrier threshold to obtain a verification result; if the verification result indicates that the register data is abnormal, then performing anomaly repair on the physical layer chip based on the register data. Using the above scheme, when the link status of the read NIC information is normal, reading the register data of the physical layer chip through the serial communication bus interface connected to the NIC core and the physical layer chip allows for the elimination of faults caused by link status based on the obtained register data, improving the efficiency of physical layer detection. Simultaneously, verifying the register data through a preset error carrier threshold to obtain a verification result; if the verification result indicates that the register data is abnormal, then performing anomaly repair on the physical layer chip based on the register data. Since this process only targets the physical layer chip for detection and anomaly repair, it can promptly eliminate spurious carriers in the physical layer chip, improving network reliability and stability. Attached Figure Description
[0078] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application. Obviously, the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0079] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0080] Figure 1 An optional flowchart illustrating a physical layer detection method provided in this application embodiment. Figure 1 ;
[0081] Figure 2 A schematic diagram of an optional seven-layer network interconnection framework for a physical layer detection method provided in an embodiment of this application;
[0082] Figure 3 An optional flowchart illustrating a physical layer detection method provided in this application embodiment. Figure 2 ;
[0083] Figure 4 An optional flowchart illustrating a physical layer detection method provided in this application embodiment. Figure 3 ;
[0084] Figure 5 A schematic diagram of an optional Ethernet physical layer monitoring and recovery module for a physical layer detection method provided in this application embodiment;
[0085] Figure 6 An optional flowchart illustrating a physical layer detection method provided in this application embodiment. Figure 4 ;
[0086] Figure 7 This is a schematic diagram of the structure of a physical layer detection device provided in an embodiment of this application;
[0087] Figure 8 This is a schematic diagram of the structure of a physical layer detection device provided in an embodiment of this application. Detailed Implementation
[0088] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the specific technical solutions of this application will be further described in detail below with reference to the accompanying drawings of the embodiments of this application. The following embodiments are used to illustrate this application, but are not intended to limit the scope of this application.
[0089] Unless otherwise defined, all technical and scientific terms used in this application have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used in this application is for the purpose of describing embodiments of this application only and is not intended to be limiting of this application.
[0090] In the following description, references to "some embodiments," "this embodiment," "this application embodiment," and examples, etc., describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subset of all possible embodiments and may be combined with each other without conflict.
[0091] If the application documents contain similar descriptions such as "first / second", the following explanation shall be added: In the following description, the terms "first / second / third" are used only to distinguish similar objects and do not represent a specific order of objects. It is understood that "first / second / third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.
[0092] Figure 1 An optional flowchart illustrating a physical layer detection method provided in this application embodiment. Figure 1 ,like Figure 1 As shown, the physical layer detection method includes the following steps:
[0093] S101. When the connection status of the network card information read is normal, the data of the register of the physical layer chip is read through the serial communication bus interface connected to the intellectual property core and the physical layer chip to obtain the register data; wherein, the network card information is generated after registration by the physical layer chip.
[0094] In some embodiments of this application, network interface card (NIC) information is generated after registration with the physical layer chip. The serial communication bus interface of the intellectual property core (IP core) is connected to at least one physical layer chip, so that the reset of at least one PHY chip can be controlled via the serial communication bus interface through the kernel driver and device tree.
[0095] For example, the serial communication bus interface can be the MDIO pin of a 100Mbps Ethernet IP core. The MDIO pin of the 100Mbps Ethernet IP core is used to connect four PHY chips, thus binding the network interface card (NIC) device.
[0096] In some embodiments of this application, the physical layer detection method is adapted to scenarios where the physical layer chip experiences spurious carriers and needs to perform abnormal repair.
[0097] In some embodiments of this application, the physical layer detection method is executed by a physical layer detection device, which can be an electronic device. This application does not impose specific limitations on this.
[0098] It should be noted that electronic devices can perform physical layer testing through testing programs installed on the electronic device. These testing programs can be programs that can be set in the operating system of the same device as the PHY chip.
[0099] In some embodiments of this application, current network communication commonly adopts the Open Systems Interconnection (OSI) reference model. An open system is a system that exchanges matter, energy, and information with its external environment. Its characteristics include portability, customizability, interoperability, and ease of access. This interconnection model was developed by the ISO (International Organization for Standardization) in 1985. OSI defines a seven-layer framework for network interconnection (physical layer, data link layer, network layer, transport layer, session layer, presentation layer, and application layer). Each layer implements its own functions and protocol set, defining the data generation process and completing interface communication with adjacent layers. OSI's service definitions detail the services provided by each layer. A service of a particular layer is a capability of that layer and the layers below it, provided to the next higher layer through an interface. The services provided by each layer are independent of how these services are implemented.
[0100] For example, such as Figure 2 As shown, both the OSI transmitter 1 (host A) and receiver 2 (host B) contain a seven-layer framework. Host A and host B are connected through router 3, which includes the network layer 25c, data link layer 26c, and physical layer 27c. OSI transmitter 1 includes a seven-layer framework for network interconnection: physical layer 27a, data link layer 26a, network layer 25a, transport layer 24a, session layer 23a, presentation layer 22a, and application layer 21a. OSI receiver 2 also includes a seven-layer framework for network interconnection: physical layer 27b, data link layer 26b, network layer 25b, transport layer 24b, session layer 23b, presentation layer 22b, and application layer 21b. Physical layers 27a, 27b, and 27c are the lowest layers of network communication, responsible for transmitting raw bitstream data over the physical medium. The main functions of physical layers 27a, 27b, and 27c include: defining the electrical characteristics of physical connections—a key feature of the network physical layer protocol; signal voltage levels, impedance matching, transmission rate and distance limitations; physical interfaces and transmission media (e.g., cables, optical fibers); implementing data encoding, modulation, and demodulation; and controlling data transmission rate, clock synchronization, and data timing. Physical layers 27a and 27b provide transparent bitstream transmission without modifying or interpreting the original data, ensuring data integrity and accuracy, improving communication efficiency, and converting digital signals into physical signals for transmission over the transmission medium. Physical layers 27a and 27b are also the most susceptible to environmental influences; interference from the external environment typically manifests in physical layers 27a and 27b. This application addresses the error detection mechanism of the physical layer.
[0101] In some embodiments of this application, a PHY chip is a hardware device, typically corresponding to the physical layer. It is the actual implementation of the physical layer, responsible for performing its functions and tasks. The PHY chip is usually directly connected to the transmission medium (such as cables, optical fibers, etc.) and handles signal modulation, encoding, and decoding at the physical layer. The PHY chip plays a crucial role in communication systems, implementing the functions of the physical layer, including converting digital signals to physical signals, modulation and demodulation, signal encoding, clock synchronization, and data timing control. It is also responsible for detecting and monitoring signal strength, quality, and error conditions on the transmission medium, and performing error detection and correction as needed.
[0102] In some embodiments of this application, when the connection status of the network card information read is normal, the detection program in the electronic device can obtain the register data by reading the register data of the physical layer chip through the main chip.
[0103] In some embodiments of this application, when the link status of the network card information read is normal, the electronic device can monitor the status of the PHY chip through a detection program, and read the data of the registers of the physical layer chip through the serial communication bus interface connected to the intellectual property core and the physical layer chip to obtain the register data.
[0104] In some embodiments of this application, when the link status of the network card information read is normal, the detection program in the electronic device can read the data of the status bit register of the physical layer chip through the main chip and the serial communication bus interface to obtain the first register data; the detection program in the electronic device can read the data of the error carrier count register of the physical layer chip through the main chip to obtain the second register data.
[0105] S102. Based on the preset error carrier threshold, the register data is verified to obtain the verification result.
[0106] In some embodiments of this application, the preset carrier threshold is set based on detection experience.
[0107] In some embodiments of this application, a first verification result is obtained by verifying the data in the first register, and / or a second verification result is obtained by verifying the data in the second register using a preset error carrier threshold. Based on the first verification result and / or the second verification result, a verification result is determined.
[0108] It should be noted that the data in the first register is the status value of the status bit register, and the data in the second register is the number of errors that occurred in the error carrier count register.
[0109] In some embodiments of this application, the status bit register, also known as the condition code register, is part of the arithmetic logic unit (ALU), a core component of the computer system. The status bit register stores a series of binary bits, each representing a state or result of the processor after executing a specific type of operation. These flag bits play a crucial role in understanding the result of instruction execution, controlling program branching logic, and influencing program control flow. The status register stores two types of information: one is various status information (condition codes) reflecting the result of the current instruction execution, such as carry (CF bit), overflow (OV bit), result sign (SF bit), result zero (ZF bit), parity flag (P bit), etc.; the other is control information (PSW: Program Status Word Register), such as interrupt enable (IF bit), trace flag (TF bit), etc. In some machines, the PSW is called the Flag Register (FR). The error carrier count register stores the number of errors that occurred and is divided into a receive error register and a transmit error register. During operation, the error carrier count register maintains a set of counters to track various error states of the network protocol stack. If needed, the application can debug runtime problems by checking error counters, including low memory availability, poor performance, or missing data packets.
[0110] In some embodiments of this application, the CF bit, or carry flag, is used. During arithmetic operations, if the result exceeds the range that a register can represent (e.g., unsigned addition produces a carry, or unsigned subtraction requires a borrow), this flag is set. In some processors, the carry flag is also used for carry or borrow handling in multi-byte operations.
[0111] In some embodiments of this application, the ZF bit, or zero flag, is set if the result of an arithmetic or logical operation is zero. Programs often use this flag to determine whether a certain condition has been met; for example, one of the termination conditions of a loop is checking if the result of the operation is zero.
[0112] In some embodiments of this application, the OV bit is the overflow flag. During arithmetic operations, this flag is set if the result of the operation exceeds the range of a signed number (i.e., positive or negative overflow). The overflow flag helps distinguish the validity of the operation result, especially for addition and subtraction operations on signed numbers.
[0113] In some embodiments of this application, the SF bit, or sign flag, reflects the highest bit of the operation result (typically corresponding to the sign bit of a signed number). If the result is negative, this flag is set; otherwise, it is cleared. The sign flag is used to indicate the positive or negative nature of the operation result.
[0114] In some embodiments of this application, the P bit, i.e., the parity flag, is set or cleared based on whether the number of 1s in the accumulator's operation result is odd or even. The parity flag is commonly used in data verification or communication protocols.
[0115] S103. If the verification result indicates that there is an anomaly in the register data, then the physical layer chip is repaired based on the register data.
[0116] In some embodiments of this application, the verification result indicates that the abnormality of the register data is generally due to the presence of a false carrier in the physical layer chip.
[0117] In some embodiments of this application, if the verification result indicates that the register data is abnormal, the abnormal data type of the register data is determined. Based on the abnormal data type, at least one abnormal repair operation is determined. The at least one abnormal repair operation includes: auto-negotiation linking, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip; the physical layer chip is repaired by using at least one of auto-negotiation linking, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip.
[0118] In some embodiments of this application, if the verification result indicates that the register data is abnormal, the electronic device can determine whether the abnormality is in the status register data or the error carrier count register data, thereby determining the abnormal data type.
[0119] Understandably, when the network interface card (NIC) information indicates a normal connection status, reading the register data of the physical layer chip allows for the elimination of connection-related faults, improving the efficiency of physical layer detection. Simultaneously, a preset error carrier threshold is used to verify the register data, yielding a verification result. If the verification result indicates an anomaly in the register data, the physical layer chip is repaired based on this data. Since this process only targets the physical layer chip for detection and repair, spurious carriers from the physical layer chip can be eliminated promptly, improving network reliability and stability.
[0120] In some embodiments of this application, S101 can be implemented by S1011 and / or S1012, as follows:
[0121] S1011. If the connection status of the network card information read is normal, the data of the status bit register of the physical layer chip is read from the network card device through the serial communication bus interface to obtain the first register data.
[0122] In some embodiments of this application, the electronic device reads the registered network card information. When the link status of the read network card information is normal, the detection program in the electronic device can read the data of the status bit register of the physical layer chip from the network card device through the main chip and the serial communication bus interface to obtain the status bit data, i.e., the first register data.
[0123] In some embodiments of this application, the data in the status bit register includes different status bit data, which are represented by hexadecimal values. These different values can represent different meanings and are used to indicate the current status of the register.
[0124] For example, the status bit data in the status bit register is 16 bits of binary, such as 0x01, 0x02, and 0x03. 0x01 indicates a power failure, 0x02 indicates a CRC checksum error, and 0x03 indicates a carrier error.
[0125] S1012. Read the data from the error carrier count register of the physical layer chip from the network card device through the serial communication bus interface to obtain the second register data.
[0126] In some embodiments of this application, the occurrence of erroneous carriers is counted by the string operation instructions, shift instructions and loop instructions in the erroneous carrier count register to obtain the count value of the erroneous carrier count register; the count value of the erroneous carrier count register of the physical layer chip is read to obtain the second register data.
[0127] In some embodiments of this application, the electronic device can count the occurrence of erroneous carriers through string operation instructions, shift instructions and loop instructions in the erroneous carrier count register, and store the count value in the erroneous carrier count register. The detection program in the electronic device reads the count value of the erroneous carrier count register of the physical layer chip from the network card device through the main chip and serial communication bus interface to obtain the second register data.
[0128] Understandably, if the connection status of the network card information read is normal, data from different types of registers in the physical layer chip is read to obtain different types of register data, which is convenient for subsequent judgment of whether there are any abnormalities and for abnormal repair.
[0129] In some embodiments of this application, such as Figure 3 As shown, S102 can be implemented through S1021 and S1022, as follows:
[0130] S1021. Verify the data in the first register to obtain a first verification result, and / or verify the data in the second register using a preset error carrier threshold to obtain a second verification result.
[0131] In some embodiments of this application, the electronic device can verify the data in the first register to determine whether there is any abnormal information in the data in the first register, thereby obtaining a first verification result. And / or, the electronic device can also verify the data in the second register using a preset error carrier threshold to determine whether there is any abnormal data in the data in the second register, thereby obtaining a second verification result.
[0132] In some embodiments of this application, the data of the first register is verified. If there is abnormal information in the flag bit of the first register data, it is determined that the first verification result is abnormal; and / or, the data of the second register is verified using a preset error carrier threshold. If the data of the second register is greater than the preset error carrier threshold, it is determined that the second verification result is abnormal; wherein, the abnormality of the first verification result and the abnormality of the second verification result both indicate that the physical layer chip has an error carrier.
[0133] In some embodiments of this application, the electronic device verifies the flag bits or status bits in the first register data. If there is abnormal information in the flag bits or status bits, it is determined that the first verification result is abnormal; otherwise, it is determined that the first verification result is not abnormal. And / or, the electronic device verifies the second register data using a preset error carrier threshold, determining whether the count value of the error carrier count register is greater than the preset error carrier threshold. If the count value of the error carrier count register is greater than the preset error carrier threshold, it is determined that the second verification result is abnormal; otherwise, it is determined that the second verification result is not abnormal.
[0134] It should be noted that both the abnormality of the first verification result and the abnormality of the second verification result indicate that the physical layer chip has an erroneous carrier.
[0135] S1022. Based on the first verification result and / or the second verification result, determine the verification result.
[0136] In some embodiments of this application, the electronic device may determine the verification result based on the first verification result of the first register data. Alternatively, the electronic device may determine the verification result based on the second verification result of the second register data. Or, the electronic device may further determine the verification result based on the first verification result of the first register data and the second verification result of the second register data.
[0137] For example, if the first verification result is abnormal, then it is determined that the verification result is abnormal. If the second verification result is abnormal, then it is determined that the verification result is abnormal.
[0138] It is understandable that the first register data is verified to obtain the first verification result, and / or the second register data is verified using a preset error carrier threshold to obtain the second verification result. Then, the verification result is determined by the first verification result and / or the second verification result. In this process, two verifications are performed, which can make the verification result more accurate.
[0139] In some embodiments of this application, S103 can be implemented by S201 and S202, as follows:
[0140] S201. Obtain the configuration parameters in the device tree by connecting the intellectual property core and the physical layer chip.
[0141] In some embodiments of this application, the configuration parameters in the device tree are pre-set in the parameters of the device tree based on the connection relationship between the intellectual property core and the physical layer chip.
[0142] For example, the block design of an FPGA, as well as the configuration parameters of the Linux kernel driver and device tree, can be designed based on the connection relationship between the intellectual property core and the physical layer chip.
[0143] In some embodiments of this application, electronic devices can directly obtain configuration parameters from multiple parameters in the device tree through the connection relationship between the intellectual property core and the physical layer chip.
[0144] S202. By configuring parameters and combining register data, perform anomaly repair on the physical layer chip.
[0145] In some embodiments of this application, electronic devices can perform anomaly repair on physical layer chips by configuring parameters and combining them with register data.
[0146] In some embodiments of this application, if the verification result indicates that the register data is abnormal, the abnormal data type of the register data is determined; based on the abnormal data type, at least one abnormal repair operation is determined; wherein, the at least one abnormal repair operation includes: auto-negotiation linking, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip. By configuring parameters, at least one of auto-negotiation linking, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip is performed to repair the abnormality of the physical layer chip.
[0147] In some embodiments of this application, the PHY chip reset is controlled by the configuration parameters of the device tree under the kernel driver of the electronic device.
[0148] For example, the reset can be controlled through the kernel driver and device tree configuration parameters of the electronic device. Specifically, the reset of at least one PHY chip can be controlled through the MDIO pin of the IP core. The reset methods include auto-negotiation link, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip.
[0149] Understandably, configuration parameters in the device tree can be obtained from the device tree parameters based on the connection relationship between the intellectual property core and the physical layer chip. These configuration parameters can then be used to directly determine the parameters required for anomaly repair in the physical layer chip. After obtaining these parameters, and combining them with register data, anomaly repair can be performed directly on the physical layer chip. Because the anomaly repair is performed directly on the physical layer chip, spurious carriers can be eliminated promptly, improving network reliability and stability.
[0150] In some embodiments of this application, such as Figure 4 As shown, S202 can be implemented through S2021, S2022, and S2023, as follows:
[0151] S2021. If the verification result indicates that there is an anomaly in the register data, then determine the abnormal data type of the register data.
[0152] In some embodiments of this application, if the verification result indicates that the data in the register is abnormal (i.e., the data in the first register is abnormal, and / or the data in the second register is abnormal), then the abnormal data type of the register data is determined.
[0153] It should be noted that abnormal data types include abnormal data in the first register, abnormal data in the second register, and abnormal data in both the first register and the second register.
[0154] S2022. Based on the abnormal data type, determine at least one abnormal repair operation; wherein, at least one abnormal repair operation includes: auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip.
[0155] In some embodiments of this application, an electronic device can determine at least one abnormal repair operation among negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip by abnormal data type.
[0156] S2023. By configuring parameters, perform at least one of the following: auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip, to perform abnormal repair of physical layer chip.
[0157] In some embodiments of this application, the electronic device can perform at least one of the following abnormal repair operations—auto-negotiation link, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip—by configuring parameters to repair the physical layer chip abnormally.
[0158] In some embodiments of this application, a self-negotiation link is performed by configuring parameters. If the self-negotiation link is successful, erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed; and / or, the digital circuit of the physical layer chip is reset by configuring parameters. If the digital circuit reset is successful, erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed; and / or, the hardware of the physical layer chip is reset by configuring parameters. If the hardware reset is successful, erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0159] In some embodiments of this application, after determining that the physical layer chip has an anomaly, the electronic device can perform an auto-negotiation link. If the auto-negotiation link is successful, the erroneous carrier information is eliminated, completing the anomaly repair of the physical layer chip. If the auto-negotiation link fails, the digital circuit of the physical layer chip is reset. If the digital circuit reset is successful, the erroneous carrier information is eliminated, completing the anomaly repair of the physical layer chip. If the digital circuit reset fails, the hardware reset of the physical layer chip is performed. If the hardware reset is successful, the erroneous carrier information is eliminated, completing the anomaly repair of the physical layer chip.
[0160] Understandably, if the verification result indicates that the register data is abnormal, then the abnormal data type of the register data is determined; based on the abnormal data type, at least one of the following abnormal repair operations is determined: auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip; by configuring parameters, at least one of the following—auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip—can be used to repair the physical layer chip abnormally, thereby improving the reliability and stability of the network.
[0161] In some embodiments of this application, S2023 can be implemented by at least one of S301, S302, and S303, as follows:
[0162] S301. By configuring parameters, a self-negotiation link is established. If the self-negotiation link is successful, erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0163] In some embodiments of this application, after determining that there is an anomaly in the physical layer chip, the electronic device performs a self-negotiation link. If the self-negotiation link is successful, the erroneous carrier information is eliminated, and the anomaly repair of the physical layer chip is completed.
[0164] In some embodiments of this application, parameter filtering is performed by configuring parameters to determine the first parameter corresponding to the auto-negotiation link; under the kernel driver, the same operating parameters in the devices at both ends of the link are determined by the interaction information between the first parameter and the devices at both ends of the link; wherein, the operating parameters include the operating mode and the operating rate; by using a fast connection pulse signal, the information of the operating mode and the information of the operating rate are exchanged to obtain the exchange information; when the exchange information of the devices at both ends of the link is consistent, the auto-negotiation link is realized; if the auto-negotiation link is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0165] S302. By configuring parameters, the digital circuit of the physical layer chip is reset. If the digital circuit is successfully reset, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0166] In some embodiments of this application, if the auto-negotiation link fails after the electronic device performs the auto-negotiation link, the digital circuit of the physical layer chip is reset. If the digital circuit reset is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0167] In some embodiments of this application, by configuring parameters and filtering parameters, the second parameter corresponding to the digital circuit reset is determined; under the kernel driver, the circuit logic module or the first register of the physical layer chip is digitally reset by using the second parameter and the obtained reset signal, so as to realize the digital communication of the physical layer chip; if the digital circuit reset is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0168] S303. By configuring parameters, perform a hardware reset of the physical layer chip. If the hardware reset is successful, eliminate the erroneous carrier information and complete the abnormal repair of the physical layer chip.
[0169] In some embodiments of this application, the electronic device performs a digital circuit reset of the physical layer chip. If the digital circuit reset of the physical layer chip fails, a hardware reset of the physical layer chip is performed. If the hardware reset is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0170] In some embodiments of this application, parameter filtering is performed by configuring parameters to determine the third parameter corresponding to hardware reset; under kernel driver, the physical layer chip is hardware reset by the third parameter and the chip reset pin of the physical layer chip; if the hardware reset is successful, the erroneous carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
[0171] It is understandable that by repairing the physical layer chip through at least one of the following methods—auto-negotiation link, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip—the reliability and stability of the network can be improved, and normal network communication can be restored.
[0172] In some embodiments of this application, the physical layer detection method further includes: S104, as follows:
[0173] S104. When performing anomaly repair on the physical layer chip, record the anomaly repair information and upload it to the log management system; the anomaly repair information includes: anomaly repair time, anomaly repair method, and anomaly repair process.
[0174] In some embodiments of this application, if auto-negotiation linking is performed, the time of successful auto-negotiation linking, the operating parameters selected during chip auto-negotiation linking, and the auto-negotiation linking process are recorded.
[0175] In some embodiments of this application, if the digital circuit of the physical layer chip is reset, the type of reset signal, the circuit logic module or register that is reset, the digital circuit reset process, and the time it takes for the physical layer chip to return to normal working state are recorded.
[0176] In some embodiments of this application, if a hardware reset of the physical layer chip is performed, the chip reset pin corresponding to the hardware reset of the physical layer chip, the hardware reset process, and the time it takes for the physical layer chip to return to normal working state are recorded.
[0177] It is understandable that when performing anomaly repair on the physical layer chip, relevant anomaly repair information should be recorded and uploaded to the log management system for easy anomaly query in the future.
[0178] In some embodiments of this application, the physical layer detection method further includes: S105 and S106, as follows:
[0179] S105. By traversing the registered network interface card (NIC) information, read the connection status in the registered NIC information.
[0180] In some embodiments of this application, when the electronic device reads the network card information and finds the connection status to be normal, it needs to detect the register status of the physical layer chip and obtain the register data before it can traverse the registered network card information to read the connection status in the registered network card information.
[0181] It should be noted that the registered network card information is generated by the system after the physical layer chip is registered.
[0182] S106. If the connection status of the network card information read is normal, read the data of the physical layer chip register based on the preset detection time; wherein, the preset detection time is data that is set in advance before the detection is performed.
[0183] In some embodiments of this application, when the network card information connection status is normal, the detection program in the electronic device reads the data of the physical layer chip register through the main chip based on a preset detection time.
[0184] It should be noted that the preset detection time is data set in advance before the detection is performed, so that the electronic device can cyclically detect the physical layer chip.
[0185] It is understandable that by traversing the registered network interface card (NIC) information and reading the connection status within the registered NIC information, and if the connection status is normal, reading the data in the physical layer chip's registers based on a preset detection time, unnecessary traversal can be reduced, and the detection efficiency of the physical layer can be improved.
[0186] In some embodiments of this application, the electronic device performs physical layer detection and physical layer chip anomaly repair, which can be illustrated by a schematic diagram of an Ethernet physical layer monitoring and recovery module, such as... Figure 5 As shown, system module 5 includes: a timing module 51, a monitoring module 52, a PHY reconnection and chip reset module 53, and a logging module 54. The timing module 51 is responsible for traversing network cards (NICs): network adapters, network interface cards, and serial / parallel converters, according to a user-defined loop detection time. The monitoring module 52 has a physical connection between the PHY chip and the operating system's main chip, enabling data reading. It is responsible for reading data from the PHY chip's status bit register and error count register to determine if the PHY chip is malfunctioning. Specifically, the read data stores various status information reflecting the current instruction execution result, as well as control information. The error count register includes a standard register set with error status indication information, as well as other user-defined error indication information, facilitating link status detection and analysis. The PHY reconnection and chip reset module 53 is responsible for hierarchical system recovery, including auto-negotiation linking, PHY chip digital circuit reset, and PHY chip hardware reset. The logging module 54 records the time and status information (i.e., register values) under abnormal conditions, sends it to the logging system, and displays it to the front end for user viewing.
[0187] It should be noted that auto-negotiation linkage: after setting the corresponding registers to initiate auto-negotiation, the negotiation result is obtained by reading the relevant registers. PHY chip digital circuit reset: setting registers to reset. PHY chip hardware reset: physically clearing data and settings. PHY chips include both identical registers and custom-defined registers; the custom-defined registers are different for each PHY and should be determined according to the relevant manual.
[0188] Figure 6 An optional flowchart illustrating a physical layer detection method provided in this application embodiment. Figure 4 ,like Figure 6 As shown, the physical layer detection method includes the following steps:
[0189] S1. Configure the detection time t and the error carrier threshold v according to the task requirements.
[0190] In some embodiments of this application, the detection time t and the error carrier threshold v are set according to the current system's requirements for network real-time performance.
[0191] It should be noted that the detection time t is the preset detection time; and the error carrier threshold v is the preset error carrier threshold.
[0192] S2. Traverse the network interface cards (NICs) that have been registered in the system.
[0193] In some embodiments of this application, after the PHY chip is registered, the system generates corresponding network interface card (NIC) information. At this time, the monitoring program automatically traverses the registered NIC information, reads the connection status of each NIC, and only traverses the registered ones to reduce unnecessary traversal.
[0194] S3. Access the corresponding status bits and misalignment registers of the PHY chip to obtain the working status of the PHY chip.
[0195] In some embodiments of this application, the number of errors in the PHY chip's status bit register and the number of errors in the spurious carrier counter register are periodically detected according to a set value. Problems during operation are debugged by checking the error counter. When the status bit is abnormal or the counter exceeds the error carrier threshold v, it indicates that the PHY chip is experiencing spurious carrier activity, at which point the network connection becomes intermittent and cannot be restored.
[0196] S4. If there is an abnormal status, select the corresponding solution according to the abnormal status table.
[0197] In some embodiments of this application, there is an abnormal state. According to the abnormal state table, the corresponding solution is selected and any one of the operations S5, S6, and S7 is executed.
[0198] S5, Renegotiation Link.
[0199] S6, PHY chip digital circuit reset.
[0200] S7, PHY chip hardware reset.
[0201] In some embodiments of this application, the electronic device may first attempt to re-negotiate the link. If this fails, it may perform a digital circuit reset at the PHY chip level, restart the device, and eliminate erroneous carrier information. If the link is still broken, it may select a hardware-level reset at the PHY chip level to restart the entire PHY chip, power it on again, and re-establish a connection with the main chip and external network circuits.
[0202] S8. Log the message and continue polling for detection.
[0203] In some embodiments of this application, after the system returns to normal, the timing and status of the reset process are logged, including the reset interaction and reset time. The process continues to iterate through the next network interface card.
[0204] In some embodiments of this application, S2 is executed after S8.
[0205] Understandably, by traversing the registered network interface card (NIC) information and reading the link status within it, and assuming a normal link status, the physical layer chip's register status is checked based on a preset detection time. This reduces unnecessary traversal and improves physical layer detection efficiency. The register data is verified using a preset error carrier threshold, yielding a verification result. If the verification result indicates an anomaly in the register data, the physical layer chip is repaired based on this data. Detection and recording are only performed on the Ethernet physical layer, improving network reliability and stability. Furthermore, it allows for timely system error correction, recording, and reporting, restoring normal network communication.
[0206] This application also provides a physical layer detection device. Figure 7 This is a schematic diagram of the structure of a physical layer detection device provided in an embodiment of this application, as shown below. Figure 7 As shown, the physical layer detection device 7 includes: an acquisition unit 701 and a repair unit 702; wherein,
[0207] The acquisition unit 701 is used to read the data in the registers of the physical layer chip through the serial communication bus interface connected to the physical layer chip via the intellectual property core when the link status of the network card information is normal. The network card information is generated after registration by the physical layer chip. The register data is verified based on a preset error carrier threshold to obtain the verification result.
[0208] Repair unit 702 is used to repair the physical layer chip based on the register data if the verification result indicates that there is an anomaly in the register data.
[0209] In some embodiments of this application, the acquisition unit 701 is also used to acquire configuration parameters in the device tree based on the connection relationship between the intellectual property core and the physical layer chip;
[0210] Repair unit 702 is also used to perform anomaly repair on physical layer chips by configuring parameters and combining register data.
[0211] In some embodiments of this application, the register data includes: first register data and / or second register data;
[0212] The physical layer detection device 7 includes: a determination unit 703;
[0213] The acquisition unit 701 is also used to verify the data in the first register to obtain a first verification result, and / or to verify the data in the second register using a preset error carrier threshold to obtain a second verification result;
[0214] The determining unit 703 is used to determine the verification result based on the first verification result and / or the second verification result.
[0215] In some embodiments of this application, the acquisition unit 701 is further configured to, when the link status of the network card information being read is normal, read the data of the status bit register of the physical layer chip from the network card device through the serial communication bus interface to obtain the first register data; and / or, read the data of the error carrier count register of the physical layer chip from the network card device through the serial communication bus interface to obtain the second register data.
[0216] In some embodiments of this application, the determining unit 703 is further configured to verify the data in the first register, and if there is abnormal information in the flag bit of the data in the first register, then it is determined that the first verification result is abnormal; and / or, to verify the data in the second register using a preset error carrier threshold, and if the data in the second register is greater than the preset error carrier threshold, then it is determined that the second verification result is abnormal; wherein, the abnormality of the first verification result and the abnormality of the second verification result both indicate that the physical layer chip has an error carrier.
[0217] In some embodiments of this application, the acquisition unit 701 is further configured to count the occurrence of erroneous carriers using string operation instructions, shift instructions, and loop instructions in the erroneous carrier count register to obtain the count value of the erroneous carrier count register; and to read the count value of the erroneous carrier count register of the physical layer chip from the network card device through the serial communication bus interface to obtain the second register data.
[0218] In some embodiments of this application, the determining unit 703 is further configured to determine the abnormal data type of the register data if the verification result indicates that the register data is abnormal; and determine at least one abnormal repair operation based on the abnormal data type; wherein, the at least one abnormal repair operation includes: auto-negotiation linking, digital circuit reset of the physical layer chip, and hardware reset of the physical layer chip;
[0219] The repair unit 702 is also used to perform at least one of the following: auto-negotiation link, digital circuit reset of physical layer chip, and hardware reset of physical layer chip, by configuring parameters, to perform abnormal repair on physical layer chip.
[0220] In some embodiments of this application, the repair unit 702 is further configured to perform auto-negotiation linking by configuring parameters, and if the auto-negotiation linking is successful, eliminate erroneous carrier information to complete the abnormal repair of the physical layer chip; and / or, perform digital circuit reset of the physical layer chip by configuring parameters, and if the digital circuit reset is successful, eliminate erroneous carrier information to complete the abnormal repair of the physical layer chip; and / or, perform hardware reset of the physical layer chip by configuring parameters, and if the hardware reset is successful, eliminate erroneous carrier information to complete the abnormal repair of the physical layer chip.
[0221] In some embodiments of this application, the determining unit 703 is further configured to perform parameter filtering through configuration parameters to determine the first parameter corresponding to the self-negotiation link; under the kernel driver, the same working parameters in the devices at both ends of the link are determined through the interaction information between the first parameter and the devices at both ends of the link; wherein, the working parameters include working mode and running speed;
[0222] The acquisition unit 701 is also used to exchange information on the working mode and the running speed through a fast connection pulse signal to obtain exchange information;
[0223] The repair unit 702 is also used to achieve self-negotiation link when the exchanged information of the devices at both ends of the link is consistent; and to eliminate erroneous carrier information and complete the abnormal repair of the physical layer chip when the self-negotiation link is successful.
[0224] In some embodiments of this application, the repair unit 702 is further configured to perform parameter filtering by configuration parameters to determine the second parameter corresponding to the digital circuit reset; under kernel drive, the circuit logic module or the first register of the physical layer chip is digitally reset by the second parameter and the obtained reset signal to realize the digital communication of the physical layer chip; if the digital circuit reset is successful, the erroneous carrier information is eliminated to complete the abnormal repair of the physical layer chip.
[0225] In some embodiments of this application, the repair unit 702 is further configured to perform parameter filtering by configuration parameters to determine the third parameter corresponding to the hardware reset; under the kernel driver, to perform hardware reset of the physical layer chip by the third parameter and the chip reset pin of the physical layer chip; and if the hardware reset is successful, to eliminate the erroneous carrier information and complete the abnormal repair of the physical layer chip.
[0226] In some embodiments of this application, the physical layer detection device 7 further includes a recording unit 704;
[0227] The recording unit 704 is used to record anomaly repair information when performing anomaly repair on the physical layer chip, and upload the anomaly repair information to the log management system; wherein, the anomaly repair information includes: anomaly repair time, anomaly repair method and anomaly repair process.
[0228] In some embodiments of this application, the recording unit 704 is further configured to: if auto-negotiation linking is performed, record the time of successful auto-negotiation linking, the operating parameters selected during chip auto-negotiation linking, and the auto-negotiation linking process; if digital circuit reset of the physical layer chip is performed, record the type of reset signal during digital circuit reset of the physical layer chip, the circuit logic module or register reset during reset, the digital circuit reset process, and the time when the physical layer chip returns to normal working state; if hardware reset of the physical layer chip is performed, record the chip reset pin corresponding to the hardware reset of the physical layer chip, the hardware reset process, and the time when the physical layer chip returns to normal working state.
[0229] In some embodiments of this application, the acquisition unit 701 is further configured to read the link status in the registered network card information by traversing the registered network card information; if the link status of the read network card information is normal, the data of the register of the physical layer chip is read based on a preset detection time; wherein, the preset detection time is data that is preset before detection.
[0230] Based on the physical layer detection method of the above embodiments, this application also provides a physical layer detection device, such as... Figure 8 As shown, Figure 8 This is a schematic diagram of a physical layer detection device provided in an embodiment of this application. The physical layer detection device 8 includes a processor 801 and a memory 802. The memory 802 is used to store computer programs; the processor 801 is used to call and run the computer programs from the memory to execute the physical layer detection method as described in the above embodiment.
[0231] In the embodiments of this application, the processor 801 described above can be at least one of the following: Application-Specific Integrated Circuit (ASIC), Digital Signal Processor (DSP), Digital Signal Processing Device (DSPD), Programmable Logic Device (PLD), Field Programmable Gate Array (FPGA), Central Processing Unit (CPU), Controller, Microcontroller, and Microprocessor. It is understood that for different devices, the electronic device used to implement the above processor function can also be other types, and the embodiments of this application do not specifically limit it.
[0232] This application provides a computer-readable storage medium storing a computer program for implementing the physical layer detection method of any of the above embodiments when executed by a processor.
[0233] For example, the program instructions corresponding to a physical layer detection method in this embodiment can be stored on a storage medium such as an optical disc, hard disk, or USB flash drive. When the program instructions corresponding to a physical layer detection method in the storage medium are read or executed by an electronic device, the physical layer detection method as described in any of the above embodiments can be implemented.
[0234] If the integrated unit is implemented as a software functional module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, electronic device, or network device, etc.) or processor to execute all or part of the steps of the method of this embodiment.
[0235] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.
[0236] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules. They may be located in one place or distributed across multiple network units. Some or all of the modules may be selected to achieve the purpose of this embodiment according to actual needs.
[0237] Furthermore, the functional modules in the various embodiments of this application can all be integrated into one processing unit, or each module can be a separate unit, or two or more modules can be integrated into one unit; the integrated modules can be implemented in hardware or in a combination of hardware and software functional units. It should be understood that "an embodiment" or "one embodiment" mentioned in this application means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this disclosure. Therefore, "in one embodiment" or "in one embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Moreover, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0238] It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply the order of execution. The execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this disclosure. The sequence numbers of the above embodiments of this disclosure are merely for descriptive purposes and do not represent the superiority or inferiority of the embodiments.
[0239] It should be noted that, in this application, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0240] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components may be combined, or integrated into another system, or some features may be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0241] The methods disclosed in the several method embodiments provided in this application can be arbitrarily combined without conflict to obtain new method embodiments.
[0242] The features disclosed in the several product embodiments provided in this application can be arbitrarily combined without conflict to obtain new product embodiments.
[0243] The features disclosed in the several method or device embodiments provided in this application can be arbitrarily combined without conflict to obtain new method or device embodiments.
[0244] The above are merely embodiments of this application, but the protection scope of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method of detecting a physical layer, the method comprising: The application relates to a method for repairing a physical layer chip, and a device thereof. In a case where the link state of read network card information is normal, register data of a physical layer chip is read through a serial communication bus interface connected between an intellectual property core and the physical layer chip, to obtain the register data; wherein the network card information is generated after being registered through the physical layer chip; Based on a preset error carrier threshold, the register data is checked to obtain a checking result; If the checking result represents that the register data is abnormal, the physical layer chip is repaired based on the register data.
2. The detection method of a physical layer according to claim 1, wherein, The repairing of the physical layer chip based on the register data comprises: Configuration parameters in a device tree are obtained based on the connection relationship between the intellectual property core and the physical layer chip; The physical layer chip is repaired based on the configuration parameters and the register data.
3. The detection method of a physical layer according to claim 1 or 2, wherein, The register data comprises first register data and / or second register data. The checking of the register data based on the preset error carrier threshold to obtain the checking result comprises: The first register data is checked to obtain a first checking result, and / or the second register data is checked based on the preset error carrier threshold to obtain a second checking result; The checking result is determined based on the first checking result and / or the second checking result.
4. The method of claim 1-3, wherein, In a case where the link state of read network card information is normal, register data of a physical layer chip is read through a serial communication bus interface connected between an intellectual property core and the physical layer chip, to obtain the register data; wherein the network card information is generated after being registered through the physical layer chip; In a case where the link state of read network card information is normal, register data of a physical layer chip is read through a serial communication bus interface connected between an intellectual property core and the physical layer chip, to obtain the register data; wherein the network card information is generated after being registered through the physical layer chip; The checking of the first register data to obtain the first checking result, and / or the checking of the second register data based on the preset error carrier threshold to obtain the second checking result comprises:
5. The detection method of a physical layer according to claim 3, wherein, The first register data is checked, and if abnormal information exists in a flag bit of the first register data, it is determined that the first checking result is abnormal; and / or The second register data is checked based on the preset error carrier threshold, and if the second register data is greater than the preset error carrier threshold, it is determined that the second checking result is abnormal; wherein the first checking result being abnormal and the second checking result being abnormal both represent that the physical layer chip has an error carrier. The reading of the data of the error carrier counting register of the physical layer chip from the network card device through the serial communication bus interface to obtain the second register data comprises:
6. The detection method of a physical layer according to claim 4, wherein, The error carrier counting register is counted through a string operation instruction, a bit shift instruction and a loop instruction in the error carrier counting register, to obtain a counting value of the error carrier counting register; reading the count value of the error carrier counting register of the physical layer chip from the network card device through the serial communication bus interface to obtain the second register data.
7. The detection method of a physical layer according to claim 2, wherein, The abnormality repairing of the physical layer chip through the configuration parameters and the second register data comprises: if the check result indicates that the second register data is abnormal, determining an abnormal data type of the second register data; determining at least one abnormality repairing operation through the abnormal data type, wherein the at least one abnormality repairing operation comprises self-negotiation, digital circuit reset of the physical layer chip and hardware reset of the physical layer chip; performing abnormality repairing of the physical layer chip through at least one of self-negotiation, digital circuit reset of the physical layer chip and hardware reset of the physical layer chip through the configuration parameters.
8. The detection method of a physical layer according to claim 7, wherein, The abnormality repairing of the physical layer chip through at least one of self-negotiation, digital circuit reset of the physical layer chip and hardware reset of the physical layer chip through the configuration parameters comprises: performing self-negotiation through the configuration parameters, eliminating error carrier information in the case of successful self-negotiation, and completing abnormality repairing of the physical layer chip; and / or, performing digital circuit reset of the physical layer chip through the configuration parameters, eliminating error carrier information in the case of successful digital circuit reset, and completing abnormality repairing of the physical layer chip; and / or, performing hardware reset of the physical layer chip through the configuration parameters, eliminating error carrier information in the case of successful hardware reset, and completing abnormality repairing of the physical layer chip.
9. The method of claim 8, wherein, The abnormality repairing of the physical layer chip through at least one of self-negotiation, digital circuit reset of the physical layer chip and hardware reset of the physical layer chip through the configuration parameters comprises: performing parameter screening through the configuration parameters to determine a first parameter corresponding to self-negotiation; determining the same working parameters in the two end devices of the link through the first parameter and interaction information of the two end devices of the link under the kernel driver, wherein the working parameters comprise working mode and running rate; performing data exchange of information of the working mode and information of the running rate through a fast connection pulse signal to obtain exchange information; implementing self-negotiation in the case that the exchange information of the two end devices of the link is consistent; eliminating the error carrier information in the case of successful self-negotiation, and completing abnormality repairing of the physical layer chip.
10. The method of claim 8, wherein, The abnormality repairing of the physical layer chip through at least one of self-negotiation, digital circuit reset of the physical layer chip and hardware reset of the physical layer chip through the configuration parameters comprises: performing parameter screening through the configuration parameters to determine a second parameter corresponding to digital circuit reset; performing digital circuit reset of a circuit logic module or a first register of the physical layer chip through the second parameter and a reset signal obtained under the kernel driver to implement digital communication of the physical layer chip. In the case of successful reset of the digital circuit, the error carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
11. The method of claim 8, wherein, The hardware reset of the physical layer chip is performed through the configuration parameters, and in the case of successful hardware reset, the error carrier information is eliminated, and the abnormal repair of the physical layer chip is completed, comprising: A third parameter corresponding to the hardware reset is determined through parameter screening by the configuration parameters; The hardware reset of the physical layer chip is performed through the third parameter and the chip reset pin of the physical layer chip under the kernel driver; In the case of successful hardware reset, the error carrier information is eliminated, and the abnormal repair of the physical layer chip is completed.
12. The method of detecting a physical layer according to any one of claims 1-11, wherein, The method further comprises: When the physical layer chip is abnormally repaired, abnormal repair related information is recorded, and the abnormal repair related information is uploaded to a log management system; wherein the abnormal repair related information includes: abnormal repair time, abnormal repair means and abnormal repair process.
13. The method of claim 12, wherein, The abnormal repair related information is recorded when the physical layer chip is abnormally repaired, comprising: If self-negotiation is performed, the time of successful self-negotiation, the working parameters selected by the chip during self-negotiation, and the self-negotiation process are recorded; If the digital circuit of the physical layer chip is reset, the reset signal type during the reset of the physical layer chip, the circuit logic module or the register reset during the reset, the digital circuit reset process, and the time when the physical layer chip returns to the normal working state are recorded; If the hardware reset of the physical layer chip is performed, the chip reset pin corresponding to the hardware reset of the physical layer chip, the hardware reset process, and the time when the physical layer chip returns to the normal working state are recorded.
14. The method of detecting a physical layer according to any one of claims 1-13, wherein, The method further comprises: By traversing the registered network card information, the link state in the registered network card information is read; In the case that the link state of the read network card information is normal, the data of the register of the physical layer chip is read based on a preset detection time; wherein the preset detection time is data set in advance before detection.
15. A detection apparatus of a physical layer, characterized by comprising: The detection device of the physical layer comprises: an acquisition unit and a repair unit; wherein, The acquisition unit is configured to read the data of the register of the physical layer chip through the serial communication bus interface connected between the intellectual property core and the physical layer chip in the case that the link state of the read network card information is normal, to obtain register data; wherein the network card information is generated after being registered by the physical layer chip; the register data is verified based on a preset error carrier threshold to obtain a verification result; The repair unit is configured to abnormally repair the physical layer chip based on the register data if the verification result indicates that the register data is abnormal.
16. A detection device of a physical layer, characterized by, Comprising: A processor and a memory, wherein The memory is configured to store a computer program; The processor is configured to call and run the computer program from the memory to execute the physical layer detection method according to any one of claims 1 to 14.
17. A computer readable storage medium characterized by: The executable instructions stored in the computer readable medium are used to cause the processor to implement the detection method of the physical layer according to any one of claims 1 to 14 when executed.
