Port dynamic switching method and device and storage medium

By detecting the port service quality in the Ethernet loop and dynamically switching the port with the lowest service quality, the problem of blocked ports in the Ethernet loop cannot be switched, and network stability and reliability are improved.

CN119232521AActive Publication Date: 2024-12-31ZHEJIANG DAHUA TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411726028.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2024-12-31
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

In the Ethernet loop, blocking ports cannot be switched dynamically, resulting in ports with high service quality being set to blocking ports by mistake, and ports with low service quality frequently experience link failures and link recovery, affecting network communication quality.

Method used

Through the Ethernet multi-ring protection technology of the detection node, the appropriate evaluation strategy (hardware or software implementation) is selected to evaluate the port service quality, dynamically switch the port with the lowest service quality as the new master port, improving the accuracy of port service quality evaluation and Network stability.

Benefits of technology

Dynamic switching of port service quality is realized, network stability and reliability are improved, and link failure and recovery problems caused by wrong port settings are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232521A_ABST
    Figure CN119232521A_ABST
Patent Text Reader

Abstract

The invention discloses a port dynamic switching method and device and a storage medium. The port dynamic switching method comprises the steps that it is detected that the Ethernet multi-ring protection technology of a node belongs to hardware implementation or software implementation; if the Ethernet multi-ring protection technology of the node belongs to hardware implementation, selecting a first evaluation strategy as a target evaluation strategy; if the Ethernet multi-ring protection technology of the node belongs to software implementation, selecting a second evaluation strategy as a target evaluation strategy; based on the target evaluation strategy, the port service quality of the node is obtained through evaluation; the port service quality is sent to the main port on the Ethernet loop, so that the main port selects the port with the lowest port service quality as the to-be-switched port, and the to-be-switched port is switched to the new main port, the accuracy of port service quality evaluation is improved, a more accurate node port is selected as the main port, and the switching efficiency is improved. The network stability and reliability can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a port dynamic switching method, device and storage medium. Background Art

[0002] ERPS (Ethernet Ring Protection Switching) is a Layer 2 loop prevention protocol standard that defines the Ring Auto Protection Switching (R-APS) protocol message and protection switching mechanism. It can prevent broadcast storms caused by data loops in Ethernet rings. When a link on the Ethernet ring is disconnected, the backup link can be quickly enabled to restore communication between nodes on the ring network.

[0003] When a port of a device on an EPRS ring is a blocked port, the blocked port will remain unchanged, so that a port with a relatively high service quality may be set as a blocked port. When problems frequently occur on a port with a relatively low service quality, the EPRS ring will cause continuous link failures and link recovery, affecting the quality of network communication. Summary of the invention

[0004] In order to solve the above technical problems, the present application at least provides a port dynamic switching method, device and storage medium.

[0005] The first aspect of the present application provides a port dynamic switching method, which is applied to any node on an Ethernet ring, wherein one of the multiple nodes is a master node, and the master node is provided with a master port connected to the Ethernet ring, and the master port is in a blocked state when the Ethernet ring is in a non-fault state. The method comprises: detecting whether the Ethernet multi-ring protection technology of the node is implemented in hardware or software, wherein the hardware implementation refers to the implementation by accessing hardware registers, and the software implementation refers to the implementation by directly driving software codes; if the Ethernet multi-ring protection technology of the node is implemented in hardware, a first evaluation strategy is selected as a target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented in software, a second evaluation strategy is selected as a target evaluation strategy; wherein the corresponding service quality influencing factors between the first evaluation strategy and the second evaluation strategy are different and / or the corresponding weights of the service quality influencing factors are different; based on the target evaluation strategy, evaluating the port service quality of the node; sending the port service quality to the master port on the Ethernet ring, so that the master port selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to the new master port.

[0006] In one embodiment, based on the target evaluation strategy, the port service quality of the node is evaluated, including: based on the target evaluation strategy, evaluating and obtaining an initial evaluation value of the node; and, if the Ethernet multi-ring protection technology of the node is hardware-implemented, selecting a first preset value as the additional value of the node, if the Ethernet multi-ring protection technology of the node is software-implemented, selecting a second preset value as the additional value of the node; performing weighted summation on the initial evaluation value and the additional value, and using the weighted summation result as the port service quality of the node.

[0007] In one embodiment, the service quality influencing factors include one or more of the CPU usage, the number of port connection interruptions, delay, packet loss rate, and error rate.

