CN111541958A - Optical interface rate self-adaption method, equipment, device and readable storage medium - Google Patents

Optical interface rate self-adaption method, equipment, device and readable storage medium Download PDF

Info

Publication number
CN111541958A
CN111541958A CN202010317028.3A CN202010317028A CN111541958A CN 111541958 A CN111541958 A CN 111541958A CN 202010317028 A CN202010317028 A CN 202010317028A CN 111541958 A CN111541958 A CN 111541958A
Authority
CN
China
Prior art keywords
optical
port
optical fiber
rate
module
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
CN202010317028.3A
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.)
3onedata Co ltd
Original Assignee
3onedata Co ltd
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 3onedata Co ltd filed Critical 3onedata Co ltd
Priority to CN202010317028.3A priority Critical patent/CN111541958A/en
Publication of CN111541958A publication Critical patent/CN111541958A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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
    • H04Q1/00Details of selecting apparatus or arrangements
    • H04Q1/02Constructional details
    • H04Q1/10Exchange station construction
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04QSELECTING
    • H04Q11/00Selecting arrangements for multiplex systems
    • H04Q11/0001Selecting arrangements for multiplex systems using optical switching
    • H04Q11/0003Details

Abstract

The invention discloses a method, a device, equipment and a readable storage medium for optical port rate self-adaptation, wherein the method comprises the following steps: when an optical module is installed at an optical fiber port of an optical fiber switch, acquiring a preset rate value, configuring a register corresponding to the optical fiber port, setting an optical port rate corresponding to the optical fiber port of the optical fiber switch to the preset rate value, determining a communication state of the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port, acquiring a new preset rate value when the communication state is determined to be a communication failure, updating the optical port rate corresponding to the optical fiber port of the optical fiber switch based on the new preset rate value, and determining the current optical port rate of the optical fiber port to be a target optical port rate when the communication state of the optical fiber switch and the optical module is determined to be a communication success based on the updated optical port rate corresponding to the optical fiber port, thereby avoiding reading of an EEPROM (electrically erasable programmable read only memory) in the optical module, reducing configuration complexity and improving configuration efficiency.

Description

