Network establishment method, Ethernet system and vehicle

JP2026041799A5Pending Publication Date: 2026-06-25SHENZHEN YINWANG INTELLIGENT TECHNOLOGIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
JP · JP
Patent Type
Applications
Current Assignee / Owner
SHENZHEN YINWANG INTELLIGENT TECHNOLOGIES CO LTD
Filing Date
2025-11-21
Publication Date
2026-06-25

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

A network establishment method, an Ethernet system, and a vehicle are provided. [Solution] The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port, forming a ring network. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of the other backbone node are in a forwarding state. In the network establishment method, the first backbone node obtains link failure information of the ring network, and switches the second backbone port of the first backbone node to the forwarding state based on the link failure information.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] [CROSS-REFERENCE TO RELATED APPLICATIONS] This application claims priority to Chinese Patent Application No. 202110415169.3, entitled "NETWORK ESTABLISHING METHOD AND APPARATUS," filed on April 17, 2021, the entire contents of which are incorporated by reference.

[0002] This application claims priority to Chinese Patent Application No. 202110861508.0, entitled "NETWORK ESTABLISHING METHOD, ETHERNET SYSTEM, AND VEHICLE," filed on July 29, 2021, the entire contents of which are incorporated by reference.

[0003] [Technical field] This application relates to the field of Ethernet, and more particularly to a network establishment method, an Ethernet system and a vehicle. [Background technology]

[0004] In order to improve the communication security and reliability of vehicle systems, a redundant network is usually involved in the application process of automotive Ethernet to perform data link backup. Typical network topologies include T-type network, bilinear network, and ring topology. Among these network topologies, ring network is widely used in many application scenarios due to its lowest cost.

[0005] Ring networks inevitably create Layer 2 loops within a Layer 2 network, which, if no measures are taken to eliminate the loops, can lead to a series of problems, such as network broadcast storms and media access control (MAC) address table shocks resulting in unavailable MAC address entries.

[0006] To eliminate Layer 2 loops, conventional network technologies use protocols such as Spanning Tree Protocol (STP), Rapid Spanning Tree Protocol (RSTP), and Multiple Spanning Tree Protocol (MSTP) to perform link pruning and loop removal actions through node selection. However, due to limitations in the convergence algorithms and mechanisms of protocols such as STP, RSTP, and MSTP, the network topology configuration time cannot meet the requirements of in-vehicle applications. Summary of the Invention

[0007] This application provides a network establishment method, an Ethernet system, and a vehicle to shorten the response time for switching between an active link and a standby link, achieve fast network reconstruction, and meet the requirements of in-vehicle applications.

[0008] According to a first aspect, there is provided a network establishment method. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port, where M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The method includes: the first backbone node obtains link failure information of the ring network; and the first backbone node switches the second backbone port of the first backbone node to a forwarding state based on the link failure information.

[0009] In this application, a first backbone node may acquire link failure information of a ring network. The link failure information is used as an event trigger source. When the first backbone node acquires the information, the first backbone node switches a blocked port to a forwarding state and enables a standby link where the originally blocked port is located. After the port state is switched, the ring network can be reconstructed into a linear communication network for communication when a link fails. In the prior art, when a link fails, all nodes become silent, and then a new round of node selection and link pruning is performed to reestablish communication connections between the remaining links. Compared with the prior art, this application can shorten the response time for switching between active links and standby links, realize fast network reconstruction, and meet the requirements of in-vehicle applications.

[0010] Referring to the first aspect, in some implementations of the first aspect, the first backbone node obtaining link failure information of the ring network includes: the first backbone node receiving a notification packet through a first backbone port of the first backbone node; the notification packet is used to indicate that a first link has failed; the first link is a link where a first backbone port of a second backbone node is located.

[0011] Referring to the first aspect, in some implementations of the first aspect, the notification packet is a bridge protocol data unit (BPDU) packet.

[0012] In some implementations of the first aspect, the first backbone node obtaining link failure information of the ring network includes: determining that a second link has failed, the second link being a link on which a first backbone port of the first backbone node is located;

[0013] Referring to the first aspect, in some implementation manners of the first aspect, the method further includes: the first backbone node switches a first backbone port of the first backbone node to a blocking state;

[0014] Referring to the first aspect, in some implementations of the first aspect, how the first backbone node determines that the second link has failed includes: the first backbone node determines that the second link has failed through differential signal diagnosis;

[0015] Referring to the first aspect, in some implementations of the first aspect, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node within the network.

[0016] Referring to the first aspect, in some implementations of the first aspect, the method includes: a first backbone node detects a first identifier; and the first backbone node determines, based on the first identifier, that the first backbone node is a backbone node in the network.

[0017] According to a second aspect, there is provided a network establishment method. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node. The method includes: the second backbone node determines that a first link has failed. The first link is a link on which the first backbone port of the second backbone node is located. The second backbone node sends a notification packet through the second backbone port of the second backbone node, which is used to indicate that the first link has failed.

[0018] In this application, when a first link is determined to have failed, the second backbone node sends a notification packet, thereby enabling the first backbone node to acquire link failure information of the ring network. The link failure information is used as an event trigger source. When the first backbone node acquires the information, it switches the blocked port to a forwarding state and activates the standby link where the originally blocked port is located. After the port state is switched, the ring network can be reconstructed into a linear communication network for communication when the link fails. In the prior art, when a link fails, all nodes become silent, and then a new round of node election and link pruning is performed to reestablish communication connections between the remaining links. Compared with the prior art, this application can shorten the response time for switching between active and standby links, achieve fast network reconstruction, and meet the requirements of in-vehicle applications.

[0019] Referring to the second aspect, in some implementation manners of the second aspect, the method includes: the second backbone node switches a first backbone port of the second backbone node to a blocking state;

[0020] Referring to the second aspect, in some implementations of the second aspect, the first backbone port of the second backbone node is a master port, and the second backbone port of the second backbone node is a slave port.

[0021] Referring to the second aspect, in some implementations of the second aspect, how the second backbone node determines that the first link has failed includes: the second backbone node determines that the first link has failed through differential signal diagnosis;

[0022] Referring to the second aspect, in some implementations of the second aspect, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node within the network.

[0023] Referring to the second aspect, in some implementations of the second aspect, the method further includes: the second backbone node detects the first identifier; and the second backbone node determines, based on the first identifier, that the second backbone node is a backbone node in the network.

[0024] Referring to the second aspect, in some implementations of the second aspect, the notification packet is a bridge protocol data unit (BPDU) packet.

[0025] According to a third aspect, there is provided a network establishment method. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The network further includes terminal nodes. The terminal nodes include a first terminal port and a second terminal port. The first terminal port is in a forwarding state. The second terminal port is in a blocking state. At least two of the M backbone nodes further include a third terminal port. The first terminal port and the second terminal port are connected to third terminal ports of at least two backbone nodes. The method includes: the terminal node determines that a third link has failed; the third link is the link on which the first terminal port is located; and the terminal node switches the second terminal port to a forwarding state.

[0026] In this application, a terminal node may acquire link failure information of the terminal node's active link and standby link. The link failure information is used as an event trigger source. When the terminal node acquires the information, the terminal node switches a blocked port to a forwarding state and enables the standby link where the originally blocked port is located. Compared with the prior art, in this application, devices other than the terminal node do not need to be involved in control and processing, and fast switching between the active link and the standby link is completed under the configuration logic within the terminal node. Therefore, the response time for switching between the active link and the standby link can be shortened, fast network reconstruction can be realized, and the requirements of in-vehicle applications can be met.

[0027] Referring to the third aspect, in some implementation manners of the third aspect, the method includes: the terminal node switches a first terminal port to a blocking state;

[0028] Referring to the third aspect, in some implementations of the third aspect, how the terminal node determines that the third link has failed includes: The terminal node determines that the third link has failed through differential signal diagnosis.

[0029] In some implementations of the third aspect, the terminal node includes a second identifier, which is used to identify the terminal node within the network.

[0030]

[0013] Referring to the third aspect, in some implementations of the third aspect, the method includes: a terminal node detects a second identifier; and the terminal node determines, based on the second identifier, that the terminal node is a terminal node in the network.

[0031] According to a fourth aspect, there is provided a network establishment device. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node. The device includes a transceiver unit and a processing unit. Optionally, the device is the first backbone node. The transceiver unit is configured to acquire link failure information of the ring network. The processing unit is configured to switch a second backbone port of the first backbone node to a forwarding state based on the link failure information.

[0032] With reference to the fourth aspect, in some implementations of the fourth aspect, the transceiver unit is specifically configured to receive a notification packet through a first backbone port of a first backbone node. The notification packet is used to indicate that a first link has failed. The first link is a link on which a first backbone port of a second backbone node is located.

[0033] Referring to the fourth aspect, in some implementations of the fourth aspect, the notification packet is a bridge protocol data unit (BPDU) packet.

[0034] With reference to the fourth aspect, in some implementations of the fourth aspect, the processing unit is further configured to determine that a second link has failed, the second link being a link on which a first backbone port of the first backbone node is located.

[0035] Referring to the fourth aspect, in some implementations of the fourth aspect, the processing unit is further configured to switch a first backbone port of the first backbone node to a blocked state.

[0036] Referring to the fourth aspect, in some implementations of the fourth aspect, the processing unit is specifically configured to determine that the second link has failed through differential signal diagnosis.

[0037] Referring to the fourth aspect, in some implementations of the fourth aspect, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node within the network.

[0038] With reference to the fourth aspect, in some implementations of the fourth aspect, the processing unit is further configured to detect a first identifier and determine, based on the first identifier, that the processing unit is a backbone node in the network.

[0039] According to a fifth aspect, there is provided a network establishment device. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node. The device includes a transceiver unit and a processing unit. Optionally, the device is the second backbone node. The processing unit is configured to determine that the first link has failed. The first link is a link on which a first backbone port of a second backbone node is located. The transceiver unit is configured to transmit a notification packet through the second backbone port of the second backbone node. The notification packet is used to indicate that the first link has failed.

[0040] Referring to the fifth aspect, in some implementations of the fifth aspect, the processing unit is further configured to switch the first backbone port of the second backbone node to a blocked state.

[0041] Referring to the fifth aspect, in some implementations of the fifth aspect, the first backbone port of the second backbone node is a master port, and the second backbone port of the second backbone node is a slave port.

[0042] Referring to the fifth aspect, in some implementations of the fifth aspect, the processing unit is specifically configured to determine that the first link has failed through differential signal diagnosis.

[0043] Referring to the fifth aspect, in some implementations of the fifth aspect, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node in the network.

[0044] With reference to the fifth aspect, in some implementations of the fifth aspect, the processing unit is further configured to detect a first identifier and determine, based on the first identifier, that the processing unit is a backbone node in the network.