[0008] In one embodiment, the corresponding service quality impact factors between the first evaluation strategy and the second evaluation strategy are different. The service quality impact factors of the first evaluation strategy include one or more of the CPU utilization rate, the number of port connection interruptions, delay, packet loss rate, and error rate. The service quality impact factors of the second evaluation strategy include at least the CPU utilization rate.

[0009] In one embodiment, the service quality influencing factors of the first evaluation strategy and the second evaluation strategy include central processing unit usage, and the weights corresponding to the corresponding service quality influencing factors between the first evaluation strategy and the second evaluation strategy are different. The weight corresponding to the central processing unit usage in the second evaluation strategy is greater than the weight corresponding to the central processing unit usage in the first evaluation strategy.

[0010] A second aspect of the present application provides a port dynamic switching method, which is applied to a master node on an Ethernet ring, wherein the Ethernet ring contains multiple nodes, one of the multiple nodes is the master node, and the master node is provided with a master port connected to the Ethernet ring, and the master port is in a blocked state when the Ethernet ring is in a non-fault state. The method comprises: receiving the port service quality reported by each node; wherein, if the Ethernet multi-ring protection technology of the node belongs to hardware implementation, a first evaluation strategy is selected as a target evaluation strategy; if the Ethernet multi-ring protection technology of the node belongs to software implementation, a second evaluation strategy is selected as a target evaluation strategy, and based on the target evaluation strategy, the port service quality of the node is evaluated, wherein hardware implementation refers to implementation by accessing hardware registers, and software implementation refers to implementation by directly driving software codes, and the service quality impact factors corresponding to the first evaluation strategy and the second evaluation strategy are different and / or the weights corresponding to the service quality impact factors are different; a port with the lowest port service quality is selected as the port to be switched, and the port to be switched is switched to a new master port.

[0011] In one embodiment, a port with the lowest outbound port service quality is selected as the port to be switched, and the port to be switched is switched to a new master port, including: if the port to be switched is another port of the master node accessing the Ethernet loop, then the other port of the master node accessing the Ethernet loop is directly switched to the master port; if the port to be switched is a port of other nodes accessing the Ethernet loop, then a port switching instruction is sent to the ports of other nodes accessing the Ethernet loop, so that other nodes switch the port to be switched to the new master port, and mark the other nodes as master nodes; in response to the successful switching of the ports of other nodes, the blocking state of the original master port of the node itself is released, and the node itself is marked as a non-master node.

[0012] In one embodiment, before receiving the port service quality reported by each node, the method further includes: sending a port dynamic switching enable instruction to each node, so that each node responds to the port dynamic switching enable instruction and evaluates the port service quality of the node.

[0013] The third aspect of the present application provides a port dynamic switching device, which is deployed at any node on an Ethernet ring, and the device includes: a node detection module, which is used to detect whether the Ethernet multi-ring protection technology of the node is implemented in hardware or software, hardware implementation refers to the implementation by accessing hardware registers, and software implementation refers to the implementation by directly driving software code; a strategy selection module, which is used to select a first evaluation strategy as a target evaluation strategy if the Ethernet multi-ring protection technology of the node is implemented in hardware; if the Ethernet multi-ring protection technology of the node is implemented in software, then select a second evaluation strategy as the target evaluation strategy; wherein the service quality influencing factors corresponding to the first evaluation strategy and the second evaluation strategy are different and / or the weights corresponding to the service quality influencing factors are different; a quality evaluation module, which is used to evaluate the port service quality of the node based on the target evaluation strategy; a quality reporting module, which is used to send the port service quality to the main port on the Ethernet ring, so that the main port selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to the new main port.

[0014] The fourth aspect of the present application provides a port dynamic switching device, which is deployed on a main node on an Ethernet ring, and the device includes: an information receiving module, which is used to receive the port service quality reported by each node; wherein, if the Ethernet multi-ring protection technology of the node is hardware-implemented, a first evaluation strategy is selected as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is software-implemented, a second evaluation strategy is selected as the target evaluation strategy, and the port service quality of the node is evaluated based on the target evaluation strategy, wherein hardware implementation refers to implementation by accessing hardware registers, and software implementation refers to implementation by directly driving software codes, and the service quality influencing factors corresponding to the first evaluation strategy and the second evaluation strategy are different and / or the weights corresponding to the service quality influencing factors are different; a port selection and switching module, which is used to select the port with the lowest port service quality as the port to be switched, and switch the port to be switched to a new main port.

