CN110730035A - Optical interface connection detection method, exchange single board and computer storage medium - Google Patents

Optical interface connection detection method, exchange single board and computer storage medium Download PDF

Info

Publication number
CN110730035A
CN110730035A CN201810779006.1A CN201810779006A CN110730035A CN 110730035 A CN110730035 A CN 110730035A CN 201810779006 A CN201810779006 A CN 201810779006A CN 110730035 A CN110730035 A CN 110730035A
Authority
CN
China
Prior art keywords
optical port
detected
position information
target
port
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810779006.1A
Other languages
Chinese (zh)
Inventor
李昕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201810779006.1A priority Critical patent/CN110730035A/en
Priority to PCT/CN2019/089242 priority patent/WO2020015467A1/en
Publication of CN110730035A publication Critical patent/CN110730035A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/07Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems
    • H04B10/075Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal
    • H04B10/079Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal using measurements of the data signal
    • H04B10/0791Fault location on the transmission path
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/07Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems
    • H04B10/075Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal
    • H04B10/079Arrangements for monitoring or testing transmission systems; Arrangements for fault measurement of transmission systems using an in-service signal using measurements of the data signal
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q11/00Selecting arrangements for multiplex systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q11/00Selecting arrangements for multiplex systems
    • H04Q11/0001Selecting arrangements for multiplex systems using optical switching
    • H04Q11/0005Switch and router aspects
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q11/00Selecting arrangements for multiplex systems
    • H04Q11/0001Selecting arrangements for multiplex systems using optical switching
    • H04Q11/0062Network aspects
    • H04Q2011/0079Operation or maintenance aspects
    • H04Q2011/0083Testing; Monitoring
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q11/00Selecting arrangements for multiplex systems
    • H04Q11/0001Selecting arrangements for multiplex systems using optical switching
    • H04Q11/0062Network aspects
    • H04Q2011/009Topology aspects

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Signal Processing (AREA)
  • Optical Communication System (AREA)
  • Mechanical Coupling Of Light Guides (AREA)

Abstract

本发明实施例公开了一种光口连接检测方法,包括:待检测光口所在交换单板获取所述待检测光口的位置信息;所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息。本发明实施例还公开了一种交换单板及计算机存储介质。

Figure 201810779006

The embodiment of the present invention discloses a method for detecting the connection of an optical port. The optical port sends out position information of the optical port to be detected. The embodiment of the present invention also discloses an exchange single board and a computer storage medium.

Figure 201810779006

Description

一种光口连接检测方法、交换单板及计算机存储介质Optical port connection detection method, switching single board and computer storage medium

技术领域technical field

本发明涉及通信领域,尤其涉及一种光口连接检测方法、交换单板及计算机存储介质。The present invention relates to the field of communications, and in particular, to an optical port connection detection method, a switching single board and a computer storage medium.

背景技术Background technique

集群路由器一般由多个机框级联组成,级联所使用的光缆有几十乃至数百根之多,且不能随意连接,需要根据组网情况按照指定的拓扑关系进行连接。一旦光缆连接错误,会导致业务丢包甚至业务中断。集群路由器中各个光口之间的连接关系通常由厂家通过在说明书或操作手册中进行标明,依靠用户来保证光口之间连接的准确性。然而,在光口数目较多的情况下,不仅连接的复杂度增大,而且光口之间连接的准确性也难以保证。面对这种情况,一些方法被用于检测集群路由器的光口之间连接的准确性,例如,利用集群路由器主控单板实时接收各交换单板上告的各光口的光口信息并进行校验,以确认光口之间是否连接正确。然而,上述方法将增加对光口连接进行检测的复杂度和降低可靠性。Cluster routers are generally composed of multiple racks cascaded together. There are dozens or even hundreds of optical cables used in the cascade, and they cannot be connected arbitrarily. They need to be connected according to the specified topology according to the networking situation. Once the optical cable is connected incorrectly, it will cause service packet loss or even service interruption. The connection relationship between the various optical ports in the cluster router is usually indicated by the manufacturer in the manual or operation manual, and the user is used to ensure the accuracy of the connection between the optical ports. However, in the case of a large number of optical ports, not only the complexity of the connection increases, but also the accuracy of the connection between the optical ports is difficult to guarantee. Faced with this situation, some methods are used to detect the accuracy of the connection between the optical ports of the cluster routers. Check to confirm whether the optical ports are connected correctly. However, the above method will increase the complexity and reduce the reliability of the detection of the optical port connection.

发明内容SUMMARY OF THE INVENTION

为解决现有技术存在的问题,本发明实施例提供一种能够降低检测复杂度和提高可靠性的光口连接检测方法、交换单板及计算机存储介质。In order to solve the problems existing in the prior art, the embodiments of the present invention provide an optical port connection detection method, a switching board and a computer storage medium that can reduce detection complexity and improve reliability.

为达到上述目的,本发明实施例的技术方案是这样实现的:In order to achieve the above-mentioned purpose, the technical scheme of the embodiment of the present invention is realized as follows:

第一方面,本发明实施例提供了一种光口连接检测方法,包括:In a first aspect, an embodiment of the present invention provides an optical port connection detection method, including:

待检测光口所在交换单板获取所述待检测光口的位置信息;The switching board where the optical port to be detected is located obtains the location information of the optical port to be detected;

所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息。The switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected.

上述方案中,所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息之后,还包括:In the above solution, after the switching board where the optical port to be detected is located sends out the position information of the optical port to be detected through the optical port to be detected, the method further includes:

所述待检测光口所在交换单板获取目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;The switching board where the optical port to be detected is located obtains the position information of the target optical port, and the target optical port is the optical port that receives the position information of the optical port to be detected;

所述待检测光口所在交换单板根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。The switching board where the optical port to be detected is located determines the target optical port and the optical port to be detected according to the set optical port connection topology, the location information of the target optical port, and the location information of the optical port to be detected. Check whether the connection of the port is correct.

上述方案中,还包括:The above scheme also includes:

所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is incorrect, an alarm message is sent; or,

所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,When the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is incorrect, a prompt message is sent; the prompt message carries information related to the target optical port or the optical port to be detected. The position information of the desired optical port corresponding to the port; or,

所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is correct, a link establishment request is sent through the target optical port.

上述方案中,所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息,包括:In the above solution, the switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected, including:

所述待检测光口所在交换单板确定所述待检测光口有光缆接入时,通过所述待检测光口发出所述待检测光口的位置信息;或,When the switching board where the optical port to be detected is located determines that the optical port to be detected has an optical cable connected to it, the location information of the optical port to be detected is sent out through the optical port to be detected; or,

所述待检测光口所在交换单板以设定时间间隔通过所述待检测光口发出所述待检测光口的位置信息。The switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected at a set time interval.

上述方案中,所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息,包括:In the above solution, the switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected, including:

所述待检测光口所在交换单板封装所述待检测光口的位置信息至设置的探测报文,通过所述待检测光口发出所述探测报文;或者,The switching board where the optical port to be detected is located encapsulates the location information of the optical port to be detected into a set detection packet, and sends the detection packet through the optical port to be detected; or,

所述待检测光口所在交换单板按照设置的编码方式对所述待检测光口的位置信息进行编码,生成码流,通过所述待检测光口发出所述码流。The switching board where the optical port to be detected is located encodes the location information of the optical port to be detected according to the set encoding mode, generates a code stream, and sends the code stream through the optical port to be detected.

第二方面,本发明实施例提供了一种光口连接检测方法,包括:In a second aspect, an embodiment of the present invention provides an optical port connection detection method, including:

目标光口所在交换单板获取待检测光口的位置信息和目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;The switching board where the target optical port is located obtains the position information of the optical port to be detected and the position information of the target optical port, and the target optical port is the optical port that receives the position information of the optical port to be detected;

所述目标光口所在交换单板根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。The switching board where the target optical port is located determines the target optical port and the to-be-detected optical port according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port connection is correct.

上述方案中,所述目标光口所在交换单板获取待检测光口的位置信息和目标光口的位置信息之后,还包括:In the above solution, after the switching board where the target optical port is located obtains the position information of the optical port to be detected and the position information of the target optical port, the method further includes:

所述目标光口所在交换单板通过所述目标光口发出所述目标光口的位置信息。The switching board where the target optical port is located sends the position information of the target optical port through the target optical port.

上述方案中,还包括:The above scheme also includes:

所述目标光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is incorrect, an alarm message is sent; or,

所述目标光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,When the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is incorrect, a prompt message is sent; the prompt message carries the information related to the target optical port or the to-be-detected optical port The position information of the corresponding desired optical port; or,

所述目标光口所在交换单板确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is correct, a link establishment request is sent through the target optical port.

上述方案中,所述目标光口所在交换单板获取待检测光口的位置信息,包括:In the above solution, the switching board where the target optical port is located obtains the location information of the optical port to be detected, including:

所述目标光口所在交换单板对接收到的所述待检测光口所在交换单板发送的探测报文进行解析,获得待检测光口的位置信息;或者,The switching board where the target optical port is located parses the received detection message sent by the switching board where the optical port to be detected is located to obtain location information of the optical port to be detected; or,

所述目标光口所在交换单板对接收到的所述待检测光口所在交换单板发送的码流进行解码,获得待检测光口的位置信息。The switching board where the target optical port is located decodes the received code stream sent by the switching board where the optical port to be detected is located, and obtains location information of the optical port to be detected.

第三方面,本发明实施例提供了一种交换单板,包括:In a third aspect, an embodiment of the present invention provides a switching board, including:

第一获取单元,用于获取待检测光口的位置信息;a first acquisition unit, configured to acquire position information of the optical port to be detected;

第一发送单元,用于通过所述待检测光口发出所述待检测光口的位置信息。The first sending unit is configured to send the position information of the optical port to be detected through the optical port to be detected.

第四方面,本发明实施例提供了一种交换单板,包括:In a fourth aspect, an embodiment of the present invention provides a switching board, including:

第二获取单元,用于获取待检测光口的位置信息和目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;a second acquisition unit, configured to acquire the position information of the optical port to be detected and the position information of the target optical port, where the target optical port is the optical port that receives the position information of the optical port to be detected;

检测单元,用于根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。A detection unit, configured to determine whether the connection between the target optical port and the to-be-detected optical port is correct according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port .

第五方面,本发明实施例提供了一种交换单板,所述交换单板包括处理器和用于存储能够在处理器上运行的计算机程序的存储器;其中,In a fifth aspect, an embodiment of the present invention provides a switching board, where the switching board includes a processor and a memory for storing a computer program that can run on the processor; wherein,

所述处理器用于运行所述计算机程序时,执行第一方面所述光口连接检测方法的步骤。The processor is configured to execute the steps of the optical port connection detection method of the first aspect when running the computer program.

第六方面,本发明实施例提供了一种交换单板,所述交换单板包括处理器和用于存储能够在处理器上运行的计算机程序的存储器;其中,In a sixth aspect, an embodiment of the present invention provides a switch board, the switch board includes a processor and a memory for storing a computer program that can run on the processor; wherein,

所述处理器用于运行所述计算机程序时,执行第二方面所述光口连接检测方法的步骤。The processor is configured to execute the steps of the optical port connection detection method of the second aspect when running the computer program.

第七方面,本发明实施例提供了一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现第一方面或第二方面所述光口连接检测方法的步骤。In a seventh aspect, an embodiment of the present invention provides a computer storage medium, where a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the optical port connection detection of the first aspect or the second aspect is implemented steps of the method.