[0045] Referring to the fifth aspect, in some implementations of the fifth aspect, the notification packet is a bridge protocol data unit (BPDU) packet.

[0046] According to a sixth aspect, there is provided a network establishment device. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Of the M backbone nodes, both the first backbone port and the second backbone port of any backbone node other than the first backbone node are in a forwarding state. The network further includes terminal nodes. The terminal nodes include a first terminal port and a second terminal port. The first terminal port is in a forwarding state. The second terminal port is in a blocking state. At least two of the M backbone nodes further include a third terminal port. The first terminal port and the second terminal port are connected to third terminal ports of at least two backbone nodes. The apparatus includes a processing unit. Optionally, the apparatus is an end node. The processing unit is configured to determine that a third link has failed. The third link is the link on which the first terminal port is located. The processing unit is further configured to switch the second terminal port to a forwarding state.

[0047] Referring to the sixth aspect, in some implementations of the sixth aspect, the processing unit is further configured to switch the first terminal port to a blocking state.

[0048] Referring to the sixth aspect, in some implementations of the sixth aspect, the processing unit is specifically configured to determine that the third link has failed through differential signal diagnosis.

[0049] In some implementations of the sixth aspect, the terminal node includes a second identifier, which is used to identify the terminal node within the network.

[0050] With reference to the sixth aspect, in some implementations of the sixth aspect, the processing unit is further configured to detect a second identifier and determine, based on the second identifier, that the processing unit is a terminal node in the network.

[0051] According to a seventh aspect, there is provided a network establishment apparatus, the apparatus comprising: a memory configured to store a computer program; and a processor configured to execute the computer program stored in the memory, thereby causing the apparatus to perform the method of any possible implementation of the first aspect, or to perform the method of any possible implementation of the second aspect, or to perform the method of any possible implementation of the third aspect.

[0052] According to an eighth aspect, there is provided a chip system, the chip system including a processor configured to call a computer program from a memory and execute the computer program, thereby causing a device in which the chip system is installed to perform the method of any possible implementation manner of the first aspect, or to perform the method of any possible implementation manner of the second aspect, or to perform the method of any possible implementation manner of the third aspect.

[0053] According to a ninth aspect, there is provided a computer-readable storage medium storing a computer program which, when executed on a computer, enables the computer to perform the method of any possible implementation manner of the first aspect, or the method of any possible implementation manner of the second aspect, or the method of any possible implementation manner of the third aspect.

[0054] According to a tenth aspect, there is provided an Ethernet system including M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node.

[0055] The first backbone node is configured to obtain link failure information of the ring network, and switch a second backbone port of the first backbone node to a forwarding state based on the link failure information.

[0056] With reference to the tenth aspect, in some implementations of the tenth aspect, the second backbone node is configured to determine that a first link has failed, where the first link is a link on which a first backbone port of the second backbone node is located, and is configured to transmit a notification packet through the second backbone port of the second backbone node, The notification packet is used to indicate that the first link has failed.

[0057] The first backbone node is specifically configured to receive the notification packet through a first backbone port of the first backbone node.

[0058] Referring to the tenth aspect, in some implementations of the tenth aspect, the second backbone node is further configured to switch the first backbone port of the second backbone node to a blocked state.

[0059] Referring to the tenth aspect, in some implementations of the tenth aspect, the first backbone port of the second backbone node is a master port, and the second backbone port of the second backbone node is a slave port.

[0060] Referring to the tenth aspect, in some implementations of the tenth aspect, the second backbone node is specifically configured to determine that the first link has failed through differential signal diagnosis.

[0061] Referring to the tenth aspect, in some implementations of the tenth aspect, the notification packet is a bridge protocol data unit (BPDU) packet.

[0062] With reference to the tenth aspect, in some implementations of the tenth aspect, the first backbone node is specifically configured to determine that the second link has failed, where the second link is a link on which a first backbone port of the first backbone node is located.

[0063] Referring to the tenth aspect, in some implementations of the tenth aspect, the first backbone node is further configured to switch a first backbone port of the first backbone node to a blocked state.

[0064] Referring to the tenth aspect, in some implementations of the tenth aspect, the first backbone node is specifically configured to determine that the second link has failed through differential signal diagnosis.

[0065] Referring to the tenth aspect, in some implementations of the tenth aspect, each of the M backbone nodes includes a first identifier, and the first identifier is used to identify the backbone node in the Ethernet system.

[0066] Referring to the tenth aspect, in some implementations of the tenth aspect, the Ethernet system further includes a terminal node. The terminal node includes a first terminal port and a second terminal port. The first terminal port is in a forwarding state. The second terminal port is in a blocking state. At least two backbone nodes among the M backbone nodes further include a third terminal port, and the first terminal port and the second terminal port are connected to the third terminal ports of the at least two backbone nodes. The terminal node is configured to determine that the third link has failed, where the third link is the link on which the first terminal port is located, and to switch the second terminal port to a forwarding state.

[0067] Referring to the tenth aspect, in some implementations of the tenth aspect, the terminal node is further configured to switch the first terminal port to a blocking state.

[0068] Referring to the tenth aspect, in some implementations of the tenth aspect, the end node is specifically configured to determine that the third link has failed through differential signal diagnostics.

[0069] In some implementations of the tenth aspect, the terminal node includes a second identifier, which is used to identify the terminal node in the Ethernet system.

[0070] According to an eleventh aspect, there is provided a vehicle including an Ethernet system according to the tenth aspect or any one of the possible implementations of the tenth aspect. [Brief explanation of the drawings]

[0071] [Figure 1]1 is a schematic diagram of an application scenario according to an embodiment of the present application; [Figure 2] FIG. 1 is a schematic block diagram of a network establishment method according to an embodiment of the present application; [Figure 3] 1 is a schematic block diagram of an Ethernet system according to an embodiment of the present application. [Figure 4] 1 is a schematic flowchart of a network establishment method according to an embodiment of the present application; [Figure 5] 1 is a schematic block diagram of an Ethernet system according to an embodiment of the present application. [Figure 6] 1 is a schematic diagram of the structure of a network establishment device according to an embodiment of this application; [Figure 7] 1 is a schematic diagram of the structure of a network establishment device according to an embodiment of this application; [Figure 8] 1 is a schematic diagram of the structure of a network establishment device according to an embodiment of this application; [Figure 9] 1 is a schematic diagram of the structure of a network establishment device according to an embodiment of this application; [Figure 10] FIG. 2 is a schematic diagram of the execution logic of a backbone node according to an embodiment of the present application; [Figure 11] 11 is a schematic diagram of a network architecture 1100 according to an embodiment of the present application. [Figure 12] FIG. 1 is a schematic diagram of port state switching when a link fails according to an embodiment of the present application; [Figure 13] FIG. 1 is a schematic diagram of port state switching when a backbone node fails according to an embodiment of the present application; [Figure 14] 1 is a schematic diagram of a transmission path of a BPDU packet when a link fails according to an embodiment of the present application; [Figure 15] 1 is a schematic diagram of a transmission path of a BPDU packet on a backbone node according to an embodiment of the present application; [Figure 16] FIG. 1 is a schematic diagram of port state switching when a link fails according to an embodiment of the present application; DETAILED DESCRIPTION OF THE INVENTION

[0072] The technical solutions of this application are described below with reference to the accompanying drawings.

[0073] 1 is a schematic diagram of an application scenario according to an embodiment of this application. As shown in FIG. 1, the method provided in this embodiment of this application may be applied to an Ethernet system 100. The Ethernet system 100 may include a domain controller (DC) 110, a vehicle integrated / integration unit (VIU) 120, and vehicle components 130. The DC 110, the VIU 120, and the vehicle components 130 communicate with each other by using Ethernet technology.

[0074] 1, DC 110 includes multiple DCs. Each DC is configured to manage a functional domain in a vehicle, i.e., the DC is communicatively connected to multiple vehicle components located in the functional domain. DC 110 is configured to control the vehicle components in the corresponding functional domain or to provide data processing functions for the vehicle components in the corresponding functional domain.

[0075] For example, the DC in a vehicle may include an autonomous driving domain controller, a cockpit domain controller (CDC), a vehicle domain controller (VDC), etc. The autonomous driving domain controller may provide services for vehicle components that realize the autonomous driving function. Vehicle components that realize the autonomous driving function include a monocular camera, a binocular camera, a millimeter-wave radar, a laser radar, an ultrasonic radar, etc. The CDC may provide services for vehicle components in the cockpit domain. Vehicle components in the cockpit domain include a head-up display, an instrument display, a radio, a navigation system, a camera, etc. The VDC may provide services for vehicle components in the body domain and vehicle components in the chassis domain. Vehicle components in the body domain include a door / window lift controller, an electric rearview mirror, an air conditioner, a center door lock, etc. Vehicle components in the chassis domain include vehicle components in the braking system, the steering system, and the throttle in the acceleration system.

[0076] The vehicle component 130 includes an execution element. The execution element is configured to perform a specific function, and the execution element may be, for example, a sensor 133 or an actuator 132 within the vehicle. Optionally, the vehicle component 130 may further include an electronic control unit (ECU) 131. The vehicle component 130 may include one or more of the following vehicle components: a vehicle component with some or all ECU functions, and a vehicle component with no electronic control functions. A vehicle component 130 with all electronic control functions may be understood as a vehicle component 130 that can perform all electronic control functions required by the vehicle component 130 by using the ECU 131 of the vehicle component 130. A vehicle component 130 with some electronic control functions may be understood as a vehicle component 130 in which some electronic control functions required by the vehicle component 130 are performed by an ECU within the vehicle component 130 and other electronic control functions required by the vehicle component 130 are performed by the VIU 120. The vehicle component 130 without electronic control functions may be understood as a vehicle component 130 that does not have an electronic control unit (ECU) for realizing electronic control functions, and all electronic control functions required by the vehicle component 130 are realized by the VIU. The ECU 131 is located inside the vehicle component and configured to provide electronic control functions for the vehicle component. The ECU 131 is, for example, an electronic control unit in a rain wiper, an electronic control unit located in a vehicle door, etc.

[0077] The VIU 120 is communicatively coupled to the vehicle components 130 and the DC 110 within the vehicle. For example, in FIG. 1 , VIU1 is communicatively coupled to vehicle components 1, 2, and 3, and VIU1 is communicatively coupled to DC1 and DC2. Optionally, the VIU 120 may be communicatively coupled to a DC within the DC 110. For example, as shown in FIG. 1 , VIUb is communicatively coupled to DCn. The VIU 120 may further be communicatively coupled to multiple DCs within the DC 110. For example, as shown in FIG. 1 , VIU1 may be communicatively coupled to DC1 and DC2.

