Auto-negotiation method, communication apparatus and communication device

By introducing automatic crossover function and target signal recognition mechanism in Ethernet devices, the problem of correct self-negotiation in the prior art cannot be correctly negotiated under any line pair sequence and network cable crimping sequence is achieved, and more flexible and efficient Ethernet connection is achieved.

WO2025113197A1PCT designated stage expired Publication Date: 2025-06-05HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/132142
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-30
Filing Date
2024-11-15
Publication Date
2025-06-05

AI Technical Summary

Technical Problem

The existing Ethernet self-negotiation method cannot correctly self-negotiate in any line pair order and network cable crimp order, resulting in connection failure.

Method used

By introducing automatic crossover function and target signal recognition mechanism in Ethernet devices, the device allows the device to determine the ports for self-negotiation in any wiring sequence and network cable crimp sequence and perform automatic cross-negotiation.

Benefits of technology

It realizes flexible wired connections between Ethernet devices, improves connection flexibility and freedom, and reduces connection complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024132142_05062025_PF_FP_ABST
    Figure CN2024132142_05062025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses an auto-negotiation method and a related apparatus. During an auto-negotiation process of two Ethernet devices, after one Ethernet device enters an auto-negotiation state, all ports wait to receive signals from the peer device. If two ports of the Ethernet device respectively receive link pulse signals from the peer device at different moments, this indicates that the two ports are connected to ports of the peer device that are currently used for executing automatic cross-over. Therefore, the two ports respectively receiving the link pulse signals at the two moments are determined to be target ports, and the two target ports are then used for automatic cross-over and auto-negotiation information interaction with the peer device. In the present application, when two Ethernet devices are connected in a circuit board wiring sequence, any network cable crimping sequence or any interface mode, ports required for automatic cross-over can be determined between the two Ethernet devices, so that the two Ethernet devices can both successfully perform auto-negotiation.
Need to check novelty before this filing date? Find Prior Art

Description