上述实施例所提供的光口连接检测方法、交换单板及计算机存储介质,待检测光口所在交换单板获取所述待检测光口的位置信息,并通过所述待检测光口向目标光口发出所述待检测光口的位置信息,则目标光口所在交换单板或待检测光口所在交换单板能够根据接收到的待检测光口的位置信息以及光口连接拓扑关系,来检测所述待检测光口与所述目标光口的连接是否正确,即通过交换单板就可以完成对所述待检测光口与所述目标光口的连接是否正确的检测,降低了对光口连接进行检测的复杂度和提高了对光口连接进行检测的可靠性。In the optical port connection detection method, the switching veneer and the computer storage medium provided by the above embodiments, the switching veneer where the optical port to be detected is located acquires the position information of the optical port to be detected, and sends the target optical port to the target optical port through the optical port to be detected. If the position information of the optical port to be detected is sent from the port, the switching board where the target optical port is located or the switching board where the optical port to be detected is located can detect the optical port according to the received position information of the optical port to be detected and the connection topology of the optical port. Whether the connection between the optical port to be detected and the target optical port is correct, that is, the detection of whether the connection between the optical port to be detected and the target optical port is correct can be completed by exchanging single boards, which reduces the need for the optical port. The complexity of the connection detection and the reliability of the detection of the optical port connection are improved.

附图说明Description of drawings

图1为本发明一实施例中光口连接检测方法的流程示意图;FIG. 1 is a schematic flowchart of a method for detecting an optical port connection according to an embodiment of the present invention;

图2为本发明另一实施例中光口连接检测方法的流程示意图;2 is a schematic flowchart of a method for detecting an optical port connection according to another embodiment of the present invention;

图3为本发明一实施例中交换单板的结构示意图;FIG. 3 is a schematic structural diagram of a switching board in an embodiment of the present invention;

图4为本发明另一实施例中交换单板的结构示意图;FIG. 4 is a schematic structural diagram of a switching board in another embodiment of the present invention;

图5为本发明又一实施例中交换单板的结构示意图;FIG. 5 is a schematic structural diagram of a switching board in another embodiment of the present invention;

图6为本发明一具体实施例中光口连接检测方法的流程示意图;6 is a schematic flowchart of a method for detecting an optical port connection according to a specific embodiment of the present invention;

图7为本发明一实施例中光口连接检测装置的结构示意图。FIG. 7 is a schematic structural diagram of an optical port connection detection device according to an embodiment of the present invention.

具体实施方式Detailed ways

以下结合说明书附图及具体实施例对本发明技术方案做进一步的详细阐述。除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施例的目的,不是旨在于限制本发明。本文所使用的术语“和/或”包括一个或多个相关的所列项目的任意的和所有的组合。The technical solutions of the present invention will be further elaborated below with reference to the accompanying drawings and specific embodiments of the description. Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terms used herein in the description of the present invention are for the purpose of describing specific embodiments only, and are not intended to limit the present invention. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.

参见图1,为本发明实施例提供的一种光口连接检测方法,应用于交换单板,包括以下步骤:Referring to FIG. 1 , a method for detecting an optical port connection provided by an embodiment of the present invention, applied to a switching board, includes the following steps:

S101:待检测光口所在交换单板获取所述待检测光口的位置信息;S101: The switching board where the optical port to be detected is located acquires location information of the optical port to be detected;

可以理解地,集群路由器通常由多个核心路由器和中心连接路由器组成,而每个路由器中都包含有一个或多个交换单板(也可称为交换板卡),每个交换单板上也会包含一个或多个光口。各个光口之间的光缆连接只有满足指定的拓扑关系,才能确保集群路由器能够正常工作。当需要对某路由器中的某交换单板的光口(简称为待检测光口)进行光缆连接检测时,该交换单板(简称为待检测光口所在交换单板)获取所述待检测光口的位置信息,本实施例中,所述待检测光口的位置信息包括待检测光口的框号、槽位号和光口号。其中,所述待检测光口的框号表示待检测光口所在的机框,所述机框包括由核心路由器组成的业务核心框和由中心连接路由器组成的中心交换框;所述待检测光口的槽位号表示待检测光口所在的交换单板;所述待检测光口的光口号表示待检测光口在所述待检测光口所在的交换单板上的标识。由于每个光口都具有唯一的地址信息,也即每个光口的位置信息与光口之间具有唯一对应关系,因此,根据所述待检测光口的位置信息可唯一确定所述待检测光口。Understandably, a cluster router is usually composed of multiple core routers and center-connected routers, and each router includes one or more switching boards (also called switch boards), and each switching board is also Will contain one or more optical ports. Only when the optical cable connection between each optical port meets the specified topology relationship, can the cluster router work normally. When it is necessary to perform optical cable connection detection on an optical port of a switching board in a router (referred to as the optical port to be detected), the switching board (referred to as the switching board where the optical port to be detected is located) obtains the optical fiber to be detected. The position information of the port. In this embodiment, the position information of the optical port to be detected includes the frame number, slot number and optical port number of the optical port to be detected. The frame number of the optical port to be detected indicates the frame where the optical port to be detected is located, and the frame includes a service core frame composed of core routers and a central switch frame composed of a central connection router; the optical port to be detected is located. The slot number of the port represents the switching board where the optical port to be detected is located; the optical port number of the optical port to be detected represents the identification of the optical port to be detected on the switching board where the optical port to be detected is located. Since each optical port has unique address information, that is, there is a unique correspondence between the position information of each optical port and the optical port, the to-be-detected optical port can be uniquely determined according to the position information of the to-be-detected optical port Optical mouth.

这里,所述待检测光口所在交换单板获取所述待检测光口的位置信息,可以是所述待检测光口所在交换单板检测到所述待检测光口有光缆接入,即所述待检测光口所在交换单板检测到所述待检测光口有信号时,触发待检测光口的位置信息收集过程,即获取所述待检测光口的位置信息;也可以是所述待检测光口所在交换单板以设定时间间隔,触发待检测光口的位置信息收集过程。需要说明的是,所述待检测光口可以是一个光口,也可以是多个光口,本实施例中以所述待检测光口为一个光口为例。Here, the switching board where the optical port to be detected is located obtains the location information of the optical port to be detected, which may be that the switching board where the optical port to be detected is located detects that the optical port to be detected has an optical cable connected, that is, the When the switching board where the optical port to be detected is located detects that the optical port to be detected has a signal, it triggers the process of collecting the location information of the optical port to be detected, that is, the location information of the optical port to be detected is acquired; The switching board where the optical port is located is detected at a set time interval, and the process of collecting the location information of the optical port to be detected is triggered. It should be noted that, the optical port to be detected may be one optical port or multiple optical ports. In this embodiment, the optical port to be detected is an optical port as an example.

S102:所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息。S102: The switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected.

这里,所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息,可以是所述待检测光口所在交换单板检测到满足设置的发送条件时,通过所述待检测光口向目标光口发送所述待检测光口的位置信息,所述设置的发送条件可以是检测到所述待检测光口有光缆接入、或当前时间至上一次发送所述待检测光口的位置信息的时间的差值等于设定时间间隔。当所述待检测光口有光缆接入时,所述待检测光口所在交换单板通过所述待检测光口向目标光口发送所述待检测光口的位置信息,可以理解为是所述待检测光口所在交换单板通过一端插入所述待检测光口的光缆向外发送所述待检测光口的位置信息,所述目标光口为与所述光缆的另一端连接的光口。Here, the switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected, which may be when the switching board where the optical port to be detected is located detects that the set sending condition is met. , send the location information of the optical port to be detected to the target optical port through the optical port to be detected, and the set sending condition may be to detect that the optical port to be detected has optical cable access, or the current time to the last transmission The time difference of the position information of the optical port to be detected is equal to the set time interval. When the optical port to be detected is connected with an optical cable, the switching board where the optical port to be detected is located sends the location information of the optical port to be detected to the target optical port through the optical port to be detected, which can be understood as the The switching veneer where the optical port to be detected is located sends out the position information of the optical port to be detected through an optical cable whose one end is inserted into the optical port to be detected, and the target optical port is an optical port connected to the other end of the optical cable. .

需要说明的是,所述待检测光口和所述目标光口可以是位于同一路由器的同一交换单板上,所述待检测光口和所述目标光口也可以是分别位于同一路由器的不同交换单板上,所述待检测光口和所述目标光口还可以是分别位于不同路由器的交换单板上。也就是说,所述待检测光口所在交换单板与所述目标光口所在交换单板在不同的应用场景中可以是同一交换单板,也可以是不同交换单板。It should be noted that the to-be-detected optical port and the target optical port may be located on the same switch board of the same router, and the to-be-detected optical port and the target optical port may also be different ones located on the same router. On the switching board, the to-be-detected optical port and the target optical port may also be respectively located on switching boards of different routers. That is to say, the switching board where the optical port to be detected is located and the switching board where the target optical port is located may be the same switching board or different switching boards in different application scenarios.

综上,上述实施例提供的光口连接检测方法中,通过待检测光口所在交换单板向目标光口发送所述待检测光口的位置信息,而使所述目标光口所在交换单板或所述待检测光口所在交换单板根据所述待检测光口的位置信息、对所述待检测光口与所述目标光口的连接是否正确进行检测,即通过交换单板就可以完成对所述待检测光口与所述目标光口的连接是否正确的检测,降低了对光口连接进行检测的复杂度和提高了对光口连接进行检测的可靠性。To sum up, in the optical port connection detection method provided by the above embodiment, the position information of the optical port to be detected is sent to the target optical port through the switching board where the optical port to be detected is located, so that the switching board where the target optical port is located Or the switching board where the optical port to be detected is located checks whether the connection between the optical port to be detected and the target optical port is correct according to the position information of the optical port to be detected, that is, the switching board can complete the detection. The detection of whether the connection between the optical port to be detected and the target optical port is correct reduces the complexity of detecting the connection of the optical port and improves the reliability of detecting the connection of the optical port.

在一个可选的实施例中,所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息,包括:In an optional embodiment, the switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected, including:

所述待检测光口所在交换单板确定所述待检测光口有光缆接入时,通过所述待检测光口发出所述待检测光口的位置信息;或,When the switching board where the optical port to be detected is located determines that the optical port to be detected has an optical cable connected to it, the location information of the optical port to be detected is sent out through the optical port to be detected; or,

所述待检测光口所在交换单板以设定时间间隔通过所述待检测光口发出所述待检测光口的位置信息。The switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected at a set time interval.

具体地,所述待检测光口所在交换单板确定所述待检测光口有光缆接入即检测到所述待检测光口有信号时,通过所述待检测光口发出所述待检测光口的位置信息;或者,根据设定时间间隔,所述待检测光口所在交换单板以所述设定时间间隔为周期通过所述待检测光口发出所述待检测光口的位置信息。Specifically, when the switching board where the optical port to be detected is located determines that an optical cable is connected to the optical port to be detected, that is, when it detects that the optical port to be detected has a signal, the optical port to be detected emits the light to be detected through the optical port to be detected. Or, according to a set time interval, the switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected at the set time interval as a period.

如此,当所述待检测光口所在交换单板检测到所述待检测光口有光缆接入时,即通过所述待检测光口发出所述待检测光口的位置信息,提高了对光口连接进行检测的及时性和快速性。而所述待检测光口所在交换单板以设定时间间隔通过所述待检测光口发出所述待检测光口的位置信息,实现了对光口连接的周期性检测,特别是当光口的连接发生变化后,能够自动重新进行光口连接的检测。此外,也增强了对光口连接进行检测的方式多样性。In this way, when the switching board where the optical port to be detected is located detects that there is an optical cable connected to the optical port to be detected, the position information of the optical port to be detected is sent out through the optical port to be detected, which improves the optical communication efficiency. The timeliness and rapidity of port connection detection. The switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected at a set time interval, so as to realize the periodic detection of the connection of the optical port, especially when the optical port is connected. After the connection of the optical port changes, it can automatically re-detect the optical port connection. In addition, the diversity of ways to detect optical port connections is also enhanced.

在一个可选的实施例中,所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息,包括:In an optional embodiment, the switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected, including:

所述待检测光口所在交换单板封装所述待检测光口的位置信息至设置的探测报文,通过所述待检测光口发出所述探测报文;或者,The switching board where the optical port to be detected is located encapsulates the location information of the optical port to be detected into a set detection packet, and sends the detection packet through the optical port to be detected; or,