[0015] A fifth aspect of the present application provides an electronic device, including a memory and a processor, wherein the processor is used to execute program instructions stored in the memory to implement the above-mentioned port dynamic switching method.

[0016] A sixth aspect of the present application provides a computer-readable storage medium on which program instructions are stored. When the program instructions are executed by a processor, the above-mentioned port dynamic switching method is implemented.

[0017] The above scheme detects whether the Ethernet multi-ring protection technology of the node is implemented by hardware or software. Hardware implementation refers to the implementation by accessing hardware registers, and software implementation refers to the implementation by directly driving software code. If the Ethernet multi-ring protection technology of the node is implemented by hardware, the first evaluation strategy is selected as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented by software, the second evaluation strategy is selected as the target evaluation strategy; wherein the service quality influencing factors corresponding to the first evaluation strategy and the second evaluation strategy are different and / or the weights corresponding to the service quality influencing factors are different; based on the target evaluation strategy, the port service quality of the node is evaluated; the port service quality is sent to the main port on the Ethernet ring, so that the main port selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to the new main port. The evaluation strategy matching each node can be flexibly determined according to the implementation method of the Ethernet multi-ring protection technology in the node to improve the accuracy of the port service quality evaluation, and then a more accurate node port is selected as the main port, which can improve network stability and reliability.

[0018] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The drawings herein are incorporated into the specification and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and are used together with the specification to illustrate the technical solution of the present application.

[0020] Figure 1 It is a schematic diagram of an implementation environment of a solution provided by an embodiment of the present application; Figure 2 is a flow chart of a method for dynamic port switching shown in an exemplary embodiment of the present application; Figure 3 is a flow chart of a method for dynamic port switching shown in another exemplary embodiment of the present application; Figure 4 is a schematic diagram of some fields contained in a message shown in an exemplary embodiment of the present application; Figure 5 is a schematic diagram of blocking port switching shown in an exemplary embodiment of the present application; Figure 6 is a block diagram of a first port dynamic switching device shown in an exemplary embodiment of the present application; Figure 7 is a block diagram of a second port dynamic switching device shown in an exemplary embodiment of the present application; Figure 8 is a schematic structural diagram of an electronic device shown in an exemplary embodiment of the present application; Fig. 9 It is a schematic diagram of the structure of a computer-readable storage medium shown in an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0021] The scheme of the embodiment of the present application is described in detail below in conjunction with the drawings of the specification.

[0022] In the following description, for the purpose of explanation rather than limitation, specific details such as specific system structures, interfaces, and technologies are provided to facilitate a thorough understanding of the present application.

[0023] The term "and / or" in this article is only an association information describing the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the previous and next associated objects are in an "or" relationship. In addition, "many" in this article means two or more than two. In addition, the term "at least one" in this article means any combination of at least two of any one or more of a plurality of, for example, including at least one of A, B, and C, can mean including any one or more elements selected from the set consisting of A, B, and C.

[0024] The following is a description of the port dynamic switching method provided in an embodiment of the present application.

[0025] Please refer to Figure 1 , which shows a schematic diagram of the solution implementation environment provided by an embodiment of the present application. The solution implementation environment may include multiple devices and management terminals. The devices added to the Ethernet ring (ie, ERPS ring) are called nodes. Each node cannot have more than two ports added to the same ERPS ring. Figure 1 For example, an ERPS ring includes node 1, node 2, and node 3, where one of the nodes is a master node, such as node 1.

[0026] The port roles specified in the ERPS protocol mainly include the master port, namely the Remote Program Load owner (RPLowner) port and the common port. For example, node 1 is the master node, and node 1 is provided with a master port connected to the Ethernet ring.

[0027] When the Ethernet ring is in a normal state, the primary port is in a blocked state to prevent a link loop.

[0028] The management end is a personal computer (PC), which is used to manage nodes in the Ethernet ring.

[0029] See also Figure 2 , Figure 2 is a flow chart of a method for dynamic port switching shown in an exemplary embodiment of the present application. The method for dynamic port switching can be applied to Figure 1 The implementation environment shown is specifically implemented by the nodes in the implementation environment.

[0030] like Figure 2 As shown, the port dynamic switching method at least includes steps S210 to S240, which are described in detail as follows: Step S210: The Ethernet multi-ring protection technology of the detection node is implemented by hardware or software.

[0031] Hardware implementation refers to the method of accessing hardware registers, and software implementation refers to the method of directly driving software code.

[0032] Exemplarily, a software development kit (SDK) interface of the node may be called to determine whether the Ethernet multi-ring protection technology of the node is implemented by hardware or software.