A self-negotiation method, communication device and communication equipment This application claims the priority of the Chinese patent application with the application number 202311638481.4 and the application title "A self-negotiation method, communication device and communication equipment" submitted to the National Intellectual Property Administration on November 30, 2023. The entire content is incorporated herein by reference. Technical Field This application relates to the field of communication technologies, and in particular, to a self-negotiation method, a communication device and a communication equipment. Background Art During the process from power-on to normal data transmission of an Ethernet twisted pair cable (hereinafter referred to as a network cable), it is necessary to execute the self-negotiation process specified by the standard so that the two network devices on both sides can negotiate information such as the master / slave relationship, rate, and working mode. The automatic crossover function in the standard self-negotiation enables the ports of the two Ethernet devices on both sides to successfully perform self-negotiation according to the wiring method shown in Figure 1 (the A port and the B' port are cross-connected, and / or the C port and the D' port are cross-connected). If other wiring methods are adopted, such as cross-connecting the A port and the D' port, or cross-connecting the B port and the C' port, etc., the automatic crossover function of the network device cannot correctly and orderly switch the port for sending Fast Link Pulse (FLP) signals, resulting in the failure of self-negotiation information interaction. In view of this, a solution for supporting Ethernet crimping in any wire pair order is urgently needed. Summary of the Invention This application provides a self-negotiation method, a communication device and a communication equipment, which are used to improve the flexibility of the wired connection between Ethernet devices. In a first aspect, the present application provides a self-negotiation method. In the self-negotiation method provided by the present application, it is required that both Ethernet devices at both ends have entered the self-negotiation state, and both Ethernet devices at both ends have the automatic crossover function. One of the Ethernet devices (hereinafter referred to as the local device) first confirms that the peer device has successfully entered the self-negotiation state, and then all ports of the local device need to enter the signal reception state. During the signal reception state of each port of the Ethernet device, link pulse signals are received, and the transmission of link pulse signals is prohibited. Among them, the link pulse signals in the present application include Fast Link Pulse (FLP) signals or Normal Link Pulse (NLP) signals. Therefore, the self-negotiation method in the present application is applicable to the self-negotiation process implemented based on FLP signals for interaction, and is also applicable to the self-negotiation process implemented based on NLP signals for interaction. The other Ethernet device (hereinafter referred to as the peer device) needs to enter the standard ability detection stage. When the peer device is in the ability detection state, two of its ports are selected. At the same time, link pulse signals are sent from one port, and only link pulse signals are received from the other port without sending link pulse signals. Therefore, the link pulse signals sent by the peer device will be received by one of the ports of the local device. Since all ports of the local device are prohibited from sending signals, the peer device will not receive link pulse signals from the local device, resulting in the peer device triggering the automatic crossover function, so that the port that previously sent link pulse signals is used to receive link pulse signals, and the port that previously received link pulse signals is used to send link pulse signals. The switching of the receiving and transmitting ports of the peer device enables another port of the local device to receive link pulse signals. Thus, it can be seen that two different ports of the local device receive link pulse signals from the peer device at different times, indicating that these two ports are connected to the ports of the peer device currently used for automatic crossover negotiation. Therefore, the local device determines the two ports that receive link pulse signals at two different times as the target ports, and the local device performs the automatic crossover function during self-negotiation with the peer device based on these two target ports. The target ports defined in the present application refer to two ports in the Ethernet device used to perform the automatic crossover function in the self-negotiation process. At the same time, one target port is used to send link pulse signals, and the other target port does not send but only receives link pulse signals. In the present application, the two Ethernet devices connected to each other determine the target ports in different ways. For the local device, the two ports that receive link pulse signals at two different times are selected as the target ports in the local device; for the peer device, the two ports used to perform automatic crossover are actively selected as the target ports in the peer device. In practical applications, the peer device can select the ports with higher priority as the target ports according to the port priority. In this application, when two Ethernet devices are connected in any wiring order, any network cable crimping order, or any interface mode, the ports for automatic cross-negotiation can be accurately and clearly determined between the two Ethernet devices, enabling the two Ethernet devices to complete auto-negotiation, thereby improving the flexibility and freedom of the wired connection of Ethernet devices and reducing the complexity of the wired connection. It should be understood that in this application, an Ethernet device is used as the execution entity of this auto-negotiation method to illustrate the method, but this application does not limit the execution entity of the auto-negotiation method. For example, the Ethernet device mentioned in this application can also be a chip, a chip system, or a processor that supports the Ethernet device to implement this method, or can also be a logical node, a logical module, or software that can implement all or part of the test of the Ethernet device. Based on the first aspect, in an optional implementation manner, a target signal is defined, and the Ethernet device selects to enter the signal reception state or the capability detection state by determining whether the target signal is received. If the local device does not receive the target signal from the peer device, the local device sends the target signal to the peer device and then enters the signal reception state. Based on the first aspect, in an optional implementation manner, a target signal is defined, and the Ethernet device selects to enter the signal reception state or the capability detection state by determining whether the target signal is received. If the local device receives the target signal from the peer device, the local device jumps out of the port detection process, enters the standard capability detection state, and actively selects two ports for performing the automatic crossover function, that is, the target ports in this application. The target ports defined in this application refer to two ports in the Ethernet device for performing the automatic crossover function in the auto-negotiation process. Among them, at the same time, one target port is used to send link pulse signals, and the other target port is used to receive link pulse signals. The target signal is a special signal type defined in this application, different from the existing signal types in the standard auto-negotiation. Exemplarily, in practical applications, the target signal can be a signal defined by a special coding format, or the target signal can be a signal carrying a certain special identifier or special field, or the target signal can be multiple signals sent by multiple ports in the Ethernet device at the same time. Then, in the auto-negotiation method of this application, if the Ethernet device receives multiple signals at the same time from multiple ports, the Ethernet device can determine that the target signal is received, or the target signal can also be other signal types, and this application does not limit this. Based on the first aspect, in an optional implementation, the target signal can be multiple link pulse signals sent by different ports at the same time. Exemplarily, the target signal can include multiple link pulse signals sent by 2, 3, or 4 ports at the same time. Specifically, because in the existing standard auto-negotiation process, an Ethernet device only sends link pulse signals through one port at a time. Therefore, the multiple link pulse signals sent by an Ethernet device through multiple ports at the same time are the target signals. If an Ethernet device receives link pulse signals (such as FLP signals) on multiple ports at the same time, then the Ethernet device can determine that it has received the target signal; if an Ethernet device only receives link pulse signals (such as FLP signals) on one port at the same time, then the Ethernet device can determine that it has received a standard link pulse signal and has not received the target signal. By controlling the number of ports sending link pulse signals at the same time, there is no need to redefine the encoding format of the target signal, which improves the efficiency of the Ethernet device in sending the target signal. In addition, since the Ethernet device identifies the target signal based on the number of ports of the received link pulse signals rather than specific bit information, the Ethernet device does not need to sense the link code word (LCW) in the target signal, and thus does not need to parse the target signal and recover the link code word, thereby improving the efficiency of the Ethernet device in receiving and identifying the target signal. Based on the first aspect, in an optional implementation, if an energy signal from the peer device is received, it is confirmed that the peer device has entered the auto-negotiation state. The energy signal is a signal used to indicate that the Ethernet device has entered the auto-negotiation state, and the present application does not limit the signal type of the energy signal. Exemplarily, in practical applications, the energy signal can be a signal defined by a special encoding format, or the energy signal can be a signal carrying a certain special identifier or special field, or the energy signal can be a link pulse signal (FLP signal or NLP signal) in the standard, or the energy signal can also be other signal types, which are not limited in the present application. For example, when the peer device is in the energy detection state, it will send a link pulse signal (FLP signal or NLP signal) to the local device. After the local device receives the link pulse signal, it can confirm that the peer device has entered the auto-negotiation state. Based on the first aspect, in an optional implementation, the local device can send an energy signal to the peer device. Among them, the local device can select any port to send the energy signal, and this application does not limit this. Among them, if the peer device also executes the auto-negotiation logic provided in this application, that is, the peer device enters the auto-negotiation state and after jumping out of the Transmit Disable state, it will also wait to receive the energy signal from the local device. At this time, the energy signal sent by the local device can enable the peer device to sense that the local device has entered the auto-negotiation state; if the peer device does not execute the auto-negotiation logic provided in this application, that is, the peer device executes the auto-negotiation process of the existing standard, then the peer device starts auto-negotiation and enters the ability detection state after jumping out of the Transmit Disable state. At this time, the energy signal sent by the peer device to the local device in the ability detection state can be used for the local device to determine that the peer device has entered the auto-negotiation state. Based on the first aspect, in an optional implementation, if a pair of twisted pairs in the network cable fails and the signal sent by the local device to the peer device happens to pass through this pair of faulty lines, the peer device cannot receive the link pulse signal and cannot sense whether the local device has entered the auto-negotiation state. Therefore, the local device can send energy signals to the peer device in multiple ports in turn, and the peer device can receive the energy signals through multiple ports, reducing the impact of network cable pair faults on the auto-negotiation process. Based on the first aspect, in an optional implementation, after the local device sends an energy signal to the peer device, during the duration of the energy signal (that is, the sum of the pulse width of the energy signal and the round-trip link transmission time of the energy signal), it is impossible to accurately determine whether the energy signal received by the local device comes from the peer device, thus affecting the accuracy of the local device to identify that the peer device has entered the auto-negotiation state. Therefore, the local device can only use the energy signal received during the energy detection period as the energy signal from the peer device to determine that the peer device has entered the auto-negotiation state, thereby improving the accuracy of confirming that the peer device has entered the auto-negotiation state. Among them, the energy detection period is the time period outside the duration of the energy signal sent by the local device. Based on the first aspect, in an optional implementation, since the local device only identifies whether the peer device enters the auto-negotiation state during the energy detection period, if both Ethernet devices enter the auto-negotiation state, but the time difference between sending energy signals is less than the energy detection period, the local device will not be able to sense whether the peer device has entered the auto-negotiation state. In this regard, if the local device does not receive an energy signal from the peer device within the energy detection period (before the energy detection timer ends), it randomly updates the start time point of the energy detection period, thereby changing the time difference between the local device and the peer device in sending energy signals, and improving the accuracy of the local device in identifying that the peer device enters the auto-negotiation state. Specifically, the local device can configure another random timer (back_off_timer), and the random timer is used to determine a random duration. When the energy detection timer ends, if the local device does not receive an energy signal from the peer device, it triggers the random timer. When the random duration defined by the random timer ends, it restarts the energy detection timer, waits to receive an energy signal from the peer device, and sends an energy signal to the peer device, and this is executed in a loop until it receives an energy signal from the peer device and confirms that the peer device has entered the auto-negotiation state. Based on the first aspect, in an optional implementation, the target signal includes multiple link pulse signals sent by different ports at the same moment. In this scenario, if the number of ports of the Ethernet device that receive link pulse signals at the same moment is multiple, the Ethernet device confirms that it has received the target signal. If a pair of twisted pairs of the network cable fails, resulting in at most one port of the Ethernet devices at both ends receiving link pulse signals, then the Ethernet devices at both ends will enter the signal receiving state. In other words, all ports of the Ethernet devices at both ends are only used to wait for receiving link pulse signals and will not send link pulse signals. Thus, all ports of the Ethernet devices at both ends are only used to wait for receiving link pulse signals and will not send link pulse signals. Therefore, after entering the signal receiving state, when the Ethernet device does not receive a link pulse signal from the peer device within the preset duration, it can determine that there is a failure in the wired pair between it and the peer device. Based on the first aspect, in an optional implementation, since it has been determined that a link failure has occurred and auto-negotiation cannot be performed, the Ethernet devices at both ends can choose to exit the auto-negotiation state. Furthermore, they choose to perform PMA training and communication on the only remaining intact link. In a second aspect, the present application provides a communication device, which is characterized by including: A determination unit, configured to determine that the peer device enters the auto-negotiation state in the auto-negotiation state; A processing unit, configured to enter a signal receiving state on all ports, and each port prohibits sending link pulse signals during the signal receiving state, where the link pulse signals include fast link pulse signals FLP or normal link pulse signals NLP; A determining unit, further configured to determine two ports as target ports when link pulse signals from a peer device are received through two ports at two different times, where the target ports are used for automatic crossover with the peer device. In an optional implementation manner based on the second aspect, the processing unit is specifically configured to: When a target signal from a peer device is not received, send the target signal to the peer device and enter a signal receiving state on all ports. In an optional implementation manner based on the second aspect, the determining unit is further configured to determine two of the ports as target ports for automatic crossover when a target signal from a peer device is received. In an optional implementation manner based on the second aspect, the target signal is a plurality of link pulse signals sent by different ports at the same time. In an optional implementation manner based on the second aspect, the determining unit is further configured to: When link pulse signals from a peer device are received on multiple ports at the same time, determine that a target signal from the peer device is received. In an optional implementation manner based on the second aspect, the determining unit is specifically configured to: Receive an energy signal from a peer device; Determine that the peer device enters a self-negotiation state according to the energy signal from the peer device. In an optional implementation manner based on the second aspect, the processing unit is further configured to: Send an energy signal to the peer device. In an optional implementation manner based on the second aspect, the processing unit is specifically configured to: Send energy signals to the peer device through multiple ports in turn. In an optional implementation manner based on the second aspect, the determining unit is specifically configured to: Determine that the link pulse signals received during an energy detection period are link pulse signals from a peer device, where the energy detection period is a time period outside the duration of the link pulse signals sent by the local device. In an optional implementation manner based on the second aspect, the processing unit is further configured to update the start time point of the energy detection period when no link pulse signals from a peer device are received during the energy detection period. Based on the second aspect, in an alternative implementation, the processing unit is further configured to perform auto-negotiation with the peer device through two target ports. Based on the second aspect, in an alternative implementation, the processing unit is further configured to determine that a network cable pair between the local device and the peer device is faulty when no link pulse signal is received from the peer device within a preset duration. Based on the second aspect, in an alternative implementation, the processing unit is further configured to: Exit the auto-negotiation state. The content such as the information interaction and execution process of the embodiments shown in this aspect is based on the same concept as the embodiments shown in the first aspect. Therefore, for the description of the beneficial effects shown in this aspect, please refer to the above-mentioned first aspect for details, and no further elaboration will be provided here. In a third aspect, an embodiment of the present application provides a communication device, including: a processor, the processor is coupled to a memory, and the memory is used to store instructions. When the instructions are executed by the processor, the communication device implements the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which instructions are stored. When the instructions are executed, a computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. In a fifth aspect, an embodiment of the present application provides a computer program product, which includes computer program code. When the computer program code runs on a computer, the computer executes the method in the above-mentioned first aspect or any possible implementation manner of the first aspect. In a sixth aspect, an embodiment of the present application provides a chip, including: a processor, the processor is coupled to a memory, and the memory is used to store instructions. When the instructions are executed by the processor, the chip implements the method in the above-mentioned first aspect and any possible implementation manner of the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained according to the provided drawings without creative efforts. FIG. 1 is a schematic diagram of the crossover mode of a standard Ethernet cable pair; FIG. 2 is a schematic diagram of the FLP signal structure; FIG. 3 is a schematic diagram of the NLP signal structure; FIG. 4 is a standard schematic diagram of crimping a network cable to an RJ45 interface; FIG. 5 is a schematic diagram of a non-standard network cable crimping method; FIG. 6 is a schematic diagram of an application scenario of the auto-negotiation method in an embodiment of the present application; FIG. 7 is a schematic flowchart of an auto-negotiation method in an embodiment of the present application; FIG. 8 is a schematic diagram of the auto-negotiation logic provided in an embodiment of the present application; FIG. 9 is a schematic diagram of a process for an Ethernet device to perform port detection in an embodiment of the present application; FIG. 10 is another schematic diagram of a process for an Ethernet device to perform port detection in an embodiment of the present application; FIG. 11 is a schematic structural diagram of a communication device provided in an embodiment of the present application; FIG. 12 is a schematic logical structure diagram of a communication device provided in an embodiment of the present application. Detailed implementation manners The embodiments of the present application provide an auto-negotiation method, a communication device, and a communication device, which are used to improve the flexibility of wired connections between Ethernet devices. The embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application. The terms used in the embodiments of the present application are only used to explain the specific embodiments of the present application, rather than to limit the embodiments of the present application. Those of ordinary skill in the art will know that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems. In the embodiments of the present application, "at least one" means one or more, and "a plurality" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B may be singular or plural. "At least one (item)" or its similar expression refers to any combination of these items, including any combination of single item (item) or plural items (items). For example, at least one (item) of a, b, or c may represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c may be single or multiple. In the description, claims and above-mentioned drawings of the present application, terms such as "first", "second", "third", "fourth", etc. (if any) are used to distinguish similar objects and do not necessarily describe a specific order or sequence. It should be understood that the data used in this way can be interchanged under appropriate circumstances so that the embodiments of the present application described herein, for example, can be implemented in an order other than those illustrated or described herein. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices. Some nouns or terms used in the embodiments of the present application are explained below, and these nouns or terms are also part of the invention content. Auto-negotiation: The main function of auto-negotiation is that the devices at both ends of the shared link automatically select and configure working parameters through information interaction, so that the transmission capacity reaches the maximum value that both devices can support. The basic mechanism for implementing auto-negotiation is to encapsulate information (such as master / slave relationship, duplex mode, operating rate, and flow control information, etc.) in Fast Link Pulse (FLP) signals or Normal Link Pulse (NLP) signals for transmission. Please refer to Figure 2, which is a schematic diagram of the structure of FLP signals. As shown in Figure 2, the FLP signal includes 33 pulses, among which 33 pulses include 17 clock pulses and 16 data pulses, and the clock pulses and data pulses are alternately arranged. When a data pulse appears, it represents logic 1; when a data pulse is missing, it represents logic 0. In order to maintain interoperability with existing Ethernet devices, the auto-negotiation function also supports using NLP signals compliant with the 10BASE-T standard as shown in Figure 3 to replace FLP signals for interaction. FLP Signal: A device with auto-negotiation function can send and receive FLP signals. The data pulses in the FLP signal are encoded into a 16-bit (bit) Link Code Word (LCW), which is divided into a basic page and an additional page. The code word length of the basic page is 16 bits, and each bit has a corresponding standard definition, that is, constant encoding. The additional page can be a predefined encoding (message page) or a custom encoding. After the device starts the auto-negotiation function, it enters the disabled transmission stage. After the link interruption timer in the device ends, the device enters the capability detection state and sends a 16-bit basic page message (where the "Ack" bit is 0). If the subsequent received 16-bit basic page information, except for the "Ack" bit, the other 15 bits are the same for 3 consecutive times, the device exits the capability detection state, enters the confirmation detection state, and sets the Ack bit to 1. If the 16-bit basic pages received 3 consecutive times are exactly the same and are the same as the other 15 bits except the Ack bit in the capability detection state, it exits the confirmation detection state and starts to send the additional page. Network Cable: A network cable is a combined cable. According to different network standards, it is divided into Category 5 network cable, Category 5e network cable, Category 6 network cable, Category 6A network cable, Category 7 network cable, and Category 8 network cable. To achieve a communication rate of 1G or above, a network cable with 4 pairs of twisted pairs is usually required. Every two wires are twisted together to form 1 pair of twisted pairs, and each pair of twisted pairs serves as a data transmission channel. Next, the scenarios involved in the embodiments of the present application will be introduced. In the 10BASE-T and 100BASE-TX technologies of Ethernet, only two pairs of twisted pair cables are required to operate. That is, only two pairs of pins in the 45th standard interface (RJ45 interface) of the standard socket interface (Registered Jack) are used: pins1 and pins2 are used to send signals, and pins3 and pins6 are used to receive signals. In the half-duplex communication mode, sending and receiving are carried out separately on the two pairs of lines, so the pins for sending and receiving need to be staggered. Specifically, please refer to Figure 4, which is a standard schematic diagram of the crimped network cable of the RJ45 interface. As shown in Figure 4, in the standard of the crimped network cable of the RJ45 interface, there are usually two methods: Type A (EIA / TIA 568A) and Type B (EIA / TIA 568B). According to whether the wiring methods of the RJ45 connectors at both ends of the network cable are the same, the network cables crimped by Ethernet devices can be divided into straight-through cables and cross-over cables. Among them, those with the same wiring method of the RJ45 connectors at both ends of the network cable (for example, both ends adopt the EIA / TIA 568A standard or both ends adopt the EIA / TIA 568B standard) belong to straight-through cables, while those with different wiring methods of the RJ45 connectors at both ends of the network cable (for example, one end adopts the EIA / TIA 568A standard and the other end adopts the EIA / TIA 568B standard) belong to cross-over cables. Currently, high-speed Ethernet twisted pair cables (such as 1 gigabit per second) mainly adopt the full-duplex communication mode. In the full-duplex communication mode, each pair of pins has both receiving and sending functions. Therefore, the full-duplex communication mode is not affected by the wiring order of the network cable. However, during the process from power-on to normal data transmission of Ethernet twisted pair cables (hereinafter referred to as network cables), there are mainly three processes: 1. Configure information such as master / slave relationship, rate, and working mode, which can be specifically achieved through manual configuration or enabling the auto-negotiation function for information interaction. Auto-negotiation does not require manual participation and is more flexible and efficient; 2. Physical medium attachment (PMA) training to achieve pre-convergence of parameters such as digital signal processing (DSP), thereby further improving the success rate of link communication; 3. Normal communication, which requires further updating of DSP parameters based on pre-convergence. During the above three processes, high-speed Ethernet twisted pair cables (such as 1 gigabit per second) can achieve the full-duplex communication mode during PMA training and normal communication, and are not affected by the wiring order of the network cable. However, when performing the auto-negotiation process, only the half-duplex communication mode can be adopted. In the half-duplex communication mode of an Ethernet network, when connecting a medium dependent interface (MDI) device such as a network card or a router to a medium dependent interface crossover (MDIX) device such as a hub or a switch via an Ethernet twisted pair cable to establish communication, a straight-through cable is required. When connecting an MDI device to another MDI device or connecting an MDIX device to another MDIX device, a cross-over cable is needed. Network administrators must use different cables (straight-through cables or cross-over cables) for different devices, which causes inconvenience during the wiring process. To eliminate the usage restrictions of straight-through cables and cross-over cables, an auto-crossover function, i.e., Auto-MDI / MDIX technology, is introduced in the auto-negotiation process of Ethernet. Based on the received link pulse signals within a certain period of time and the output bit condition of the Pseudo-Random Binary Sequence (PRBS) 11, it is determined whether to perform a switch between MDI and MDIX on the device (i.e., a switch between the transmit and receive ports / line pairs). In this case, either a straight-through cable or a cross-over cable can be used by the Ethernet device to complete the communication connection. Specifically, if the Ethernet device receives link pulse signals before the sampling timer expires, no switch of the transmit and receive ports / line pairs is performed within the next sampling timer period; if the Ethernet device does not receive link pulse signals before the sampling timer expires, and the S