所述待检测光口所在交换单板按照设置的编码方式对所述待检测光口的位置信息进行编码,生成码流,通过所述待检测光口发出所述码流。The switching board where the optical port to be detected is located encodes the location information of the optical port to be detected according to the set encoding mode, generates a code stream, and sends the code stream through the optical port to be detected.

如此,所述待检测光口所在交换单板通过将所述待检测光口的位置信息封装至设置的探测报文、或者对所述待检测光口的位置信息进行编码,并以探测报文或码流的方式发出所述待检测光口的位置信息,能够加快所述待检测光口的位置信息向外传输的速度,节省传输时间,并且能够有效避免外界环境的干扰。In this way, the switching board where the optical port to be detected is located encapsulates the position information of the optical port to be detected into the set detection packet, or encodes the position information of the optical port to be detected, and uses the detection packet to encode the position information of the optical port to be detected. The position information of the optical port to be detected can be sent out in the form of code stream or code stream, which can speed up the outward transmission speed of the position information of the optical port to be detected, save the transmission time, and can effectively avoid the interference of the external environment.

在一个可选的实施例中,所述待检测光口所在交换单板通过所述待检测光口发出所述待检测光口的位置信息之后,该方法还包括:In an optional embodiment, after the switching board where the optical port to be detected is located sends the position information of the optical port to be detected through the optical port to be detected, the method further includes:

所述待检测光口所在交换单板获取所述目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;The switching board where the optical port to be detected is located acquires the position information of the target optical port, and the target optical port is an optical port that receives the position information of the optical port to be detected;

所述待检测光口所在交换单板根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。The switching board where the optical port to be detected is located determines the target optical port and the optical port to be detected according to the set optical port connection topology, the location information of the target optical port, and the location information of the optical port to be detected. Check whether the connection of the port is correct.

具体地,所述待检测光口所在交换单板获取目标光口的位置信息,并根据设置的光口连接拓扑关系获取所述目标光口对应的期望光口的位置信息,当所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息一致时,确定所述目标光口与所述待检测光口的连接正确;当所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息不一致时,确定所述目标光口与所述待检测光口的连接错误。或者,所述待检测光口所在交换单板获取所述目标光口的位置信息,并根据设置的光口连接拓扑关系获取所述待检测光口对应的期望光口的位置信息,当所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息一致时,确定所述目标光口与所述待检测光口的连接正确;当所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息不一致时,确定所述目标光口与所述待检测光口的连接错误。Specifically, the switching board where the optical port to be detected is located obtains the location information of the target optical port, and obtains the location information of the desired optical port corresponding to the target optical port according to the set optical port connection topology. When the position information of the optical port is consistent with the position information of the desired optical port corresponding to the target optical port, it is determined that the connection between the target optical port and the to-be-detected optical port is correct; When the position information of the desired optical port corresponding to the target optical port is inconsistent, it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect. Alternatively, the switching board where the optical port to be detected is located acquires the location information of the target optical port, and acquires the location information of the desired optical port corresponding to the optical port to be detected according to the set optical port connection topology. When the position information of the desired optical port corresponding to the optical port to be detected is consistent with the position information of the target optical port, it is determined that the connection between the target optical port and the optical port to be detected is correct; When the position information of the desired optical port is inconsistent with the position information of the target optical port, it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect.

这里,若所述待检测光口的位置信息包括待检测光口的框号、槽位号和光口号,所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息一致为所述待检测光口的框号、槽位号和光口号与所述目标光口对应的期望光口的框号、槽位号和光口号一一对应相同,所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息不一致为所述待检测光口的框号、槽位号和光口号中至少一个与所述目标光口对应的期望光口的框号、槽位号和光口号不一一对应相同;相应的,所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息一致为所述待检测光口对应的期望光口的框号、槽位号和光口号与所述目标光口的框号、槽位号和光口号一一对应相同,所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息不一致为所述待检测光口对应的期望光口的框号、槽位号和光口号中至少一个与所述目标光口的框号、槽位号和光口号不一一对应相同。Here, if the position information of the optical port to be detected includes the frame number, slot number and optical port number of the optical port to be detected, the position information of the optical port to be detected is the position information of the desired optical port corresponding to the target optical port It is consistent that the frame number, slot number and optical port number of the optical port to be detected are the same as the frame number, slot number and optical port number of the desired optical port corresponding to the target optical port, and the position of the optical port to be detected is the same. The inconsistency between the information and the position information of the desired optical port corresponding to the target optical port is that at least one of the frame number, slot number and optical port number of the optical port to be detected is the frame number of the desired optical port corresponding to the target optical port, The slot number and the optical port number are not in one-to-one correspondence; correspondingly, the position information of the desired optical port corresponding to the optical port to be detected is consistent with the position information of the target optical port, which is the desired optical port corresponding to the optical port to be detected The frame number, slot number and optical port number of the target optical port are in one-to-one correspondence with the frame number, slot number and optical port number of the target optical port, and the position information of the desired optical port corresponding to the optical port to be detected is the same as that of the target optical port. The inconsistent location information means that at least one of the frame number, slot number and optical port number of the desired optical port corresponding to the optical port to be detected is not in a one-to-one correspondence with the frame number, slot number and optical port number of the target optical port.

需要说明的是,光口之间的连接是一一对应的,即光口连接拓扑关系中指定了每个光口对应的期望光口,也就是说每个光口应该与该光口对应的期望光口连接。在实际应用中,可以以表格方式描述光口连接拓扑关系。例如,光口A是光口B唯一对应的期望光口,则可以将光口A的框号、槽位号和光口号与光口B的框号、槽位号和光口号进行绑定后形成光口A与光口B之间的连接拓扑关系,并以表格方式存储。所述光口连接拓扑关系可以根据实际情况预先进行设置并存储在交换单板中。对于所述待检测光口所在交换单板而言,可存储自身所有光口对应的连接拓扑关系,还可存储其它交换单板的光口对应的连接拓扑关系。当所述待检测光口和所述目标光口位于同一交换单板时,该交换单板获知接收到所述待检测光口的位置信息的目标光口后,可主动获取所述目标光口的位置信息。需要说明的是,当所述待检测光口和所述目标光口位于不同交换单板,所述目标光口所在交换单板确定所述目标光口有光缆接入即检测到所述目标光口有信号时,会通过所述目标光口向待检测光口发送所述目标光口的位置信息,则所述待检测光口所在交换单板获取所述目标光口的位置信息。It should be noted that the connections between optical ports are in one-to-one correspondence, that is, the desired optical port corresponding to each optical port is specified in the optical port connection topology, that is, each optical port should correspond to the optical port. Optical port connection is expected. In practical applications, the optical port connection topology can be described in a table. For example, if optical port A is the only desired optical port corresponding to optical port B, the frame number, slot number, and optical port number of optical port A can be bound to the frame number, slot number, and optical port number of optical port B to form an optical port. The connection topology relationship between port A and optical port B is stored in a table. The optical port connection topology relationship can be preset according to the actual situation and stored in the switching board. For the switching board where the optical port to be detected is located, the connection topology relationship corresponding to all the optical ports of itself can be stored, and the connection topology relationship corresponding to the optical ports of other switching boards can also be stored. When the optical port to be detected and the target optical port are located on the same switching board, the switching board can actively acquire the target optical port after knowing the target optical port that has received the position information of the optical port to be detected location information. It should be noted that when the to-be-detected optical port and the target optical port are located on different switching boards, the switching board where the target optical port is located determines that the target optical port has an optical cable connected, that is, the target optical port is detected. When the port has a signal, the position information of the target optical port will be sent to the optical port to be detected through the target optical port, and the switching board where the optical port to be detected is located obtains the position information of the target optical port.

如此,当所述待检测光口和所述目标光口位于同一交换单板时,所述同一交换单板即可根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,从而确定所述目标光口与所述待检测光口的连接是否正确,对光口连接的检测可以都在同一交换单板上完成;当所述待检测光口和所述目标光口位于不同交换单板,也可以由所述待检测光口所在交换单板或所述目标光口所在交换单板完成检测,通过由交换单板直接实现光口连接的检测,避免了引入第三方进行检测所带来的延时和外界干扰问题,不仅检测过程简单、检测速度快,而且可靠性高。In this way, when the to-be-detected optical port and the target optical port are located on the same switching board, the same switching board can be connected according to the set optical port connection topology, the location information of the target optical port and the The position information of the optical port to be detected, so as to determine whether the connection between the target optical port and the optical port to be detected is correct, and the detection of the optical port connection can be completed on the same switching board; The target optical port is located on a different switching board, and the detection can also be completed by the switching board where the optical port to be detected is located or the switching board where the target optical port is located, and the detection of the connection of the optical port is directly realized by the switching board. , avoiding the delay and external interference caused by the introduction of a third party for detection, not only the detection process is simple, the detection speed is fast, but also the reliability is high.

在一个可选的实施例中,该方法还包括:In an optional embodiment, the method further includes:

所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is incorrect, an alarm message is sent; or,

所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,When the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is incorrect, a prompt message is sent; the prompt message carries information related to the target optical port or the optical port to be detected. The position information of the desired optical port corresponding to the port; or,

所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is correct, a link establishment request is sent through the target optical port.

这里,所述发出告警消息可以是所述待检测光口所在交换单板通过命令行方式发出所述目标光口与所述待检测光口的连接错误消息,以在用户远程登录集群路由器的显示界面显示所述目标光口与所述待检测光口的连接错误消息。所述发出告警消息也可以是向用户直接发送告警消息,以告知所述目标光口与所述待检测光口的连接错误。所述发出告警消息还可以是触发设置的指示灯点亮,以告知所述目标光口与所述待检测光口的连接错误。例如,假设交换单板上为每个光口对应设置了连接状态指示灯,当光口连接正确时,不点亮该光口对应的连接状态指示灯;当光口连接错误时,点亮该光口对应的连接状态指示灯。所述待检测光口所在交换单板通过所述目标光口发出建链请求,可以理解为所述待检测光口所在交换单板通过所述目标光口向所述待检测光口发送设置的一大流量报文,以告知所述目标光口与所述待检测光口的连接正确。所述待检测光口所在交换单板通过所述目标光口发出建链请求,可以看作是控制所述目标光口与所述待检测光口的光缆链路建链。所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出携带有与所述目标光口对应的期望光口的位置信息或与所述待检测光口对应的期望光口的位置信息的提示消息,以告知用户根据所述提示消息实现光口之间的正确连接。此外,当所述待检测光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,不通过所述目标光口发出建链请求,可以看作是控制所述目标光口与所述待检测光口之间的光缆链路复位,以避免出现在光缆插错而光缆建链成功后出现丢包或业务中断的情况。Here, the sending an alarm message may be that the switching board where the optical port to be detected is located sends a connection error message between the target optical port and the optical port to be detected through a command line, so as to be displayed on the user's remote login to the cluster router. The interface displays a connection error message between the target optical port and the to-be-detected optical port. The sending an alarm message may also be sending an alarm message directly to the user, so as to inform the connection error between the target optical port and the to-be-detected optical port. The sending of the alarm message may also trigger the lighting of a set indicator light to inform that the connection between the target optical port and the to-be-detected optical port is incorrect. For example, suppose that a connection status indicator is set for each optical port on the switch board. When the optical port is connected correctly, the connection status indicator corresponding to the optical port is not lit; when the optical port is incorrectly connected, the connection status indicator is lit. The connection status indicator corresponding to the optical port. The switch board where the optical port to be detected is located sends a link establishment request through the target optical port, which can be understood as the switching board where the optical port to be detected is located sends the set up request to the optical port to be detected through the target optical port. A large flow of packets is sent to inform that the target optical port and the to-be-detected optical port are correctly connected. The switching board where the optical port to be detected sends a link establishment request through the target optical port can be regarded as controlling the establishment of a link between the optical cable link between the target optical port and the optical port to be detected. When the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is incorrect, it sends out the position information that carries the desired optical port corresponding to the target optical port or is related to the optical port to be detected. The prompt message of the position information of the desired optical port corresponding to the optical port is detected, so as to inform the user to realize the correct connection between the optical ports according to the prompt message. In addition, when the switching board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is incorrect, it does not send a link establishment request through the target optical port, which can be regarded as controlling the The optical cable link between the target optical port and the to-be-detected optical port is reset to avoid packet loss or service interruption after the optical cable is inserted incorrectly and the optical cable is successfully established.