[0033] Step S220: If the Ethernet multi-ring protection technology of the node is implemented by hardware, the first evaluation strategy is selected as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented by software, the second evaluation strategy is selected as the target evaluation strategy.

[0034] The first evaluation strategy and the second evaluation strategy have different corresponding service quality impact factors and / or different corresponding weights of the service quality impact factors.

[0035] The service quality influencing factors refer to factors that affect the service quality of the node, including but not limited to one or more of the CPU usage, the number of port connection interruptions, delay, packet loss rate, and error rate.

[0036] The number of port connection interruptions represents the connectivity between the node port and other node ports.

[0037] Specifically, ERPS uses Continuity Check Message (CCM) messages to detect the connectivity between node ports.

[0038] The principle of CCM connectivity detection technology is as follows: each device connected to the Ethernet (such as a switch) will periodically send CCM frames, which contain a specific identifier; after receiving the CCM frame, other devices will detect the identifier in it and record it to know that the device sending the CCM frame is active; the device determines the connectivity of the link by detecting the CCM frame. If the device does not receive the corresponding CCM frame for a period of time (such as three CCM frame cycles), it can be determined that the link has failed or is disconnected, and a port connection interruption is recorded.

[0039] The central processing unit (CPU) usage is an indicator used to measure the degree of CPU resource utilization. The CPU resource usage can be queried periodically to obtain the central processing unit usage.

[0040] Port delay refers to the time required for an input signal to enter the chip from the port to be recognized, and the time required for an output signal to leave the chip from the port in digital circuit design. It is used to measure the information processing speed of the port.

[0041] The port packet loss rate and error rate are indicators to measure the performance of network devices. The packet loss rate refers to the ratio of the number of lost data packets to the total number of sent data packets, while the error rate includes abnormal conditions in network transmission such as cyclic redundancy check (CRC) errors and frame loss.

[0042] The first evaluation strategy and the second evaluation strategy can adopt different service quality impact factors, and / or set different weights for the same service quality impact factors, so as to respectively adapt to nodes that implement Ethernet multi-ring protection technology in hardware and nodes that implement Ethernet multi-ring protection technology in software, thereby improving the adaptability and accuracy of subsequent port service quality evaluations.

[0043] Step S230: Based on the target evaluation strategy, the port service quality of the node is evaluated.

[0044] According to the target evaluation strategy, the service quality of the port on which the node is connected to the Ethernet ring is evaluated, and finally the credentials for subsequent port switching are obtained.

[0045] Step S240: Send the port service quality to the master port on the Ethernet ring, so that the master port selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to the new master port.

[0046] Since the lower the port service quality, the greater the probability of failure of the corresponding port, the node periodically evaluates the service quality and reports the evaluated port service quality of the node to the main port of the main node on the Ethernet ring. The main port determines the port with the lowest port service quality as the port to be switched and switches the port to be switched to the new main port.

[0047] It should be noted that, for the master node, the port service quality of the primary port is also periodically evaluated based on the above steps, and the port service quality of each port reported by other nodes is combined to comprehensively select the port with the lowest service quality as the port to be switched.

[0048] Of course, if the currently selected port with the lowest service quality is the original primary port, there is no need to perform port switching, and the original primary port continues to be used as the primary port for subsequent processes.

[0049] Through the above embodiments, the evaluation strategy for matching each node is flexibly determined according to the implementation method of the Ethernet multi-ring protection technology in the node to improve the accuracy of the port service quality evaluation, and then a more accurate node port is selected as the main port, which can improve network stability and reliability.

[0050] Next, some embodiments of the present application are described by way of example.

[0051] In some embodiments, the corresponding service quality impact factors between the first evaluation strategy and the second evaluation strategy are different. The service quality impact factors of the first evaluation strategy include one or more of the CPU utilization rate, the number of port connection interruptions, delay, packet loss rate, and error rate; the service quality impact factors of the second evaluation strategy include at least the CPU utilization rate.

[0052] For nodes that do not support hardware-implemented Ethernet multi-ring protection technology and only support software-implemented Ethernet multi-ring protection technology, the CCM connectivity detection will fail due to the influence of the CPU busy scheduling of the main control chip. Therefore, the second evaluation strategy is adopted for such nodes. The service quality influencing factors of the second evaluation strategy at least include the central processing unit utilization rate.