[0078] For example, the VIU 120 may transmit the control information acquired from the DC 110 to corresponding components in the vehicle component 130 and control the components in the vehicle component 130 to perform operations based on the acquired control information, such as controlling the operation of the rain wipers based on the control information. In another example, the VIU 120 may control the on / off status of the vehicle door lock based on the control information. The VIU 120 may also process data to be processed in the vehicle component 130, such as performing data processing on rainfall information collected by using the sensing elements of the rain wipers to determine the operation status of the rain wipers. The operation status may include the operation frequency or on / off status of the rain wipers. In another example, the VIU 120 may perform data processing on fingerprint information on the vehicle door acquired by using the sensing elements of the door lock to determine the on / off status information of the vehicle door. The VIU 120 may further transmit the data processing result to the DC 110, and the DC 110 generates corresponding control information based on the operation status in the area.

[0079] Currently, ring networks are widely used in automotive Ethernet systems due to their lowest cost. For example, in system 100, VIUs may be connected in a wired manner to form a ring network. The ring network may also be called a backbone network. Each VIU functions as a backbone node in the ring network. Furthermore, electronic devices in the vehicle (e.g., DC 110 and vehicle components 130 in FIG. 1) may be connected to the ring network, thereby enabling the electronic devices in the vehicle to communicate through the ring network. Devices accessing the ring network may be called terminal nodes.

[0080] The use of a ring network inevitably leads to the formation of Layer 2 loops within the Layer 2 network. To eliminate Layer 2 loops, protocols such as Spanning Tree Protocol (STP), Rapid Spanning Tree Protocol (RSTP), and Multiple Spanning Tree Protocol (MSTP) may be used to perform link pruning and loop elimination through node selection. However, due to limitations in the convergence algorithms and mechanisms of protocols such as STP, RSTP, and MSTP, the network topology configuration time cannot meet the requirements of in-vehicle applications.

[0081] In view of this, this application provides a network establishment method, an Ethernet system, and a vehicle to shorten the response time for switching between an active link and a standby link, achieve fast network reconstruction, and meet the requirements of in-vehicle applications.

[0082] 2 is a schematic block diagram of a network establishment method 200 according to an embodiment of this application. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. The ring network may also be called a backbone network. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node.

[0083] In this application, the network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port, where M is an integer greater than 2. In the ring network, the second backbone port of the first backbone node may be set to a blocked state, and both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state to avoid a Layer 2 loop. In this case, the link on which the blocked port is located may also be called a standby link. Two of these forwarding ports are connected to each other to form an active link. The network establishment method 200 includes the following steps.

[0084] S210: The first backbone node obtains link failure information of the ring network.

[0085] In this application, a link failure includes, but is not limited to, the following possibilities: a link failure caused by a loose backbone port of a backbone node, a link failure caused by a power failure of any connected backbone node on the link, or a link failure caused by a short, open circuit, or disconnection of a communication cable on the link.

[0086] In this application, a backbone port is understood to be a port used to form a ring network and located within a port of a backbone node. One backbone node may include two backbone ports, and each of the two backbone ports is connected to one backbone node.

[0087] In one possible implementation, the link failure information includes that a first link has failed, where the first link is a link where a first backbone port of the second backbone node is located. At S210, the first backbone node obtains link failure information of the ring network including:

[0088] The second backbone node determines that the first link has failed. The second backbone node transmits a notification packet through a second backbone port of the second backbone node. The notification packet is used to indicate that the first link has failed. In response, the first backbone node may receive the notification packet through the first backbone port of the first backbone node.

[0089] In other words, when the second backbone node detects that the first link has failed, the failure information may trigger the second backbone node to send a notification packet. The notification packet is used to indicate the link failure information. The second backbone node may send the notification packet through a second backbone port of the second backbone node. The notification packet may be forwarded by each backbone node in the ring network. The first backbone node receives the notification packet through the first backbone port of the first backbone node and obtains link failure information of the ring network based on the notification packet.

[0090] In this application, a first link failure includes, but is not limited to, the following possibilities: a link failure caused by a loose first backbone port of a second backbone node, a link failure caused by a power failure of one port of a connected backbone node on the first link, or a link failure caused by a short circuit, open circuit, or disconnection of a communication cable on the first link.

[0091] It should be noted that when a link or node in a ring network fails, link failure information can be detected by two connected backbone nodes on the failed link or two backbone nodes connected to the failed node. The failure information is used as a trigger source for a notification packet. Therefore, each of the two second backbone nodes forwards the notification packet through a port within the two second backbone nodes that can perform normal communication. In other words, since there are two second backbone nodes in the ring network that separately perform the step of sending a notification packet, there are two notification packets in the ring network. The notification packets are transmitted in opposite directions within the ring network. One notification packet arrives at the second backbone port of the first backbone node, but is discarded at the port because the port is in a blocked state. The other notification packet arrives at the first backbone port of the first backbone node. Because the first backbone port of the first backbone node is in a forwarding state, the first backbone node may receive the notification packet through the port. When receiving the notification packet, the first backbone node learns that a link has failed in the ring network, that is, the first backbone node obtains link failure information based on the notification packet.

[0092] It should be understood that the notification packet in this application is a notification packet when a link fails. A link failure triggers the transmission of a notification packet. When a link does not fail, the transmission of a notification packet is not triggered. Thus, when a first backbone node receives a notification packet, the link in the ring network is considered to have failed. When no packet is received, the link is considered to be normal. The specific information included in the notification packet may or may not carry specific information about the failed link, i.e., information indicating the specific failed link. This is not a limitation in this application.

[0093] In a possible implementation, the link failure information includes that a second link has failed. The second link is a link where a first backbone port of the first backbone node is located. At S210, the first backbone node obtains link failure information of the ring network including: the first backbone node determines that the second link has failed;

[0094] In this application, a first backbone node may obtain failure information of a link on which a first backbone port of the first backbone node is located. In other words, if a second link in the ring network fails, the first backbone node may obtain failure information of the first backbone port based on the port performance of the first backbone node. In this case, the second backbone port of the first backbone node cannot communicate with the outside world, and the first backbone port of the first backbone node is in a blocked state. Therefore, no notification packet is received.

[0095] In this application, when a first link in the ring network fails, the first backbone node may receive a notification packet through the first backbone port of the first backbone node to obtain link failure information. When a second link fails, the first backbone node may directly obtain the link failure information.

[0096] In this application, a failure of the second link includes, but is not limited to, the following possibilities: a link failure caused by a loose first backbone port of the first backbone node, a link failure caused by a power failure of one port of the connected backbone node on the second link, or a link failure caused by a short circuit, open circuit, or disconnection of the communication cable on the second link.

[0097] S220: The first backbone node switches the second backbone port of the first backbone node to a forwarding state based on the link failure information.

[0098] When the first backbone node acquires the link failure information, it switches the second backbone port in the blocked state to the forwarding state. In other words, the first backbone node learns based on the link failure information that a link has failed in the current ring network, and therefore may immediately switch the second backbone port originally in the blocked state to the forwarding state to activate the standby link in the ring network. In this case, all normal nodes may continue to perform normal communication through the linear communication network formed by the standby link and the non-failed link, thereby completing communication in the failure state. This ensures communication security in the Ethernet system.

[0099] In this application, a first backbone node may acquire link failure information of a ring network. The link failure information is used as an event trigger source. When the first backbone node acquires the information, the first backbone node switches a blocked port to a forwarding state and enables a standby link where the originally blocked port is located. After the port state is switched, the ring network can be reconstructed into a linear communication network for communication when a link fails. In the prior art, when a link fails, all nodes become silent, and then a new round of node selection and link pruning is performed to reestablish communication connections between the remaining links. Compared with the prior art, this application can shorten the response time for switching between active links and standby links, realize fast network reconstruction, and meet the requirements of in-vehicle applications.

[0100] It should be noted that in this application, the forward state of a port means that the port can transmit physical layer signals or can transmit packets at layer 2 and higher layers. The block state of a port means that the port can transmit physical layer signals but cannot transmit packets at layer 2 and higher layers. Packets at layer 2 and higher layers are discarded when passing through the port.

[0101] It should be understood that a link in this application is a straight link between two nodes, in other words, there are no other nodes between the two nodes.

[0102] Optionally, if the first link fails, the method further includes: S230-a: The second backbone node switches the first backbone port of the second backbone node into a blocking state.

[0103] In this application, after the first link fails, the second backbone node may switch the first backbone port of the second backbone node to a blocked state. In this way, after the first link is restored to normal, one port remains in a blocked state in the ring network. This prevents the formation of a network storm.

[0104] It is particularly noted that when the first link fails, two second backbone nodes on the ring network separately perform the step of sending a notification packet, but only one of the two second backbone nodes switches the first backbone port of the second backbone node to a blocked state.

[0105] It should be understood that in this application, the second backbone node sends a notification packet and the first backbone node receives the notification packet. Whether the notification packet is forwarded by other backbone nodes in the transmission process is not limited. Specifically, the second backbone node may directly send the notification packet to the first backbone node through the link between the first backbone node and the second backbone node. Alternatively, the second backbone node may first send the notification packet to a backbone node connected to the second backbone node, and the notification packet arrives at the first backbone node after being forwarded one or more times.

[0106] Optionally, before S220, the second backbone node switches the first backbone port of the second backbone node to a blocking state.

[0107] In other words, before sending the notification packet, the second backbone node switches the first backbone port of the second backbone node to a blocking state. In this way, before the first backbone port of the second backbone node is switched to a blocking state, the second backbone port of the first backbone node is not switched to a forwarding state, and the first link is not restored to normal. This helps ensure network security.

[0108] Optionally, the first backbone port of the second backbone node is a master port, and the second backbone port of the second backbone node is a slave port.

[0109] In peer-to-peer (P2P) communication, the two connected ports in a link are configured as a master port and a slave port, respectively. Furthermore, in a ring network, any link is always connected by using a master port and a slave port as a pair. If two master ports or two slave ports are directly connected, communication will fail. In a link formed by connecting a master port and a slave port as a pair, the master port actively sends a handshake signal to the slave port to establish a communication connection with the slave port.

[0110] In this application, after a first link fails, two second backbone nodes that send notification packets may detect whether the first backbone ports of the two second backbone nodes are master ports. If the first backbone ports of the two second backbone nodes are master ports, the second backbone node switches the first backbone ports of the second backbone nodes to a blocked state. In other words, after a link fails, the connected master ports in the failed link are set to a blocked state. In this way, after the failed link is successfully restored, the master ports in the link are in a blocked state. This can avoid handshaking signals on the link and reduce communication overhead.

[0111] Optionally, in the solution of this application, the first backbone port of the second backbone node may alternatively be a master port, and the second backbone port of the second backbone node may alternatively be a slave port. In other words, the connected slave port in the failed link may be switched to a blocked state. This is not limited in this application.