如此,当所述目标光口与所述待检测光口的连接错误,即光缆插错时,通过发出告警、提示消息等方式提示光缆插错,提示方式直观,且提示效果好。当所述目标光口与所述待检测光口的连接正确即光缆未插错时,控制所述光缆链路建链,而当所述目标光口与所述待检测光口的连接错误即光缆插错时,控制所述光缆链路复位,避免出现在光缆插错而光缆链路建链成功后出现丢包或业务中断的情况,提高了检测的灵活性。In this way, when the connection between the target optical port and the to-be-detected optical port is wrong, that is, when the optical cable is inserted incorrectly, an alarm, a prompt message, etc. are issued to indicate that the optical cable is incorrectly inserted. The prompting method is intuitive and the prompting effect is good. When the connection between the target optical port and the to-be-detected optical port is correct, that is, the optical cable is not inserted incorrectly, control the optical cable link to establish a link, and when the target optical port and the to-be-detected optical port are connected incorrectly, that is, the optical cable When wrongly inserted, the optical cable link is controlled to reset, so as to avoid the situation of packet loss or service interruption after the optical cable is inserted incorrectly and the optical cable link is successfully established, thereby improving the flexibility of detection.

参见图2,为本发明实施例提供的一种光口连接检测方法,应用于交换单板,包括以下步骤:Referring to FIG. 2, an optical port connection detection method provided by an embodiment of the present invention, applied to a switching board, includes the following steps:

S201:目标光口所在交换单板获取待检测光口的位置信息和目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;S201: The switching board where the target optical port is located obtains the position information of the optical port to be detected and the position information of the target optical port, where the target optical port is the optical port that receives the position information of the optical port to be detected;

具体地,当所述待检测光口和所述目标光口位于不同交换单板,即所述待检测光口所在交换单板与所述目标光口所在交换单板为不同交换单板时,目标光口所在交换单板接收待检测光口所在交换单板发送的待检测光口的位置信息、以及获取目标光口的位置信息。Specifically, when the optical port to be detected and the target optical port are located on different switching boards, that is, when the switching board where the optical port to be detected is located and the switching board where the target optical port is located are different switching boards, The switching board where the target optical port is located receives the location information of the optical port to be detected sent by the switching board where the optical port to be detected is located, and acquires the location information of the target optical port.

S202:所述目标光口所在交换单板根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。S202: The switching board where the target optical port is located determines the target optical port and the to-be-detected optical port according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port Whether the connection of the optical port is correct.

具体地,所述目标光口所在交换单板根据设置的光口连接拓扑关系获取所述目标光口对应的期望光口的位置信息,当所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息一致时,确定所述目标光口与所述待检测光口的连接正确;当所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息不一致时,确定所述目标光口与所述待检测光口的连接错误。或者,目标光口所在交换单板根据设置的光口连接拓扑关系获取所述待检测光口对应的期望光口的位置信息,当所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息一致时,确定所述目标光口与所述待检测光口的连接正确;当所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息不一致时,确定所述目标光口与所述待检测光口的连接错误。Specifically, the switching board where the target optical port is located obtains the position information of the desired optical port corresponding to the target optical port according to the set optical port connection topology. When the position information of the desired optical port corresponding to the target optical port is consistent, it is determined that the connection between the target optical port and the to-be-detected optical port is correct; when the location information of the to-be-detected optical port and the desired optical port corresponding to the target optical port When the location information is inconsistent, it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect. Alternatively, the switching board where the target optical port is located obtains the position information of the desired optical port corresponding to the optical port to be detected according to the set optical port connection topology. When the position information of the target optical port is consistent, it is determined that the connection between the target optical port and the to-be-detected optical port is correct; when the position information of the desired optical port corresponding to the to-be-detected optical port and the position of the target optical port When the information is inconsistent, it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect.

这里,若所述待检测光口的位置信息包括待检测光口的框号、槽位号和光口号,所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息一致为所述待检测光口的框号、槽位号和光口号与所述目标光口对应的期望光口的框号、槽位号和光口号一一对应相同,所述待检测光口的位置信息与所述目标光口对应的期望光口的位置信息不一致为所述待检测光口的框号、槽位号和光口号中至少一个与所述目标光口对应的期望光口的框号、槽位号和光口号不一一对应相同;相应的,所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息一致为所述待检测光口对应的期望光口的框号、槽位号和光口号与所述目标光口的框号、槽位号和光口号一一对应相同,所述待检测光口对应的期望光口的位置信息与所述目标光口的位置信息不一致为所述待检测光口对应的期望光口的框号、槽位号和光口号中至少一个与所述目标光口的框号、槽位号和光口号不一一对应相同。Here, if the position information of the optical port to be detected includes the frame number, slot number and optical port number of the optical port to be detected, the position information of the optical port to be detected is the position information of the desired optical port corresponding to the target optical port It is consistent that the frame number, slot number and optical port number of the optical port to be detected are the same as the frame number, slot number and optical port number of the desired optical port corresponding to the target optical port, and the position of the optical port to be detected is the same. The inconsistency between the information and the position information of the desired optical port corresponding to the target optical port is that at least one of the frame number, slot number and optical port number of the optical port to be detected is the frame number of the desired optical port corresponding to the target optical port, The slot number and the optical port number are not in one-to-one correspondence; correspondingly, the position information of the desired optical port corresponding to the optical port to be detected is consistent with the position information of the target optical port, which is the desired optical port corresponding to the optical port to be detected The frame number, slot number and optical port number of the target optical port are in one-to-one correspondence with the frame number, slot number and optical port number of the target optical port, and the position information of the desired optical port corresponding to the optical port to be detected is the same as that of the target optical port. The inconsistent location information means that at least one of the frame number, slot number and optical port number of the desired optical port corresponding to the optical port to be detected is not in a one-to-one correspondence with the frame number, slot number and optical port number of the target optical port.

需要说明的是,光口之间的连接是一一对应的,即光口连接拓扑关系中指定了每个光口唯一对应的期望光口,也就是说每个光口必须与该光口对应的期望光口连接。在实际应用中,可以以表格方式描述光口连接拓扑关系。例如,光口A是光口B唯一可对应连接的期望光口,则可以将光口A的框号、槽位号和光口号与光口B的框号、槽位号和光口号进行绑定后形成光口A与光口B之间的连接拓扑关系,并以表格方式存储。所述光口连接拓扑关系可以根据实际情况预先进行设置并存储在交换单板中。对于所述目标光口所在交换单板而言,可存储自身所有光口对应的连接拓扑关系,也可存储其它交换单板的光口对应的连接拓扑关系。It should be noted that the connections between optical ports are in one-to-one correspondence, that is, the optical port connection topology specifies the only desired optical port corresponding to each optical port, that is, each optical port must correspond to this optical port. the desired optical port connection. In practical applications, the optical port connection topology can be described in a table. For example, if optical port A is the only desired optical port that can be connected to optical port B, you can bind the frame number, slot number, and optical port number of optical port A with the frame number, slot number, and optical port number of optical port B. The connection topology relationship between optical port A and optical port B is formed and stored in a table. The optical port connection topology relationship can be preset according to the actual situation and stored in the switching board. For the switching board where the target optical port is located, the connection topology relationship corresponding to all the optical ports of itself may be stored, and the connection topology relationship corresponding to the optical ports of other switching boards may also be stored.

如此,当所述待检测光口和所述目标光口位于不同交换单板时,所述目标光口所在交换单板根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,从而确定所述目标光口与所述待检测光口的连接是否正确,通过由交换单板直接实现光口连接的检测,避免了引入第三方进行检测所带来的延时和外界干扰问题,不仅检测过程简单、检测速度快,而且可靠性高。In this way, when the to-be-detected optical port and the target optical port are located on different switching boards, the switching board where the target optical port is located is based on the set optical port connection topology, the location information of the target optical port and the The position information of the optical port to be detected is used to determine whether the connection between the target optical port and the optical port to be detected is correct. Due to the delay and external interference, not only the detection process is simple, the detection speed is fast, but also the reliability is high.

在一个可选的实施例中,该方法还包括:In an optional embodiment, the method further includes:

所述目标光口所在交换单板通过所述目标光口发出所述目标光口的位置信息。The switching board where the target optical port is located sends the position information of the target optical port through the target optical port.

这里,所述目标光口所在交换单板通过所述目标光口发出所述目标光口的位置信息,可以理解为所述目标光口所在交换单板通过所述目标光口向待检测光口发送所述目标光口的位置信息。所述目标光口所在交换单板通过所述目标光口向待检测光口发送所述目标光口的位置信息,可以是所述目标光口所在交换单板检测到满足设置的发送条件时,通过所述目标光口向待检测光口发送所述目标光口的位置信息,所述设置的发送条件可以是检测到所述目标光口有光缆接入、或当前时间至上一次发送所述目标光口的位置信息的时间的差值等于设定时间间隔。当所述目标光口有光缆接入时,所述目标光口所在交换单板通过所述目标光口向待检测光口发送所述目标光口的位置信息,可以理解为是所述目标光口所在交换单板通过一端插入所述目标光口的光缆向外发送所述目标光口的位置信息。Here, the switching board where the target optical port is located sends the location information of the target optical port through the target optical port, which can be understood as the switching board where the target optical port is located to the optical port to be detected through the target optical port Send the location information of the target optical port. The switching board where the target optical port is located sends the location information of the target optical port to the optical port to be detected through the target optical port, which may be when the switching board where the target optical port is located detects that the set sending condition is met, The location information of the target optical port is sent to the optical port to be detected through the target optical port. The set sending condition may be that it is detected that the target optical port is connected to an optical cable, or the target is sent from the current time to the last time. The time difference of the position information of the optical port is equal to the set time interval. When an optical cable is connected to the target optical port, the switching board where the target optical port is located sends the location information of the target optical port to the optical port to be detected through the target optical port, which can be understood as the target optical port. The switch board where the port is located sends out the location information of the target optical port through an optical cable whose one end is inserted into the target optical port.

如此,目标光口所在交换单板通过所述目标光口发出所述目标光口的位置信息,而使所述目标光口所在交换单板或所述待检测光口所在交换单板根据所述目标光口的位置信息对所述待检测光口与所述目标光口的连接是否正确进行检测,即通过交换单板就可以完成对所述待检测光口与所述目标光口的连接是否正确的检测,降低了对光口连接进行检测的复杂度和提高了对光口连接进行检测的可靠性。In this way, the switching board where the target optical port is located sends the location information of the target optical port through the target optical port, so that the switching board where the target optical port is located or the switching board where the optical port to be detected is located according to the The position information of the target optical port detects whether the connection between the to-be-detected optical port and the target optical port is correct, that is, the connection between the to-be-detected optical port and the target optical port can be completed by exchanging a single board. Correct detection reduces the complexity of detecting the connection of the optical port and improves the reliability of detecting the connection of the optical port.

在一个可选的实施例中,该方法还包括:In an optional embodiment, the method further includes:

所述目标光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is incorrect, an alarm message is sent; or,

所述目标光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息的提示消息;或,When the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is incorrect, it sends out the position carrying the desired optical port corresponding to the target optical port or the to-be-detected optical port informational alert messages; or,

所述目标光口所在交换单板确定所述目标光口与所述待检测光口之间的连接正确时,通过所述目标光口发出建链请求。When the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is correct, a link establishment request is sent through the target optical port.