[0053] For example, the service quality influencing factors of the first evaluation strategy include the number of port connection interruptions, delay, packet loss rate, and error rate; the service quality influencing factors of the second evaluation strategy include CPU utilization, the number of port connection interruptions, delay, packet loss rate, and error rate.

[0054] In some embodiments, the service quality influencing factors of the first evaluation strategy and the second evaluation strategy include central processing unit usage, and the weights corresponding to the corresponding service quality influencing factors between the first evaluation strategy and the second evaluation strategy are different, and the weight corresponding to the central processing unit usage in the second evaluation strategy is greater than the weight corresponding to the central processing unit usage in the first evaluation strategy.

[0055] Similarly, since the nodes implementing Ethernet multi-ring protection technology by software need to pay more attention to CPU busyness, the weight corresponding to the CPU usage in the second evaluation strategy is greater than the weight corresponding to the CPU usage in the first evaluation strategy.

[0056] For example, the weight corresponding to the CPU usage rate in the first evaluation strategy may be 0%, 5%, 10%, etc., and the weight corresponding to the CPU usage rate in the second evaluation strategy may be 70%, 80%, etc.

[0057] It should be noted that the above embodiments are merely illustrative. In actual application scenarios, the service quality influencing factors can be flexibly combined, and the weights corresponding to the service quality influencing factors can be flexibly set. This application does not limit this.

[0058] For example, the first evaluation strategy can be shown in Table 1 below:

[0059] Table 1 For example, the second evaluation strategy can be shown in Table 2 below:

[0060] Table 2 Based on the service quality impact factors considered in the first evaluation strategy or the second evaluation strategy, the node port service quality is evaluated from the corresponding dimensions of each service quality impact factor, and the corresponding weight limits the proportion of each service quality impact factor in the final port service quality.

[0061] In some implementations, evaluating the port service quality of the node based on the target evaluation strategy in step S230 includes: Step S231: Based on the target evaluation strategy, evaluate and obtain the initial evaluation value of the node.

[0062] That is, according to the first evaluation strategy or the second evaluation strategy, the node port service quality is evaluated from the dimensions corresponding to each service quality impact factor, and the evaluation value of each service quality impact factor is weightedly calculated according to the weight corresponding to each service quality impact factor to obtain an initial evaluation value.

[0063] Step S232: if the Ethernet multi-ring protection technology of the node is implemented by hardware, a first preset value is selected as the additional value of the node; if the Ethernet multi-ring protection technology of the node is implemented by software, a second preset value is selected as the additional value of the node.

[0064] For example, if the Ethernet multi-ring protection technology of the node is implemented by hardware, the added value of the node is 30 points; if the Ethernet multi-ring protection technology of the node is implemented by software, the added value of the node is 0.

[0065] Of course, in actual application scenarios, the first preset value and the second preset value may also be set to other values, and this application does not limit this.

[0066] Step S233: Perform weighted summation on the initial evaluation value and the additional value, and use the weighted summation result as the port service quality of the node.

[0067] The weighted weights corresponding to the initial evaluation value and the additional value are obtained, the initial evaluation value and the additional value are weightedly summed, and the weighted sum result is used as the final port service quality of the node.

[0068] After each node on the Ethernet ring completes the service quality evaluation, the port service quality is sent to the main port on the Ethernet ring so that the main port selects the port with the lowest port service quality as the port to be switched and switches the port to be switched to the new main port.

[0069] See also Figure 3 , Figure 3 is a flow chart of a port dynamic switching method shown in another exemplary embodiment of the present application. The port dynamic switching method can be applied to Figure 1 The implementation environment shown is specifically executed by the master node in the implementation environment.

[0070] like Figure 3 As shown, the port dynamic switching method at least includes steps S310 to S320, which are described in detail as follows: Step S310: receiving the port service quality reported by each node.

[0071] Among them, if the Ethernet multi-ring protection technology of the node is implemented by hardware, the first evaluation strategy is selected as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented by software, the second evaluation strategy is selected as the target evaluation strategy, and the port service quality of the node is evaluated based on the target evaluation strategy. Among them, hardware implementation refers to the implementation by accessing hardware registers, and software implementation refers to the implementation by directly driving software codes. The service quality influencing factors corresponding to the first evaluation strategy and the second evaluation strategy are different and / or the weights corresponding to the service quality influencing factors are different.

[0072] Step S320: Select the port with the lowest outbound port service quality as the port to be switched, and switch the port to be switched to a new primary port.

[0073] Prior to this, configure the CCM connection information between the nodes.