Optical interface rate self-adaption method, equipment, device and readable storage medium
Technical Field
The invention relates to the technical field of optical fiber switches, in particular to an optical port rate self-adaption method, equipment, a device and a readable storage medium.
Background
An optical module is an optoelectronic device that performs photoelectric and electro-optical conversion. The sending end of the optical module converts the electric signal into an optical signal, and the receiving end converts the optical signal into the electric signal. Optical modules are classified according to their packaging formats, and SFP, SFP +, SFF, gigabit ethernet interface converter (GBIC), and the like are common.
With the continuous development of network communication technology, optical fiber communication is the main wired communication mode due to the advantages of good confidentiality and large transmission capacity. When in communication, the optical fiber switch and the optical module which are connected with each other are required to have uniform optical port rate and mode so as to normally communicate. In a general optical fiber switch, the optical port rate is generally set by an optical fiber switch manufacturer before the optical fiber switch manufacturer leaves a factory, and the optical port rate of the optical fiber switch can be reconfigured according to the optical port rate of an actually used optical module. In the prior art, an optical fiber switch needs to obtain the type and the working mode of an optical module by reading chip resources of an EEPROM inside the optical module, and then configures a register built in the optical fiber switch to update an optical port rate of the optical fiber switch.
In practical use, due to the difference between the chip architecture and the internal register of the optical fiber switch, the optical port rate needs to be adjusted during the practical development of the optical fiber switch manufacturer, and the above operations need to be performed for each optical fiber switch chip: the work of reading the optical module EEPROM and configuring the chip register of the optical fiber switch is extremely complicated and time-consuming, and the debugging is required by an optical fiber switch manufacturer and a chip manufacturer.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a method, equipment and a device for optical port rate adaptation and a readable storage medium, and aims to solve the technical problems of complex configuration process and time consumption when an existing optical fiber switch and an optical module are used for optical port rate configuration.
In order to achieve the above object, the present invention provides an optical interface rate adaptation method, which includes the following steps:
when detecting that an optical module is installed at an optical fiber port of the optical fiber switch, acquiring a preset speed value;
configuring a register corresponding to the optical fiber port, and setting an optical port rate corresponding to the optical fiber port of the optical fiber switch to be a preset rate value;
determining the communication state of the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port;
when the communication state is determined to be communication failure, acquiring a new preset speed value, and updating an optical port speed corresponding to an optical fiber port of the optical fiber switch based on the new preset speed value;
and determining that the communication state of the optical fiber switch and the optical module is successful based on the updated optical port rate corresponding to the optical fiber port, and taking the current optical port rate of the optical fiber port as a target optical port rate.
Further, in an embodiment, before the step of obtaining the preset rate value when it is detected that the optical module is installed at the fiber port of the fiber switch, the method further includes:
when receiving an optical port rate configuration instruction, reading port signals of each optical fiber port of the optical fiber switch;
determining whether each optical fiber port is provided with an optical module or not based on each port signal;
the step of obtaining a preset speed value when detecting that the optical module is installed at the optical fiber port of the optical fiber switch includes:
when the port signal is a preset signal, determining that the optical module is installed at the optical fiber port corresponding to the port signal, and acquiring a preset rate value corresponding to the optical fiber port.
Further, in an embodiment, the step of determining the communication status of the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port includes:
sending communication negotiation data to the optical module;
when receiving the confirmation data fed back by the optical module, determining that the communication state is successful;
and when the confirmation data fed back by the optical module is not received within the preset time, determining that the communication state is communication failure.
Further, in an embodiment, after the step of determining the communication status between the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port, the method includes:
and when the communication state is determined to be successful, taking the current optical port speed of the optical fiber port as a target optical port speed, and storing the current optical port speed of the optical fiber port.
Further, in an embodiment, the step of acquiring a preset rate value when detecting that an optical module is installed at a fiber port of the fiber switch includes:
and acquiring a speed value from the preset speed value list as a preset speed value.
Further, in an embodiment, the optical port rate adaptation method includes:
when detecting that the optical module is installed at the optical fiber port of the optical fiber switch, sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber port of the optical fiber switch respectively;
determining that the communication states of the optical fiber switch and the optical module are all failure based on the optical port rates, and accumulating the cycle times;
when the cycle times are less than the preset times, continuously executing the step of sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber ports of the optical fiber switch respectively;
and outputting prompt information of the failure of the rate matching of the optical port when the cycle times are more than or equal to the preset times.
Further, in one embodiment, the rate values in the preset rate value list include 1000Mbps, 100Mbps, and 10 Gbps.
Further, in one embodiment, the optical port rate adaptive device includes:
the acquisition module is used for acquiring a preset speed value when detecting that an optical module is installed at an optical fiber port of the optical fiber switch;
the configuration module is used for configuring a register corresponding to the optical fiber port and setting the optical port rate corresponding to the optical fiber port of the optical fiber switch to a preset rate value;
the determining module is used for determining the communication state of the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port;
the updating module is used for acquiring a new preset rate value when the communication state is determined to be communication failure, and updating the optical port rate corresponding to the optical fiber port of the optical fiber switch based on the new preset rate value;
and the storage module is used for determining that the communication state of the optical fiber switch and the optical module is successful based on the updated optical port rate corresponding to the optical fiber port, and taking the current optical port rate of the optical fiber port as a target optical port rate.
Further, to achieve the above object, the present invention also provides an apparatus comprising: a memory, a processor and an optical interface rate adaptation program stored on the memory and executable on the processor, the optical interface rate adaptation program when executed by the processor implementing the steps of any of the above-described optical interface rate adaptation methods.
In addition, to achieve the above object, the present invention further provides a readable storage medium, which stores thereon an optical interface rate adaptation program, which when executed by a processor implements the steps of the optical interface rate adaptation method according to any one of the above.
The method comprises the steps of obtaining a preset speed value when an optical module is installed at an optical fiber port of an optical fiber switch, then configuring a register corresponding to the optical fiber port, setting an optical port speed corresponding to the optical fiber port of the optical fiber switch to be the preset speed value, determining a communication state of the optical fiber switch and the optical module based on the optical port speed corresponding to the optical fiber port, obtaining a new preset speed value when the communication state is determined to be communication failure, updating the optical port speed corresponding to the optical fiber port of the optical fiber switch based on the new preset speed value, and finally determining the communication state of the optical fiber switch and the optical module to be communication success based on the updated optical port speed corresponding to the optical fiber port, wherein the current optical port speed of the optical fiber port is used as a target optical port speed. And determining the target optical port rate corresponding to the optical fiber port of the optical fiber switch according to the communication state of the optical fiber switch and the optical module by adopting a polling configuration optical port rate mode of the optical fiber switch. Therefore, reading of the built-in EEPROM of the optical module is avoided, configuration complexity is reduced, and configuration efficiency is improved. The polling method of the present application is versatile and is not limited to any optical fiber switch or any optical module.
Drawings
FIG. 1 is a schematic diagram of a device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a first embodiment of a method for adapting an optical port rate according to the present invention;
fig. 3 is a functional block diagram of an optical port rate adaptive device according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a device in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the apparatus is a fabric switch, and may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration of the object detection system shown in FIG. 1 does not constitute a limitation of the apparatus and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a readable storage medium, may include therein an operating system, a network communication module, a user interface module, and an optical port rate adaptation program.
In the device shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a user terminal and performing data communication with the user terminal; and the processor 1001 may be used to invoke an optical port rate adaptation program stored in the memory 1005.
In this embodiment, the apparatus comprises: the optical interface rate adaptation method comprises a memory 1005, a processor 1001 and an optical interface rate adaptation program stored in the memory 1005 and capable of being executed on the processor 1001, wherein when the processor 1001 calls the optical interface rate adaptation program stored in the memory 1005, the steps of the optical interface rate adaptation method provided by the embodiments of the present application are executed.
Referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the optical interface rate adaptation method according to the present invention.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than that shown.
In this embodiment, the optical port rate adaptive method includes:
step S10, when detecting that the optical module is installed at the optical fiber port of the optical fiber switch, acquiring a preset speed value;
in this embodiment, in the current internet era, optical modules and optical fiber switches are not separated from enterprise network deployment and data center construction. The optical module is mainly used for converting an electric signal and an optical signal, and the optical fiber switch plays a role in forwarding the optical signal. The optical module is composed of an optoelectronic device, a functional circuit, an optical interface and the like, wherein the optoelectronic device comprises a transmitting part and a receiving part. In brief, the optical module functions as a photoelectric converter, the transmitting end converts an electrical signal into an optical signal, and the receiving end converts the optical signal into the electrical signal after the optical signal is transmitted through the optical fiber. In the field of general optical fiber switches, such as digital communications and transmission, in fact, an optical fiber switch with an optical port and an optical fiber switch with an optical module are both referred to as supporting an optical module interface, and only different terms are used.
When in communication, the optical fiber switch and the optical module which are connected with each other are required to have uniform optical port rate and mode so as to normally communicate. As described above, in the prior art, the optical fiber switch needs to obtain the type and the working mode of the optical module by reading chip resources of the EEPROM inside the optical module, and then configure a register built in the optical fiber switch to update the optical port rate of the optical fiber switch. In practical use, due to the difference between the chip architecture and the internal register of the optical fiber switch, the optical port rate needs to be adjusted during the practical development of the optical fiber switch manufacturer, and the above operations need to be performed for each optical fiber switch chip: the work of reading the optical module EEPROM and configuring the chip register of the optical fiber switch is extremely complicated and time-consuming, and the debugging is required by an optical fiber switch manufacturer and a chip manufacturer. According to the method and the device, the optical port rate of the optical fiber switch is configured in a polling mode, and the target optical port rate corresponding to the optical fiber port of the optical fiber switch is determined according to the communication state of the optical fiber switch and the optical module. Therefore, reading of the built-in EEPROM of the optical module is avoided, configuration complexity is reduced, and configuration efficiency is improved. The polling method of the present application is versatile and is not limited to any optical fiber switch or any optical module.
Specifically, an optical fiber interface of the optical fiber switch is provided with an LOS pin, whether an optical fiber is inserted into the optical fiber interface is detected through the LOS pin, one end of the LOS pin is connected with a chip of the switch, and therefore whether the optical fiber interface is output is determined through the chip. After the optical fiber switch is powered on, whether the optical module is plugged in the optical fiber port is detected by inquiring the LOS pin.
Specifically, step S10 includes:
in step S11, a speed value is obtained from the preset speed value list as a preset speed value.
In this embodiment, when it is determined that an optical module is installed in an optical fiber port of an optical fiber switch, an optical port rate of the optical fiber switch is configured by polling, and a preset rate value is first obtained as the optical port rate. The preset speed value can be obtained from a preset speed value list, common optical modules are SFP, SFF, SFP +, GBIC and XFP, wherein a gigabit optical module is mostly an SFP optical module, and a gigabit optical module is mostly an SFP + optical module, so the speed values in the preset speed value list include 1000Mbps, 100Mbps and 10 Gbps.
Step S20, configuring a register corresponding to the optical fiber port, and setting the optical port rate corresponding to the optical fiber port of the optical fiber switch as a preset rate value;
in this embodiment, the optical port rate corresponding to the optical fiber port is updated by configuring a register of the optical fiber switch. Firstly, determining a register address corresponding to the optical interface rate, then updating the optical interface rate according to the register address, and setting the optical interface rate as a preset rate value.
Step S30, determining a communication state between the optical fiber switch and the optical module based on an optical port rate corresponding to the optical fiber port;
specifically, step S30 includes:
step S31, sending communication negotiation data to the optical module;
step S32, when receiving the acknowledgment data fed back by the optical module, determining that the communication status is successful;
step S33, when the acknowledgment data fed back by the optical module is not received within a preset time, determining that the communication status is communication failure.
In this embodiment, the optical fiber switch sends negotiation data to the optical module, for example, the same negotiation data may be continuously sent for 3 times, and after the optical module successfully receives the negotiation data, confirmation data is sent to the optical fiber switch, where the confirmation data may also be consistent with the contents of the negotiation data. When the optical fiber switch receives the confirmation data fed back by the optical module, the optical fiber switch and the optical module have the same optical port rate, and the communication state is successful. Otherwise, when the confirmation data fed back by the optical module is not received within the preset time, the optical port rates of the optical fiber switch and the optical module are inconsistent at the moment, and the communication state is communication failure.
Step S40, when the communication state is determined to be communication failure, acquiring a new preset rate value, and updating the optical port rate corresponding to the optical fiber port of the optical fiber switch based on the new preset rate value;
in this embodiment, when it is determined that the communication state is a communication failure, which indicates that the optical port rates of the optical fiber switch and the optical module are not consistent at this time, the optical port rate of the current optical fiber switch needs to be updated, that is, a new preset rate value is obtained, a different preset rate value may be continuously obtained in the preset rate value list, then, a register of the optical fiber switch is configured to update the optical port rate corresponding to the optical fiber port, and the optical port rate is set to the new preset rate value.
Step S50, based on the updated optical port rate corresponding to the optical fiber port, when it is determined that the communication state between the optical fiber switch and the optical module is successful, taking the current optical port rate of the optical fiber port as a target optical port rate.
In this embodiment, the optical fiber switch sends the negotiation data to the optical module again, and after the optical module successfully receives the negotiation data, sends the confirmation data to the optical fiber switch, where the confirmation data may also be consistent with the contents of the negotiation data. When the optical fiber switch receives the confirmation data fed back by the optical module, the communication state is successful, which indicates that the optical fiber switch and the optical module have the same optical port rate, the current optical port rate of the optical fiber port is the target optical port rate, and the target optical port rate of the optical fiber port on the pair is recorded and stored. If the current communication state is still communication failure, step S40 is continuously executed until the optical port rate configuration is successful or an optical port rate configuration stop condition is detected. The optical port rate configuration stop condition may be that the maximum number of times of non-configuration is reached.
Further, in an embodiment, step S10 is preceded by:
step S60, when receiving the optical port rate configuration instruction, reading the port signal of each optical fiber port of the optical fiber switch;
step S70, determining whether each optical fiber port is provided with an optical module based on each port signal;
step S10 includes: when the port signal is a preset signal, determining that the optical module is installed at the optical fiber port corresponding to the port signal, and acquiring a preset rate value corresponding to the optical fiber port.
In this embodiment, the optical fiber switch includes a plurality of optical fiber ports, and can be connected to a plurality of optical modules, and when a port signal is a preset signal, it is determined that an optical module is installed at an optical fiber port corresponding to the port signal; optical port rate configuration may also be performed on the optical fiber ports connected to the optical modules in sequence.
Further, in an embodiment, after the step S30, the method further includes:
step S70, when it is determined that the communication state is successful, taking the current optical port rate of the optical fiber port as a target optical port rate, and storing the current optical port rate of the optical fiber port.
In this embodiment, the optical fiber switch sends negotiation data to the optical module, and after the optical module successfully receives the negotiation data, sends confirmation data to the optical fiber switch, where the confirmation data may also be consistent with the contents of the negotiation data. When the optical fiber switch receives the confirmation data fed back by the optical module, the communication state is successful, which indicates that the optical fiber switch and the optical module have the same optical port rate, the current optical port rate of the optical fiber port is the target optical port rate, and the target optical port rate of the optical fiber port on the pair is recorded and stored.
The method for adapting the optical port rate provided in this embodiment obtains a preset rate value when detecting that an optical module is installed at an optical fiber port of the optical fiber switch, then configuring a register corresponding to the optical fiber port, setting an optical port rate corresponding to the optical fiber port of the optical fiber switch to a preset rate value, and then determining a communication state between the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port, and then when the communication state is determined to be communication failure, acquiring a new preset rate value, updating the optical port rate corresponding to the optical fiber port of the optical fiber switch based on the new preset rate value, and finally, when the communication state of the optical fiber switch and the optical module is determined to be communication success based on the updated optical port rate corresponding to the optical fiber port, taking the current optical port rate of the optical fiber port as a target optical port rate. And determining the target optical port rate corresponding to the optical fiber port of the optical fiber switch according to the communication state of the optical fiber switch and the optical module by adopting a polling configuration optical port rate mode of the optical fiber switch. Therefore, reading of the built-in EEPROM of the optical module is avoided, configuration complexity is reduced, and configuration efficiency is improved. The polling method of the present application is versatile and is not limited to any optical fiber switch or any optical module.
Based on the first embodiment, a second embodiment of the optical port rate adaptive method according to the present invention is provided, where in this embodiment, before step S10, the method further includes:
step S80, when detecting that the optical module is installed at the optical fiber port of the optical fiber switch, sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber ports of the optical fiber switch respectively;
step S90, based on each optical port rate, when the communication state of the optical fiber switch and the optical module is determined to be failure, accumulating the circulation times;
step S100, when the cycle times are less than the preset times, continuing to execute the step of sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber ports of the optical fiber switch respectively;
and step S110, outputting prompt information of the failure of the rate matching of the optical port when the cycle times are more than or equal to the preset times.
In this embodiment, when it is detected that the optical module is installed at the optical fiber port of the optical fiber switch, the speed values in the preset speed value list are sequentially set as the optical port speeds corresponding to the optical fiber ports of the optical fiber switch, respectively. Common optical module types include SFP, SFF, SFP +, GBIC, and XFP, wherein a gigabit optical module is mostly an SFP optical module, and a gigabit optical module is mostly an SFP + optical module, so the speed values in the preset speed value list include 1000Mbps, 100Mbps, and 10 Gbps. Preferentially configuring a rate value to be 1000Mbps (kilomega) (because the rate value is most commonly used), if negotiation data occurs and the communication state of the optical fiber switch and the optical module is determined to be failed, accumulating the cycle times, and when the cycle times are less than the preset times, if the preset times are 3, continuously executing the step of sequentially setting the rate values in the preset rate value list as optical port rates corresponding to optical fiber ports of the optical fiber switch respectively; and outputting prompt information of the failure of the rate matching of the optical port when the cycle times are more than or equal to the preset times.
In the optical port rate adaptive method provided in this embodiment, a target optical port rate corresponding to an optical fiber port of an optical fiber switch is determined according to a communication state between the optical fiber switch and an optical module by using a polling configuration optical port rate mode of the optical fiber switch. Therefore, reading of the built-in EEPROM of the optical module is avoided, configuration complexity is reduced, and configuration efficiency is improved. The polling method of the present application is versatile and is not limited to any optical fiber switch or any optical module.
The invention further provides an optical port rate adaptive device, referring to fig. 3, fig. 3 is a functional module schematic diagram of an embodiment of the optical port rate adaptive device of the invention.
An obtaining module 10, configured to obtain a preset rate value when detecting that an optical module is installed at an optical fiber port of the optical fiber switch;
a configuration module 20, configured to configure a register corresponding to the optical fiber port, and set an optical port rate corresponding to the optical fiber port of the optical fiber switch to a preset rate value;
a determining module 30, configured to determine a communication state between the optical fiber switch and the optical module based on an optical port rate corresponding to the optical fiber port;
an updating module 40, configured to obtain a new preset rate value when it is determined that the communication state is a communication failure, and update an optical port rate corresponding to an optical fiber port of the optical fiber switch based on the new preset rate value;
and the storing module 50 is configured to, based on the updated optical port rate corresponding to the optical fiber port, determine that the communication state between the optical fiber switch and the optical module is successful, and store the current optical port rate of the optical fiber port.
Further, the optical port rate adaptive device further includes:
the reading module is used for reading port signals of all optical fiber ports of the optical fiber switch when receiving an optical port rate configuration instruction;
the judging module is used for determining whether each optical fiber port is provided with an optical module or not based on each port signal;
the obtaining module 10 is further configured to, when the port signal is a preset signal, determine that the optical module is installed at the optical fiber port corresponding to the port signal, and obtain a preset rate value corresponding to the optical fiber port.
Further, the determining module 30 is further configured to:
sending communication negotiation data to the optical module;
when receiving the confirmation data fed back by the optical module, determining that the communication state is successful;
and when the confirmation data fed back by the optical module is not received within the preset time, determining that the communication state is communication failure.
Further, the optical port rate adaptive device further includes:
and the storage module is used for taking the current optical port rate of the optical fiber port as a target optical port rate and storing the current optical port rate of the optical fiber port when the communication state is determined to be successful.
Further, the obtaining module 10 is further configured to:
and acquiring a speed value from the preset speed value list as a preset speed value.
Further, the optical port rate adaptive device further includes:
the setting module is used for sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber ports of the optical fiber switch when detecting that the optical modules are installed at the optical fiber ports of the optical fiber switch;
the accumulation module is used for accumulating the cycle times when the communication states of the optical fiber switch and the optical module are determined to be failures based on the optical port rates;
the circulation module 1, when the circulation times are less than the preset times, continuously executing the step of sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber ports of the optical fiber switch respectively;
and the circulation module 2 outputs prompt information of the failed rate matching of the optical port when the circulation times are more than or equal to the preset times.
In this embodiment, when detecting that an optical module is installed at an optical fiber port of the optical fiber switch, a preset rate value is obtained, then configuring a register corresponding to the optical fiber port, setting an optical port rate corresponding to the optical fiber port of the optical fiber switch to a preset rate value, and then determining a communication state between the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port, and then when the communication state is determined to be communication failure, acquiring a new preset rate value, updating the optical port rate corresponding to the optical fiber port of the optical fiber switch based on the new preset rate value, and finally, when the communication state of the optical fiber switch and the optical module is determined to be communication success based on the updated optical port rate corresponding to the optical fiber port, taking the current optical port rate of the optical fiber port as a target optical port rate. And determining the target optical port rate corresponding to the optical fiber port of the optical fiber switch according to the communication state of the optical fiber switch and the optical module by adopting a polling configuration optical port rate mode of the optical fiber switch. Therefore, reading of the built-in EEPROM of the optical module is avoided, configuration complexity is reduced, and configuration efficiency is improved. The polling method of the present application is versatile and is not limited to any optical fiber switch or any optical module.
In addition, an embodiment of the present invention further provides a readable storage medium, where an optical port rate adaptation program is stored on the readable storage medium, and when being executed by a processor, the optical port rate adaptation program implements the steps of the optical port rate adaptation method in the foregoing embodiments.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a readable storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, and includes several instructions for enabling a system device (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An optical interface rate adaptation method, applied to a fiber switch, includes:
when detecting that an optical module is installed at an optical fiber port of the optical fiber switch, acquiring a preset speed value;
configuring a register corresponding to the optical fiber port, and setting an optical port rate corresponding to the optical fiber port of the optical fiber switch to be a preset rate value;
determining the communication state of the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port;
when the communication state is determined to be communication failure, acquiring a new preset speed value, and updating an optical port speed corresponding to an optical fiber port of the optical fiber switch based on the new preset speed value;
and determining that the communication state of the optical fiber switch and the optical module is successful based on the updated optical port rate corresponding to the optical fiber port, and taking the current optical port rate of the optical fiber port as a target optical port rate.
2. The method for adapting an optical port rate according to claim 1, wherein before the step of obtaining the preset rate value when detecting that an optical module is installed in an optical fiber port of the optical fiber switch, the method further comprises:
when receiving an optical port rate configuration instruction, reading port signals of each optical fiber port of the optical fiber switch;
determining whether each optical fiber port is provided with an optical module or not based on each port signal;
the step of obtaining a preset speed value when detecting that the optical module is installed at the optical fiber port of the optical fiber switch includes:
when the port signal is a preset signal, determining that the optical module is installed at the optical fiber port corresponding to the port signal, and acquiring a preset rate value corresponding to the optical fiber port.
3. The method of claim 1, wherein the step of determining the communication status of the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port comprises:
sending communication negotiation data to the optical module;
when receiving the confirmation data fed back by the optical module, determining that the communication state is successful;
and when the confirmation data fed back by the optical module is not received within the preset time, determining that the communication state is communication failure.
4. The method of claim 1, wherein the step of determining the communication status between the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port is followed by:
and when the communication state is determined to be successful, taking the current optical port speed of the optical fiber port as a target optical port speed, and storing the current optical port speed of the optical fiber port.
5. The method according to any of claims 1 to 4, wherein the step of obtaining the preset rate value upon detecting that an optical module is installed on the fiber port of the fiber switch comprises:
and acquiring a speed value from the preset speed value list as a preset speed value.
6. The optical port rate adaptation method of claim 5, wherein the optical port rate adaptation method comprises:
when detecting that the optical module is installed at the optical fiber port of the optical fiber switch, sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber port of the optical fiber switch respectively;
determining that the communication states of the optical fiber switch and the optical module are all failure based on the optical port rates, and accumulating the cycle times;
when the cycle times are less than the preset times, continuously executing the step of sequentially setting the speed values in the preset speed value list as the optical port speeds corresponding to the optical fiber ports of the optical fiber switch respectively;
and outputting prompt information of the failure of the rate matching of the optical port when the cycle times are more than or equal to the preset times.
7. The optical port rate adaptation method of claim 5, wherein the rate values in the preset rate value list comprise 1000Mbps, 100Mbps and 10 Gbps.
8. An optical port rate adaptation apparatus, comprising:
the acquisition module is used for acquiring a preset speed value when detecting that an optical module is installed at an optical fiber port of the optical fiber switch;
the configuration module is used for configuring a register corresponding to the optical fiber port and setting the optical port rate corresponding to the optical fiber port of the optical fiber switch to a preset rate value;
the determining module is used for determining the communication state of the optical fiber switch and the optical module based on the optical port rate corresponding to the optical fiber port;
the updating module is used for acquiring a new preset rate value when the communication state is determined to be communication failure, and updating the optical port rate corresponding to the optical fiber port of the optical fiber switch based on the new preset rate value;
and the storage module is used for determining that the communication state of the optical fiber switch and the optical module is successful based on the updated optical port rate corresponding to the optical fiber port, and taking the current optical port rate of the optical fiber port as a target optical port rate.
9. An apparatus, the apparatus being a fabric switch, the apparatus comprising: memory, a processor and an optical interface rate adaptation program stored on the memory and executable on the processor, the optical interface rate adaptation program when executed by the processor implementing the steps of the optical interface rate adaptation method according to any one of claims 1 to 7.
10. A readable storage medium, having stored thereon the optical port rate adaptation program, which when executed by a processor implements the steps of the optical port rate adaptation method according to any one of claims 1 to 7.
CN202010317028.3A 2020-04-21 2020-04-21 Optical interface rate self-adaption method, equipment, device and readable storage medium Pending CN111541958A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010317028.3A CN111541958A (en) 2020-04-21 2020-04-21 Optical interface rate self-adaption method, equipment, device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010317028.3A CN111541958A (en) 2020-04-21 2020-04-21 Optical interface rate self-adaption method, equipment, device and readable storage medium

Publications (1)

Publication Number Publication Date
CN111541958A true CN111541958A (en) 2020-08-14

Family

ID=71980074

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010317028.3A Pending CN111541958A (en) 2020-04-21 2020-04-21 Optical interface rate self-adaption method, equipment, device and readable storage medium

Country Status (1)

Country Link
CN (1) CN111541958A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115714941A (en) * 2023-01-05 2023-02-24 北京工蜂电子技术有限公司 Optical interface rate self-adaption method, device, medium and equipment of network communication equipment
CN117240355A (en) * 2023-11-14 2023-12-15 四川泰瑞创通讯技术股份有限公司 Optical module rate self-adaptive adjustment method, device, equipment and readable storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083536A (en) * 2006-06-02 2007-12-05 杭州华三通信技术有限公司 Ethernet optical terminal adapter and ethernet transmission method
US20080131118A1 (en) * 2006-11-10 2008-06-05 Ting-Kuang Chiang Configurable Multi-Rate Optical Network Port and Processing Modules
CN102340352A (en) * 2010-07-20 2012-02-01 中兴通讯股份有限公司 Optical interface speed auto-negotiation method and device
CN103095367A (en) * 2013-01-25 2013-05-08 中兴通讯股份有限公司 Optical-fiber interface speed self-adapting method and optical-fiber network device
CN103178899A (en) * 2011-12-23 2013-06-26 中兴通讯股份有限公司 Fiber interface rate self-adaption method and device
CN104038275A (en) * 2014-06-07 2014-09-10 深圳市共进电子股份有限公司 Method for realizing self-adaptation of network equipment interface to optical module, and network equipment
CN104639468A (en) * 2015-01-07 2015-05-20 武汉微创光电股份有限公司 Optical port adaptive Ethernet switch and adaptive method thereof
CN105610741A (en) * 2016-03-03 2016-05-25 山东超越数控电子有限公司 Optical module based optical port rate adaptation method
CN110602003A (en) * 2019-09-17 2019-12-20 深圳市三旺通信股份有限公司 Mine intrinsic safety type ten-gigabit three-layer switch with flexibly configurable optical ports

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101083536A (en) * 2006-06-02 2007-12-05 杭州华三通信技术有限公司 Ethernet optical terminal adapter and ethernet transmission method
US20080131118A1 (en) * 2006-11-10 2008-06-05 Ting-Kuang Chiang Configurable Multi-Rate Optical Network Port and Processing Modules
CN102340352A (en) * 2010-07-20 2012-02-01 中兴通讯股份有限公司 Optical interface speed auto-negotiation method and device
CN103178899A (en) * 2011-12-23 2013-06-26 中兴通讯股份有限公司 Fiber interface rate self-adaption method and device
CN103095367A (en) * 2013-01-25 2013-05-08 中兴通讯股份有限公司 Optical-fiber interface speed self-adapting method and optical-fiber network device
CN104038275A (en) * 2014-06-07 2014-09-10 深圳市共进电子股份有限公司 Method for realizing self-adaptation of network equipment interface to optical module, and network equipment
CN104639468A (en) * 2015-01-07 2015-05-20 武汉微创光电股份有限公司 Optical port adaptive Ethernet switch and adaptive method thereof
CN105610741A (en) * 2016-03-03 2016-05-25 山东超越数控电子有限公司 Optical module based optical port rate adaptation method
CN110602003A (en) * 2019-09-17 2019-12-20 深圳市三旺通信股份有限公司 Mine intrinsic safety type ten-gigabit three-layer switch with flexibly configurable optical ports

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115714941A (en) * 2023-01-05 2023-02-24 北京工蜂电子技术有限公司 Optical interface rate self-adaption method, device, medium and equipment of network communication equipment
CN117240355A (en) * 2023-11-14 2023-12-15 四川泰瑞创通讯技术股份有限公司 Optical module rate self-adaptive adjustment method, device, equipment and readable storage medium
CN117240355B (en) * 2023-11-14 2024-02-02 四川泰瑞创通讯技术股份有限公司 Optical module rate self-adaptive adjustment method, device, equipment and readable storage medium

Similar Documents

Publication Publication Date Title
US11129221B2 (en) Bluetooth connection method, device and smart terminal
CN111541956B (en) Optical port self-adaption method, device, switch and computer readable storage medium
US8499103B2 (en) Converter device to convert between different small form factor pluggable standards
US20190274050A1 (en) Auto-provisioning device
CN108462601B (en) Multi-protection-group switching method and device applied to optical transmission network and network element equipment
US11515943B2 (en) Optical communications apparatus, optical line termination, and optical communication processing method
CN111541958A (en) Optical interface rate self-adaption method, equipment, device and readable storage medium
US20200076925A1 (en) Software-defined Interconnection Method and Apparatus for Heterogeneous Protocol Data
CN111556383A (en) Optical module adaptive speed interface method, switch and computer storage medium
JP2017531339A (en) Method and apparatus for interconnecting smart terminals and in-vehicle terminals
CN111835569A (en) Optical interface rate and mode self-adapting method, system and storage medium
CN104519482A (en) Equipment parameter configuration method and device
US8886913B2 (en) Apparatus and method for identifier management
CN111541629A (en) Mode self-adaption method, device, equipment and computer readable storage medium
US11323179B2 (en) Testing method for optical communication module, and test device
CN113848850A (en) BSP board bus interface test method, device and storage medium
CN110545494A (en) method and device for rapidly switching passive optical network types and related equipment thereof
CN102752050A (en) Method and device for realizing communication between host machine and multiple optical modules
CN111541960B (en) Switch configuration method, device, equipment and computer readable storage medium
EP3300384A1 (en) Onu template generating method and device
CN111541568B (en) Switch configuration method, device, equipment and computer readable storage medium
CN107710681B (en) Method and apparatus for upgrading multi-dwelling unit
CN115373927B (en) Product testing method, device, electronic equipment and computer readable medium
US7047449B2 (en) Method for providing cable isolation in a fibre channel test environment using a software driven PCI device
CN110740439A (en) Intelligent matching method of Zigbee equipment and Zigbee equipment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200814