这里,所述发出告警消息可以是通过命令行方式发出所述目标光口与所述待检测光口之间的连接错误消息,以在用户远程登录集群路由器的显示界面显示所述目标光口与所述待检测光口的连接错误消息。所述发出告警消息也可以是向用户直接发送告警消息,以告知所述目标光口与所述待检测光口的连接错误。所述发出告警消息还可以是触发设置的指示灯点亮,以告知所述目标光口与所述待检测光口的连接错误。例如,假设交换单板上为每个光口对应设置了连接状态指示灯,当光口连接正确时,不点亮该光口对应的连接状态指示灯;当光口连接错误时,点亮该光口对应的连接状态指示灯。所述目标光口所在交换单板通过所述目标光口发出建链请求,可以理解为所述目标光口所在交换单板通过所述目标光口向所述待检测光口发送设置的一大流量报文,以告知所述目标光口与所述待检测光口的连接正确。所述目标光口所在交换单板通过所述目标光口发出建链请求,可以看作是控制所述目标光口与所述待检测光口之间的光缆链路建链。所述目标光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,发出携带有与所述目标光口对应的期望光口的位置信息或所述待检测光口对应的期望光口的位置信息的提示消息,以告知用户根据所述提示消息改变光口之间的连接。此外,当所述目标光口所在交换单板确定所述目标光口与所述待检测光口的连接错误时,不通过所述目标光口发出建链请求,可以看作是控制所述目标光口与所述待检测光口之间的光缆链路复位,以避免出现在光缆插错而光缆链路建链成功后出现丢包或业务中断的情况。Here, the sending an alarm message may be sending a connection error message between the target optical port and the to-be-detected optical port through a command line, so as to display the target optical port and the target optical port on the display interface of the user logging in to the cluster router remotely. The connection error message of the optical port to be detected. The sending an alarm message may also be sending an alarm message directly to the user, so as to inform the connection error between the target optical port and the to-be-detected optical port. The sending of the alarm message may also trigger the lighting of a set indicator light to inform that the connection between the target optical port and the to-be-detected optical port is incorrect. For example, suppose that a connection status indicator is set for each optical port on the switch board. When the optical port is connected correctly, the connection status indicator corresponding to the optical port is not lit; when the optical port is incorrectly connected, the connection status indicator is lit. The connection status indicator corresponding to the optical port. The switching board where the target optical port is located sends a link establishment request through the target optical port. A traffic packet is sent to inform that the target optical port is correctly connected to the to-be-detected optical port. The switching board where the target optical port is located sends a link establishment request through the target optical port, which can be regarded as controlling the establishment of a link of an optical cable link between the target optical port and the to-be-detected optical port. When the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is incorrect, it sends out the position information carrying the desired optical port corresponding to the target optical port or the to-be-detected optical port. A prompt message of the position information of the desired optical port corresponding to the port is displayed, so as to inform the user to change the connection between the optical ports according to the prompt message. In addition, when the switching board where the target optical port is located determines that the connection between the target optical port and the to-be-detected optical port is incorrect, it does not send a link establishment request through the target optical port, which can be regarded as controlling the target optical port. The optical cable link between the optical port and the optical port to be detected is reset, so as to avoid the situation of packet loss or service interruption after the optical cable is inserted incorrectly and the optical cable link is successfully established.

如此,当所述目标光口与所述待检测光口的连接错误即光缆插错时,通过发出告警、提示消息等方式提示光缆插错,提示方式直观,且提示效果好。当所述目标光口与所述待检测光口的连接正确即光缆未插错时,控制所述光缆链路建链,而当所述目标光口与所述待检测光口的连接错误即光缆插错时,控制所述光缆链路复位,避免出现在光缆插错而光缆链路建链成功后出现丢包或业务中断的情况,提高了检测的灵活性。In this way, when the connection between the target optical port and the to-be-detected optical port is incorrect, that is, the optical cable is incorrectly inserted, an alarm, a prompt message, etc. are issued to prompt the optical cable to be incorrectly inserted. The prompting method is intuitive and the prompting effect is good. When the connection between the target optical port and the to-be-detected optical port is correct, that is, the optical cable is not inserted incorrectly, control the optical cable link to establish a link, and when the target optical port and the to-be-detected optical port are connected incorrectly, that is, the optical cable When wrongly inserted, the optical cable link is controlled to reset, so as to avoid the situation of packet loss or service interruption after the optical cable is inserted incorrectly and the optical cable link is successfully established, thereby improving the flexibility of detection.

在一个可选的实施例中,所述目标光口所在交换单板获取所述待检测光口的位置信息,包括:In an optional embodiment, the switching board where the target optical port is located acquires the location information of the optical port to be detected, including:

所述目标光口所在交换单板对接收到的所述待检测光口所在交换单板发送的探测报文进行解析,获得待检测光口的位置信息;或者,The switching board where the target optical port is located parses the received detection message sent by the switching board where the optical port to be detected is located to obtain location information of the optical port to be detected; or,

所述目标光口所在交换单板对接收到的所述待检测光口所在交换单板发送的码流进行解码,获得待检测光口的位置信息。The switching board where the target optical port is located decodes the received code stream sent by the switching board where the optical port to be detected is located, and obtains location information of the optical port to be detected.

这里,当所述待检测光口所在交换单板是通过将所述待检测光口的位置信息封装至设置的探测报文或者对所述待检测光口的位置信息进行编码,并以探测报文或码流的方式将所述待检测光口的位置信息通过待检测光口发送给目标光口时,所述目标光口所在交换单板相应的对接收到的探测报文进行解析或对码流进行解码,从而获得待检测光口的位置信息。如此,能够有效避免外界环境的干扰。Here, when the switching board where the optical port to be detected is located, the location information of the optical port to be detected is encapsulated into the set detection packet or the position information of the optical port to be detected is encoded, and the detection packet is used to encode the position information of the optical port to be detected. When the position information of the optical port to be detected is sent to the target optical port through the optical port to be detected in the form of text or code stream, the switching board where the target optical port is located will parse or analyze the received detection packet correspondingly. The code stream is decoded to obtain the position information of the optical port to be detected. In this way, the interference of the external environment can be effectively avoided.

为实现上述方法,本发明实施例还提供了一种交换单板,如图3所示,该交换单板包括:第一获取单元10和第一发送单元11;其中,To implement the above method, an embodiment of the present invention further provides a switching board. As shown in FIG. 3 , the switching board includes: a first acquiring unit 10 and a first sending unit 11; wherein,

所述第一获取单元10,用于获取待检测光口的位置信息;The first obtaining unit 10 is configured to obtain the position information of the optical port to be detected;

所述第一发送单元11,用于通过所述待检测光口发出所述待检测光口的位置信息。The first sending unit 11 is configured to send the position information of the optical port to be detected through the optical port to be detected.

综上,上述实施例提供的交换单板中,通过向目标光口发送所述待检测光口的位置信息,而使所述目标光口所在交换单板或所述待检测光口所在交换单板根据所述待检测光口的位置信息、对所述待检测光口与所述目标光口的连接是否正确进行检测,即通过交换单板就可以完成对所述待检测光口与所述目标光口的连接是否正确的检测,降低了对光口连接进行检测的复杂度和提高了对光口连接进行检测的可靠性。To sum up, in the switching board provided by the above-mentioned embodiments, by sending the position information of the optical port to be detected to the target optical port, the switching board where the target optical port is located or the switching board where the optical port to be detected is located. The board detects whether the connection between the optical port to be detected and the target optical port is correct according to the position information of the optical port to be detected. The detection of whether the connection of the target optical port is correct reduces the complexity of detecting the connection of the optical port and improves the reliability of detecting the connection of the optical port.

在一个可选的实施例中,该交换单板还包括:判断单元12;其中,In an optional embodiment, the switching board further includes: a judging unit 12; wherein,

所述第一获取单元10,还用于获取目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;The first acquisition unit 10 is further configured to acquire position information of a target optical port, where the target optical port is an optical port that receives the position information of the to-be-detected optical port;

所述判断单元12,用于根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。The judging unit 12 is configured to determine the relationship between the target optical port and the to-be-detected optical port according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port. Is the connection correct.

如此,通过由交换单板直接实现光口连接的检测,避免了引入第三方进行检测所带来的延时和外界干扰问题,不仅检测过程简单、检测速度快,而且可靠性高。In this way, the detection of the optical port connection is directly realized by the switching board, which avoids the delay and external interference caused by the introduction of a third party for detection. The detection process is simple, the detection speed is fast, and the reliability is high.

在一个可选的实施例中,In an optional embodiment,

所述第一发送单元11,还用于确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。The first sending unit 11 is further configured to issue an alarm message when it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect; or, to determine the connection between the target optical port and the to-be-detected optical port When an error occurs, a prompt message is sent; the prompt message carries the position information of the desired optical port corresponding to the target optical port or the to-be-detected optical port; or, to determine the target optical port and the to-be-detected optical port When the connection is correct, a link establishment request is sent through the target optical port.

如此,当所述目标光口与所述待检测光口之间的连接错误,即光缆插错时,通过发出告警、提示消息等方式提示光缆插错,提示方式直观,且提示效果好。当所述目标光口与所述待检测光口之间的连接正确即光缆未插错时,控制所述光缆链路建链,而当所述目标光口与所述待检测光口之间的连接错误即光缆插错时,控制所述光缆链路复位,避免出现在光缆插错而光缆链路建链成功后出现丢包或业务中断的情况,提高了检测的灵活性。In this way, when the connection between the target optical port and the to-be-detected optical port is incorrect, that is, when the optical cable is inserted incorrectly, an alarm, a prompt message, etc. are issued to indicate that the optical cable is incorrectly inserted. The prompting method is intuitive and the prompting effect is good. When the connection between the target optical port and the to-be-detected optical port is correct, that is, the optical cable is not inserted incorrectly, the optical cable link is controlled to establish a link, and when the connection between the target optical port and the to-be-detected optical port is When the connection is wrong, that is, when the optical cable is inserted incorrectly, the optical cable link is controlled to reset, so as to avoid the situation of packet loss or service interruption after the optical cable is inserted incorrectly and the optical cable link is successfully established, and the flexibility of detection is improved.

在一个可选的实施例中,所述第一发送单元11,具体用于:In an optional embodiment, the first sending unit 11 is specifically configured to:

确定所述待检测光口有光缆接入时,通过所述待检测光口发出所述待检测光口的位置信息;或,以设定时间间隔通过所述待检测光口发出所述待检测光口的位置信息。When it is determined that an optical cable is connected to the optical port to be detected, the position information of the optical port to be detected is sent through the optical port to be detected; or, the optical port to be detected is sent out through the optical port to be detected at a set time interval Location information of the optical port.

如此,当检测到所述待检测光口有光缆接入时,便通过所述待检测光口发出所述待检测光口的位置信息,提高了对光口之间连接进行检测的及时性和快速性。而以设定时间间隔通过所述待检测光口发出所述待检测光口的位置信息,实现了对光口之间连接的周期性检测,特别是当光口之间的连接发生变化后,能够自动重新进行光口之间连接的检测。此外,也增强了对光口之间连接进行检测的方式多样性。In this way, when it is detected that an optical cable is connected to the optical port to be detected, the position information of the optical port to be detected is sent out through the optical port to be detected, which improves the timeliness and efficiency of detecting the connection between the optical ports. rapidity. The position information of the optical port to be detected is sent out through the optical port to be detected at a set time interval, so as to realize the periodic detection of the connection between the optical ports, especially when the connection between the optical ports changes, Can automatically re-detect the connection between optical ports. In addition, the diversity of ways to detect connections between optical ports is also enhanced.

在一个可选的实施例中,该交换单板还包括:第一处理单元13;其中,In an optional embodiment, the switching board further includes: a first processing unit 13; wherein,

所述第一处理单元13,用于封装所述待检测光口的位置信息至设置的探测报文;或者,按照设置的编码方式对所述待检测光口的位置信息进行编码,生成码流;The first processing unit 13 is used to encapsulate the position information of the optical port to be detected into the set detection message; or, encode the position information of the optical port to be detected according to the set encoding mode to generate a code stream ;

所述第一发送单元11,还用于通过所述待检测光口向目标光口发送所述探测报文;或者,通过所述待检测光口向目标光口发送所述码流。The first sending unit 11 is further configured to send the detection packet to the target optical port through the to-be-detected optical port; or, to send the code stream to the target optical port through the to-be-detected optical port.