[0074] For example, continue to see Figure 1 The CCM connection information between nodes on the Ethernet ring obtained by configuration is shown in Table 3 below:

[0075] Table 3 The configured master nodes and master ports on the Ethernet ring are shown in Table 4 below:

[0076] Table 4 Referring to Table 4, select Node 1 as the master node and Port 2 of Node 1 as the master port.

[0077] In some implementations, the master node may send a port dynamic switching enable instruction to each node, so that each node responds to the port dynamic switching enable instruction and evaluates the port service quality of the node.

[0078] For example, see Figure 4 , Figure 4 This is a schematic diagram of some fields contained in a message shown in an exemplary embodiment of the present application, such as Figure 4 As shown, the No request message can be taken to perform private field extension to obtain the above message. The extension has a port switching indication field (Dynamic Switch Block Port, DSDP), through which each node is indicated whether to start port service quality evaluation. For example, if the value of the port switching indication field is 0, the port service quality of the evaluation node is turned off, and if the value of the port switching indication field is 1, the port service quality of the evaluation node is turned on.

[0079] The message may also contain a switch role (SR) field to indicate the role of the node. If the value of the node role field is 0, it indicates that the node is a master node. If the value of the node role field is 1, it indicates that the node is not a master node.

[0080] The message may also contain a port quality of service field (maximum value 100) of the east port node and a port quality of service field (maximum value 100) of the west port node.

[0081] Of course, the message also contains other fields, such as flags, fragment offset and other fields.

[0082] The master node sends a No request message with DSDP set to 1 to other nodes, and other nodes reply with a No request message with DSDP set to 1 and fill in the port service quality of their own two ports.

[0083] Of course, in addition to the above embodiments, the port service quality can also be reported in other ways, such as extending the fields of other messages, or resetting a new message protocol, which is not limited in this application.

[0084] After receiving the port service quality reported by other nodes, the master node selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to the new master port.

[0085] Specifically, if the port to be switched is the current primary port, no other operations are performed.

[0086] If the port to be switched is another port of the master node connected to the Ethernet ring, the other port of the master node connected to the Ethernet ring is directly switched to the master port.

[0087] If the port to be switched is the port of other nodes connected to the Ethernet ring, a port switching instruction is sent to the port of other nodes connected to the Ethernet ring, so that other nodes switch the port to be switched to a new main port and mark the other nodes as main nodes; in response to the successful switching of the port of other nodes, the blocking state of its original main port is released, and itself is marked as a non-main node.

[0088] For example, see Figure 5 , Figure 5 A schematic diagram of blocking port switching is shown in an exemplary embodiment of the present application, as shown in FIG. Figure 5As shown, if it is detected that the port service quality of port 12 is the lowest, then node 1 sends a port switching instruction (such as Manualswitch) to node 2, node 2 blocks port 12 according to the port switching instruction, and node 2 sets itself as the master node. In response to the successful port switching of node 2, node 1 releases the blocking state of node 1's original master port 2 and marks itself as a non-master node.

[0089] Of course, if the port to be switched is the current primary port, no other operations are performed.

[0090] The port dynamic switching method provided by the present application detects whether the Ethernet multi-ring protection technology of the node is implemented by hardware or software, wherein the hardware implementation refers to the implementation by accessing the hardware register, and the software implementation refers to the implementation by directly driving the software code; if the Ethernet multi-ring protection technology of the node is implemented by hardware, the first evaluation strategy is selected as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented by software, the second evaluation strategy is selected as the target evaluation strategy; wherein the service quality influencing factors corresponding to the first evaluation strategy and the second evaluation strategy are different and / or the weights corresponding to the service quality influencing factors are different; based on the target evaluation strategy, the port service quality of the node is evaluated; the port service quality is sent to the main port on the Ethernet ring so that the main port selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to the new main port, and the evaluation strategy matching each node can be flexibly determined according to the implementation method of the Ethernet multi-ring protection technology in the node to improve the accuracy of the port service quality evaluation, and then a more accurate node port is selected as the main port, which can improve the network stability and reliability.