[0112] In other words, when the switching logic of the nodes is configured, if a link fails, the second backbone node may detect whether the second backbone port of the second backbone node is a master port. When the second backbone port is a master port, the second backbone node switches the second backbone port of the second backbone node to a blocked state. Alternatively, the configuration may be as follows: The second backbone node detects whether the second backbone port of the second backbone node is a slave port. When the second backbone port of the second backbone node is a slave port, the second backbone node switches the second backbone port of the second backbone node to a blocked state. Regardless of the above configuration scheme, it should be understood that the switching logic configured in each backbone node should be the same to avoid switching confusion.

[0113] It should be understood that both the first backbone port and the second backbone port of the second backbone node are in a forwarding state. In a possible implementation, the first link may alternatively be a link on which the second backbone port of the second backbone node is located, so that the port that sends the notification packet may alternatively be the first backbone port of the second backbone node. This is not limited in this application.

[0114] In a possible implementation, the notification packets are bridge protocol data unit (BPDU) packets.

[0115] In this application, the BPDU packet in the existing STP / RSTP protocol may be used, and the trigger condition of the BPDU packet is modified to realize fast network reconstruction, achieve better compatibility with the existing protocol, and reduce excessive configuration operations. Therefore, the BPDU packet is simple and easy to implement.

[0116] Optionally, the notification packet may alternatively be an Internet group management protocol (IGMP) broadcast packet, i.e., the link failure information is sent in a broadcast manner. Alternatively, the notification packet may be a directed multicast packet. All backbone nodes form a multicast group, and notification is performed by sending multicast packets. Alternatively, the notification packet may be a media access control (MAC) multicast packet. The link failure information is notified by using a MAC layer multicast packet. Optionally, the notification packet may alternatively be a directional unicast packet, which is sent directionally by the backbone nodes.

[0117] It should be understood that in this application, the notification packet may be generated by the backbone node before the backbone node detects the link failure, i.e., the link failure information is only used as a trigger source for the backbone node to send the notification packet. Alternatively, the backbone node may generate the notification packet after detecting the link failure, and then send the notification packet. This is not limited in this application.

[0118] It should be understood that the above specific types of notification packets are merely examples for explanation purposes, and the format and name of the notification packet are not limited in this application, provided that the same functions as those in this application are realized, that is, the notification packet may be sent when a link fails, and the notification packet may enable a port in a ring network that is originally in a blocked state to switch to a forwarding state, all of which are within the scope of protection of this application.

[0119] Optionally, if the second link fails, the method further includes: S230-b: The first backbone node switches a first backbone port of the first backbone node into a blocking state.

[0120] When the first backbone node determines that the second link has failed, the first backbone node switches the first backbone port of the first backbone node to a blocked state. In this way, when the second link is restored to normal, one port in the ring network remains in a blocked state. This avoids network storms and ensures communication security.

[0121] Optionally, the first backbone node performs S230-b before S220, i.e., the first backbone node first switches the first backbone port of the first backbone node to a blocking state before switching the second backbone port of the first backbone node to a forwarding state.

[0122] It should be understood that the first backbone port of the first backbone node may be a master port or a slave port. Correspondingly, the second backbone node of the first backbone node may be a slave port or a master port. That is, in the initial state, a blocked port in the ring network may be a master port or a slave port. This is not limited in this application.

[0123] It should be further understood that in this application, the physical hardware of the master port and the physical hardware of the slave port are the same, but the port configurations are different, for example, different identifiers may be configured for the two ports to distinguish between the master port and the slave port.

[0124] In a possible implementation, the fourth link may be a link on which a second backbone port of the first backbone node is located, and the second backbone port of the first backbone node is directly connected to the first backbone port of the second backbone node. That is, the fourth link and the first link may be the same link. When the first link (the fourth link) fails, the first backbone node may detect that the link on which the second backbone port of the first backbone node is located has failed. Furthermore, the second backbone node may further send a notification packet through the second backbone port of the second backbone node, thereby allowing the first backbone node to receive the notification packet through the first backbone port of the first backbone node. When the first backbone node detects that the link on which the second backbone port of the first backbone node is located has failed or when it receives the notification packet, it may switch the second backbone port of the first backbone node to a forwarding state. Optionally, the first backbone node may further determine the second backbone port of the first backbone node as a master port (or a slave port), and further switch the second backbone port of the first backbone node to a blocked state again. Alternatively, the second backbone node may determine the first backbone port of the second backbone node as a master port (or a slave port), and further switch the first backbone port of the second backbone node to a blocked state.

[0125] Optionally, when detecting that the fourth link has failed, the first backbone node determines that a standby link in the ring network has failed, and therefore may not switch the port state even if a notification packet is received.

[0126] In a possible implementation, how the second backbone node determines that the first link has failed includes: The second backbone node determines that the first link has failed through differential signal diagnosis.

[0127] Differential signal diagnostics is a link diagnostic technique at the Ethernet physical layer. Specifically, a node may detect the voltage difference and carrier waveform transmitted on the twisted pair connected to the node's port. When the transmitted voltage difference and / or carrier waveform are abnormal, a link fault may be determined.

[0128] Therefore, in this application, link failures are detected through differential signal diagnosis, which allows link failures to be found quickly.Furthermore, the response time for switching between active and standby links is shortened, and fast network reconstruction is realized, ensuring the requirements of in-vehicle applications.

[0129] Optionally, in this application, how the second backbone node determines that the first link has failed may alternatively be as follows: The second backbone node determines that the first link has failed by using a connectivity check packet.

[0130] Specifically, the second backbone node may periodically send a connectivity check packet on the first backbone port of the second backbone node, and the second backbone node determines whether a response packet of another connected port in the first link is received within a valid time to determine whether the first link is normal.

[0131] It should be understood that the above fault diagnosis and detection methods are merely examples and do not constitute limitations on this application. Those skilled in the art may also detect link failures in other ways. For example, a link up state is detected through a link heartbeat.

[0132] Similarly, how the first backbone node determines that the second link has failed includes: the first backbone node determines that the second link has failed through differential signal diagnosis; alternatively, the first backbone node determines that the second link has failed by using a connectivity check packet; alternatively, other methods may be used.

[0133] In a possible implementation, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node within the network.

[0134] In this application, a first identifier is configured for a backbone node in a ring network, such that the backbone node having the first identifier sends a notification packet based on the link state or switches a blocked port to a forwarding state upon receiving the notification packet. Alternatively, upon receiving the notification packet, the backbone node continues to forward the notification packet within the ring network to realize switching between active and standby links and network reconstruction. A node that does not have the first identifier does not belong to a backbone node in the ring network and does not send or identify a notification packet. In other words, backbone nodes within the network may be distinguished by using the first identifier.

[0135] The above scheme is merely an illustrative example. Alternatively, backbone nodes may be identified by using other nodes in the network to distinguish between backbone and non-backbone nodes. This is not a limitation of this application.

[0136] Optionally, the method 200 further includes S240: the first backbone node detects the first identifier, and the first backbone node determines, based on the first identifier, that the first backbone node is a backbone node in the network.

[0137] Similarly, the method 200 further includes S250: the second backbone node detects the first identifier, and the second backbone node determines, based on the first identifier, that the second backbone node is a backbone node in the network.

[0138] In a possible implementation, the first identifier may be a value written to a register and is used to identify the backbone node. The backbone node is determined by powering on the node and reading the value in the register. Furthermore, a switching logic of the backbone node is executed. For example, if a link on which a backbone port in a forwarding state is located fails, the notification packet is sent through another backbone port in a forwarding state. Alternatively, if a port of the backbone node is in a blocking state, the backbone node may switch the blocked port to a forwarding state when it receives the notification packet. Alternatively, if two backbone ports of the backbone node are in a forwarding state and the backbone node receives the notification packet, the backbone node continues to forward the notification packet within the ring network.

[0139] The following describes the configuration process and power-on detection process of the backbone node.

[0140] Step 1: Configure a network access device as a backbone node, for example, by using a first identifier to identify the backbone node, and configure two backbone ports of the backbone node.

[0141] Step 2: Configure port familiarity for all backbone ports of all backbone nodes, identify the state of the backbone ports, and specify that one port of all backbone nodes is in the blocking state and all other ports are in the forwarding state. Configure execution logic for each backbone node.

[0142] Step 3: Configure the power-on networking time jitter difference register to configure the power-on startup time jitter difference to eliminate network switching flapping caused by the power-on jitter difference.

[0143] Step 4: Power on the backbone node to enable the working state and execution logic of the backbone node, which is the network establishment method 200 described above.

[0144] Step 5: If the running logic includes a switching limit for the backbone node, when any port of the backbone node reaches the switching limit, the port stops switching states, keeps its current last configured state, and sends a network link exception notification and limit-exceeded port switching information. After reboot or software clear, the status alarm is cleared and the function is restored.

[0145] The above method 200 will now be described by using an example with reference to Figure 3. Figure 3 is a schematic block diagram of an Ethernet system 300 according to an embodiment of the present application.

[0146] As shown in FIG. 3 , Ethernet system 300 includes four backbone nodes, namely, node 310, node 320, node 330, and node 340, i.e., M=4. Node 310, node 320, node 330, and node 340 each include two backbone ports P1 and P2. Ports P1 and P2 are connected in pairs to form a ring network. For ease of explanation, the link connecting port P2 of node 310 to port P1 of node 340 is referred to as link L1. L1 may also be referred to as the link on which port P2 of node 310 is located or the link on which port P1 of node 340 is located. Similarly, L4 is the link on which port P2 of node 320 is located or the link on which port P1 of node 310 is located. L2 is the link on which port P2 of node 330 is located or the link on which port P1 of node 320 is located. L3 is the link on which port P2 of node 340 is located or the link on which port P1 of node 330 is located. Port P1 (one side of the first backbone port) of node 310 (first backbone node) is in a forwarding state. Port P2 (one side of the second backbone port) of node 310 is in a blocking state. Ports P1 and P2 of any node other than node 310, i.e., node 320, node 330, and node 340, are in a forwarding state. This can avoid a Layer 2 loop. In this case, L1 is a standby link, and L2, L3, and L4 form active links.

[0147] It should be understood that because port P2 of node 310 is in a blocked state, packets at layer 2 and higher layers cannot be forwarded as they pass through the port, but the L1 link is normal. Specifically, packets at layer 2 and higher layers sent by node 340 through port P1 may be transmitted to port P2 of node 310 over link L1, but are not forwarded when they arrive at port P2 of node 310.

[0148] When link L2 (one side of the first link) fails at some point, node 320 (one side of the second backbone node) may detect that the link on which port P1 (one side of the second backbone port) of node 320 is located has failed. The failure information is used as a trigger source. Node 320 sends a BPDU packet (one side of a notification packet) through port P2 of node 320. The BPDU packet passes through link L4. Node 310 receives the BPDU packet through port P1 of node 310. Upon receiving the BPDU packet, node 310 learns that a link has failed in the ring network. Therefore, node 310 immediately switches port P2 of node 310 to a forwarding state, thereby enabling the standby link L1.