如此,通过将所述待检测光口的位置信息封装至设置的探测报文、或者对所述待检测光口的位置信息进行编码,并以探测报文或码流的方式发出所述待检测光口的位置信息,能够加快所述待检测光口的位置信息向外传输的速度,节省传输时间,并且能够有效避免外界环境的干扰。In this way, by encapsulating the position information of the optical port to be detected into a set detection message, or by encoding the position information of the optical port to be detected, the to-be-detected port is sent out in the form of a detection message or a code stream. The position information of the optical port can speed up the outward transmission speed of the position information of the optical port to be detected, save the transmission time, and can effectively avoid the interference of the external environment.

为实现上述方法,本发明实施例还提供了一种交换单板,如图4所示,该交换单板包括:第二获取单元20和检测单元21;其中,To implement the above method, an embodiment of the present invention further provides a switching board. As shown in FIG. 4 , the switching board includes: a second acquisition unit 20 and a detection unit 21 ; wherein,

所述第二获取单元20,用于获取待检测光口的位置信息和目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;The second acquisition unit 20 is configured to acquire the position information of the optical port to be detected and the position information of the target optical port, where the target optical port is the optical port that receives the position information of the optical port to be detected;

所述检测单元21,用于根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。The detection unit 21 is configured to determine the relationship between the target optical port and the to-be-detected optical port according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port. Is the connection correct.

如此,当所述待检测光口和所述目标光口位于不同交换单板时,根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,从而确定所述目标光口与所述待检测光口的连接是否正确,通过由交换单板直接实现光口连接的检测,避免了引入第三方进行检测所带来的延时和外界干扰问题,不仅检测过程简单、检测速度快,而且可靠性高。In this way, when the optical port to be detected and the target optical port are located on different switching boards, according to the set optical port connection topology, the location information of the target optical port and the location information of the optical port to be detected, Therefore, it is determined whether the connection between the target optical port and the to-be-detected optical port is correct, and the detection of the connection of the optical port is directly realized by the switching single board, avoiding the delay and external interference caused by introducing a third party to perform the detection. Not only the detection process is simple, the detection speed is fast, but also the reliability is high.

在一个可选的实施例中,该交换单板还包括:第二发送单元22,用于通过所述目标光口发出所述目标光口的位置信息。In an optional embodiment, the switching board further includes: a second sending unit 22, configured to send the position information of the target optical port through the target optical port.

如此,通过所述目标光口发出所述目标光口的位置信息,而使所述目标光口所在交换单板或所述待检测光口所在交换单板根据所述目标光口的位置信息对所述待检测光口与所述目标光口的连接是否正确进行检测,即通过交换单板就可以完成对所述待检测光口与所述目标光口的连接是否正确的检测,降低了对光口连接进行检测的复杂度和提高了对光口连接进行检测的可靠性。In this way, the position information of the target optical port is sent out through the target optical port, so that the switching board where the target optical port is located or the switching single board where the optical port to be detected is located is based on the position information of the target optical port. Whether the connection between the optical port to be detected and the target optical port is correct is detected, that is, the detection of whether the connection between the optical port to be detected and the target optical port is correct can be completed by exchanging single boards, which reduces the need for The complexity of detecting the optical port connection improves the reliability of detecting the optical port connection.

在一个可选的实施例中,In an optional embodiment,

所述第二发送单元22,还用于确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,确定所述目标光口与所述待检测光口的连接错误时,发出携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息的提示消息;或,确定所述目标光口与所述待检测光口之间的连接正确时,通过所述目标光口发出建链请求。The second sending unit 22 is further configured to issue an alarm message when it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect; or, to determine the connection between the target optical port and the to-be-detected optical port When there is an error, a prompt message carrying the position information of the desired optical port corresponding to the target optical port or the to-be-detected optical port is sent out; or, to determine the connection between the target optical port and the to-be-detected optical port When correct, a link establishment request is sent through the target optical port.

如此,当所述目标光口与所述待检测光口的连接错误即光缆插错时,通过发出告警、提示消息等方式提示光缆插错,提示方式直观,且提示效果好。当所述目标光口与所述待检测光口的连接正确即光缆未插错时,控制所述光缆链路建链,而当所述目标光口与所述待检测光口的连接错误即光缆插错时,控制所述光缆链路复位,避免出现在光缆插错而光缆链路建链成功后出现丢包或业务中断的情况,提高了检测的灵活性。In this way, when the connection between the target optical port and the to-be-detected optical port is incorrect, that is, the optical cable is incorrectly inserted, an alarm, a prompt message, etc. are issued to prompt the optical cable to be incorrectly inserted. The prompting method is intuitive and the prompting effect is good. When the connection between the target optical port and the to-be-detected optical port is correct, that is, the optical cable is not inserted incorrectly, control the optical cable link to establish a link, and when the target optical port and the to-be-detected optical port are connected incorrectly, that is, the optical cable When wrongly inserted, the optical cable link is controlled to reset, so as to avoid the situation of packet loss or service interruption after the optical cable is inserted incorrectly and the optical cable link is successfully established, thereby improving the flexibility of detection.

在一个可选的实施例中,该交换单板还包括:第二处理单元23,用于对接收到的所述待检测光口所在交换单板发送的探测报文进行解析,获得待检测光口的位置信息;或者,对接收到的所述待检测光口所在交换单板发送的码流进行解码,获得待检测光口的位置信息。In an optional embodiment, the switching board further includes: a second processing unit 23, configured to parse the received detection packet sent by the switching board where the optical port to be detected is located, and obtain the optical fiber to be detected. location information of the optical port to be detected; or, decoding the received code stream sent by the switching board where the optical port to be detected is located to obtain the location information of the optical port to be detected.

如此,能够有效避免外界环境的干扰。In this way, the interference of the external environment can be effectively avoided.

本发明实施例提供了一种交换单板,如图5所示,该交换单板包括:处理器310和用于存储能够在处理器310上运行的计算机程序的存储器311;其中,图5中示意的处理器310并非用于指代处理器310的个数为一个,而是仅用于指代处理器310相对其他器件的位置关系,在实际应用中,处理器310的个数可以为一个或多个;同样,图5中示意的存储器311也是同样的含义,即仅用于指代存储器311相对其他器件的位置关系,在实际应用中,存储器311的个数可以为一个或多个。An embodiment of the present invention provides a switch board. As shown in FIG. 5 , the switch board includes: a processor 310 and a memory 311 for storing a computer program that can run on the processor 310; wherein, in FIG. 5 The illustrated processor 310 is not used to refer to the number of processors 310 being one, but is only used to refer to the positional relationship of the processor 310 relative to other devices. In practical applications, the number of processors 310 may be one Similarly, the memory 311 shown in FIG. 5 also has the same meaning, that is, it is only used to refer to the positional relationship of the memory 311 relative to other devices. In practical applications, the number of the memory 311 may be one or more.

其中,所述处理器310用于运行所述计算机程序时,执行如下步骤:Wherein, when the processor 310 is configured to run the computer program, the following steps are performed:

获取所述待检测光口的位置信息;obtaining the location information of the optical port to be detected;

通过所述待检测光口发出所述待检测光口的位置信息。The position information of the optical port to be detected is sent out through the optical port to be detected.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

获取目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;Acquire position information of a target optical port, where the target optical port is an optical port that receives the position information of the to-be-detected optical port;

根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。Whether the connection between the target optical port and the to-be-detected optical port is correct is determined according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, an alarm message is sent; or,

确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, a prompt message is sent; the prompt message carries the position information of the desired optical port corresponding to the target optical port or the to-be-detected optical port; or,

确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When it is determined that the connection between the target optical port and the to-be-detected optical port is correct, a link establishment request is sent through the target optical port.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

确定所述待检测光口有光缆接入时,通过所述待检测光口发出所述待检测光口的位置信息;或,When it is determined that an optical cable is connected to the optical port to be detected, the position information of the optical port to be detected is sent out through the optical port to be detected; or,

以设定时间间隔通过所述待检测光口发出所述待检测光口的位置信息。The position information of the optical port to be detected is sent out through the optical port to be detected at a set time interval.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

封装所述待检测光口的位置信息至设置的探测报文,通过所述待检测光口发出所述探测报文;或者,The location information of the optical port to be detected is encapsulated into a set detection packet, and the detection packet is sent through the optical port to be detected; or,

按照设置的编码方式对所述待检测光口的位置信息进行编码生成码流,通过所述待检测光口发出所述码流。The location information of the optical port to be detected is encoded according to the set encoding mode to generate a code stream, and the code stream is sent out through the optical port to be detected.

该交换单板还包括:至少一个网络接口312。该交换单板中的各个组件通过总线系统313耦合在一起。可理解,总线系统313用于实现这些组件之间的连接通信。总线系统313除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图5中将各种总线都标为总线系统313。The switching board further includes: at least one network interface 312 . Various components in the switch board are coupled together through the bus system 313 . It can be understood that the bus system 313 is used to realize the connection communication between these components. In addition to the data bus, the bus system 313 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the various buses are labeled as bus system 313 in FIG. 5 .

其中,存储器311可以是易失性存储器或非易失性存储器,也可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,ferromagnetic random access memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random AccessMemory),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,SynchronousDynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器311旨在包括但不限于这些和任意其它适合类型的存储器。Wherein, the memory 311 may be a volatile memory or a non-volatile memory, and may also include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM, Read Only Memory), a programmable read-only memory (PROM, Programmable Read-Only Memory), an erasable programmable read-only memory (EPROM, Erasable Programmable Read-only memory) Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM, Electrically Erasable Programmable Read-Only Memory), Magnetic Random Access Memory (FRAM, ferromagnetic random access memory), Flash Memory (Flash Memory), Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM, Compact Disc Read-Only Memory); the magnetic surface memory can be a magnetic disk memory or a tape memory. The volatile memory may be Random Access Memory (RAM), which is used as an external cache memory. By way of example and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory Memory (DRAM, Dynamic Random Access Memory), Synchronous Dynamic Random Access Memory (SDRAM, SynchronousDynamic Random Access Memory), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM, Double Data Rate Synchronous Dynamic Random Access Memory), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM, Enhanced Synchronous Dynamic Random Access Memory), Synchronous Link Dynamic Random Access Memory (SLDRAM, SyncLink Dynamic Random Access Memory), Direct Memory Bus Random Access Memory (DRRAM, Direct Rambus Random Access Memory) . The memory 311 described in the embodiments of the present invention is intended to include, but not limited to, these and any other suitable types of memory.

本发明实施例中的存储器311用于存储各种类型的数据以支持交换单板的操作。这些数据的示例包括:用于在交换单板上操作的任何计算机程序,如操作系统和应用程序;联系人数据;电话簿数据;消息;图片;视频等。其中,操作系统包含各种系统程序,例如框架层、核心库层、驱动层等,用于实现各种基础业务以及处理基于硬件的任务。应用程序可以包含各种应用程序,例如媒体播放器(Media Player)、浏览器(Browser)等,用于实现各种应用业务。这里,实现本发明实施例方法的程序可以包含在应用程序中。The memory 311 in the embodiment of the present invention is used to store various types of data to support the operation of the switching board. Examples of such data include: any computer programs used to operate on the switching board, such as operating systems and applications; contact data; phonebook data; messages; pictures; videos, etc. Among them, the operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks. The application program may include various application programs, such as a media player (Media Player), a browser (Browser), etc., for implementing various application services. Here, the program implementing the method of the embodiment of the present invention may be included in the application program.