[0091] Figure 6 FIG. 1 is a block diagram of a first port dynamic switching device shown in an exemplary embodiment of the present application, which is deployed at any node on an Ethernet ring. Figure 6 As shown, the exemplary first port dynamic switching device 600 includes: a node detection module 610, a strategy selection module 620, a quality evaluation module 630 and a quality reporting module 640. Specifically: The node detection module 610 is used to detect the Ethernet multi-ring protection technology of the node, which is implemented by hardware or software. The hardware implementation refers to the implementation by accessing the hardware register, and the software implementation refers to the implementation by directly driving the software code. A strategy selection module 620 is used to select a first evaluation strategy as a target evaluation strategy if the Ethernet multi-ring protection technology of the node is implemented by hardware; and select a second evaluation strategy as a target evaluation strategy if the Ethernet multi-ring protection technology of the node is implemented by software; wherein the first evaluation strategy and the second evaluation strategy have different corresponding service quality impact factors and / or different corresponding weights of the service quality impact factors; The quality evaluation module 630 is used to evaluate the port service quality of the node based on the target evaluation strategy; The quality reporting module 640 is used to send the port service quality to the master port on the Ethernet ring, so that the master port selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to the new master port.

[0092] Figure 7 FIG. 1 is a block diagram of a second port dynamic switching device shown in an exemplary embodiment of the present application, which is deployed on a master node on an Ethernet ring. Figure 7 As shown, the exemplary second port dynamic switching device 700 includes: an information receiving module 710 and a port selection and switching module 720. Specifically: The information receiving module 710 is used to receive the port service quality reported by each node; if the Ethernet multi-ring protection technology of the node is implemented by hardware, the first evaluation strategy is selected as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented by software, the second evaluation strategy is selected as the target evaluation strategy, and the port service quality of the node is evaluated based on the target evaluation strategy, wherein the hardware implementation refers to the implementation by accessing the hardware register, and the software implementation refers to the implementation by directly driving the software code, and the service quality impact factors corresponding to the first evaluation strategy and the second evaluation strategy are different and / or the weights corresponding to the service quality impact factors are different; The port selection and switching module 720 is used to select a port with the lowest outgoing port service quality as a port to be switched, and switch the port to be switched to a new primary port.

[0093] It should be noted that the port dynamic switching device provided in the above embodiment and the port dynamic switching method provided in the above embodiment belong to the same concept, wherein the specific manner in which each module and unit performs the operation has been described in detail in the method embodiment, and will not be repeated here. In practical applications, the port dynamic switching device provided in the above embodiment can allocate the above functions to different functional modules as needed, that is, divide the internal structure of the device into different functional modules to complete all or part of the functions described above, and this is not limited here.

[0094] See also Figure 8 , Figure 8800 includes a memory 801 and a processor 802, and the processor 802 is used to execute the program instructions stored in the memory 801 to implement the steps in any of the above-mentioned port dynamic switching method embodiments. In a specific implementation scenario, the electronic device 800 may include but is not limited to: a microcomputer, a server, and in addition, the electronic device 800 may also include a mobile device such as a laptop computer and a tablet computer, which is not limited here.

[0095] Specifically, the processor 802 is used to control itself and the memory 801 to implement the steps in any of the above-mentioned port dynamic switching method embodiments. The processor 802 can also be called a central processing unit (CPU). The processor 802 may be an integrated circuit chip with signal processing capabilities. The processor 802 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. In addition, the processor 802 can be implemented by an integrated circuit chip.

[0096] See also Fig. 9 , Fig. 9 The computer-readable storage medium 900 stores program instructions 910 that can be executed by a processor, and the program instructions 910 are used to implement the steps in any of the above-mentioned port dynamic switching method embodiments.

[0097] In some embodiments, the functions or modules included in the device provided by the embodiments of the present disclosure can be used to execute the method described in the above method embodiments. The specific implementation can refer to the description of the above method embodiments, and for the sake of brevity, it will not be repeated here.

[0098] The above description of various embodiments tends to emphasize the differences between the various embodiments. The same or similar aspects can be referenced to each other, and for the sake of brevity, they will not be repeated herein.

[0099] In the several embodiments provided in the present application, it should be understood that the disclosed methods and devices can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation, such as units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0100] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of a software functional unit. If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or part of the contribution to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (processor) to perform all or part of the steps of each implementation method of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), disk or optical disk and other media that can store program code.

Claims

1. A port dynamic switching method, applied to any node on an Ethernet ring, wherein one of the multiple nodes is a master node, the master node is provided with a master port connected to the Ethernet ring, the master port is in a blocked state when the Ethernet ring is in a non-fault state, characterized in that: The method comprises: The Ethernet multi-ring protection technology for detecting the node belongs to hardware implementation or software implementation, the hardware implementation refers to the implementation by accessing hardware registers, and the software implementation refers to the implementation by directly driving software codes; If the Ethernet multi-ring protection technology of the node is implemented by hardware, the first evaluation strategy is selected as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented by software, the second evaluation strategy is selected as the target evaluation strategy; wherein the first evaluation strategy and the second evaluation strategy have different corresponding service quality impact factors and / or different corresponding weights of the service quality impact factors; Based on the target evaluation strategy, evaluating and obtaining the port service quality of the node; The port service quality is sent to the master port on the Ethernet ring, so that the master port selects the port with the lowest port service quality as the port to be switched, and switches the port to be switched to a new master port.