[0010] bit of PRBS11 is 0, no switch of the transmit and receive ports / line pairs is performed; if no link pulse signals are received and the S

[0010] bit of PRBS11 is 1, a switch of the transmit and receive ports / line pairs is performed. For example, as shown in Figure 1, originally transmitted from port A and received at port B, it is switched to receive at port A and transmit from port B, or originally transmitted from port C and received at port D, it is switched to receive at port C and transmit from port D. The auto-crossover function in standard auto-negotiation enables the ports of two Ethernet devices on both sides to successfully perform auto-negotiation according to the wiring method shown in Figure 1 (the A port and the B' port are cross-connected, and / or the C port and the D' port are cross-connected). If the line pair crossover situation is outside the above range, auto-negotiation will fail. Therefore, when users crimp network cables for Ethernet devices, they need to strictly compare with the color spectrum shown in Figure 4, which requires a high level of professionalism from users and has a low tolerance for operation errors. Please refer to FIG. 5, which is a schematic diagram of a non-standard network cable crimping method. As shown in FIG. 5: Port A is connected to Port D’, Port B is connected to Port C’, Port C is connected to Port A’, and Port D is connected to Port B’. It can be seen that in this scenario, the wiring methods of the two end devices are different from those in FIG. 1. During the automatic crossover process, the two end devices (Device 1 and Device 2) need to first select their respective two ports for sending and receiving auto-negotiation signals. Assume that Device 1 and Device 2 respectively select to perform auto-negotiation on Ports (A, B) and (A’, B’). During a certain period of time, Device 1 sends signals on Port A and receives signals on Port B, while Device 2 just sends signals on Port B’ and receives signals on Port A’. In the wiring method shown in FIG. 5, since Device 1 cannot receive signals from Device 2 on Port B, Device 1 will perform an automatic crossover, so that Device 1 switches to sending signals on Port B and receiving signals on Port A. Similarly, since Device 2 cannot receive signals from Device 1 on Port A’, Device 2 will perform an automatic crossover, so that Device 2 switches to sending signals on Port A’ and receiving signals on Port B’. However, as can be seen from the wiring method shown in FIG. 5, no matter how many times Device 1 and Device 2 cross over, the negotiation between Device 1 and Device 2 cannot succeed, that is, the automatic crossover function of the device cannot be successfully implemented. In view of this, embodiments of the present application provide an auto-negotiation method, a communication device, and a communication device, which are used to improve the flexibility of wired connections between Ethernet devices. In practical applications, the auto-negotiation method in the embodiments of the present application is used to support communication connections between two Ethernet devices in any circuit board wiring sequence, any network cable crimping sequence, or any interface mode. Please refer to FIG. 6, which is a schematic diagram of the scenario to which the auto-negotiation method in the embodiments of the present application is applied. In the example shown in FIG. 6, the auto-negotiation method in the embodiments of the present application is applicable to the wired connection between a switch and a terminal device, or applicable to the wired connection between a switch and a switch, or also applicable to the wired connection between a terminal device and a terminal device. The Ethernet device in the embodiments of the present application is a communication device that supports the Ethernet protocol for sending signals, or receiving signals, or sending and receiving signals. Exemplarily, the Ethernet device includes a switch, a router, a computer, a printer, a camera, a vehicle to everything (V2X) device, a gateway device, or a bridge device, etc. The embodiments of the present application do not limit this. Next, the auto-negotiation method provided by the embodiments of the present application will be introduced. In the auto-negotiation method provided by the present application, it is required that the Ethernet devices at both ends have entered the auto-negotiation state, and the Ethernet devices at both ends have the auto-crossing function. One of the Ethernet devices (referred to as the local device) first confirms that the peer device has successfully entered the auto-negotiation state, and then all ports of the local device need to enter the signal receiving state. During the signal receiving state of each port of the Ethernet device, link pulse signals are received, and the transmission of link pulse signals is prohibited. Among them, the link pulse signals in the present application include Fast Link Pulse (FLP) signals or Normal Link Pulse (NLP) signals. Therefore, the auto-negotiation method in the present application is applicable to the auto-negotiation process implemented based on FLP signal interaction and also applicable to the auto-negotiation process implemented based on NLP signal interaction. The other Ethernet device (referred to as the peer device) needs to enter the standard ability detect stage. When the peer device is in the ability detection state, two of its ports are selected, and at the same moment, link pulse signals are sent from one port and received at the other port. Therefore, the link pulse signals sent by the peer device will be received by one of the ports of the local device. Since all ports of the local device are prohibited from sending signals, the peer device will not receive link pulse signals from the local device, which causes the peer device to trigger the auto-crossing function, so that the port that previously sent link pulse signals is used to receive link pulse signals, and the port that previously received link pulse signals is used to send link pulse signals. The switching of the receiving and transmitting ports of the peer device enables another port of the local device to receive link pulse signals. Thus, it can be seen that two different ports of the local device receive link pulse signals from the peer device at different times, indicating that these two ports are connected to the ports of the peer device currently used for auto-cross negotiation. Therefore, the local device determines the two ports that receive link pulse signals at two different times as the target ports, and the local device performs the auto-crossing function during auto-negotiation with the peer device based on these two target ports. The target ports defined in this application refer to two ports in an Ethernet device that are used to perform the auto - crossover function in the auto - negotiation process. At the same time, one target port is used to send link pulse signals, and the other target port only receives link pulse signals without sending them. In this application, the two interconnected Ethernet devices determine the target ports in different ways. For the local device, the two ports that receive link pulse signals at two different times are selected as the target ports in the local device; for the peer device, the two ports used to perform auto - crossover are actively selected as the target ports in the peer device. In practical applications, the peer device can select the ports with higher priority as the target ports according to the port priority. In this application, when two Ethernet devices are connected in any wiring order, any network cable crimping order, or any interface mode, the ports for auto - crossover negotiation can be accurately and clearly determined between the two Ethernet devices, enabling the two Ethernet devices to complete auto - negotiation, thereby improving the flexibility and freedom of the wired connection of Ethernet devices and reducing the complexity of the wired connection. It should be understood that in the embodiments of this application, an Ethernet device is used as the execution entity of this auto - negotiation method to illustrate the method, but this application does not limit the execution entity of the auto - negotiation method. For example, the Ethernet device mentioned in the embodiments of this application can also be a chip, a chip system, or a processor that supports the Ethernet device to implement this method, or can also be a logical node, a logical module, or software that can implement all or part of the test of the Ethernet device. For the sake of easy understanding, the above - mentioned auto - negotiation method will be exemplarily described below in conjunction with the accompanying drawings. Please refer to FIG. 7. FIG. 7 is a schematic flow diagram of an auto - negotiation method in an embodiment of this application. In the example of FIG. 7, the auto - negotiation method in the embodiments of this application includes but is not limited to steps 101 to 104. 101. The local device enters the signal receiving state, and the peer device enters the ability detection state. After the two Ethernet devices at both ends enter the auto - negotiation state, one of the Ethernet devices (referred to as the local device) enters the signal receiving state on all its ports. During the signal receiving state of each port of the local device, it is used to receive link pulse signals and is prohibited from sending link pulse signals. The other Ethernet device (referred to as the peer device) enters the ability detection state in the standard protocol and can normally send link pulse signals. As shown in FIG. 7, the wiring method between the local device and the peer device is: port A is connected to port D’, port B is connected to port C’, port C is connected to port A’, and port D is connected to port B’. 102. The peer device sends an FLP signal to the local device through one of its ports. As can be seen from the above, the link pulse signal in the embodiment of the present application includes an FLP signal or an NLP signal. Therefore, the auto-negotiation method in the embodiment of the present application is applicable to the auto-negotiation process implemented based on the FLP signal for interaction, and is also applicable to the auto-negotiation process implemented based on the NLP signal for interaction. Here, only the FLP signal is used as the link pulse signal in the embodiment of the present application for exemplary description. In the ability detection state of the peer device, only one of the ports can be selected to send the FLP signal at the same time. As shown in Figure 7, the peer device selects to send the FLP signal to the local device through port A', and selects port B' (which can also be port C' or port D') to receive the FLP signal from the local device. As can be seen from Figure 7, port A' of the peer device is connected to port C of the local device. Therefore, the local device can receive the FLP signal from port A' of the peer device on port C. 103. The peer device sends a signal to the local device through another port. Since all ports (port A, port B, port C, and port D) of the local device are prohibited from sending FLP signals, the ports of the peer device will not receive the FLP signal from the local device, resulting in the peer device triggering auto-crossing, that is, sending the FLP signal to the local device through another port. As shown in Figure 7, after the peer device performs auto-crossing, it becomes receiving the FLP signal on port A' and sending the FLP signal on port B'. At this time, since port B' of the peer device is connected to port D of the local device, the local device can receive the FLP signal from port B' of the peer device on port D. In practical applications, since the peer device enters the standard ability detection state, the standard auto-crossing logic can be followed to determine whether to switch the sending and receiving ports. For example, when the peer device cannot receive the FLP signal, if the S