请再次参阅图5,本发明实施例提供了另一种交换单板,该交换单板包括:处理器310和用于存储能够在处理器310上运行的计算机程序的存储器311;其中,图5中示意的处理器310并非用于指代处理器310的个数为一个,而是仅用于指代处理器310相对其他器件的位置关系,在实际应用中,处理器310的个数可以为一个或多个;同样,图5中示意的存储器311也是同样的含义,即仅用于指代存储器311相对其他器件的位置关系,在实际应用中,存储器311的个数可以为一个或多个。Referring to FIG. 5 again, an embodiment of the present invention provides another switching board, the switching board includes: a processor 310 and a memory 311 for storing a computer program that can run on the processor 310; wherein, FIG. 5 The processor 310 shown in is not used to refer to the number of processors 310 being one, but is only used to refer to the positional relationship of the processor 310 relative to other devices. In practical applications, the number of processors 310 may be one or more; similarly, the memory 311 shown in FIG. 5 has the same meaning, that is, it is only used to refer to the positional relationship of the memory 311 relative to other devices. In practical applications, the number of the memory 311 can be one or more .

其中,所述处理器310用于运行所述计算机程序时,执行如下步骤:Wherein, when the processor 310 is configured to run the computer program, the following steps are performed:

获取待检测光口的位置信息和目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;Obtain the position information of the optical port to be detected and the position information of the target optical port, where the target optical port is the optical port that receives the position information of the optical port to be detected;

根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。Whether the connection between the target optical port and the to-be-detected optical port is correct is determined according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

通过所述目标光口发出所述目标光口的位置信息。The position information of the target optical port is sent out through the target optical port.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, an alarm message is sent; or,

确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, a prompt message is sent; the prompt message carries the position information of the desired optical port corresponding to the target optical port or the to-be-detected optical port; or,

确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When it is determined that the connection between the target optical port and the to-be-detected optical port is correct, a link establishment request is sent through the target optical port.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

对接收到的所述待检测光口所在交换单板发送的探测报文进行解析,获得待检测光口的位置信息;或者,Analyzing the received detection message sent by the switching board where the optical port to be detected is located to obtain the location information of the optical port to be detected; or,

对接收到的所述待检测光口所在交换单板发送的码流进行解码,获得待检测光口的位置信息。The received code stream sent by the switching board where the optical port to be detected is located is decoded to obtain location information of the optical port to be detected.

在一可选的实施例中,所述处理器310还用于运行所述计算机程序时,执行如下步骤:In an optional embodiment, when the processor 310 is further configured to run the computer program, the following steps are performed:

确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或者,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, an alarm message is sent; or,

确定所述目标光口与所述待检测光口的连接错误时,发出所述提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;和/或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, the prompt message is sent; the prompt message carries the position of the desired optical port corresponding to the target optical port or the to-be-detected optical port information; and/or,

确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When it is determined that the connection between the target optical port and the to-be-detected optical port is correct, a link establishment request is sent through the target optical port.

本实施例还提供了一种计算机存储介质,例如包括存储有计算机程序的存储器311,上述计算机程序可由交换单板中的处理器310执行,以完成前述方法所述步骤。计算机存储介质可以是FRAM、ROM、PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备,如移动电话、计算机、平板设备、个人数字助理等。This embodiment also provides a computer storage medium, for example, including a memory 311 storing a computer program, and the computer program can be executed by the processor 310 in the switch board to complete the steps of the foregoing method. The computer storage medium can be memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; it can also be various devices including one or any combination of the above memories, such as a mobile phone , computers, tablet devices, personal digital assistants, etc.

一方面,一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程被处理器运行时,执行如下步骤:On the one hand, a computer storage medium, a computer program is stored in the computer storage medium, and when the computer program is executed by a processor, the following steps are performed:

获取所述待检测光口的位置信息;obtaining the location information of the optical port to be detected;

通过所述待检测光口发出所述待检测光口的位置信息。The position information of the optical port to be detected is sent out through the optical port to be detected.

在一可选的实施例中,所述计算机程序被处理器运行时,还执行如下步骤:In an optional embodiment, when the computer program is executed by the processor, the following steps are further performed:

获取目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;Acquire position information of a target optical port, where the target optical port is an optical port that receives the position information of the to-be-detected optical port;

根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。Whether the connection between the target optical port and the to-be-detected optical port is correct is determined according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port.

在一可选的实施例中,所述计算机程序被处理器运行时,还执行如下步骤:In an optional embodiment, when the computer program is executed by the processor, the following steps are further performed:

确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, an alarm message is sent; or,

确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, a prompt message is sent; the prompt message carries the position information of the desired optical port corresponding to the target optical port or the to-be-detected optical port; or,

确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When it is determined that the connection between the target optical port and the to-be-detected optical port is correct, a link establishment request is sent through the target optical port.

在一可选的实施例中,所述计算机程序被处理器运行时,还执行如下步骤:In an optional embodiment, when the computer program is executed by the processor, the following steps are further performed:

确定所述待检测光口有光缆接入时,通过所述待检测光口发出所述待检测光口的位置信息;或者,When it is determined that an optical cable is connected to the optical port to be detected, the location information of the optical port to be detected is sent out through the optical port to be detected; or,

以设定时间间隔通过所述待检测光口发出所述待检测光口的位置信息。The position information of the optical port to be detected is sent out through the optical port to be detected at a set time interval.

在一可选的实施例中,所述计算机程序被处理器运行时,还执行如下步骤:In an optional embodiment, when the computer program is executed by the processor, the following steps are further performed:

封装所述待检测光口的位置信息至设置的探测报文,通过所述待检测光口发出所述探测报文;或者,The location information of the optical port to be detected is encapsulated into a set detection packet, and the detection packet is sent through the optical port to be detected; or,

按照设置的编码方式对所述待检测光口的位置信息进行编码生成码流,通过所述待检测光口发出所述码流。The location information of the optical port to be detected is encoded according to the set encoding mode to generate a code stream, and the code stream is sent out through the optical port to be detected.

另一方面,一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程被处理器运行时,执行如下步骤:In another aspect, a computer storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are performed:

获取待检测光口的位置信息和目标光口的位置信息,所述目标光口为接收到所述待检测光口的位置信息的光口;Obtain the position information of the optical port to be detected and the position information of the target optical port, where the target optical port is the optical port that receives the position information of the optical port to be detected;

根据设置的光口连接拓扑关系、所述目标光口的位置信息和所述待检测光口的位置信息,确定所述目标光口与所述待检测光口的连接是否正确。Whether the connection between the target optical port and the to-be-detected optical port is correct is determined according to the set optical port connection topology, the position information of the target optical port and the position information of the to-be-detected optical port.

在一可选的实施例中,所述计算机程序被处理器运行时,还执行如下步骤:In an optional embodiment, when the computer program is executed by the processor, the following steps are further performed:

通过所述目标光口发出所述目标光口的位置信息。The position information of the target optical port is sent out through the target optical port.

在一可选的实施例中,所述计算机程序被处理器运行时,还执行如下步骤:In an optional embodiment, when the computer program is executed by the processor, the following steps are further performed:

确定所述目标光口与所述待检测光口的连接错误时,发出告警消息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, an alarm message is sent; or,

确定所述目标光口与所述待检测光口的连接错误时,发出提示消息;所述提示消息携带有与所述目标光口或所述待检测光口对应的期望光口的位置信息;或,When it is determined that the connection between the target optical port and the to-be-detected optical port is incorrect, a prompt message is sent; the prompt message carries the position information of the desired optical port corresponding to the target optical port or the to-be-detected optical port; or,

确定所述目标光口与所述待检测光口的连接正确时,通过所述目标光口发出建链请求。When it is determined that the connection between the target optical port and the to-be-detected optical port is correct, a link establishment request is sent through the target optical port.

在一可选的实施例中,所述计算机程序被处理器运行时,还执行如下步骤:In an optional embodiment, when the computer program is executed by the processor, the following steps are further performed:

对接收到的所述待检测光口所在交换单板发送的探测报文进行解析,获得待检测光口的位置信息;或者,Analyzing the received detection message sent by the switching board where the optical port to be detected is located to obtain the location information of the optical port to be detected; or,

对接收到的所述待检测光口所在交换单板发送的码流进行解码,获得待检测光口的位置信息。The received code stream sent by the switching board where the optical port to be detected is located is decoded to obtain location information of the optical port to be detected.

下面通过具体示例对本发明实施例作进一步详细说明,以待检测光口所在交换单板为发送端、待检测光口为发送端光口、目标光口所在交换单板为接收端为例,如图6所示,为本发明实施例提供的一种光口连接检测方法,包括以下步骤:The embodiments of the present invention are further described in detail below through specific examples, taking the switch board where the optical port to be detected is the sending end, the optical port to be detected is the sending end optical port, and the switching board where the target optical port is located is the receiving end as an example. As shown in FIG. 6, an optical port connection detection method provided by an embodiment of the present invention includes the following steps:

S201:发送端将发送端光口的位置信息发送给接收端;S201: The sending end sends the location information of the optical port of the sending end to the receiving end;

这里,所述发送端光口的位置信息包括发送端光口的框号、槽位号和光口号。所述发送端可以通过将发送端光口的位置信息封装在探测报文中或通过自协商码流发送给接收端。此外,所述发送端可以在发送端光口的光缆插好后,或者以某一时间间隔将发送端光口的位置信息发送给接收端。Here, the location information of the optical port at the transmitting end includes the frame number, slot number, and optical port number of the optical port at the transmitting end. The sending end may encapsulate the location information of the optical port of the sending end in a detection packet or send it to the receiving end through an auto-negotiation code stream. In addition, the transmitting end may send the position information of the optical port of the transmitting end to the receiving end after the optical cable of the optical port of the transmitting end is plugged in, or at a certain time interval.

S202:接收端接收所述发送端光口的位置信息,并根据拓扑连接关系计算出期望的对端光口的位置信息;S202: The receiving end receives the location information of the optical port of the transmitting end, and calculates the desired location information of the optical port of the opposite end according to the topology connection relationship;

这里,所述拓补连接关系可根据各个厂家根据集群路由器的具体组网形式,以表格的形式保存到光口所在板卡即交换单板的存储空间中,如表1所示。Here, the topological connection relationship can be saved in the storage space of the switch board where the optical port is located in the form of a table according to the specific networking form of the cluster router by each manufacturer, as shown in Table 1.

Figure BDA0001732100340000231
Figure BDA0001732100340000231

表1Table 1

其中,源光口表示本端的光口,期望的光口表示与该源光口所对应的光口。The source optical port refers to the optical port of the local end, and the desired optical port refers to the optical port corresponding to the source optical port.

S203:比较发送端光口的位置信息和期望的对端光口的位置信息是否一致,如果不一致,则执行步骤S204;如果一致,则执行步骤S206;S203: Compare whether the position information of the optical port of the transmitting end is consistent with the position information of the desired optical port of the opposite end, if they are inconsistent, execute step S204; if they are consistent, execute step S206;

具体地,接收端比较发送端发来的发送端光口的位置信息,以及期望的对端光口的位置信息,只有当两者完全一致,即框号、槽位号、光口编号三者完全相同时,才判定为发送端光口的位置信息和期望的对端光口的位置信息一致,否则为发送端光口的位置信息和期望的对端光口的位置信息不一致。Specifically, the receiving end compares the location information of the optical port of the transmitting end sent by the transmitting end with the desired location information of the optical port of the opposite end, and only when the two are completely consistent, that is, the frame number, slot number, and optical port number are three. When they are exactly the same, it is determined that the location information of the optical port at the sending end is consistent with the expected location information of the optical port at the opposite end;

S204:接收端提示用户光缆插错;S204: The receiving end prompts the user that the optical cable is inserted incorrectly;

这里,接收端提示用户光缆插错包括:接收端通过提示灯提示用户光缆插错;或者,接收端通过告警或命令行通知用户光缆插错,并提示期望的对端光口位置信息。Here, the receiving end prompting the user that the optical cable is incorrectly inserted includes: the receiving end prompts the user that the optical cable is incorrectly inserted through a prompt light; or, the receiving end notifies the user that the optical cable is incorrectly inserted through an alarm or command line, and prompts the desired opposite end optical port position information.

S205:接收端复位光缆链路;S205: the receiving end resets the optical cable link;