[0149] When link L2 fails, node 330 also detects that the link on which port P2 of node 330 (one side of the second backbone port) is located has failed. The failure information is used as a trigger source. Node 330 also transmits a BPDU packet, and node 330 transmits the BPDU packet through port P1 of node 330. The BPDU packet passes through link L3. Node 340 receives the BPDU packet through port P2 of node 340. Node 340 determines that port P1 of node 340 is in the forwarding state, and therefore forwards the BPDU packet through port P1 of node 340. However, because port P2 of node 310 is in the blocked state, node 310 cannot receive the BPDU packet through port P2 of node 310.

[0150] From the above, it can be seen that when link L2 fails, node 310, triggered by the notification packet, learns that a link has failed in the ring network, and therefore immediately switches port P2 of node 310 to a forwarding state, thereby enabling standby link L1. Furthermore, the new linear link formed by links L4, L1, and L3 may still be used for normal communication between node 310, node 320, node 330, and node 340. Compared with methods such as a new round of node selection in the prior art, this application can shorten the response time for switching between the active link and the standby link, realize fast network reconstruction, and meet the requirements of in-vehicle applications.

[0151] Optionally, node 330 further switches port P2 of node 330 to a blocked state, or node 320 further switches port P1 of node 320 to a blocked state.

[0152] Optionally, the method further includes successfully restoring L2 and restoring the physical connection between node 320 and node 330 by using L2. One of port P1 of node 320 and port P2 of node 330 is in a blocked state and cannot forward data. In this case, the ring network is restored to an initial state, and L2 becomes a new standby link in the ring network.

[0153] Optionally, before node 330 transmits the BPDU packet, node 330 switches port P2 of node 330 to a blocked state. Alternatively, before node 320 transmits the BPDU packet, node 320 switches port P1 of node 320 to a blocked state.

[0154] In a possible implementation, all ports P1 in Figure 3 are set as master ports, and all ports P2 are set as slave ports. When port switching is performed, the connected master port in the failed link may be switched to a blocked state by default. Specifically, port P1 of node 320 is set to a blocked state, and port P2 of node 330 remains in a forwarding state.

[0155] Optionally, when port switching is performed, the connected slave ports in the failed link may be switched to a blocked state by default. Specifically, port P2 of node 330 is set to a blocked state, and the state of port P1 of node 320 remains unchanged and is still in a forwarding state.

[0156] Optionally, when link L2 fails, this may alternatively be due to a failure of node 330 (e.g., a power failure). As a result, links L2 and L3 fail simultaneously. In this case, node 340 detects that the link on which port P2 of node 340 is located has failed, and therefore transmits a BPDU packet through port P1 of node 340. Node 320 detects that the link on which port P1 of node 320 is located has failed, and therefore transmits a BPDU packet through port P2 of node 320. For the execution logic of node 340, refer to node 330 above. The execution logic of node 320 is similar to that of node 320 above. Details will not be described again here.

[0157] Optionally, in the ring network shown in FIG. 3, if link L4 (one side of the second link) fails, node 310 may determine that the link on which port P1 of node 310 is located has failed, and node 310 switches port P2 of node 310 to a forwarding state based on the link failure information, thereby enabling standby link L1.

[0158] Optionally, if link L4 fails, node 310 may further switch port P1 of node 310 to a blocked state.

[0159] For example, in the ring network shown in FIG. 3 , if link L1 (one side of the fourth link) fails, node 310 detects that the link on which port P2 of node 310 is located has failed, and node 340 (one side of the second backbone node) also detects that the link on which port P1 of node 340 is located has failed. Therefore, a BPDU packet is transmitted through port P2 of node 340. BPDU packets are used to notify link failures in a ring network. BPDU packets are forwarded by nodes 330 and 320, and node 310 receives the BPDU packet through node P1 of node 310. Optionally, when node 310 detects that the link on which port P2 of node 310 is located has failed or receives a BPDU packet, node 310 may learn that a link has failed in the ring network and switch port P2 of node 310 to a forwarding state.

[0160] Optionally, in FIG. 3 , all ports P1 are configured as master ports, and all ports P2 are configured as slave ports. When port switching is performed, the master port connected to the failed link may be switched to a blocked state by default. Specifically, when L1 fails, node 340 may switch port P1 of node 340 to a blocked state, and the state of port P2 of node 310 remains unchanged and is still in a forwarding state. Alternatively, when port switching is performed, the slave port connected to the failed link may be switched to a blocked state by default. Specifically, when L1 fails, node 310 may switch port P2 of node 310 to a blocked state, and the state of port P1 of node 340 remains unchanged and is still in a forwarding state. In other words, after state switching, two cases may exist. 1. Port P2 of node 310 is in the forwarding state and port P1 of node 340 is in the blocking state, or 2. Port P2 of node 310 is still in the blocking state, and port P1 of node 340 is still in the forwarding state.

[0161] Optionally, if link L1 fails, node 310 may determine that the link on which port P2 of node 310 is located has failed and that port P2 of node 310 is in a blocked state. That is, node 310 may determine that a standby link in the ring network has failed. Therefore, no state switching may be performed when a BPDU packet is received.

[0162] 3, each of node 310, node 320, node 330, and node 340 includes an identifier a. To perform method 200 above, the backbone node is determined by powering up the node and reading the value a in the register.

[0163] 3, the method for determining link failure by node 310, node 320, node 330, and node 340 is described above, and the details will not be described again here.

[0164] It should be understood that in Figure 3, an example in which only four backbone nodes are connected to form a ring network is used for illustration purposes. The number of backbone nodes forming the ring network may alternatively be 3, 5, 128, etc. This is not limited in this application.

[0165] 4 is a schematic flowchart of a network establishment method 400 according to an embodiment of this application. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node. The network further includes an end node. The end node includes a first end port and a second end port. The first end port is in a forwarding state. The second end port is in a blocking state. At least two of the M backbone nodes each further include a third terminal port, and the first terminal port and the second terminal port are connected to the third terminal ports of the at least two backbone nodes.

[0166] In this application, the ring network may further access one or more terminal nodes. The terminal node is connected to two backbone nodes in the ring network by using a first terminal port and a second terminal port of the terminal node. The first terminal port of the terminal node may be set to a forwarding state, and the second terminal port may be set to a blocking state. That is, the link where the first terminal port is located is an active link, and the link where the second terminal port is located is a secondary link, thereby realizing redundant access of the terminal node. As shown in FIG. 4, the method 400 includes the following steps:

[0167] S410: The end node determines that the third link has failed, where the third link is the link on which the first end port is located.

[0168] In this application, a failed third link includes, but is not limited to, the following possibilities: a link failure caused by a loose first terminal port of the terminal node, a link failure caused by a power failure in the backbone node of another connected port in the third link, or a link failure caused by a short circuit, open circuit, or disconnection of the communication cable on the third link.

[0169] S420: The terminal node switches the second terminal port to a forwarding state.

[0170] In other words, when the terminal node determines that the third link has failed, the terminal node may switch the second terminal port from a blocking state to a forwarding state to activate the standby link where the blocked port is located, thereby ensuring communication security.

[0171] In this application, a terminal node may acquire link failure information of the terminal node's active link and standby link. The link failure information is used as an event trigger source. When the terminal node acquires the information, the terminal node switches a blocked port to a forwarding state and enables the standby link where the originally blocked port is located. Compared with the prior art, in this application, devices other than the terminal node do not need to be involved in control and processing, and fast switching between the active link and the standby link is completed under the configuration logic within the terminal node. Therefore, the response time for switching between the active link and the standby link can be shortened, fast network reconstruction can be realized, and the requirements of in-vehicle applications can be met.

[0172] Optionally, before the end node switches the second end port to a forwarding state, the method 400 further includes: S430: The end node switches the first end port to a blocking state.

[0173] In other words, the terminal node may switch the second terminal port connected in the first link to a blocked state, so that the first link becomes a standby link and the link where the first terminal port is located becomes an active link. In this way, after the third link is successfully restored, accessing the terminal node does not result in a new ring network topology and a complex network with multiple nested rings. This ensures the reliability of the communication system.

[0174] Furthermore, after the third link is successfully restored, there are still two links through which the terminal node accesses the ring network, one active link and one standby link. In this way, both links of the terminal node may be prevented from communicating with the ring network. This solves the problem that a complex network topology may be constructed due to redundant access of terminal nodes, and improves the reliability of redundant access of important terminal nodes.

[0175] In a possible implementation manner, in S410, how the end node determines that the third link has failed includes: The end node determines that the third link has failed through differential signal diagnosis.

[0176] For a specific description of differential signal diagnosis, please refer to the method 200 above, and the details will not be described again here.

[0177] In this application, link failures are detected through differential signal diagnosis, which allows link failures to be found quickly. Furthermore, the response time for switching between active and standby links is shortened, realizing fast network reconstruction and ensuring the requirements of in-vehicle applications.

[0178] In other words, in this application, the switching between the active link and the standby link can be realized at the physical layer, thereby making it more efficient.

[0179] Optionally, in this application, in S410, how the terminal node determines that the third link has failed may alternatively be as follows: The terminal node determines that the first link has failed by using a connection check packet.

[0180] It should be understood that the above fault diagnosis and detection methods are merely examples and do not constitute limitations on this application. Those skilled in the art may also detect link failures in other ways. For example, a link up state is detected through a link heartbeat.

[0181] In this application, it should be understood that a link failure includes, but is not limited to, the following possibilities: a link failure caused by a loose port, a link failure caused by a power failure in a backbone node, or a link failure caused by shorts and open circuits in the communication cables on the link.

[0182] Optionally, in the method 400, the end node includes a second identifier, which is used to identify the end node within the Ethernet system.

[0183] In this application, the second identifier is configured for the terminal node in the Ethernet system, so that the terminal node having the second identifier does not identify or forward notification packets in the Ethernet system, and also does not switch the state of a port under the influence of the notification packets, i.e., the terminal node having the second identifier only monitors the state of the active link and standby link of the terminal node, and does not participate in the switching logic of the backbone network.

[0184] The above scheme is merely an illustrative example. Alternatively, end nodes may be identified by using other nodes in the Ethernet system to distinguish between end nodes and non-end nodes.

[0185] Optionally, the method 400 further includes: S440: The terminal node detects a second identifier. The terminal node determines, based on the second identifier, that the terminal node is a terminal node in the network.

[0186] In a possible implementation, the second identifier may be a value written in a register and used to identify the terminal node. The terminal node is determined by powering on the terminal node and reading the value in the register. Furthermore, a switching logic of the terminal node is executed. Specifically, if the link on which the terminal port is located fails, the standby link is enabled to complete the switching between the active link and the standby link. This ensures communication security.