[0010] bit of PRBS11 is 0, the sending and receiving ports are not switched; if the S

[0010] bit of PRBS11 is 1, the sending and receiving ports are switched. 104. The local device determines the two ports that receive the FLP signal at two different times as the target ports. After the above steps 102 and 103, two different ports (port C and port D) of the local device receive the FLP signal from the peer device at different times, which indicates that these two ports (port C and port D) are connected to the current ports (port A' and port B') of the peer device used for auto-crossing. Therefore, the local device determines the two ports (port C and port D) that receive the FLP signal at two different times as the target ports, and the local device performs the subsequent auto-crossing process with the peer device based on the target ports. In the auto-negotiation process defined by the existing Ethernet standard, after an Ethernet device starts the auto-negotiation state, it will enter the ability detection state. In the ability detection state, the Ethernet device can only select one port to send link pulse signals at the same time. As can be seen from the above, in the auto-negotiation method of the embodiments of the present application, one of the Ethernet devices needs to enter the signal reception state after starting the auto-negotiation state, and the other Ethernet device needs to enter the ability detection state to normally send link pulse signals. Therefore, in the embodiments of the present application, it is necessary to update the auto-negotiation logic of at least one Ethernet device so that the Ethernet device can select whether to enter the signal reception state based on the auto-negotiation logic provided by the embodiments of the present application after starting the auto-negotiation state. In practical applications, the auto-negotiation logic provided by the embodiments of the present application can be applied to two mutually connected Ethernet devices at the same time (that is, the auto-negotiation logics between the two Ethernet devices are peer-to-peer), or it can also be applied to only one of the Ethernet devices, and the other Ethernet device does not need to update the auto-negotiation logic (that is, continues the auto-negotiation logic defined by the existing Ethernet standard), thereby realizing compatibility with existing Ethernet devices and improving the flexibility of the solution. Please refer to FIG. 8. FIG. 8 is a schematic diagram of the auto-negotiation logic provided in the embodiments of the present application. As shown in FIG. 8, in the traditional auto-negotiation logic, after the Ethernet device starts the auto-negotiation function, it enters the transmit disable stage. After the break_link_timer_done, the local device enters the ability detection state and executes the process defined in the standard. The auto-negotiation logic defined in the embodiments of the present application inserts the newly added port detection process shown in FIG. 8 between the steps of the transmit disable stage and the ability detection state. For the Ethernet device that updates the auto-negotiation logic provided in the embodiments of the present application, after the break_link_timer_done in the transmit disable stage, it will first execute the port detection process shown in FIG. 9 to select whether to enter the signal reception state. Please refer to FIG. 9. FIG. 9 is a schematic diagram of an Ethernet device executing the port detection process in the embodiments of the present application. In the example of FIG. 9, the port detection process executed by the local device is taken as an example for an exemplary introduction. As shown in FIG. 9, the port detection process executed by the local device includes, but is not limited to, steps 201 to 206. 201. Wait to receive the energy signal from the peer device. After the local device starts the auto-negotiation function, it waits to receive an energy signal from the peer device. Based on whether it receives an energy signal from the peer device, the local device confirms whether the peer device has entered the auto-negotiation state. When the local device receives an energy signal from the peer device, the local device confirms that the peer device has entered the auto-negotiation state and then executes step 203. Among them, the energy signal is a signal used to indicate that the Ethernet device has entered the auto-negotiation state, and the embodiments of the present application do not limit the signal type of the energy signal. Exemplarily, in practical applications, the energy signal can be a signal defined by a special coding format, or the energy signal can be a signal carrying a certain special identifier or special field, or the energy signal can be a link pulse signal (FLP signal or NLP signal) in the standard, or the energy signal can also be other signal types, which are not limited in the embodiments of the present application. For example, when the peer device is in the energy detection state, it will send a link pulse signal (FLP signal or NLP signal) to the local device. After the local device receives the link pulse signal, it can confirm that the peer device has entered the auto-negotiation state. In the embodiments of the present application, there is no limitation on the port for receiving the energy signal. As long as any port in the local device receives an energy signal from the peer device, it can be confirmed that the peer device has entered the auto-negotiation state. In practical applications, the local device can define an energy detection timer for the local device to determine whether it receives an energy signal from the peer device before the end of the energy detection timer. If it receives an energy signal from the peer device before the end of the energy detection timer, it is determined that the peer device has entered the auto-negotiation state. 202. Send an energy signal to the peer device. The local device executes step 201 and also executes step 202, that is, it sends an energy signal to the peer device. Among them, the local device can select any port to send the energy signal (such as an FLP signal or an NLP signal), and this application embodiment does not limit this. Preferably, the local device can send the energy signal to the peer device simultaneously when the energy detection timer starts (that is, execute step 201 and step 202 simultaneously). Among them, if the peer device also executes the auto-negotiation logic (port detection process) provided by this application embodiment, that is, after the peer device starts the auto-negotiation function, it will also wait to receive the energy signal from the local device (that is, execute step 201). At this time, the energy signal sent by the local device can enable the peer device to sense that the local device has entered the auto-negotiation state. If the peer device does not execute the auto-negotiation logic (port detection process) provided by this application embodiment, that is, executes the existing standard auto-negotiation process, then the peer device enters the ability detection state after starting the auto-negotiation and sends a link pulse signal (which belongs to the energy signal) to the local device. The local device can determine that the peer device has entered the auto-negotiation state by receiving this link pulse signal. In practical applications, if it is known in advance that the peer device executes the existing standard auto-negotiation process, then the local device can choose not to send a link pulse signal to the peer device, and the local device directly executes step 206. In practical applications, after the local device sends an energy signal to the peer device, within the duration of this energy signal (that is, the sum of the pulse width of the energy signal and the round-trip link transmission time of the energy signal), it is impossible to accurately determine whether the energy signal received by the local device comes from the peer device, thus affecting the accuracy of identifying that the peer device has entered the auto-negotiation state. Therefore, the local device can consider only the energy signals received within the energy detection period as coming from the peer device, thereby improving the accuracy of confirming that the peer device has entered the auto-negotiation state. In other words, the local device will determine that the peer device has entered the auto-negotiation state only when it receives an energy signal within the energy detection period. Among them, the energy detection period is the time period outside the duration of the signal sent by the local device. Furthermore, since the local device only identifies whether the opposite device enters the self-negotiation state during the energy detection period. If the opposite device sends an energy signal to the opposite device during the non-energy detection period (i.e., the duration of the energy signal sent by the local device) after entering the self-negotiation state, the local device will not be able to perceive that the opposite device has entered the self-negotiation state. In this regard, if the local device does not receive the energy signal from the opposite device during the energy detection period (before the energy detection timer ends), the starting time point of the energy detection period is randomly updated to stagger the time when the local device sends the energy signal so that the time difference between the local device and the opposite device is greater than the duration of the energy signal, thereby improving the accuracy of the local device in identifying that the opposite device enters the self-negotiation state. Specifically, the local device can configure another random timer (back_off_timer), and the random timer is used to determine a random duration. When the energy detection timer ends, if the local device does not receive the energy signal from the opposite device, the random timer is triggered. When the random duration defined by the random timer ends, the energy detection timer is restarted, and the energy signal from the opposite device is continued to be received, and the energy signal is sent to the opposite device. This cycle is executed until the energy signal from the opposite device is received, confirming that the opposite device has entered the auto-negotiation state. 203. Determine whether a target signal is received from the opposite device. If the target signal is received, execute step 204; if the target signal is not received, execute step 205. In an embodiment of the present application, a target signal is defined, and the Ethernet device chooses to enter a signal receiving state or a capability detection state by whether the target signal is received. If the local device receives the target signal from the opposite device, the local device executes step 204, that is, the local device jumps out of the port detection process and enters the standard capability detection state. In the capability detection state, the port for performing automatic crossover is actively selected, that is, the target port in the embodiment of the present application. The target port defined in the embodiment of the present application refers to two ports for performing automatic crossover in the Ethernet device, wherein, at the same time, one target port is used to send a link pulse signal and the other target port is used to receive a link pulse signal. In practical applications, the opposite device can preferentially select two ports with high priority as the target port according to the port priority (for example, the priority order in FIG. 1 is A' port> B' port> C' port> D' port). The target signal is a special signal type defined in this application, which is different from the existing signal types in standard auto-negotiation. Exemplarily, in practical applications, the target signal can be a signal defined by a special coding format, or the target signal can be a signal carrying a special identifier or a special field, or the target signal can be multiple signals sent by multiple ports in an Ethernet device at the same time. In the auto-negotiation method of this application, if an Ethernet device receives multiple signals at the same time on multiple ports, the Ethernet device can determine that it has received the target signal. Or, the target signal can also be other signal types, which are not limited in this application. In a possible implementation, the target signal in the embodiments of this application can be multiple link pulse signals sent by different ports at the same time. Exemplarily, the target signal can include multiple link pulse signals sent by 2, 3, or 4 ports at the same time. Specifically, because in the existing standard auto-negotiation process, an Ethernet device will only send link pulse signals on one port at the same time. Therefore, an Ethernet device sending multiple link pulse signals through multiple ports at the same time is the target signal. If an Ethernet device receives link pulse signals (such as FLP signals) on multiple ports at the same time, the Ethernet device can determine that it has received the target signal; if an Ethernet device only receives link pulse signals (such as FLP signals) on one port at the same time, the Ethernet device can determine that it has received the standard link pulse signal and has not received the target signal. By controlling the number of ports sending link pulse signals at the same time, there is no need to redefine the coding format of the target signal, which improves the efficiency of the Ethernet device sending the target signal. In addition, since the Ethernet device identifies the target signal based on the number of ports of the received link pulse signals, rather than specific bit information, the Ethernet device does not need to sense the Link Code Word (LCW) in the target signal, and thus does not need to parse the target signal and recover the link coding word, thereby improving the efficiency of the Ethernet device receiving and identifying the target signal. If the local device does not receive the target signal from the peer device, the local device executes step 205, that is, the local device sends the target signal to the peer device, and then executes step 206, that is, enters the signal receiving state. Specifically, as can be seen from the above, the port detection process of the embodiments of the present application can be applied to two interconnected Ethernet devices at the same time. In other words, the auto-negotiation logic between the two Ethernet devices is peer-to-peer, and both have executed the newly added port detection process (steps 201 to step 206) in the embodiments of the present application. Or, it can also be applied to only one of the Ethernet devices, and the other Ethernet device does not need to execute the newly added port detection process in the embodiments of the present application (that is, continue the auto-negotiation process of the existing Ethernet standard). In both of the above cases, one of the two interconnected Ethernet devices can enter the signal receiving state, and the other Ethernet device can enter the capability detection state. Next, the above two cases will be described separately. Case 1: The auto-negotiation logic between two interconnected Ethernet devices is peer-to-peer, and both have executed the newly added port detection process in the embodiments of the present application. After the two Ethernet devices confirm that the other party has entered the auto-negotiation state, both will determine whether their own device has received the target signal. Among them, since an Ethernet device only considers that the other device has entered the auto-negotiation state when it receives an energy signal during the energy detection period, this ensures that the time for the two Ethernet devices to execute the step of "determining whether the target signal is received" is staggered and greater than the duration of sending the energy signal. Assume that the local device executes the step of "determining whether the target signal is received" earlier than the peer device. Therefore, when the local device does not receive the target signal, it first sends the target signal to the peer device, and then the local device enters the signal receiving state (that is, first execute step 205, and then execute step 206). For the peer device, since the local device has sent the target signal to the peer device, the peer device can receive the target signal, and thus the peer device enters the standard capability detection state. Case 2: The port detection process of the embodiments of the present application is only applied to one of the Ethernet devices, and the other Ethernet device does not need to execute the newly added port detection process in the embodiments of the present application (that is, continue the auto-negotiation process of the existing Ethernet standard). Hereinafter, taking the local device executing the port detection process of the embodiments of the present application as an example for description. Since the peer device does not execute the newly added port detection process in the embodiments of the present application, that is, the peer device continues to execute the auto-negotiation process of the existing standard. When the peer device starts the auto-negotiation function and enters the capability detection state, it will not send the target signal to the local device. After the local device confirms that the peer device has entered the auto-negotiation state, since it cannot receive the target signal, the local device sends the target signal to the peer device and then enters the signal receiving state (that is, first execute step 205, and then execute step 206). 204. Enter the capability detection state. If the local device receives a target signal from the peer device, the local device actively selects the port for performing automatic crossover, that is, the target port in the embodiments of the present application. Among them, one target port is used to send link pulse signals, and the other target port is used to receive link pulse signals. In practical applications, the peer device can preferentially select the two ports with higher priorities as the target ports according to the port priorities (for example, the priority order in Figure 1 is port A'> port B'> port C'> port D'). Then, the local device exits the port detection process and enters the standard ability detection state. 205. Send a target signal to the peer device. After the local device sends a target signal to the peer device, it then enters the signal reception state, that is, step 206 is executed. 206. Enter the signal reception state. When the local device enters the signal reception state, during the signal reception state, all ports of the local device are used to receive link pulse signals, and sending link pulse signals is prohibited. The peer device is in the ability detection state and autonomously selects two target ports. At the same time, one of the target ports is used to send link pulse signals, and the other target port is used to receive link pulse signals. Since the local device does not send link pulse signals, the peer device cannot receive link pulse signals, so the automatic crossover function of the peer device is triggered, causing the peer device to switch the two ports for sending and receiving. In practical applications, the peer device can follow the standard automatic crossover logic to determine whether to switch the sending and receiving ports. For example, when the peer device cannot receive the FLP signal, if the S