这里,接收端通过复位光缆链路,以防止出现光缆连接错误,而链路又正常的情况,导致出现业务大量丢包甚至中断的情况。Here, the receiving end resets the optical cable link to prevent an optical cable connection error, but the link is normal, resulting in a large number of packet loss or even interruption of services.

S206:接收端发起光缆链路建链。S206: The receiving end initiates the establishment of an optical cable link.

这里,当发送端光口的位置信息和期望的对端光口的位置信息一致时,判定光口连接正确,接收端发起光缆链路建链。Here, when the location information of the optical port of the transmitting end is consistent with the location information of the desired optical port of the opposite end, it is determined that the optical port is connected correctly, and the receiving end initiates the establishment of the optical cable link.

为实现上述方法,本发明实施例还提供了一种光口连接检测装置,请参阅图7,包括:To implement the above method, an embodiment of the present invention further provides an optical port connection detection device, please refer to FIG. 7 , including:

发送模块20,用于向接收端发送待测光口的位置信息,以使接收端根据计算得到期望的对端光口的位置信息,检测光缆是否插错;The sending module 20 is used for sending the position information of the optical port to be measured to the receiving end, so that the receiving end obtains the desired position information of the optical port of the opposite end according to the calculation, and detects whether the optical cable is inserted incorrectly;

其中,可将待测光口的位置信息封装在报文中,或者通过自协商码流发送到接收端。Wherein, the location information of the optical port to be measured can be encapsulated in a message, or sent to the receiving end through an auto-negotiation code stream.

接收模块21,用于接收发送端发送的待测光口的位置信息;The receiving module 21 is used for receiving the position information of the optical port to be measured sent by the transmitting end;

判断模块22,用于根据目标光口的位置信息,以及集群路由器光口的拓补连接关系,计算得到期望的对端光口的位置信息,并和所述获取单元10得到的待测光口的位置信息进行比较,以判断光缆是否插错;The judgment module 22 is used to calculate and obtain the desired position information of the opposite end optical port according to the position information of the target optical port and the topological connection relationship of the optical port of the cluster router, and compare it with the optical port to be measured obtained by the acquisition unit 10 Compare the position information of the cable to determine whether the optical cable is inserted incorrectly;

处理模块23,用于根据判断模块22得到的光缆是否插错的结果,进行进一步操作。如果光缆插错,则通过指示灯提示用户光缆插错,并通过告警通知的形式提示用户正确的对端光口的位置信息,并复位光缆链路;如果正确,则对光缆链路发起建链。The processing module 23 is configured to perform further operations according to the result obtained by the judging module 22 whether the optical cable is inserted incorrectly. If the optical cable is inserted incorrectly, the indicator will prompt the user that the optical cable is incorrectly inserted, and the correct location information of the opposite end optical port will be prompted through an alarm notification, and the optical cable link will be reset; if it is correct, the optical cable link will be established. .

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。本发明的保护范围应以所述权利要求的保护范围以准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention. should be included within the protection scope of the present invention. The protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (13)

1. An optical interface connection detection method, the method comprising:
the method comprises the steps that a switching single board where an optical port to be detected is located obtains position information of the optical port to be detected;
and the exchange single board where the optical port to be detected is located sends out the position information of the optical port to be detected through the optical port to be detected.
2. The method according to claim 1, wherein after the switch board where the optical port to be detected is located sends out the position information of the optical port to be detected through the optical port to be detected, the method further comprises:
the exchange single board where the optical port to be detected is located acquires position information of a target optical port, wherein the target optical port is the optical port which receives the position information of the optical port to be detected;
and the exchange single board where the optical port to be detected is located determines whether the connection between the target optical port and the optical port to be detected is correct or not according to the set optical port connection topological relation, the position information of the target optical port and the position information of the optical port to be detected.
3. The method of claim 2, further comprising:
when the exchange single board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is wrong, an alarm message is sent out; or,
when the exchange single board where the optical port to be detected is located determines that the connection between the target optical port and the optical port to be detected is wrong, sending a prompt message; the prompt message carries position information of an expected optical port corresponding to the target optical port or the optical port to be detected; or,
and when the switching single board where the optical port to be detected is located determines that the target optical port is correctly connected with the optical port to be detected, sending a link establishment request through the target optical port.
4. The method according to claim 1, wherein the step of sending the position information of the optical port to be detected by the exchange board where the optical port to be detected is located through the optical port to be detected comprises:
when the exchange single board where the optical port to be detected is located determines that the optical port to be detected has the optical cable access, the exchange single board sends out the position information of the optical port to be detected through the optical port to be detected; or,
and the exchange single board where the optical port to be detected is located sends out the position information of the optical port to be detected through the optical port to be detected at set time intervals.
5. The method according to any one of claims 1 to 3, wherein the step of sending the position information of the optical port to be detected by the exchange board where the optical port to be detected is located through the optical port to be detected comprises:
the exchange single board where the optical port to be detected is located encapsulates the position information of the optical port to be detected to a set detection message, and the detection message is sent out through the optical port to be detected; or,
and the exchange single board where the optical port to be detected is located encodes the position information of the optical port to be detected according to a set encoding mode to generate a code stream, and the code stream is sent out through the optical port to be detected.
6. An optical interface connection detection method, the method comprising:
the method comprises the steps that a switching single board where a target optical port is located obtains position information of an optical port to be detected and position information of the target optical port, wherein the target optical port is the optical port which receives the position information of the optical port to be detected;
and the exchange single board where the target optical port is located determines whether the connection between the target optical port and the optical port to be detected is correct or not according to the set optical port connection topological relation, the position information of the target optical port and the position information of the optical port to be detected.
7. The method according to claim 6, wherein after the switch board where the target optical port is located acquires the position information of the optical port to be detected and the position information of the target optical port, the method further comprises:
and the exchange single board where the target optical port is located sends out the position information of the target optical port through the target optical port.
8. The method of claim 6, further comprising:
when the exchange single board where the target optical port is located determines that the connection between the target optical port and the optical port to be detected is wrong, an alarm message is sent out; or,
when the exchange single board where the target optical port is located determines that the connection between the target optical port and the optical port to be detected is wrong, sending a prompt message; the prompt message carries position information of an expected optical port corresponding to the target optical port or the optical port to be detected; or,
and when the exchange single board where the target optical port is located determines that the connection between the target optical port and the optical port to be detected is correct, sending a link establishment request through the target optical port.
9. The method according to claim 6, wherein the obtaining of the position information of the optical port to be detected by the switch board where the target optical port is located includes:
the switch single board where the target optical port is located analyzes the received detection message sent by the switch single board where the optical port to be detected is located, and obtains the position information of the optical port to be detected; or,
and the exchange single board where the target optical port is located decodes the received code stream sent by the exchange single board where the optical port to be detected is located, so as to obtain the position information of the optical port to be detected.
10. A switch board, comprising:
the first acquisition unit is used for acquiring the position information of the optical port to be detected;
and the first sending unit is used for sending the position information of the optical port to be detected through the optical port to be detected.
11. A switch board, comprising:
a second obtaining unit, configured to obtain position information of an optical port to be detected and position information of a target optical port, where the target optical port is an optical port that receives the position information of the optical port to be detected;
and the detection unit is used for determining whether the connection between the target optical port and the optical port to be detected is correct or not according to the set optical port connection topological relation, the position information of the target optical port and the position information of the optical port to be detected.
12. A switch board comprising a processor and a memory for storing a computer program capable of running on the processor; wherein,
the processor is configured to execute the steps of the method for detecting an optical interface connection according to any one of claims 1 to 9 when running the computer program.
13. A computer storage medium, characterized in that a computer program is stored in the computer storage medium, which computer program, when being executed by a processor, performs the steps of the optical interface connection detection method according to any one of claims 1 to 9.
CN201810779006.1A 2018-07-16 2018-07-16 Optical interface connection detection method, exchange single board and computer storage medium Pending CN110730035A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810779006.1A CN110730035A (en) 2018-07-16 2018-07-16 Optical interface connection detection method, exchange single board and computer storage medium
PCT/CN2019/089242 WO2020015467A1 (en) 2018-07-16 2019-05-30 Optical port connection detection method and switch single board

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810779006.1A CN110730035A (en) 2018-07-16 2018-07-16 Optical interface connection detection method, exchange single board and computer storage medium

Publications (1)

Publication Number Publication Date
CN110730035A true CN110730035A (en) 2020-01-24

Family

ID=69163850

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810779006.1A Pending CN110730035A (en) 2018-07-16 2018-07-16 Optical interface connection detection method, exchange single board and computer storage medium

Country Status (2)

Country Link
CN (1) CN110730035A (en)
WO (1) WO2020015467A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020009269A1 (en) * 2000-05-08 2002-01-24 Mitel Semiconductor Ab Optical fiber interface device on folded circuit board
CN1728609A (en) * 2004-07-27 2006-02-01 华为技术有限公司 A method for detecting the connection mode of multi-frame equipment
CN2874537Y (en) * 2006-03-15 2007-02-28 中兴通讯股份有限公司 Optical fiber connector
CN101621722A (en) * 2009-06-29 2010-01-06 中兴通讯股份有限公司 Method and system for automatically discovering node inner resource topology
CN103368643A (en) * 2012-04-01 2013-10-23 华为技术有限公司 Method, system and device for detecting optical fiber link

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6920287B1 (en) * 2000-08-01 2005-07-19 Nortel Networks Limited Smart connect
CN102594450B (en) * 2012-02-22 2015-06-03 中兴通讯股份有限公司 Method and device for preventing wrong insertion of optical cable of cluster router
CN108259260B (en) * 2017-01-24 2020-12-04 新华三技术有限公司 Link detection method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020009269A1 (en) * 2000-05-08 2002-01-24 Mitel Semiconductor Ab Optical fiber interface device on folded circuit board
CN1728609A (en) * 2004-07-27 2006-02-01 华为技术有限公司 A method for detecting the connection mode of multi-frame equipment
CN2874537Y (en) * 2006-03-15 2007-02-28 中兴通讯股份有限公司 Optical fiber connector
CN101621722A (en) * 2009-06-29 2010-01-06 中兴通讯股份有限公司 Method and system for automatically discovering node inner resource topology
CN103368643A (en) * 2012-04-01 2013-10-23 华为技术有限公司 Method, system and device for detecting optical fiber link

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张磊: "SDH传输设备中支路板软件的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Also Published As

Publication number Publication date
WO2020015467A1 (en) 2020-01-23

Similar Documents

Publication Publication Date Title
US11750486B2 (en) Device state management
US10547710B2 (en) Device gateway
US10958648B2 (en) Device communication environment
US10075422B2 (en) Device communication environment
US9973593B2 (en) Device gateway
WO2017092347A1 (en) Method, device and system for updating client configuration in memcached system
US9628326B2 (en) Managing network connection of a network node
CN110417783B (en) Data transmission method and device based on Internet of things, storage medium and terminal
CN104243210A (en) Method and system for remotely having access to administrative web pages of routers
CN113612659B (en) Device networking test method and device, electronic device and storage medium
US9872148B2 (en) Adaptive mobile wireless call rescue
CN114710572A (en) Data processing method, device and computer storage medium
WO2014110707A1 (en) Method, device, and system for detecting interconnection error
WO2018053894A1 (en) Internet-of-things access point handover method and device based on transmission rate
CN113261249A (en) Data transmission method, related equipment and computer storage medium
WO2017004251A1 (en) Method and system for function and service discovery
WO2016015606A1 (en) Method for locating port connection error and related device
CN110730035A (en) Optical interface connection detection method, exchange single board and computer storage medium
CN112350859A (en) Method, device, equipment and storage medium for managing network function entity
CN111511041B (en) Remote connection method and device
CN115633044B (en) Message processing methods, devices, electronic equipment and storage media
CN110493120A (en) A kind of method and apparatus for sending device operational order
US10623422B2 (en) Protocol to detect a foreign device connected between network modules
CN115883349B (en) Method for network configuration, router, storage medium and program product
TWI791316B (en) Method and system for implementing inter-process communications

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20200124

RJ01 Rejection of invention patent application after publication