Port loop detection method and device and storage medium
Through the port loop detection method, the problem of loopback fault detection and positioning in passive optical network systems is solved, accurate fault location and rapid recovery are achieved, and network stability is improved.
Patent Information
- Application Number
- CN202411659142.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-20
- Publication Date
- 2025-02-14
AI Technical Summary
The prior art cannot effectively detect and locate loopback failures in passive optical network systems, resulting in network stability being affected.
Through a port loop detection method, it is determined whether the port enters the loopback detection state. If it enters, it is determined whether a loop failure has occurred. If it occurs, it obtains the port's location information. If it does not occur, it maintains the current state or allows the port to enter the loopback. Detection status.
It accurately reports the location of the opposite end of the loop, helping network administrators to position the location of the loop in a timely and accurate manner, and improves the efficiency of network failure location and recovery.
Smart Images

Figure CN119449168A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of loop detection, and in particular to a port loop detection method, device and storage medium. Background Art
[0002] The passive optical network system is generally composed of an optical line terminal (OLT) and an optical network unit (ONU). This system can be used in operator networks and enterprise networks. The optical line terminal is responsible for providing the aggregation and distribution of Layer 2 services on the core network side, and the optical network unit is responsible for providing access and aggregation of Layer 2 services on the user side. The optical line terminal manages and controls the ONT (Optical Network Terminal, optical network equipment) through the OMCI (ONU management and control interface), and the OMCI is defined in the ITU-TG.988 standard specification. The optical line terminal manages the ONU device by accessing the managed entity (ME) of the optical network unit through the OMCI interface.
[0003] When deployed in the existing network, ONTs may be deployed in corridors, weak current rooms, inside walls, on roofs, etc. Some devices may be in user homes, corporate offices, or even in the wild. When problems occur in the existing network, effective positioning methods and rapid service recovery are very necessary. In network deployment, loopback failures are very common. When failures occur, they will cause great damage to the stability of the network. Therefore, it is very necessary to detect loops in time and accurately locate the position. However, the existing technology cannot meet the above requirements, so it needs to be improved. Summary of the invention
[0004] In view of this, the present invention provides a port loop detection method, device and storage medium.
[0005] Specifically, the present invention is achieved through the following technical solutions:
[0006] According to a first aspect of the present invention, a port loop detection method is provided, the method comprising the steps of:
[0007] Determine whether the port enters the loopback detection state;
[0008] If so, determining whether a loop failure occurs on the port;
[0009] If not, keep the current state;
[0010] If so, obtaining location information of the port;
[0011] If not, the port is made to enter the loopback detection state.
[0012] Optionally, the determining whether the port enters the loopback detection state comprises the steps of:
[0013] Setting a loop detection entity to the port;
[0014] Determine whether the port receives a loop detection message;
[0015] If so, determining that the port enters the loopback detection state;
[0016] If not, it is determined that the port has not entered the loopback detection state.
[0017] Optionally, the step of setting a loop detection entity to the port comprises the steps of:
[0018] Setting a loopback detection switch on the port;
[0019] Setting a port location identifier to the port;
[0020] Setting a loopback detection state to the port;
[0021] A peer port location identifier is set for the port.
[0022] Optionally, the determining whether a loop fault occurs at the port comprises the steps of: acquiring a loop detection message received by the port;
[0023] Determine whether the loop detection message contains a loop fault message;
[0024] If so, determining that a loop failure occurs on the port;
[0025] If not, it is determined that no loop failure occurs on the port.
[0026] Optionally, the step of obtaining the location information of the port comprises the steps of:
[0027] Obtaining a port location identifier of the port;
[0028] Obtaining the physical address of the device where the port is located;
[0029] Get the product serial number address of the device where the port is located.
[0030] Optionally, the step of causing the port to enter the loopback detection state comprises the steps of: setting a loop detection entity to the port;
[0031] Determine whether the port receives a loop detection message;
[0032] If so, determining that the port enters the loopback detection state;
[0033] If not, return to the step of setting a loop detection entity for the port.
[0034] Optionally, the method further comprises the steps of:
[0035] Report the location information of the port.
[0036] According to a second aspect of the present invention, there is provided a port loop detection device, comprising:
[0037] A status judgment module is used to judge whether the port enters the loopback detection state;
[0038] A fault judgment module, used to judge whether a loop fault occurs on the port;
[0039] An execution module, used for executing a preset operation according to the results of the state judgment module and the fault judgment module;
[0040] Among them, when the status judgment module and the fault judgment module are both yes, the execution module obtains the location information of the port; when the status judgment module is yes and the fault judgment module is no, the execution module maintains the current state; when the status judgment module is no, the execution module makes the port enter the loopback detection state.
[0041] According to a third aspect of the present invention, there is provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of any of the aforementioned methods when executing the program.
[0042] According to a fourth aspect of the present invention, there is provided a storage medium having a computer program stored thereon, wherein the program, when executed by a processor, implements the steps of any one of the aforementioned methods.
[0043] The technical solution provided by the present invention brings at least the following beneficial effects:
[0044] The present application provides a port loop detection method, device and storage medium that accurately reports the location of the loop peer, making it convenient for network administrators to locate the location of the loop in a timely and accurate manner. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0046] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or related technical descriptions are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0047] Figure 1 A schematic diagram of a flow chart of a port loop detection method provided by an embodiment of the present invention;
[0048] Figure 2 A schematic diagram of the structure of a port loop detection device provided by an embodiment of the present invention;
[0049] Figure 3 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention;
[0050] Figure 4 A schematic diagram of the structure of a storage medium provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0052] Figure 1 The flowchart of a port loop detection method applicable to an embodiment of the present invention is schematically shown.
[0053] See also Figure 1 The embodiment of the present invention provides a port loop detection method, which can be applied to electronic devices such as PCs, servers, terminals, etc. The method may include the following steps:
[0054] S1: Determine whether the port enters the loopback detection state;
[0055] Exemplarily, the step of determining whether a port enters a loopback detection state includes the following steps:
[0056] Setting a loop detection entity to the port;
[0057] Determine whether the port receives a loop detection message;
[0058] If so, determining that the port enters the loopback detection state;
[0059] If not, it is determined that the port has not entered the loopback detection state.
[0060] In an embodiment of the present application, a loop detection entity is set at the port, and the loop detection entity can send data at the port. The data may include a loop detection message. If it is detected that the data sent by the port contains a loop detection message, it means that the port has entered the loopback detection state; otherwise, it means that the port has not entered the loopback detection state.
[0061] Exemplarily, the step of setting a loop detection entity to the port comprises the steps of:
[0062] Setting a loopback detection switch on the port;
[0063] Setting a port location identifier to the port;
[0064] Setting a loopback detection state to the port;
[0065] A peer port location identifier is set for the port.
[0066] In the embodiment of the present application, the specific content and function of the loop detection entity set on the port are: the instance identifier is used to uniquely identify an instance, the loopback detection switch is used to turn on and off the loopback detection function of the port, and the port position identifier is used to identify the location of the current port, such as the frame ID, PON board ID, PON port ID, ONU index, port ID and other information; the loopback detection status is used to identify whether a loop fault has occurred on the current port; the opposite port position identifier is used to record the opposite port position information when a loop fault occurs.
[0067] S2: If yes, determine whether a loop failure occurs on the port;
[0068] Exemplarily, the determining whether a loop failure occurs at the port comprises the steps of:
[0069] Obtaining a loop detection message received by the port;
[0070] Determine whether the loop detection message contains a loop fault message;
[0071] If so, determining that a loop failure occurs on the port;
[0072] If not, it is determined that no loop failure occurs on the port.
[0073] In the embodiment of the present application, when a loop fault occurs on a port, a loop detection message will exist in the loop detection message, so whether a loop fault occurs on the port can be determined by determining whether there is a loop detection message.
[0074] S3: If not, keep the current state;
[0075] In the embodiment of the present application, if no loop failure occurs on the port, the current state is maintained and operation continues.
[0076] S4: If yes, obtain the location information of the port;
[0077] Exemplarily, the step of obtaining the location information of the port includes the following steps:
[0078] Obtaining a port location identifier of the port;
[0079] Obtaining the physical address of the device where the port is located;
[0080] Get the product serial number address of the device where the port is located.
[0081] In the embodiment of the present application, the location information of the port specifically includes: a port location identifier, a physical address of a device where the port is located, and a product serial number address of the device where the port is located.
[0082] S5: If not, make the port enter the loopback detection state.
[0083] Exemplarily, the step of causing the port to enter the loopback detection state comprises the steps of:
[0084] Setting a loop detection entity to the port;
[0085] Determine whether the port receives a loop detection message;
[0086] If so, determining that the port enters the loopback detection state;
[0087] If not, return to the step of setting a loop detection entity for the port.
[0088] In an embodiment of the present application, setting a loop detection entity to a port can cause the port to enter a loopback detection state, and whether the port enters the loopback detection state can be determined by determining whether there is a loop detection message in the data sent by the port.
[0089] Exemplarily, the method further comprises the steps of:
[0090] Report the location information of the port.
[0091] In an embodiment of the present application, the location information of the port is reported to the system for the administrator to view.
[0092] Example
[0093] The steps of a port loop detection method provided in this application are as follows:
[0094] 1) Device initialization
[0095] During the device initialization phase, the device creates a "loop detection control" entity for each port; instance ID0 is used to associate the uplink port, and instance IDs 1 to N correspond to UNI ports 1 to N; the OLT turns on the loop detection of the port by issuing a SET command to the "loop detection control" entity, and sets the position of the port in the entire network by setting the "port location identifier" attribute of the entity; when the loop detection switch of the port is on, each UNI port of the device will send a loop detection message at a fixed time, and the original physical address of the message can be a unicast physical address, such as 2C:D1:41:00:00:01, and the destination physical address of the message can be a broadcast physical address, such as FF:FF:FF:FF:FF:FF:FF; the Ethernet frame type of the message can be customized, which is different from the currently known Ethernet frame types, such as 0xFFFA; the data part of the message carries the location information of the port; optionally, it can carry other information, such as the MAC address, GPON SN, etc.; To ensure the normal operation of the network, the device will discard the loop detection messages received from the UNI side and will not forward them to the uplink port; the device will also discard the loop detection messages received from the uplink port and will not forward them to the UNI side.
[0096] 2) Loop detection found
[0097] In a network composed of devices supporting the "loop detection control", when a port receives a port loop detection message P1, it is determined that a loop has occurred; at this time, the opposite end location information of the current loop can be identified based on the data portion of the received P1; the device updates the loop status and opposite end port location identifier of the "loop detection control" instance corresponding to the port based on this information, and then actively reports an alarm W1 through the instance; on the OLT, the user can receive a loop occurrence alarm for the port where the loop has occurred, and through the OLT, send an OMCI GET message for the "loop detection control" instance of the port, thereby obtaining the opposite end location information of the port where the loop has occurred, so that the network administrator can quickly locate the specific location where the loop has occurred.
[0098] 3) Loop elimination and automatic recovery
[0099] Loop failures will greatly affect the forwarding efficiency of the network. Therefore, when the device detects a loop, it will actively close or limit the port. Specifically, when the UNI port detects a loop, in addition to reporting an alarm, the device will actively close the UNI port. After waiting for a period of time T1, the device will try to open the port again. If no loop is detected at this time, the device will automatically return to normal. Specifically, when the uplink port receives a loop detection message, in addition to reporting an alarm, the device will actively limit the speed of the uplink port to prevent network deterioration. After no loop detection message P is received within time T2, the device will actively cancel the speed limit of the uplink port and the device will automatically return to normal.
[0100] like Figure 2 , the present application provides a port loop detection device, comprising:
[0101] A state judgment module 10 is used to judge whether the port enters the loopback detection state;
[0102] A fault judgment module 20 is used to judge whether a loop fault occurs on the port;
[0103] An execution module 30, configured to execute a preset operation according to the results of the state judgment module and the fault judgment module;
[0104] Among them, when the status judgment module and the fault judgment module are both yes, the execution module obtains the location information of the port; when the status judgment module is yes and the fault judgment module is no, the execution module maintains the current state; when the status judgment module is no, the execution module makes the port enter the loopback detection state.
[0105] A port loop detection device provided in the present application can execute a port loop detection method provided in the above steps.
[0106] It should be understood that the above specific embodiments of the present invention are only used to illustrate or explain the principles of the present invention, and do not constitute a limitation of the present invention. Therefore, any modifications, equivalent substitutions, improvements, etc. made without departing from the spirit and scope of the present invention should be included in the protection scope of the present invention. In addition, the appended claims of the present invention are intended to cover all changes and modifications that fall within the scope and boundaries of the appended claims, or the equivalent forms of such scope and boundaries.
[0107] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device 100 suitable for implementing the embodiment of the present disclosure. The electronic device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0108] like Figure 3As shown, the electronic device 100 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 102 or a program loaded from a storage device 108 to a random access memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the electronic device 100 are also stored. The processing device 101, the ROM 102, and the RAM 103 are connected to each other via a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.
[0109] Typically, the following devices may be connected to the I / O interface 105: an input device 106 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 107 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 108 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 109. The communication device 109 may allow the electronic device 100 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 100 having various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0110] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 109, or installed from the storage device 108, or installed from the ROM 102. When the computer program is executed by the processing device 101, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0111] Reference below Figure 4 , which shows a schematic diagram of the structure of a computer-readable storage medium suitable for implementing an embodiment of the present disclosure, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it can implement any of the port loop detection methods described above.
[0112] The present application also provides a computer program product, which includes a computer program / computer executable instructions, and when the computer program / computer executable instructions are executed by a processor of an electronic device, the steps of any of the above-mentioned port loop detection methods are implemented.
[0113] The present application provides a port loop detection method, device and storage medium that accurately reports the location of the loop peer, making it convenient for network administrators to locate the location of the loop in a timely and accurate manner.
[0114] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0115] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A port loop detection method, characterized in that: The method comprises the steps of: Determine whether the port enters the loopback detection state; If so, determining whether a loop failure occurs on the port; If not, keep the current state; If so, obtaining location information of the port; If not, the port is made to enter the loopback detection state.
2. The port loop detection method according to claim 1, characterized in that: Determining whether the port enters the loopback detection state comprises the following steps: Setting a loop detection entity to the port; Determine whether the port receives a loop detection message; If so, determining that the port enters the loopback detection state; If not, it is determined that the port has not entered the loopback detection state.
3. The port loop detection method according to claim 2, characterized in that: The step of setting a loop detection entity to the port comprises the following steps: Setting a loopback detection switch on the port; Setting a port location identifier to the port; Setting a loopback detection state to the port; A peer port location identifier is set for the port.
4. The port loop detection method according to claim 1, characterized in that: Determining whether a loop failure occurs at the port comprises the steps of: Obtaining a loop detection message received by the port; Determine whether the loop detection message contains a loop fault message; If so, determining that a loop failure occurs on the port; If not, it is determined that no loop failure occurs on the port.
5. The port loop detection method according to claim 1, characterized in that: The obtaining of the location information of the port comprises the steps of: Obtaining a port location identifier of the port; Obtaining the physical address of the device where the port is located; Get the product serial number address of the device where the port is located.
6. The port loop detection method according to claim 1, characterized in that: The step of causing the port to enter the loopback detection state comprises the following steps: Setting a loop detection entity to the port; Determine whether the port receives a loop detection message; If so, determining that the port enters the loopback detection state; If not, return to the step of setting a loop detection entity for the port.
7. The port loop detection method according to claim 1, characterized in that: Also includes the steps: Report the location information of the port.
8. A port loop detection device, characterized in that: include: A status judgment module is used to judge whether the port enters the loopback detection state; A fault judgment module, used to judge whether a loop fault occurs on the port; An execution module, used for executing a preset operation according to the results of the state judgment module and the fault judgment module; Among them, when the status judgment module and the fault judgment module are both yes, the execution module obtains the location information of the port; when the status judgment module is yes and the fault judgment module is no, the execution module maintains the current state; when the status judgment module is no, the execution module makes the port enter the loopback detection state.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.