Method for managing optical module and network equipment
Through the combination of logic devices and analog switches, the insertion and removal status of optical modules are identified and isolated, and the I2C polling problem during the initialization and removal of optical modules is solved, improving the stability and response speed of the system.
Patent Information
- Application Number
- CN202510537329.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-27
- Publication Date
- 2025-06-20
AI Technical Summary
The prior art cannot respond quickly to I2C polling during the initialization and unplugging of optical modules, resulting in problems such as interruption of optical module initialization, I2C bus hang and decreased system stability.
The operating status of the optical module is obtained through logic devices such as CPLD, and the target optical module inserted or unplugged is identified, and communication with the optical module is enabled or turned off through analog switches, combining with the software-level timely response and isolation processing.
It effectively avoids the situation where optical modules are misvisited during the initialization stage, improves the stability of optical modules' work, improves the overall response speed and reliability of the system, and reduces the risk of overall system crash due to individual optical module failures.
Smart Images

Figure CN120186508A_ABST
Abstract
Description
Technical Field
[0001] This specification relates to the field of communication technologies, and in particular, to a method for managing optical modules and a network device. Background Art
[0002] Optical module: A key component in an optical communication system, used to implement the conversion between optical signals and electrical signals.
[0003] I2C: A commonly used serial communication protocol. It is mainly used for short-distance communication inside and between electronic devices.
[0004] In modern communication devices, optical modules are key components for implementing optoelectronic signal conversion and are widely used in devices such as data centers, routers, and switches. With the increasing network demand, the number of optical modules in devices is also continuously increasing. Especially in complex distributed devices, the number of optical modules may reach dozens or even hundreds. These optical modules communicate with the main device through the I2C interface to transfer status information and configuration parameters.
[0005] However, the initialization time of optical modules has strict requirements for I2C access: for optical modules with a rate of 25G and below, I2C access is prohibited within 300 ms; for optical modules with a rate of 40G and above, I2C access is prohibited within 2 seconds. These requirements pose great challenges in practical applications. Currently, device management software usually polls optical modules through the I2C interface regularly to obtain real-time status information. However, during the plugging and unplugging process of optical modules, the software system often fails to respond quickly to pause I2C polling, which may lead to the following problems:
[0006] 1. Optical module initialization interruption: Performing I2C access when the optical module initialization is not completed may cause the module initialization to fail, further affecting its normal function and even triggering communication failures.
[0007] 2. I2C bus hang: During the initialization or removal of an optical module, if I2C access fails to be paused in time, it may cause the I2C bus to hang, affecting the normal communication of the optical module and even causing the entire system's I2C bus to break down.
[0008] 3. System stability degradation: For optical modules with access failures, if not isolated in time, it may have a negative impact on the stability of the entire system. Summary of the Invention
[0009] To overcome the problems existing in the related technologies, this specification provides a method for managing optical modules and a network device.
[0010] According to the first aspect of the embodiments of this specification, a method for managing optical modules is provided. The method includes:
[0011] Obtain the operating status of each optical module through a logic device, and identify the target optical module whose operating status has changed;
[0012] Send the target optical module information to the CPU;
[0013] Receive and respond to the processing actions sent by the CPU for the target optical module, and enable or disable the communication with the target optical module through the analog switch connected to the target optical module.
[0014] Among them, the logic device includes: a CPLD device.
[0015] Among them, the obtaining the operating status of each optical module through the logic device includes:
[0016] Obtain the insertion and / or removal signals of each optical module through the logic device.
[0017] Among them, the sending the target optical module information to the CPU includes:
[0018] Send the operating status of each optical module to the CPU through the convergence interrupt method.
[0019] Among them, the receiving and responding to the processing actions sent by the CPU for the target optical module, and enabling or disabling the communication with the target optical module through the analog switch connected to the target optical module includes:
[0020] When it is recognized that the target optical module is inserted, receive and respond to the processing action of closing the analog switch sent by the CPU for the target optical module, and enable communication between the CPU and the target optical module;
[0021] When it is recognized that the target optical module is removed, receive and respond to the processing action of opening the analog switch sent by the CPU for the target optical module, and disable communication between the CPU and the target optical module;
[0022] Among them, the CPU presets a delay communication duration for different optical port types.
[0023] Among them, the method further includes:
[0024] When the logic device receives the processing action sent by the CPU when detecting a failure in the I2C polling access to the target optical module, the logic device closes the communication between the CPU and the target optical module through the analog switch according to the processing action.
[0025] As can be seen from the above embodiments, by setting the analog switch control and logic device detection at the hardware level, combined with the timely response and isolation processing at the software level, the situation where the optical module is misaccessed during the initialization stage is effectively avoided, and the working stability of the optical module is improved. Specifically, when the optical module is unplugged, the communication between the CPU and the unplugged optical module can be timely disconnected through the analog switch, the invalid polling access is stopped, the overall response speed of the system is improved, and the isolation mechanism for abnormal optical modules is enhanced, the reliability of the system is enhanced, it can adapt to various complex network environments, and the risk of the overall system crash caused by the failure of individual optical modules is reduced.
[0026] According to the second aspect of the embodiments of the present specification, a network device is provided. The network device includes a CPU, an optical module, a logic device, and an analog switch. Among them, the logic device is connected to the analog switch, and the logic device and the analog switch are respectively connected to the CPU and the optical module;
[0027] The logic device is used to obtain the operating states of each optical module and identify the target optical module whose operating state has changed;
[0028] The logic device sends the target optical module information to the CPU;
[0029] The logic device receives and responds to the processing action for the target optical module sent by the CPU, and enables or closes the communication with the target optical module through the analog switch connected to the target optical module.
[0030] Among them, the logic device includes: a CPLD device.
[0031] Among them, the logic device is specifically used to send the operating states of each optical module to the CPU in a way of aggregated interrupt.
[0032] Among them, the logic device is specifically used to, when it identifies that the target optical module is inserted, receive and respond to the processing action of closing the analog switch for the target optical module sent by the CPU, and enable the communication between the CPU and the target optical module;
[0033] When it identifies that the target optical module is unplugged, receive and respond to the processing action of opening the analog switch for the target optical module sent by the CPU, and close the communication between the CPU and the target optical module;
[0034] Among them, a delay communication duration for different optical port types is preset in the CPU.
[0035] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit this specification. Description of the Drawings
[0036] The accompanying drawings here are incorporated into the specification and form a part of this specification, showing embodiments consistent with this specification, and are used together with the specification to explain the principles of this specification.
[0037] Figure 1 is a schematic circuit diagram shown in accordance with an exemplary embodiment of this specification.
[0038] Figure 2 is a schematic flowchart of a method for managing an optical module shown in accordance with an exemplary embodiment of this specification.
[0039] Figure 3 is a schematic circuit diagram shown in accordance with an exemplary embodiment of this specification. Detailed implementation manners
[0040] Here, the exemplary embodiments will be described in detail, and the examples are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this specification. On the contrary, they are merely examples of devices and methods consistent with some aspects of this specification as detailed in the appended claims.
[0041] The terms used in this specification are for the purpose of describing specific embodiments only and are not intended to limit this specification. The singular forms "a", "the", and "said" used in this specification and the appended claims are also intended to include the plural forms unless the context clearly dictates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
[0042] It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "when" or "while" or "in response to determining".
[0043] In a current technology for preventing the insertion and removal of an optical module from affecting I2C communication, a Buffer chip is connected between the CPU and each optical module, such as Figure 1As shown in the figure, there are a Buffer chip, a fiber optic interface for accessing an optical module, and a CPU for monitoring the status of the optical module; the Buffer chip is connected to the SCL line on the IIC interface of the CPU; multiple signal transmission terminals are provided on the Buffer chip, and all of the multiple signal transmission terminals are transmission lines for SCL signals; multiple fiber optic interfaces are provided, and the multiple signal transmission terminals are respectively connected to the multiple fiber optic interfaces in one-to-one correspondence, so as to realize accessing the Buffer chip on the SCL clock line of the IIC interface, and dividing the SCL clock signal into multiple paths by the Buffer chip for use by multiple optical modules respectively, realizing the separation of the SCL clock signals between the optical modules.
[0044] However, in the above method, there are the following problems:
[0045] 1. When the data SDA signal of the I2C bus is shared by multiple optical modules, if the SDA pin of one optical module is abnormally hung and pulled low or shorted to the ground, the entire system I2C bus will be unavailable, and other optical modules cannot be accessed either.
[0046] 2. Lack of systematic design, it is impossible to effectively avoid the software initiating I2C access during the initialization stage when plugging and unplugging the optical module, and it is impossible to meet the requirements of the optical module specification.
[0047] 3. When an abnormal access to the optical module occurs, it is impossible to achieve software and hardware access isolation for the abnormal optical module, and there is a greater risk of causing the I2C bus and the system to hang.
[0048] To solve the above technical problems, an embodiment of the present disclosure provides a method for managing an optical module, as Figure 2 shown, the method includes:
[0049] S201 Obtain the operating status of each optical module through a logic device, and identify a target optical module whose operating status has changed;
[0050] S202 Send the target optical module information to the CPU;
[0051] S203 Receive and respond to the processing action for the target optical module sent by the CPU, and enable or disable the communication with the target optical module through the analog switch connected to the target optical module.
[0052] In this embodiment, various sensors and circuits can be arranged in the optical module to collect relevant parameters. For example, a temperature sensor, a photodiode, an ADC (analog-to-digital converter), a status register, and communicate with the CPU through a standard interface, such as an I2C / SMBus interface.
[0053] Among them, the CPU can access the registers of the optical module through the device driver, polling periodically or responding to interrupts (such as threshold alarms). For example, in the Linux system, the data of the I2C slave device is read through i2c-tools or the kernel driver.
[0054] In this embodiment, it is implemented by providing a method for managing the optical module: 1. During the initialization process of the optical module, problems such as bus anomalies or device crashes caused by I2C access are avoided. 2. After the optical module is unplugged, an invalid I2C polling access is quickly responded to and stopped. 3. The abnormal optical module is isolated at the software and hardware levels to prevent it from affecting the normal operation of the system I2C bus.
[0055] Specifically, in step S201, the logic device can be a CPLD device. Among them, CPLD (Complex Programmable Logic Device) is an integrated circuit based on programmable logic, mainly used to implement digital logic design. It is between simple PLDs (such as PAL, GAL) and more complex FPGAs, suitable for medium and small-scale logic integration, and has the characteristics of high flexibility and short design cycle.
[0056] In this embodiment, the logic device can obtain the operating status of each optical module through an active acquisition method or a passive reception method. In one example, the obtained operating status can be all operating attributes of each optical module, such as including: transmitted optical power, bias current, extinction ratio, etc.; in another example, the operating status can include the inserted or unplugged state of the optical module.
[0057] In step S201, after the logic device obtains the operating status of each optical module, it can identify the target optical module whose operating status has changed according to user needs (for example, identify the newly inserted optical module and / or the unplugged optical module), and send the operating status of each optical module to the CPU through the aggregation interrupt method.
[0058] In this embodiment, the logic device can store the obtained operating status of each optical module through registers. Among them, the logic device sending the target optical module information to the CPU can include active sending (that is, the logic device actively sends the target optical module information to the CPU) or passive sending (that is, the CPU reads the register of the logic device to obtain the target optical module information).
[0059] In this embodiment, when the CPU learns through the logic device that there is a newly inserted optical module, the CPU can determine the delay duration of the newly inserted optical module (referred to as the target delay duration for distinction) according to the preset delay time of each optical port type, and the CPU tells the logic device the target delay duration of the newly inserted optical module.
[0060] In step S203, after the logic device receives the target delay duration sent by the CPU, when the target delay duration arrives, it will control the analog switch to close the communication link between the CPU and the target optical module, enabling the CPU to communicate with the target optical module.
[0061] Through the above steps, it can be achieved that the I2C bus channel is in a physically closed state during the initialization process of the optical module, avoiding the access to the optical module that has not been initialized.
[0062] In this embodiment, when the CPU learns through the logic device that an optical module has been unplugged, the CPU can immediately notify the logic device to turn off the corresponding target optical module.
[0063] After receiving the notification from the CPU to turn off the corresponding target optical module, the logic device controls the analog switch to disconnect the communication link between the CPU and the target optical module, achieving physical isolation, and stops the I2C polling access to the optical module.
[0064] From the above examples, it can be seen that through the hardware physical isolation and software active intervention mechanism, it is ensured to quickly respond to the unplugging action of the optical module, stop the ineffective polling access, and improve the system reliability.
[0065] In this embodiment, when the logic device receives the processing action sent by the CPU when detecting the failure of the I2C polling access to the target optical module, the CPU can notify the logic device to turn off the I2C polling function of the target optical module, and the logic device can control the analog switch to close the communication link between the CPU and the target optical module according to the notification of the CPU, thereby avoiding the abnormal optical module from affecting the I2C bus.
[0066] From the above embodiments, it can be seen that setting the analog switch control and logic device detection at the hardware level, combined with the timely response and isolation processing at the software level, effectively avoids the situation of the optical module being misaccessed during the initialization stage and improves the stability of the optical module operation.
[0067] Based on the above method embodiments, the present disclosure embodiments also provide a network device, the network device includes a CPU, an optical module, a logic device and an analog switch, wherein, the logic device is connected to the analog switch, and the logic device and the analog switch are respectively connected to the CPU and the optical module;
[0068] The logic device is used to obtain the operating states of each optical module and identify the target optical module whose operating state has changed;
[0069] The logic device sends the target optical module information to the CPU;
[0070] The logic device receives and responds to the processing action for the target optical module sent by the CPU, and enables or disables the communication with the target optical module through the analog switch connected to the target optical module.
[0071] like Figure 3 As shown, the analog switch is connected in series between the CPU and each optical module through SCL and SDA. When the module switch connects the CPU and the optical module, the communication between the CPU and the optical module can be realized. When the analog open loop disconnects the CPU and the optical module, the link between the CPU and the optical module can be physically disconnected.
[0072] Typically, analog switches have different port specifications, such as Figure 3 The analog switch has 4 management ports, which can manage two optical modules, that is, SCL0 and SDA0 are connected to optical module 0, and SCL1 and SDA1 are connected to optical module 1. Figure 3 The four optical modules in the system can be controlled by two analog switches.
[0073] The logic device is respectively connected to the analog switch, the CPU and the optical module (to obtain the in-place signal).
[0074] In this embodiment, the logic device includes: a CPLD device.
[0075] The logic device is specifically used to send the operating status of each optical module to the CPU through a converged interruption method.
[0076] The logic device is specifically used to receive and respond to the processing action of closing the analog switch for the target optical module sent by the CPU when the target optical module is identified to be inserted, and the CPU and the target optical module are enabled to communicate;
[0077] When it is identified that the target optical module is unplugged, the CPU receives and responds to the processing action of opening the analog switch for the target optical module, and the CPU closes the communication with the target optical module;
[0078] Wherein, the CPU is preset with delayed communication durations for different optical port types.
[0079] Through the method in this embodiment, the I2C access protection mechanism when the optical module is plugged in and out is implemented:
[0080] When the optical module is inserted or removed, the in-place signal is transmitted to the logic device.
[0081] The logic device filters and de-jitters the presence signal, and reports the presence signals of multiple optical modules to the CPU in the form of aggregate interrupts.
[0082] 1. The CPU reads the corresponding registers of the logic device to obtain the presence status of each optical module. For the inserted optical module, the CPU delays for a sufficient time according to the pre-set optical port type, and then enables the corresponding analog switch through the control logic device, ensuring that the I2C bus channel is physically closed during the initialization process of the optical module to prevent the uninitialized optical module from being accessed.
[0083] 2. For the removed optical module, the CPU immediately disables the enabling signal of the corresponding analog switch after receiving the interrupt, realizes physical isolation, and stops the I2C polling access to this optical module. Through the hardware physical isolation and software active intervention mechanism, it ensures a quick response to the removal of the optical module, stops the ineffective polling access, and improves the system reliability.
[0084] Through the method in this embodiment, an isolation mechanism for abnormal optical modules is realized:
[0085] 1. For the optical module that is normally present, if the CPU detects that the I2C polling access fails a preset number of times, it closes the I2C polling function of this module and simultaneously closes the corresponding analog switch channel to prevent the abnormal optical module from affecting the I2C bus.
[0086] 2. When the CPU detects that the abnormal optical module is removed, it releases the software isolation operation.
[0087] As can be seen from the above embodiments, through the collaborative work of hardware and software, this solution ensures the stability and reliability of the optical module and the system I2C bus, and is applicable to various complex network environments.
[0088] For the device embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The device embodiments described above are only illustrative. The modules described as separate components may or may not be physically separated. The components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement it without creative work.
[0089] The specific embodiments of this specification are described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be executed in a different order from that in the embodiments and still achieve the desired results. Additionally, the processes depicted in the figures do not necessarily require the specific order or continuous order shown to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0090] Those skilled in the art will readily conceive of other embodiments of this specification after considering the specification and practicing the invention claimed herein. This specification is intended to cover any variations, uses, or adaptations of this specification that follow the general principles of this specification and include known common general knowledge or conventional technical means in the technical field not claimed in this specification. The specification and examples are only to be regarded as exemplary, and the true scope and spirit of this specification are pointed out by the following claims.
[0091] It should be understood that this specification is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of this specification is only limited by the appended claims.
[0092] The above are only the preferred embodiments of this specification and are not intended to limit this specification. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this specification shall be included within the scope of protection of this specification.
Claims
1. A method for managing an optical module, characterized in that: The method comprises: Obtain the operating status of each optical module through a logic device, and identify the target optical module whose operating status has changed; Send the target optical module information to the CPU; Receive and respond to the processing action sent by the CPU for the target optical module, and enable or disable the communication with the target optical module through the analog switch connected to the target optical module.
2. The method according to claim 1, characterized in that The logic device includes: a CPLD device.
3. The method according to claim 1, characterized in that The obtaining the operating status of each optical module through the logic device includes: The insertion and / or removal signal of each optical module is obtained through the logic device.
4. The method according to claim 1, characterized in that: The step of sending the target optical module information to the CPU includes: The operating status of each optical module is sent to the CPU through the aggregation interrupt mode.
5. The method according to claim 1, characterized in that The receiving and responding to the processing action for the target optical module sent by the CPU, and enabling or disabling the communication with the target optical module through the analog switch connected to the target optical module, includes: When the insertion of the target optical module is recognized, the CPU receives and responds to the processing action of closing the analog switch for the target optical module, and the CPU enables communication with the target optical module; When it is identified that the target optical module is unplugged, the CPU receives and responds to the processing action of opening the analog switch for the target optical module, and the CPU closes the communication with the target optical module; Wherein, the CPU is preset with delayed communication durations for different optical port types.
6. The method according to claim 1, characterized in that The method further comprises: When the logic device receives the processing action sent by the CPU when detecting that the I2C polling access to the target optical module fails, the logic device shuts down the communication between the CPU and the target optical module through the analog switch according to the processing action.
7. A network device, characterized in that: The network device includes a CPU, an optical module, a logic device and an analog switch, wherein the logic device is connected to the analog switch, and the logic device and the analog switch are connected to the CPU and the optical module respectively; The logic device is used to obtain the operating status of each optical module and identify the target optical module whose operating status has changed; The logic device sends the target optical module information to the CPU; The logic device receives and responds to the processing action for the target optical module sent by the CPU, and enables or disables the communication with the target optical module through the analog switch connected to the target optical module.
8. The network device according to claim 7, characterized in that: The logic device includes: a CPLD device.
9. The network device according to claim 7, characterized in that: The logic device is specifically used to send the operating status of each optical module to the CPU through a converged interruption mode.
10. The network device according to claim 7, characterized in that: The logic device is specifically used to receive and respond to the processing action of closing the analog switch for the target optical module sent by the CPU when the target optical module is identified to be inserted, and the CPU and the target optical module are enabled to communicate; When it is identified that the target optical module is unplugged, the CPU receives and responds to the processing action of opening the analog switch for the target optical module, and the CPU closes the communication with the target optical module; Wherein, the CPU is preset with delayed communication durations for different optical port types.