[0187] It should be understood that in this application, when the terminal node determines that the link on which the second terminal port is located has failed, the terminal node does not need to perform any action. When the link on which the second terminal port is located is successfully restored, the second terminal port is still in a blocked state, and the link on which the second terminal port is located is still a standby link.

[0188] Therefore, in this application, a first identifier and a second identifier are used, so that the switching logic of the terminal node and the switching logic of the backbone node are independent of each other and do not interfere with each other, which helps to improve the reliability and simplicity of the Ethernet system.

[0189] The following describes the end node configuration process and power-on detection process.

[0190] Step 1: Configure a network access device as an end node, for example, by using a second identifier to identify the end node, and configure two end ports of the end node.

[0191] Step 2: Set one of the two terminal ports of the terminal node to a blocking state and the other to a forwarding state, configure the execution logic of the terminal node, and connect the terminal node to the backbone node of the ring network.

[0192] Step 3: Configure the power-on networking time jitter difference register to configure the power-on startup time jitter difference to eliminate network switching flapping caused by the power-on jitter difference.

[0193] Step 4: Power on the terminal node to enable the working state and execution logic of the terminal node, which is the network establishment method 400 described above.

[0194] Step 5: If the execution logic includes a switching limit for the terminal node, when the terminal node meets the set limit, the terminal node will be disabled, or re-enabled until the signal quality of the active link and the standby link is restored, or enabled after the next reboot and power-on, or the management device sets the subsequent action. If no switching limit is set, the terminal device will perform free diagnosis and switching based on the link signal quality and setting.

[0195] The above method 400 will now be described by using an example with reference to Figure 5. Figure 5 is a schematic block diagram of an Ethernet system 500 according to an embodiment of the present application.

[0196] As shown in FIG. 5, Ethernet system 500 includes four backbone nodes, namely, node 310, node 320, node 330, and node 340, i.e., M=4. Node 310, node 320, node 330, and node 340 each include two backbone ports, P1 and P2. Port P1 and port P2 are connected in pairs to form a ring network. Ethernet system 500 further includes an end node, namely, node 510. Node 510 includes port P1 (one side of a first end port) and port P2 (one side of a second end port). Port P1 of node 510 is in a forwarding state. Port P2 of node 510 is in a blocking state. Node 310 and node 330 each further include port P3 (one side of a third end port). Port P3 of node 310 is connected to port P1 of node 510 to form link L5. Port P3 of node 330 is connected to port P2 of node 510 to form link L6.

[0197] 5, node 510 accesses the ring network through port P3 of node 310 (one side of the third terminal port) and port P3 of node 330 (one side of at least two backbone nodes) to achieve redundant access. If any terminal port of node 510, for example, port P2, is set to a blocked state, link L6 can only transmit physical layer signals but cannot transmit data. Therefore, L6 is a standby link. Furthermore, port P1 of node 510 is in a forwarding state, i.e., link L5 is an active link. Node 510 may communicate with the ring network through L5.

[0198] When L5 (one side of the third link) fails, node 510 detects that the link on which port P2 of node 510 is located has failed. The failure information is used as an event trigger source, allowing node 510 to switch port P2 of node 510 to a forwarding state, i.e., the standby link is enabled, so that node 510 communicates with the ring network through L6. Therefore, in this application, the response time for switching between the active link and the standby link can be shortened, fast network reconstruction can be achieved, and the requirements of in-vehicle applications can be met.

[0199] Optionally, L5 may further switch port P1 of L5 to a blocked state to prevent both links of the end node from communicating with the ring network, which solves the problem that a complex network topology may be constructed due to redundant access of the end node, and improves the reliability of redundant access of important end nodes.

[0200] For example, the L5 failure may be a failure of node 310 or a failure caused by a faulty port P3 of node 310, or a failure caused by a faulty cable of L5.

[0201] Optionally, node 510 determines through differential signal diagnostics that L5 has failed.

[0202] Optionally, node 510 includes identifier b. After powering on, node 510 determines that node 510 is a backbone node by reading the value b of the register, and performs method 400 above.

[0203] Optionally, method 400 further includes restoring L5 and restoring the physical connection between node 510 and node 310 by using L5. Port P1 of node 510 is in a blocked state and cannot forward data. In this case, L5 becomes a new standby link of node 510.

[0204] It should be understood that in FIG. 5, an example in which only four backbone nodes are connected to form a ring network is used for explanation. The number of backbone nodes forming the ring network may alternatively be 3, 5, 128, etc. This is not limited in this application. Furthermore, in FIG. 5, the backbone nodes connected to node 510 may be any two of node 310, node 320, node 330, and node 340. Furthermore, two or more terminal nodes may be accessed in the ring network, and the backbone nodes connected to the multiple terminal nodes may be the same or different. This is not limited in this application.

[0205] In a possible implementation, the method 200 and the method 400 may be combined to form another network establishment method. For example, a network includes M backbone nodes and at least one end node. The procedure in the method 200 is used to switch between an active link and a standby link of the backbone network. The procedure in the method 400 is used to switch between an active link and a standby link of the end node. For specific procedures, please refer to the descriptions of the methods 200 and 400. The details will not be described again here.

[0206] Above, the network establishment method in this application has been described with reference to Figures 1 to 5. Hereinafter, the apparatus in the embodiment of this application will be described with reference to Figures 6 to 8. It should be understood that the apparatuses shown in Figures 6 to 8 may realize the steps in the above method. For the sake of brevity, the details will not be described again here.

[0207] 6 is a schematic diagram of the structure of a network establishment device according to an embodiment of this application. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node.

[0208] 6, the apparatus 600 may include a transceiver unit 610 and a processing unit 620. Optionally, the apparatus is a first backbone node. The transceiver unit 610 is configured to obtain link failure information of the ring network. The processing unit 620 is configured to switch a second backbone port of the first backbone node to a forwarding state based on the link failure information.

[0209] Optionally, the transceiver unit 610 is specifically configured to receive a notification packet through a first backbone port of a first backbone node. The notification packet is used to indicate that a first link has failed. The first link is a link on which a first backbone port of a second backbone node is located.

[0210] Optionally, the notification packet is a Bridge Protocol Data Unit BPDU packet.

[0211] Optionally, the processing unit 620 is further configured to determine that a second link has failed, the second link being the link on which a first backbone port of the first backbone node is located.

[0212] Optionally, the processing unit 620 is further configured to switch a first backbone port of the first backbone node to a blocked state.

[0213] Optionally, the processing unit 620 is specifically configured to determine that the second link has failed through differential signal diagnostics.

[0214] Optionally, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node in the network.

[0215] Optionally, the processing unit 620 is further configured to detect the first identifier and determine, based on the first identifier, that the processing unit 620 is a backbone node in the network.

[0216] 7 is a schematic diagram of the structure of a network establishment device according to an embodiment of this application. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node.

[0217] As shown in FIG. 7 , the apparatus 700 includes a transceiver unit 710 and a processing unit 720. Optionally, the apparatus is a second backbone node. The processing unit 720 is configured to determine that a first link has failed. The first link is a link where a first backbone port of a second backbone node is located. The transceiver unit 710 is configured to send a notification packet through the second backbone port of the second backbone node. The notification packet is used to indicate that the first link has failed.

[0218] Optionally, the processing unit 720 is further configured to switch the first backbone port of the second backbone node to a blocked state.

[0219] Optionally, the first backbone port of the second backbone node is a master port, and the second backbone port of the second backbone node is a slave port.

[0220] Optionally, the processing unit 720 is specifically configured to determine that the first link has failed through differential signal diagnostics.

[0221] Optionally, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node in the network.

[0222] Optionally, the processing unit 720 is further configured to detect the first identifier and determine, based on the first identifier, that the processing unit 720 is a backbone node in the network.

[0223] Optionally, the notification packet is a Bridge Protocol Data Unit BPDU packet.

[0224] 8 is a schematic diagram of the structure of a network establishment device according to an embodiment of this application. The network includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The network further includes terminal nodes. The terminal node includes a first terminal port and a second terminal port. The first terminal port is in a forwarding state. The second terminal port is in a blocking state. At least two of the M backbone nodes further include a third terminal port. The first terminal port and the second terminal port are connected to third terminal ports of at least two backbone nodes.

[0225] 8, the apparatus 800 includes a processing unit 810. Optionally, the apparatus is an end node. The processing unit 819 is configured to determine that a third link has failed. The third link is the link on which the first end port is located. The processing unit 810 is further configured to switch the second end port to a forwarding state.

[0226] Optionally, the processing unit 810 is further configured to switch the first terminal port to a blocking state.

[0227] Optionally, the processing unit 810 is specifically configured to determine that the third link has failed through differential signal diagnostics.

[0228] Optionally, the terminal node includes a second identifier, which is used to identify the terminal node within the network.

[0229] Optionally, the processing unit 810 is further configured to detect a second identifier and determine, based on the second identifier, that the processing unit 810 is a terminal node in the network.

[0230] Optionally, the apparatus 800 may further include a transceiver unit 820 configured to transmit and receive data.

[0231] 9 is a structural schematic diagram of a network establishment device 900 according to an embodiment of this application. The device 900 includes at least one memory 910 and at least one processor 920. The at least one memory 910 is configured to store a program, and the at least one processor 920 is configured to execute the program to implement the technical solution of this application.

[0232] It should be understood that the processor in the embodiments of this application may be a central processing unit (CPU). Furthermore, the processor may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, etc.

[0233] It may be understood that the memory in the embodiments of this application may be volatile memory or nonvolatile memory, or may include volatile memory and nonvolatile memory. Nonvolatile memory may be read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Volatile memory may be random access memory (RAM) used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM), and direct rambus dynamic random access memory (DR RAM).

[0234] Optionally, the apparatus 900 may further include a transceiver 930 configured to perform data reception and transmission functions.

[0235] Specifically, the apparatus 900 may correspond to the first backbone node in the methods 200 and 400 according to the embodiments of this application. The apparatus 900 may include units for the method performed by the first backbone node in the methods 200 or 400. Alternatively, the apparatus 900 may correspond to the second backbone node in the methods 200 or 400 according to the embodiments of this application. The apparatus 900 may include units for the method performed by the second backbone node in the methods 200 and 400. Alternatively, the apparatus 900 may correspond to the terminal node in the method 400 according to the embodiments of this application. The apparatus 900 may include units for the method performed by the terminal node in the method 400. It should be understood that the specific processes by which the units perform the above corresponding steps have been described in detail in the above method embodiments. For the sake of brevity, the details will not be described here.

[0236] 10 is a schematic diagram of the execution logic of a backbone node according to an embodiment of this application. As shown in FIG. 10, the switching logic includes the following steps:

[0237] S1001: Load the configuration.

[0238] Specifically, after the current node is powered on and enabled, the configuration information of the current node is loaded. As described above, the node is configured as a backbone node, and the port states are configured for the backbone node.

[0239] S1002: Wait for networking.

[0240] Specifically, this may provide a countdown to wait during network startup to prevent errors or false failure reports due to unexpected network switching caused by inconsistent startup times of nodes or devices.

[0241] S1003: Determine whether the networking waiting time is met.

[0242] Specifically, if the networking waiting time is not met or if the networking countdown is not 0, the waiting for networking continues. If the networking waiting time is met, i.e., if the countdown is 0, status monitoring begins.

[0243] S1004: Condition monitoring.

[0244] Specifically, the backbone node may monitor the status of the ports of the backbone node, the status of the links connected by the backbone node, and notification packets.

[0245] S1005: Determine whether the switching condition is met.

[0246] Specifically, whether the switching condition is met is determined based on the status of the ports of the backbone node and the status of the links connected by the backbone node. If the switching condition is not met, status monitoring continues. If the switching condition is met, a restriction check is initiated. The switching condition may be the receipt of a notification packet or a failure state of a link connected by the backbone node.

[0247] S1006: Determine whether the reset condition is met.

[0248] Specifically, in one example, the reset condition may be to clear the accumulated switching count after stable communication for a preset duration. When the reset condition is met, S1001 is executed again.

[0249] S1007: Determine whether the number of switching times exceeds a limit.

[0250] Specifically, a switching count may be set to avoid frequent switching, and when the switching count exceeds the limit, the backbone node may send an error alarm.

[0251] The reset condition and the number of switches may each be considered as a type of limit check. The limit check is used for security purposes to prevent network problems caused by frequent switches. In addition, the network is monitored. A network exception may directly trigger a reset of the node's network state to correct a serious error.

[0252] S1008: Transmit an error alarm.

[0253] Specifically, when the number of switching times exceeds a limit or the node has an internal error, the alarm is mainly used to notify an administrator or an external device of the situation that the node has failed.

[0254] S1009: Check for blocked ports.

[0255] Specifically, it mainly checks whether the blocked port is normal, whether the enabling condition is met, etc. If the enabling condition is not met, an error alarm is generated and the port status is monitored for exception handling.

[0256] S1010: Switch the blocked port to a forwarding state.

[0257] Specifically, the following port switching operations are performed: Allow blocked ports to enter forwarding state and update forwarding entries.

[0258] S1011: Reset command.

[0259] The reset command is an externally input command. It is used to perform detailed state management on the current node during network management and to restart the node network at any time. The restart takes effect after the new configuration policy is loaded.

[0260] It should be understood that the execution logic shown in Figure 10 is merely an example, and in this embodiment of this application, the execution logic of the backbone node is not necessarily limited to the procedure shown in Figure 10.

[0261] The methods 200 and 400 according to the embodiments of this application will be described below with reference to FIGS.

[0262] FIG. 11 is a schematic diagram of a network architecture 1100 according to an embodiment of this application. As shown in FIG. 11, in the network architecture 1100, LSW1, LSW2, LSW3, and LSW4 are backbone nodes, and LSW5 and LSW6 are terminal nodes. Ports P0 of LSW1, LSW2, LSW3, LSW4, and LSW5 are connected to the MCU, and port P0 of LSW6 is connected to the MPU. For the backbone nodes in FIG. 11, all ports P1 are set as master ports, and all ports P2 are set as slave ports. In the network architecture 1100, port P2 of LSW1 is in a blocking state, port P2 of LSW5 is in a blocking state, and port P1 of LSW6 is in a blocking state, and the other ports are in a forwarding state.

[0263] FIG. 12 is a schematic diagram of port state switching when a link fails according to an embodiment of this application.

[0264] Assume that link L3 in the network architecture 1100 fails. Port P1 of LSW2 and port P2 of LSW3 trigger a link down state in the port status register. Because port P1 on LSW2 is the master port, LSW2 switches port P1 to a blocked state. Furthermore, the link down state is used as an event trigger source. LSW2 and LSW3 separately transmit BPDU packets. LSW3 transmits a BPDU packet to LSW4 through port P1, and the BPDU packet is forwarded by LSW4 to port P2 of LSW1. However, port P2 on LSW1 is initially blocked and cannot receive the BPDU packet from port P2 on LSW4. LSW2 transmits a BPDU packet to LSW1 through port P2 of LSW2. After LSW1 receives the BPDU packet from port P1 of LSW1, LSW1 switches port P2, which was originally set to a blocked state, to a forwarding state. The finally formed network architecture is shown in FIG. 12. The network architecture 1200 shown in FIG. 12 is still capable of carrying out normal communications.

[0265] FIG. 13 is a schematic diagram of port state switching when a backbone node fails according to an embodiment of this application.

[0266] Assume that backbone node LSW3 in network architecture 1100 is powered off and out of networking, and an event triggers the downing of links L2 and L3. The link down information of port P2 of LSW4 triggers LSW4 to send a BPDU packet to LSW1 through port P1 of LSW4. However, port P2 of LSW1 is initially blocked and cannot receive BPDU packets from port P2 of LSW4. Because port P1 on LSW2 is the master port, LSW2 switches port P1 to the blocked state. Furthermore, the link down information of port P1 of LSW2 triggers LSW2 to send a BPDU packet to LSW1 through port P2 of LSW2. After LSW1 receives the BPDU packet from port P1 of LSW1, LSW1 switches port P2, which was originally set to the blocked state, to the forwarding state.

[0267] Furthermore, LSW5 and LSW6 are connected to LSW3. When LSW3 is powered off, the active and standby links of LSW5 and LSW6 are switched. Specifically, a power failure of LSW3 brings down L6. Because port P2 of LSW5 is in a blocked state, communication of LSW5 remains unchanged. However, the active link of LSW6, i.e., L7, is connected to LSW3. A power failure of LSW3 triggers the downing of L7. In this case, LSW6 performs a switchover between the active link and the standby link, i.e., LSW6 switches port P1 from a blocked state to a forwarding state and blocks port P2.

[0268] The final network architecture is shown in Figure 13. The network architecture 1300 shown in Figure 13 is still capable of carrying out normal communications.

[0269] FIG. 14 is a schematic diagram of the transmission path of a BPDU packet when a link fails according to an embodiment of this application.

[0270] Assume that link L3 in the network architecture 1100 fails. Port P2 of LSW2 and port P1 of LSW3 trigger a link down state in the port status register. The link down state is used as an event trigger source. LSW2 and LSW3 send BPDU packets separately. Figure 14 shows the process of sending BPDU packets.

[0271] FIG. 15 is a schematic diagram of the transmission path of a BPDU packet on a backbone node according to an embodiment of the present invention.

[0272] Assume that LSW3 in the network architecture 1100 is powered off and leaves the network. Port P2 of LSW2 and port P1 of LSW4 trigger a link down state in the port status register. The link down state is used as an event trigger source. LSW2 and LSW4 send BPDU packets separately. Figure 15 shows the process of sending BPDU packets.

[0273] FIG. 16 is a schematic diagram of port state switching when a link of an end node fails according to an embodiment of this application.

[0274] Assume that L5 in the network architecture 1100 fails. The link down state of the LSW5 port status register triggers the link switching logic of LSW5. Specifically, when port P2 of LSW5 satisfies the link up state, LSW5 enables port P2 of LSW5 and sets port P2 to a forward state, thereby enabling port P2 to handle data exchange for LSW5. Furthermore, LSW5 changes port P1 of LSW5 to a block state. When the link is restored, the link is enabled. However, when port P1 is in the block state, port P1 does not forward data packets to the network to prevent data loops on the network. The finally formed network architecture is shown in FIG. 16. The network architecture 1600 shown in FIG. 16 can still perform normal communication.

[0275] An embodiment of this application further provides a computer-readable storage medium, which includes program instructions, and when the program instructions are executed directly or indirectly, the technical solution of this application is implemented.

[0276] An embodiment of this application further provides a computer program product including instructions, which, when executed on a computing device, enables the computing device to execute the technical solutions in this application or enable the computing device to realize the functions of the above-mentioned controller.

[0277] An embodiment of the present application further provides a chip including at least one processor and an interface circuit, the interface circuit being configured to provide program instructions or data to the at least one processor, and the at least one processor being configured to execute the program instructions to realize the technical solution of the present application.

[0278] It should be understood that when the devices 600, 700, 800 and 900 are chips or chip systems, respectively, the transceiver or transceiver unit of the device may be an input / output interface, the receiver or receiving unit may be understood as an input interface, and the transmitter or transmitting unit may be understood as an output interface.

[0279] An Ethernet system according to an embodiment of this application will be described below.

[0280] An embodiment of this application provides an Ethernet system. The Ethernet system includes M backbone nodes. Each of the M backbone nodes includes a first backbone port and a second backbone port. The M backbone nodes form a ring network by using the first backbone port and the second backbone port. M is an integer greater than 2. The M backbone nodes include a first backbone node. The first backbone port of the first backbone node is in a forwarding state, and the second backbone port of the first backbone node is in a blocking state. Both the first backbone port and the second backbone port of any backbone node among the M backbone nodes other than the first backbone node are in a forwarding state. The second backbone node is one of the M backbone nodes other than the first backbone node.

[0281] The first backbone node is configured to obtain link failure information of the ring network, and switch a second backbone port of the first backbone node to a forwarding state based on the link failure information.

[0282] Optionally, the second backbone node is configured to determine that a first link has failed, the first link being a link on which a first backbone port of the second backbone node is located, and to send a notification packet through the second backbone port of the second backbone node, the notification packet being used to indicate that the first link has failed.

[0283] The first backbone node is specifically configured to receive the notification packet through a first backbone port of the first backbone node.

[0284] Optionally, the second backbone node is further configured to switch the first backbone port of the second backbone node to a blocked state.

[0285] Optionally, the first backbone port of the second backbone node is a master port, and the second backbone port of the second backbone node is a slave port.

[0286] Optionally, the second backbone node is specifically configured to determine that the first link has failed through differential signal diagnostics.

[0287] Optionally, the notification packet is a Bridge Protocol Data Unit BPDU packet.

[0288] Optionally, the first backbone node is specifically configured to determine that a second link has failed, the second link being a link on which a first backbone port of the first backbone node is located.

[0289] Optionally, the first backbone node is further configured to switch a first backbone port of the first backbone node to a blocked state.

[0290] Optionally, the first backbone node is specifically configured to determine that the second link has failed through differential signal diagnostics.

[0291] Optionally, each of the M backbone nodes includes a first identifier, which is used to identify the backbone node in the Ethernet system.