[0010] bit of PRBS11 is 0, the sending and receiving ports are not switched; if the S

[0010] bit of PRBS11 is 1, the sending and receiving ports are switched. Therefore, the local device will receive link pulse signals at two different ports at different times, indicating that these two ports are connected to the current target ports of the peer device. Then, the local device determines the two ports that continuously receive link pulse signals as the target ports. Next, based on these two target ports, the local device completes the subsequent auto-negotiation process with the peer device. In practical applications, the network cable connected between two Ethernet devices may also have a situation of network cable pair failure. The embodiments of the present application provide another port detection process for the case of Ethernet cable failure. Please refer to Figure 10. Figure 10 is another schematic diagram of the Ethernet device executing the port detection process in the embodiments of the present application. In the example of Figure 10, taking the local device executing the port detection process as an example, an exemplary introduction is made. As shown in Figure 10, the port detection process executed by the local device includes but is not limited to steps 301 to 308. 301. Wait to receive an energy signal from the peer device. 302. Send an energy signal to the peer device. If a pair of twisted pairs in the network cable fails, and the energy signal sent by the local device to the peer device happens to pass through this faulty pair, the peer device cannot receive the energy signal, and the peer device cannot sense that the local device has entered the auto-negotiation state. Therefore, the local device can send energy signals to the peer device in multiple ports in turn, reducing the impact of network cable faults on the reception of energy signals and improving the accuracy and stability of identifying whether the peer device has entered the auto-negotiation state. In addition, steps 301 to 302 are similar to the foregoing steps 201 to 202. For specific details, please refer to the description of the foregoing steps 201 to 202, and no further elaboration will be provided here. 303. Determine whether the number of ports that simultaneously receive link pulse signals is greater than or equal to 2. If not, execute step 304; if so, execute step 306. Exemplarily, in this scenario, Ethernet devices (local device and peer device) can simultaneously send link pulse signals on 4 ports as the target signals in the embodiments of the present application. If the number of ports that simultaneously receive link pulse signals in the local device is greater than or equal to 2, execute step 304; if less than 2, execute step 306. 304. Send a target signal to the peer device. If the number of ports that receive link pulse signals in the local device is less than 2, indicating that the target signal has not been received, the local device sends a target signal to the peer device and then enters the signal reception state, that is, execute step 305. 305. Enter the signal reception state. In a possible implementation, when executing step 303, only one port of the Ethernet devices at both ends receives the link pulse signal, and the Ethernet devices at both ends will enter the signal reception state. Thus, all ports of the Ethernet devices at both ends are only used to wait for receiving link pulse signals and will not send link pulse signals. Therefore, after entering the signal reception state, when the Ethernet device does not receive a link pulse signal from the peer device within the preset time, it can be determined that 3 pairs of wires between the Ethernet device and the peer device have failed, and the faulty pairs are the pairs that did not receive the energy signal. Further, since it has been determined that a link failure has occurred and auto-negotiation cannot be performed, the Ethernet devices at both ends can choose to exit the auto-negotiation state. Then, choose to perform PMA training and communication on the only remaining intact pair of wires. 306. Determine whether the number of ports that simultaneously receive link pulse signals is equal to 4. If so, execute step 307; if not, execute step 308. 307. Select two of the ports as target ports. Since link pulse signals are received simultaneously on 4 ports, that is, the local device has received the target signal, it indicates that all 4 ports are in good condition and no faults have occurred. The local device will select two of these ports as target ports for auto-crossing according to the port priority and enter the ability detection state. The remote device will use the two ports that have received the link pulse signal as the target ports of the remote device for auto-crossing. 308. Select 2 of the ports that have received the link pulse signal as target ports for auto-crossing. Since the number of ports that have received the link pulse signal simultaneously is greater than or equal to 2 and less than 4, therefore, it indicates that the local device has received the target signal and that there is a fault in the wire pair. At this time, the local device selects 2 of the ports that have received the link pulse signal as target ports for auto-crossing according to the port priority and enters the ability detection state. Optionally, for example, select the two ports with higher priority as target ports for auto-crossing according to the port priority. The remote device will use the two ports that have received the link pulse signal as the target ports of the remote device for auto-crossing. Thus, the auto-negotiation method of the embodiments of the present application can implement any cross-function on the basis of at least 2 pairs of network cables being in good condition, improving the success rate of auto-negotiation. Correspondingly, the embodiments of the present application also provide related devices for implementing the above solutions. Specifically, please refer to FIG. 11. FIG. 11 is a schematic structural diagram of a communication device provided by the embodiments of the present application. The device can be an Ethernet device, a component of an Ethernet device (such as a processor, a chip, or a chip system, etc.), or a logical node, a logical module, or software that can implement all or part of the functions of an Ethernet device. As shown in FIG. 11, the Ethernet device includes: A determination unit 401, configured to determine that the remote device enters the auto-negotiation state in the auto-negotiation state; A processing unit 402, configured to enter the signal reception state on all ports, and each port prohibits sending link pulse signals during the signal reception state. The link pulse signals include fast link pulse signals FLP or normal link pulse signals NLP; The determination unit 401 is further configured to determine two ports as target ports when link pulse signals from the remote device are received through two ports at two times respectively. The target ports are used for auto-crossing with the remote device. In a possible design, the processing unit 402 is specifically configured to: When the target signal from the remote device is not received, send the target signal to the remote device and enter the signal reception state on all ports. In a possible design, the determining unit 401 is further configured to, when receiving a target signal from a peer device, determine two of the ports as target ports for automatic crossover. In a possible design, the target signal is a plurality of link pulse signals sent by different ports at the same time. In a possible design, the determining unit 401 is further configured to: When link pulse signals from a peer device are received on multiple ports at the same time, determine that a target signal from the peer device is received. In a possible design, the determining unit 401 is specifically configured to: Receive an energy signal from a peer device; Determine that the peer device enters the auto-negotiation state according to the energy signal from the peer device. In a possible design, the processing unit 402 is further configured to: Send an energy signal to the peer device. In a possible design, the processing unit 402 is specifically configured to: Send energy signals to the peer device in turn through multiple ports. In a possible design, the determining unit 401 is specifically configured to: Determine that the link pulse signals received during the energy detection period are link pulse signals from the peer device, where the energy detection period is a time period outside the duration of the link pulse signals sent by the local device. In a possible design, when no link pulse signal from the peer device is received during the energy detection period, the processing unit 402 is further configured to update the start time point of the energy detection period. In a possible design, the processing unit 402 is further configured to perform automatic crossover negotiation with the peer device through two target ports. In a possible design, when no link pulse signal from the peer device is received within a preset time duration, the processing unit 402 is further configured to determine that a fault occurs in the network cable pair between the local device and the peer device. In a possible design, the processing unit 402 is further configured to: Exit the auto-negotiation state. It should be noted that the information interaction, execution process, etc. among the modules / units in the communication device are based on the same concept as the method embodiments corresponding to any one of FIGS. 7 to 10 in this application. For specific content, reference can be made to the descriptions in the method embodiments shown above in this application, which will not be elaborated here. Please refer to FIG. 12. FIG. 12 is a schematic diagram of a logical structure of a communication device 50 provided by an embodiment of the present application. The communication device 50 may be an Ethernet device, a component of an Ethernet device (such as a processor, a chip, or a chip system, etc.), or a logical node, a logical module, or software that can implement all or part of the functions of an Ethernet device. An Ethernet device described in the corresponding embodiment of FIG. 11 may be deployed on the communication device 50 to implement the functions implemented by the Ethernet device in any one of the corresponding embodiments of FIGS. 7 to 10. The communication device 50 includes: a memory 501, a processor 502, a communication interface 503, and a bus 504. Among them, the memory 501, the processor 502, and the communication interface 503 are communicatively connected to each other through the bus 504. The memory 501 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 501 may store a program. When the program stored in the memory 501 is executed by the processor 502, the processor 502 and the communication interface 503 are used to execute the above-mentioned auto-negotiation method. The processor 502 may be a central processing unit (CPU), a microprocessor, an application specific integrated circuit (ASIC), a graphics processing unit (GPU), a digital signal processor (DSP), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or any combination thereof, and is used to execute relevant programs to implement one or more steps corresponding to the auto-negotiation method in the present application. The steps of the data processing method disclosed in combination with the embodiments of the present application may be executed by a compiler and an executor, where the compiler and the executor may be executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a mature storage medium in the art such as a random access memory, a flash memory, a read only memory, a programmable read only memory, or an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory 501, and the processor 502 reads the information in the memory 501 and combines its hardware to execute the corresponding embodiment of the auto-negotiation method in the present application. The communication interface 503 uses a transceiver device such as, but not limited to, a transceiver to implement communication between the computer device 50 and other devices or communication networks. The bus 504 can implement a path for transmitting information among various components of the computer device 50 (for example, the memory 501, the processor 502, and the communication interface 503). The bus 504 can be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus can be divided into an address bus, a data bus, a control bus, etc. For the sake of convenience in representation, only a thick line is used in FIG. 12, but it does not mean that there is only one bus or one type of bus. It should be noted that the information interaction, execution process, etc. among the modules / units in the communication device are based on the same concept as the method embodiments corresponding to any one of FIGS. 7 to 10 in this application. For the specific content, reference can be made to the description in the method embodiments shown above in this application, and details will not be repeated here. The embodiment of the present application also provides a computer program product containing instructions. The computer program product can be software or a program product containing instructions that can run on a computing device or be stored in any available medium. When the computer program product runs on at least one computer device, it causes at least one computer device to execute the method described in the embodiment shown in any one of FIGS. 7 to 10 as described above. The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that a computing device can store or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid-state drive), etc. The computer-readable storage medium includes instructions that direct the computing device to execute the method described in the embodiment shown in any one of FIGS. 7 to 10 as described above. The communication device provided by the embodiments of the present application may specifically be a chip, and the chip includes a processing unit and a communication unit. The processing unit may be, for example, a processor, and the communication unit may be, for example, an input / output interface, a pin, a circuit, etc. The processing unit may execute the computer-executable instructions stored in the storage unit to enable the chip to execute the method described in any one of the embodiments shown in FIGS. 7 to 10 above. Optionally, the storage unit is a storage unit within the chip, such as a register, a cache, etc., and the storage unit may also be a storage unit outside the chip within the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM), etc. It should be further noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the device embodiments provided by the embodiments of the present application, the connection relationship between the modules indicates that there is a communication connection between them, which can be specifically implemented as one or more communication buses or signal lines. Through the description of the above embodiments, those skilled in the art can clearly understand that the embodiments of the present application can be implemented by means of software plus necessary general hardware, and of course, can also be implemented by dedicated hardware, including application-specific integrated circuits, dedicated CPUs, dedicated memories, dedicated components, etc. Generally, functions completed by computer programs can be easily implemented by corresponding hardware, and the specific hardware structures for implementing the same function can also be various, such as analog circuits, digital circuits, or dedicated circuits. However, for the embodiments of the present application, software programs are more often the better implementation method. Based on such an understanding, the technical solution of the embodiments of the present application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. The computer software product is stored in a readable storage medium, such as a floppy disk, a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disc of a computer, and includes several instructions to enable a computer device (which may be a personal computer, a training device, or a network device, etc.) to execute the methods described in the various embodiments of the present application. In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of the present application are generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center by wired means (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless means (such as infrared, wireless, microwave, etc.). The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a training device or a data center that includes one or more integrated available media. The available medium may be a magnetic medium (such as a floppy disk, a hard disk, a magnetic tape), an optical medium (such as a DVD), or a semiconductor medium (such as a solid state disk (SSD)), etc.

Claims

1. A self-negotiation method, characterized in that: include: In the auto-negotiation state, determine that the peer device enters the auto-negotiation state; Entering a signal receiving state on all ports, each of the ports being prohibited from sending a link pulse signal during the signal receiving state, wherein the link pulse signal includes a fast link pulse signal FLP or a normal link pulse signal NLP; In response to receiving link pulse signals from the opposite device through two ports at two times respectively, the two ports are determined to be target ports, and the target ports are used to automatically cross with the opposite device.

2. The method according to claim 1, characterized in that: The step of entering a signal receiving state on all ports includes: If the target signal from the opposite device is not received, the target signal is sent to the opposite device, and a signal receiving state is entered on all ports.

3. The method according to claim 2, characterized in that The method further comprises: If a target signal is received from the opposite device, two of the ports are determined to be target ports.

4. The method according to claim 2 or 3, characterized in that: The target signal includes a plurality of link pulse signals sent by different ports at the same time.

5. The method according to claim 4, characterized in that The method further comprises: In response to receiving link pulse signals from the opposite device on multiple ports at the same time, it is determined that a target signal from the opposite device is received.

6. The method according to any one of claims 1 to 5, characterized in that Determine whether the peer device has entered the auto-negotiation state, including: Receiving an energy signal from the opposite device; According to the energy signal from the opposite device, it is determined that the opposite device enters the auto-negotiation state.

7. The method according to claim 6, characterized in that Before determining that the opposite end device enters the self-negotiation state, the method further includes: Sending an energy signal to the opposite device.

8. The method according to claim 7, characterized in that Sending an energy signal to the opposite device includes: The energy signal is sent to the opposite-end device in turn through the multiple ports.

9. The method according to claim 7 or 8, characterized in that: The receiving the energy signal from the opposite device includes: It is determined that a signal received within an energy detection period is an energy signal from the opposite-end device, wherein the energy detection period is a time period other than a duration of the energy signal sent by the local-end device.

10. The method according to claim 9, characterized in that The method further comprises: If no energy signal is received from the opposite device during the energy detection period, the starting time point of the energy detection period is updated.

11. The method according to any one of claims 1 to 10, characterized in that The method further comprises: Automatically crossover is performed with the opposite-end device through the two target ports.

12. The method according to claim 4, characterized in that After entering the signal receiving state on all ports, the method further includes: If no link pulse signal is received from the opposite device within a preset time period, it is determined that a network cable pair between the opposite device and the opposite device is faulty.

13. The method according to claim 12, characterized in that The method further comprises: Exit the auto-negotiation state.

14. A communication device, characterized in that: include: A determination unit, used to determine, in the auto-negotiation state, whether the peer device enters the auto-negotiation state; A processing unit, configured to enter a signal receiving state on all ports, wherein each of the ports is prohibited from sending a link pulse signal during the signal receiving state, wherein the link pulse signal includes a fast link pulse signal FLP or a normal link pulse signal NLP; The determination unit is further configured to determine that the two ports are target ports when link pulse signals from the opposite device are received through the two ports at two times respectively, and the target ports are configured to automatically crossover with the opposite device.

15. The communication device according to claim 14, characterized in that: The processing unit is specifically used for: When the target signal from the opposite device is not received, the target signal is sent to the opposite device, and a signal receiving state is entered on all ports.

16. The communication device according to claim 15, characterized in that: The determining unit is further configured to determine two of the ports as target ports for automatic crossover when receiving a target signal from the opposite-end device.

17. The communication device according to claim 15 or 16, characterized in that: The target signal includes a plurality of link pulse signals sent by different ports at the same time.

18. The communication device according to claim 17, characterized in that: The determining unit is further configured to: When link pulse signals from the opposite-end device are received on multiple ports at the same time, it is determined that the target signal from the opposite-end device is received.

19. The communication device according to any one of claims 14 to 18, characterized in that: The determining unit is specifically configured to: Receiving an energy signal from the opposite device; According to the energy signal from the opposite device, it is determined that the opposite device enters the auto-negotiation state.

20. The communication device according to claim 19, characterized in that The processing unit is further used for: Sending an energy signal to the opposite device.

21. The communication device according to claim 20, characterized in that: The processing unit is specifically used for: The energy signal is sent to the opposite-end device in turn through the multiple ports.

22. The communication device according to claim 20 or 21, characterized in that: The determining unit is specifically configured to: It is determined that the link pulse signal received within the energy detection period is the link pulse signal from the opposite end device, and the energy detection period is a time period other than the duration of the link pulse signal sent by the local end device.

23. The communication device according to claim 22, characterized in that: The processing unit is further configured to update a starting time point of the energy detection period when no link pulse signal is received from the opposite device within the energy detection period.

24. The communication device according to any one of claims 14 to 23, characterized in that: The processing unit is further configured to perform automatic cross negotiation with the opposite-end device through the two target ports.

25. The communication device according to claim 17, characterized in that: The processing unit is further configured to determine that a fault occurs in the network cable pair between the processing unit and the opposite device when no link pulse signal is received from the opposite device within a preset time period.

26. The communication device according to claim 25, characterized in that The processing unit is further used for: Exit the auto-negotiation state.

27. A communication device, characterized in that: comprising a processor coupled to a memory, The memory is used to store instructions; The processor is configured to execute instructions in the memory so that the communication device performs the method according to any one of claims 1 to 13.

28. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.

29. A computer program product, characterized in that The computer program product stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Negotiation method and apparatus for connecting Ethernet port link

    CN101350823A

  • Device and method for guaranteeing normal communication of Ethernet

    CN102546289A

  • Intelligent optical fiber distribution scheduling management system and method thereof

    CN116681993A

  • Auto-negotiation for multiple ports using shared logic

    US6115389A