2. The method according to claim 1, characterized in that The evaluating and obtaining the port service quality of the node based on the target evaluation strategy includes: Based on the target evaluation strategy, evaluating and obtaining an initial evaluation value of the node; and, If the Ethernet multi-ring protection technology of the node is implemented by hardware, a first preset value is selected as the additional value of the node; if the Ethernet multi-ring protection technology of the node is implemented by software, a second preset value is selected as the additional value of the node; The initial evaluation value and the additional value are weightedly summed, and the weighted sum result is used as the port service quality of the node.

3. The method according to claim 1, characterized in that The service quality influencing factors include one or more of the CPU usage, the number of port connection interruptions, delay, packet loss rate, and error rate.

4. The method according to claim 3, characterized in that The corresponding service quality influencing factors between the first evaluation strategy and the second evaluation strategy are different. The service quality influencing factors of the first evaluation strategy include one or more of the CPU utilization rate, the number of port connection interruptions, delay, packet loss rate, and error rate. The service quality influencing factors of the second evaluation strategy include at least the CPU utilization rate.

5. The method according to claim 3, characterized in that: The service quality influencing factors of the first evaluation strategy and the second evaluation strategy include the central processing unit usage rate. The weights corresponding to the service quality influencing factors between the first evaluation strategy and the second evaluation strategy are different. The weight corresponding to the central processing unit usage rate in the second evaluation strategy is greater than the weight corresponding to the central processing unit usage rate in the first evaluation strategy.

6. A port dynamic switching method, applied to a master node on an Ethernet ring, wherein the Ethernet ring contains multiple nodes, one of the multiple nodes is a master node, the master node is provided with a master port connected to the Ethernet ring, the master port is in a blocked state when the Ethernet ring is in a non-fault state, characterized in that: The method comprises: Receive the port service quality reported by each node; if the Ethernet multi-ring protection technology of the node is implemented by hardware, select the first evaluation strategy as the target evaluation strategy; if the Ethernet multi-ring protection technology of the node is implemented by software, select the second evaluation strategy as the target evaluation strategy, and evaluate the port service quality of the node based on the target evaluation strategy, wherein the hardware implementation refers to the implementation by accessing the hardware register, and the software implementation refers to the implementation by directly driving the software code, and the first evaluation strategy and the second evaluation strategy have different corresponding service quality impact factors and / or different corresponding weights of the service quality impact factors; A port with the lowest outbound port service quality is selected as a port to be switched, and the port to be switched is switched to a new primary port.

7. The method according to claim 6, characterized in that The step of selecting a port with the lowest outbound port service quality as a port to be switched, and switching the port to be switched to a new primary port includes: If the port to be switched is another port of the master node connected to the Ethernet ring, directly switch the other port of the master node connected to the Ethernet ring to the master port; If the port to be switched is a port of another node accessing the Ethernet ring, a port switching instruction is sent to the port of the other node accessing the Ethernet ring, so that the other node switches the port to be switched to a new primary port and marks the other node as a primary node; In response to the successful switching of the ports of the other nodes, the blocking state of the original master port of the node itself is released, and the node itself is marked as a non-master node.

8. The method according to claim 6, characterized in that Before receiving the port service quality reported by each node, the method further includes: A port dynamic switching enabling instruction is sent to each node, so that each node responds to the port dynamic switching enabling instruction and evaluates the port service quality of the node.

9. An electronic device, characterized in that: The electronic device comprises a memory and a processor, wherein the processor is configured to execute program instructions stored in the memory to implement the steps in the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program instructions, and the program instructions can be executed by a processor to implement the steps in the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • EAPS distributed Ethernet ring network protection switching method, device and medium

    CN111092800A

  • Vehicle-mounted Ethernet ring network protection switching method and device, electronic equipment and storage medium

    CN115695082A

  • Generalized service protection systems and methods

    US20130258840A1

  • Systems and methods to detect and recover from a loop in an ethernet ring protected network

    US20170180153A1

  • Preventing multicast outages in ring networks

    US20200336361A1