[0292] Optionally, the Ethernet system further includes an end node. The end node includes a first end port and a second end port. The first end port is in a forwarding state. The second end port is in a blocking state. At least two backbone nodes of the M backbone nodes each further include a third end port. The first end port and the second end port are connected to the third end ports of the at least two backbone nodes.

[0293] The terminal node is configured to determine that a third link has failed, the third link being the link on which the first terminal port is located, and to switch the second terminal port to a forwarding state.

[0294] Optionally, the terminal node is further configured to switch the first terminal port to a blocking state.

[0295] Optionally, the end node is specifically configured to determine that the third link has failed through differential signal diagnostics.

[0296] Optionally, the terminal node includes a second identifier, which is used to identify the terminal node within the Ethernet system.

[0297] Optionally, the first backbone node is further configured to detect the first identifier and determine, based on the first identifier, that the first backbone node is a backbone node in the network.

[0298] Optionally, the second backbone node is further configured to detect the first identifier and determine, based on the first identifier, that the second backbone node is a backbone node in the network.

[0299] An embodiment of the present application further provides a vehicle including any one of the above Ethernet systems provided in the embodiments of the present application.

[0300] It should be noted that the vehicle may be an intelligent vehicle, a new energy vehicle, a conventional vehicle, etc., which is not limited in this application. New energy vehicles include pure electric vehicles, extended range electric vehicles, hybrid electric vehicles, fuel cell vehicles, other new energy vehicles, etc. Conventional vehicles include gasoline vehicles and crude oil vehicles.

[0301] For example, the above Ethernet system is used in a vehicle, the backbone node may be a VIU, and the terminal node may be a domain controller DC, for example, a CDC or a VDC.

[0302] Optionally, in this application, both the terminal node and the backbone node may be a switching chip (Line switch, LSW) and may have the same hardware structure. The terminal node and the backbone node are distinguished by using a first identifier and a second identifier, so that the nodes can execute different switching logics based on different identifiers to reduce the complexity of configuring the switching chip.

[0303] In this application, it should be understood that each backbone node or terminal node may have one or more other ports, such as non-backbone ports or non-terminal ports, which may be connected to other devices, such as a microprocessor unit (MPU), a micro control unit (MCU), an input / output interface (I / O interface), etc. This is not a limitation in this application.

[0304] It should be further understood that Figure 1 is merely a schematic diagram of an application scenario of this application, and the application scenario of this application is not limited thereto. For example, the solution of this application may also be used in a conventional Ethernet. The backbone nodes may be routers or switches, and the terminal nodes may also be routers or switches.

[0305] Furthermore, in the embodiments of this application, terms such as "for example" and "such as" are used to denote serving as an example, illustration, or description. Any embodiment or design manner described in this application as an "example" should not be described as preferred or having more advantages than other embodiments or design manners. Specifically, the word "example" is used to present concepts in a concrete way.

[0306] In the embodiments of this application, "corresponding" and "corresponding" may be used interchangeably in some cases. It should be noted that the meanings expressed by the terms are consistent when differences are not emphasized.

[0307] The network architectures and service scenarios described in the embodiments of this application are intended to more clearly explain the technical solutions in the embodiments of this application, but do not constitute limitations on the technical solutions provided in the embodiments of this application. Those skilled in the art may understand that the technical solutions provided in the embodiments of this application can also be applied to similar technical problems as network architectures evolve and new service scenarios emerge.

[0308] References to "an embodiment," "some embodiments," etc. in this specification indicate that one or more embodiments of this application include a particular feature, structure, or characteristic described with reference to the embodiment. Thus, phrases such as "in an embodiment," "in some embodiments," "in some other embodiments," and "in other embodiments" appearing in different places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, of the embodiments" unless otherwise emphasized. The terms "include," "comprise," "have," and variations thereof all mean "including, but not limited to," unless otherwise emphasized.

[0309] In this application, "at least one" means one or more, and "plurality" means two or more. The term "and / or" describes an association relationship between related objects and indicates that three relationships may exist. For example, A and / or B may represent the following three cases: only A is present; both A and B are present; and only B is present. A and B may be singular or plural.

[0310] It should be understood that the sequence numbers of the above processes do not mean the execution order in the embodiment of this application. The execution order of the processes should be determined based on the functions and internal logic of the processes, and should not constitute any limitation on the implementation process of the embodiment of this application.

[0311] It should be understood that the terms "first", "second" and various sequence numbers in the embodiments of this application are used merely to distinguish between different bandwidths for ease of explanation, for example, to distinguish between bandwidths under different conditions, but are not intended to limit the scope of the embodiments of this application.

[0312] Those skilled in the art may recognize that the units and algorithm steps described with reference to the examples in the embodiments disclosed in this specification may be realized by electronic hardware, or a combination of computer software and electronic hardware. Whether a function is performed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to realize the described functions for each specific application, but the implementation manner should not be considered to go beyond the scope of this application.

[0313] For the purpose of convenient and concise description, it can be clearly understood by those skilled in the art that the detailed operation processes of the above systems, devices and units may refer to the corresponding processes in the above method embodiments, and the details will not be described again here.

[0314] In some embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods may be realized in other ways. For example, the described device embodiments are merely examples. For example, the unit division is merely a logical functional division, and other divisions may be used in actual implementation. For example, multiple units or components may be combined or integrated into other systems, or some features may be ignored or not implemented. Furthermore, the shown or discussed mutual couplings or direct couplings or communication connections may be realized by using some interfaces. Indirect couplings or communication connections between devices or units may be realized in electronic, mechanical, or other forms.

[0315] The units described as separate parts may or may not be physically separate, and the parts shown as units may or may not be physical units, and may be located in one place or distributed across multiple network units. Some or all of the units may be selected based on actual requirements to achieve the objectives of the solutions of the embodiments.

[0316] Furthermore, the functional units in the embodiments of this application may be integrated into one processing unit, each of the units may exist physically alone, or two or more units may be integrated into one unit.

[0317] When a function is realized in the form of a software functional unit and sold or used as an independent product, the function may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application may essentially be realized, or a portion of the technical solution or a portion of the technical solution may be realized in the form of a software product. A computer software product is stored in a storage medium and includes some instructions for instructing a computer device (which may be a personal computer, a server, a network device, etc.) to execute all or part of the steps of the method described in the embodiments of this application. The above storage medium includes any medium capable of storing program code, such as a USB flash drive, a removable hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.

[0318] The above description is merely a specific embodiment of this application and is not intended to limit the scope of protection of this application. Any variations or replacements that can be easily conceived by those skilled in the art within the technical scope disclosed in this application shall fall within the scope of protection of this application. Therefore, the scope of protection of this application shall be subject to the scope of protection of the claims.

Claims

1. A method for establishing a network for an in-vehicle Ethernet system, The network includes M backbone nodes, each of the M backbone nodes includes a first backbone port and a second backbone port, the M backbone nodes form a ring network using the first backbone port and the second backbone port, where M is an integer greater than 2, the M backbone nodes include a first backbone node, the first backbone port of the first backbone node is in a forwarding state, the second backbone port of the first backbone node is in a blocking state, both the first backbone port and the second backbone port of any of the M backbone nodes other than the first backbone node are in a forwarding state, and the second backbone node is one of the M backbone nodes excluding the first backbone node. This method is The steps include: obtaining link failure information of the ring network from the first backbone node, determining that a second link has failed through differential signal diagnosis, wherein the second link is the link on which the first backbone port of the first backbone node is located; The first backbone node, based on the link failure information, switches the second backbone port of the first backbone node to a forwarding state. A method that includes this.

2. The step of obtaining link failure information of the ring network using the first backbone node is: The method according to claim 1, comprising the step of having the first backbone node receive an announcement packet through the first backbone port of the first backbone node, the announcement packet being used to indicate that a first link has failed, the first link being the link on which the first backbone port of the second backbone node is located.

3. This method is The method according to claim 1, further comprising the step of switching the first backbone port of the first backbone node to a blocked state using the first backbone node.

4. The method according to any one of claims 1 to 3, wherein each of the M backbone nodes includes a first identifier, the first identifier being used to identify the backbone nodes in the network.

5. This method is The first backbone node detects the first identifier, The first backbone node determines, based on the first identifier, that the first backbone node is a backbone node in the network. The method according to claim 4, further comprising:

6. An Ethernet system for vehicles, comprising M backbone nodes, Each of the M backbone nodes includes a first backbone port and a second backbone port, and the M backbone nodes form a ring network using the first backbone port and the second backbone port, where M is an integer greater than 2, and the M backbone nodes include a first backbone node, the first backbone port of the first backbone node is in a forwarding state, the second backbone port of the first backbone node is in a blocking state, both the first backbone port and the second backbone port of any of the M backbone nodes other than the first backbone node are in a forwarding state, and the second backbone node is one of the M backbone nodes excluding the first backbone node. The aforementioned first backbone node is The system is configured to obtain link failure information of the ring network, including determining through differential signal diagnostics that a second link has failed, wherein the second link is the link on which the first backbone port of the first backbone node is located. An Ethernet system configured to switch the second backbone port of the first backbone node to a forwarding state based on the link failure information.

7. The aforementioned second backbone node is It is configured to determine that a first link has failed, and the first link is the link on which the first backbone port of the second backbone node is located. It is configured to send notification packets through the second backbone port of the second backbone node, and the notification packets are used to indicate that the first link has failed. The aforementioned first backbone node is The Ethernet system according to claim 6, specifically configured to receive the notification packets through the first backbone port of the first backbone node.

8. The aforementioned second backbone node is The Ethernet system according to claim 7, further configured to switch the first backbone port of the second backbone node to a blocked state.

9. The Ethernet system according to claim 8, wherein the first backbone port of the second backbone node is a master port, and the second backbone port of the second backbone node is a slave port.

10. The aforementioned first backbone node is The Ethernet system according to claim 6, specifically configured to switch the first backbone port of the first backbone node to a blocked state.

11. The Ethernet system according to any one of claims 6 to 10, wherein each of the M backbone nodes includes a first identifier, the first identifier being used to identify the backbone nodes in the Ethernet system.

12. The Ethernet system further includes terminal nodes, The terminal node includes a first terminal port and a second terminal port, wherein the first terminal port is in a forwarding state and the second terminal port is in a blocking state. At least two of the M backbone nodes further include a third terminal port, and the first terminal port and the second terminal port are connected to the third terminal port of the at least two backbone nodes. The aforementioned terminal node is It is configured to determine that a third link has failed, and the third link is the link on which the first terminal port is located. The Ethernet system according to any one of claims 6 to 10, configured to switch the second terminal port to a forwarding state and the first terminal port to a blocking state.

13. The Ethernet system according to claim 12, wherein the terminal node includes a second identifier, the second identifier being used to identify the terminal node in the Ethernet system.

14. A vehicle comprising the Ethernet system according to any one of claims 6 to 10.