Secure switching method and device for Combo port mode and electronic equipment

By monitoring the real-time operating parameters of the optical module and adaptive rate matching, secure access control and seamless service switching of the Combo port are achieved, solving the problems of security risks, service interruptions and insufficient compatibility in existing technologies, and improving the reliability and intelligent operation and maintenance of network devices.

CN121908170APending Publication Date: 2026-04-21深圳市宇泰科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
深圳市宇泰科技有限公司
Filing Date
2026-02-26
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

The existing Combo port management mode has problems such as security risks, service interruption, insufficient compatibility and lack of adaptive capability when optical modules are inserted or removed, which cannot meet the requirements of high reliability and high availability networks.

Method used

By monitoring the real-time operating parameters of the optical module, including operating temperature, supply voltage, and laser bias current, safe access control and adaptive compatibility negotiation are achieved. Combined with pre-switching timing windows and temporary buffer queues, service continuity and seamless handover are ensured.

Benefits of technology

It improves the reliability of port management and the level of intelligent operation and maintenance, realizes secure switching and seamless service conversion under the healthy state of optical modules, and solves the problems of poor security and insufficient compatibility in traditional solutions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121908170A_ABST
    Figure CN121908170A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of network communication, and provides a Combo port mode safety switching method, a Combo port mode safety switching device and electronic equipment. Optical module insertion is determined by monitoring a level signal of the state detection pin; reading real-time working parameters of a register in the optical module through an I2C bus, and judging whether the real-time working parameters are in a preset normal working interval or not; only when the parameters are normal, the Combo port is switched from the electric port mode to the optical port mode, and a link is established. According to the invention, through the security policy of diagnosis and switching and the introduction of mechanisms such as temporary data caching, adaptive rate matching and operation state monitoring, the system instability caused by poor quality or fault optical modules is effectively prevented, and the port compatibility and the continuity of network services are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and more specifically, to a method, apparatus, and electronic device for secure switching of Combo port mode.

[0002] In network devices (such as switches and routers), a Combo port is a composite port that physically multiplexes and logically excludes electrical ports (such as RJ45 interfaces) and optical ports (such as SFP optical module interfaces). Users can choose to use either electrical or optical ports according to actual cabling needs, thereby improving the flexibility of device deployment and port resource utilization. Currently, the mainstream Combo port management mode relies on monitoring the level signal of status detection pins (such as ModAbs) on optical modules. The basic process is as follows: when the level of this pin is detected to change from low to high (indicating that the module is inserted), the port control logic automatically switches the working mode from electrical port to optical port and attempts to initiate automatic negotiation of the optical port link to establish a connection; when the level is detected to change from high to low (indicating that the module is removed), it automatically switches back to electrical port mode.

[0003] However, this automatic switching mechanism based on a single physical insertion / removal event has significant defects and security risks, making it difficult to meet the growing demand for high reliability and high availability networks. Specifically, it is manifested in the following aspects: (1) The existing scheme switches unconditionally after detecting physical insertion. If the inserted optical module itself is faulty or degraded (e.g., operating temperature exceeds the standard, power supply voltage is abnormal, laser bias current is too large), forcibly establishing an optical port link is very likely to cause frequent link oscillations, data transmission errors, and may even spread the abnormal state, affecting the overall stability of the switching equipment. (2) At the moment of switching from electrical port mode to optical port mode, the data forwarding path undergoes a hard switch. During this process, the data frames being transmitted may be lost due to the reconfiguration of parameters such as port status and rate, causing a brief interruption at the service level, and failing to achieve the seamless or zero packet loss switching experience required by operators or data centers. (3) Faced with a wide variety of non-standard or new optical modules with different models and parameters on the market, a fixed link negotiation strategy may lead to compatibility failure, making the port unable to start normally. At this time, it is often necessary for the administrator to manually configure, which increases the complexity and cost of operation and maintenance. The existing solution lacks the ability to adaptively learn unknown modules. (4) The existing solution only focuses on the state at the time of insertion and removal. For the slow performance decline of optical modules due to aging, fiber optic link degradation and other reasons during long-term operation (such as continuous attenuation of received optical power), there is a lack of effective periodic monitoring and trend analysis methods. It is impossible to give early warning or actively implement protection switching before the link is completely interrupted, which is a passive fault response mode.

[0004] Therefore, there is an urgent need to propose an innovative Combo port management mode that can achieve intelligent, secure, and reliable mode switching and operation and maintenance while ensuring business continuity, thereby fundamentally solving the above problems. Summary of the Invention

[0005] The purpose of this application is to provide a secure switching method, apparatus, and electronic device for Combo port mode, which has the advantages of enabling secure access control based on the health status of optical modules, adaptive compatibility negotiation, and seamless service switching, thereby improving the reliability of port management, service continuity, and the level of intelligent operation and maintenance.

[0006] Firstly, this application provides a secure method for switching between Combo port modes, the technical solution of which is as follows: The level signal of the monitoring status detection pin is used to determine that the optical module is inserted into the Combo port when the insertion trigger condition is met. The Combo port has an electrical port mode and an optical port mode. The electrical port mode is the working state of sending and receiving data frames through the electrical interface, and the optical port mode is the working state of sending and receiving data frames through the optical module and the optical interface. The internal registers of the optical module are read via the I2C bus to obtain real-time operating parameters, and it is determined whether the real-time operating parameters are within the corresponding preset normal operating range. In response to the real-time operating parameters being within the preset normal operating range, the Combo port is switched from the electrical port mode to the optical port mode and an optical port link connection is established to send and receive data frames through the optical module and the optical interface; otherwise, the electrical port mode is maintained and an optical module abnormality alarm message is generated. The level signal of the status detection pin is monitored, and when the unplug trigger condition is met, the Combo port is switched from the optical port mode back to the electrical port mode.

[0007] Furthermore, the real-time operating parameters include operating temperature, supply voltage, and laser bias current; after determining that the real-time operating parameters are within the corresponding preset normal operating range, the method further includes: A pre-switching timing window is initiated. During the pre-switching timing window, the Combo port receives data frames through the electrical interface and temporarily stores the received data frames in a temporary buffer queue. After establishing the optical port link connection, the data frames in the temporary buffer queue are forwarded through the optical interface, and then the temporary buffer queue is cleared and normal forwarding processing is restored.

[0008] Preferably, switching the Combo port from the electrical port mode to the optical port mode includes: Before switching, the received data frames are buffered by the switching chip, and the update of the outgoing port field corresponding to the Combo port in the MAC address forwarding table is paused. After the switchover is completed and the optical port link connection is established, the data frames cached by the switching chip are forwarded through the optical port, and the output port field is updated to the optical port identifier.

[0009] Furthermore, the step of switching the Combo port from the electrical port mode to the optical port mode further includes: Read the rate register of the optical module to obtain the data transmission rate supported by the optical module; Configure the operating speed of the corresponding port of the switching chip according to the data transmission rate to establish the optical port link connection.

[0010] Furthermore, the step of reading the rate register of the optical module to obtain the data transmission rate supported by the optical module includes: The manufacturer identification register and model identification register of the optical module are read through the I2C bus; Check if the local compatibility table stores a record containing the combination of the manufacturer identifier and the model identifier; When no corresponding record is found, the real-time working parameters are compared with the preset type parameter range to determine the type of the optical module. Based on the preset rate level sequence corresponding to the type, the working rate of the corresponding port of the switching chip is attempted to be configured from high to low until the optical port link connection is established. The manufacturer identifier, model identifier, operating speed, and real-time operating parameters corresponding to the successful establishment of the link connection are stored as mapping records in the local adaptation table.

[0011] Furthermore, after establishing the optical port link connection, the method further includes: The internal registers of the optical module are periodically read via the I2C bus to obtain the received optical power value and temperature value; The received optical power value is stored in a circular queue, and the power change slope within a preset time window is calculated. When the power change slope exceeds a preset threshold and the current received optical power value is lower than a preset safety threshold, a maintenance alarm message is generated or the Combo port is switched to the electrical port mode.

[0012] Furthermore, the insertion triggering condition includes: the level signal of the state detection pin changes from high level to low level, and the low level is maintained for more than the preset insertion debounce duration; The pull-out trigger condition includes: the level signal of the status detection pin changes from low level to high level, and the high level is maintained for more than the preset pull-out anti-shake duration; Alternatively, a physical interruption of the optical port link connection is detected, and the level signal of the status detection pin is low.

[0013] Furthermore, the method is applied to a switching device including multiple Combo ports; after obtaining the real-time operating parameters, it further includes: When multiple Combo ports are detected to meet the insertion triggering conditions within the same time window, the operating temperature and laser bias current in the real-time operating parameters of each optical module are compared. If the operating temperature deviation of each optical module and the laser bias current deviation are both less than the preset threshold, it is determined to be a batch insertion event. For optical modules identified as batch insertion events, the upper limit of the preset normal working range is lowered and the lower limit is raised to form a narrowed verification range, and the judgment is made using the narrowed verification range.

[0014] Secondly, this application also provides a Combo port mode secure switching device, comprising: The monitoring module is used to monitor the level signal of the status detection pin. When the insertion trigger condition is met, it determines that the optical module is inserted into the Combo port. The Combo port has an electrical port mode and an optical port mode. The electrical port mode is the working state of sending and receiving data frames through the electrical interface, and the optical port mode is the working state of sending and receiving data frames through the optical module and the optical interface. The judgment module is used to read the internal registers of the optical module through the I2C bus, obtain real-time operating parameters, and determine whether the real-time operating parameters are within the corresponding preset normal operating range. The first switching module is used to switch the Combo port from the electrical port mode to the optical port mode and establish an optical port link connection in response to the real-time working parameters being within the preset normal working range, so as to send and receive data frames through the optical module and the optical interface; otherwise, it maintains the electrical port mode and generates an optical module abnormal alarm information. The second switching module monitors the level signal of the status detection pin and switches the Combo port from the optical port mode back to the electrical port mode when the unplug trigger condition is met.

[0015] Thirdly, this application also provides an electronic device comprising: one or more processors, and a memory for storing one or more computer programs; the computer programs are configured to be executed by the one or more processors, and the programs include methods for performing the Combo port mode secure switching method as described in the first aspect.

[0016] As can be seen from the above, the Combo port mode secure switching method, device and electronic device provided in this application solves the problems of poor security, easy service interruption and insufficient compatibility caused by the existing Combo port switching based solely on physical insertion events by constructing a security access mechanism based on digital diagnostic monitoring, adaptive rate matching learning and service seamless switching process. It has the advantages of being able to realize intelligent security decision-making based on module health status, adaptive compatibility with unknown modules and continuous uninterrupted guarantee of critical services, which significantly improves the reliability, flexibility and automation level of port management. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating the steps of the secure switching method for Combo port mode disclosed in an embodiment of the present invention; Figure 2 This is a flowchart illustrating the steps of the method for obtaining the data transmission rate supported by an optical module as disclosed in an embodiment of the present invention. Figure 3 This is a schematic diagram of the secure switching system structure for the silver Combo port mode disclosed in an embodiment of the present invention. Detailed Implementation

[0018] 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 these embodiments belong; the terminology used herein and in the specification of the application is for the purpose of describing particular embodiments only and is not intended to limit these embodiments; the terms "comprising" and "having," and any variations thereof, in the specification of these embodiments and the foregoing drawings, are intended to cover non-exclusive inclusion. The terms "first," "second," etc., in the specification of these embodiments and the foregoing drawings are used to distinguish different objects, not to describe a particular order.

[0019] The implementation details of the technical solution in this embodiment are described in detail below: Firstly, this embodiment provides a secure method for switching Combo port modes, including: S101, monitor the level signal of the status detection pin, and when the insertion trigger condition is met, determine that the optical module is inserted into the Combo port; the Combo port has an electrical port mode and an optical port mode. The electrical port mode is the working state of sending and receiving data frames through the electrical interface, and the optical port mode is the working state of sending and receiving data frames through the optical module and the optical interface.

[0020] Specifically, in this embodiment, in step S101, monitoring the level signal of the status detection pin refers to continuously sampling the level state of the Modular Absence (ModAbs) pin on the optical module socket. When the insertion trigger condition is met, it can be understood that the level signal of the ModAbs pin is detected to jump from a logic high level (e.g., 3.3V, representing that the module is not inserted or has been removed) to a logic low level (e.g., 0V), and this low level state remains stable for more than a preset insertion anti-jitter duration (e.g., 50 milliseconds), thereby effectively filtering out false trigger signals caused by momentary jitter due to physical contact. Determining that the optical module is inserted into the Combo port is based on this stable level change. The port management logic (Port Manager) of the switch or a dedicated control chip determines that an optical module has been reliably inserted into the optical module slot corresponding to the Combo port. Here, the electrical port mode is the working state of transmitting and receiving data frames through the electrical interface (e.g., RJ45 interface) and its internal PHY chip; the optical port mode is the working state of transmitting and receiving data frames through the inserted optical module and its internal photoelectric conversion components, as well as the fiber optic interface connected to it. This step marks the physical event perception starting point for mode switching.

[0021] S102, read the internal register of the optical module through the I2C bus to obtain real-time operating parameters, and determine whether the real-time operating parameters are within the corresponding preset normal operating range.

[0022] Specifically, in this embodiment, step S102, reading the internal registers of the optical module via the I2C bus, means that the port control logic accesses the Digital Diagnostic Monitoring (DDM) storage area within the optical module, which conforms to standards such as SFF-8472, through the standard two-wire serial interface (I2C) protocol. Obtaining real-time operating parameters specifically refers to reading key diagnostic data reflecting the current operational health of the optical module, such as reading the operating temperature (Temperature) from address 0x00, the supply voltage (Vcc) from address 0x01, and the laser bias current (Tx Bias Current) from address 0x02. Determining whether the real-time operating parameters are within the corresponding preset normal operating range means comparing the read real-time values ​​with the safety threshold ranges pre-configured by the device or specified by standards. For example, the preset temperature range is -5℃ to +70℃, the preset voltage range is 3.13V to 3.47V, and the preset bias current range is 2mA to 10mA (the specific thresholds vary depending on the module type). This step represents a crucial leap from physical insertion awareness to logical security decision-making. Its purpose is to conduct an access security check on the electrical health status of the optical module before switching port modes, ensuring that only optical modules with normal parameters are allowed to access the system.

[0023] S103, in response to the real-time operating parameters being within the preset normal operating range, the Combo port is switched from the electrical port mode to the optical port mode and an optical port link connection is established to send and receive data frames through the optical module and the optical interface; otherwise, the electrical port mode is maintained and an optical module abnormality alarm message is generated.

[0024] Specifically, in this embodiment, in step S103, a switch is performed in response to the real-time operating parameters being within the preset normal operating range. For example, if the temperature value is +35℃, the voltage is 3.3V, and the bias current is 6mA, all falling within the aforementioned example range, it is determined to be "healthy". Switching the Combo port from the electrical port mode to the optical port mode means that the control logic, by configuring the port multiplexer (MUX) inside the switch ASIC, switches the data channel from the electrical port PHY physical layer to the optical port SerDes serializer / deserializer, and powers on and resets the optical module. Establishing an optical port link connection means subsequently initiating the link training process in the optical port's auto-negotiation (e.g., 1000BASE-X) or forced rate mode to establish a stable physical layer and data link layer connection between the switch chip port and the optical module. Otherwise, if any parameter is abnormal (e.g., a temperature of +85℃ is detected, exceeding the upper limit), the result is determined to be abnormal. At this time, the method will keep the Combo port in the electrical port mode, that is, it will not change the connection status of the port multiplexer and the electrical port will remain active; at the same time, it will generate optical module abnormal alarm information, for example, by recording the event "Combo port X optical module temperature exceeds limit, switching to optical port mode has been prevented" through SNMP Trap or system log, and notify the network administrator to intervene.

[0025] S104, monitor the level signal of the status detection pin, and when the unplug trigger condition is met, switch the Combo port from the optical port mode back to the electrical port mode.

[0026] Specifically, in this embodiment, in step S104, monitoring the level signal of the status detection pin means continuously monitoring the ModAbs pin when the unplug trigger condition is met. The unplug trigger condition typically includes: detecting that the pin level changes from low to high, and the high level persists for more than a preset unplug debounce duration (e.g., 30 milliseconds). Switching the Combo port from the optical port mode back to the electrical port mode means that once it is confirmed that the optical module has been physically unplugged, the port control logic immediately reverses its operation: first, it deactivates the optical port link, then controls the port multiplexer to switch the data channel back to the electrical port PHY, and re-enters the electrical port into an active state, ready to receive signals from the electrical port link. This step ensures that the Combo port can automatically and promptly restore to the default or available electrical port operating mode after the optical module is removed, guaranteeing the continuous availability of the port.

[0027] This application's solution significantly enhances and restructures the traditional switching process, which relies solely on the physical event-driven process of step S101, by introducing a real-time operational parameter safety diagnostic step based on the I2C bus and digital diagnostic monitoring in step S102. The branch decision logic in step S103—switching or holding with an alarm—constitutes an intelligent safety threshold, ensuring that only optical modules that pass health and safety checks can trigger the subsequent complete mode switching and link establishment process. Step S104 further refines the closed-loop management of operational state switching. It is precisely because step S102 provides the ability to quantitatively read key health indicators such as the optical module's internal operating temperature, power supply voltage, and laser bias current, and the ability to accurately judge based on preset thresholds, that the decision in step S103 has an objective and reliable basis, thereby achieving a fundamental improvement in the Combo port management mode from unconditional switching to safe and intelligent switching. This complete closed-loop process of perception, diagnosis, decision-making, and execution effectively solves the long-standing technical pain point of traditional solutions, which may lead to system instability, frequent link failures, or even equipment damage due to direct access to optical modules with abnormal status. It significantly improves the reliability, security, and intelligence level of network device port management.

[0028] Furthermore, the real-time operating parameters include operating temperature, supply voltage, and laser bias current. In S102, after determining that the real-time operating parameters are within the corresponding preset normal operating range, the method further includes: A pre-switching timing window is initiated. During the pre-switching timing window, the Combo port receives data frames through the electrical interface and temporarily stores the received data frames in a temporary buffer queue. After establishing the optical port link connection, the data frames in the temporary buffer queue are forwarded through the optical interface, and then the temporary buffer queue is cleared and normal forwarding processing is restored.

[0029] Specifically, in this embodiment, the operating temperature refers to the real-time junction temperature of the photoelectric conversion components and control chip inside the optical module. This value is typically measured by a temperature sensor integrated within the module and provided as a digital quantity in degrees Celsius via the I2C interface. The supply voltage refers to the real-time voltage value on the power pins that provide energy to all circuits inside the optical module. The stability of this voltage directly determines the normal operation of the laser driver, clock data recovery circuit, and microcontroller inside the module. Its preset normal operating range is typically set around the nominal value of 3.3 volts, with an allowable fluctuation range, for example, 3.13 volts to 3.47 volts. A voltage value read by the system, for example, 3.28 volts, within this range indicates good power reception. If the read value is as low as 2.98 volts, it may mean insufficient power supply to the device backplane or a risk of internal short circuit in the module; in this state, the module's logic function may malfunction. The laser bias current refers to the DC current injected to drive the laser diode in the transmitter component inside the optical module. The magnitude of this current directly affects the output optical power and lifespan of the laser and is a critical parameter that needs to be strictly monitored. Its preset normal operating range depends on the type and rate class of the laser. For example, for a gigabit SFP module, this range might be set to 6 mA to 12 mA. A bias current value read by the system, such as 8.5 mA, within this range indicates that the laser drive is healthy. A reading as high as 18 mA strongly suggests that the laser may be aging, requiring a higher current to reach its nominal optical power, or that there is a control circuit malfunction, posing a risk of sudden failure if continued use is permitted.

[0030] In this embodiment, initiating the pre-switching timing window means that after step S102 determines the health of the optical module and decides to execute the switch, the port control logic immediately sets a countdown timer, the duration of which is the width W of the pre-switching timing window. The window width W is a key parameter preset based on system hardware performance and standard protocol negotiation time. For example, its typical value can be set to 200 milliseconds. This duration is calculated based on the estimation of the time consumed in each stage of the switching process: the switching delay of the port multiplexer is about 10 milliseconds, the time from optical module power-on reset to readiness is about 100 milliseconds, and the longest possible time for the gigabit Ethernet optical port to perform self-negotiation or link training is about 100 milliseconds. By adding these worst-case times and reserving a 10% margin, an estimated total duration of about 230 milliseconds can be obtained, and the window width W is finally rounded to 200 milliseconds. This window W covers the entire estimated time consumed from the switch decision to the execution of port multiplexer switching, optical module power-on initialization, link negotiation and training, until the optical port link is stably established.

[0031] During the pre-switching timing window, the Combo port receives data frames via the electrical interface. This means that although the system has decided to switch to optical port mode, within the window W before the optical port link is ready, the port control logic does not immediately cut off the data reception path of the electrical port. The electrical port physical layer chip remains active and can continuously receive data frames sent from the device at the other end of the twisted-pair link. The received data frames are temporarily stored in a temporary buffer queue, meaning the system dynamically allocates a first-in-first-out temporary queue Q in the switching chip's message buffer pool or dedicated memory for this switching event. All data frames received from the electrical port within the window W, whose destination address needs to be forwarded from this port, are copied or redirected to this temporary queue Q for buffered storage. Taking a gigabit operating rate as an example, within a 200-millisecond window W, the theoretical maximum amount of data R that the port can receive can be estimated using the formula R = port rate × time window. The line speed of a gigabit port is approximately 125 megabytes per second; therefore, within 0.2 seconds, the maximum data volume is 25 megabytes. To ensure that no packets are lost due to insufficient buffering under any circumstances, the system configures a buffer capacity C for the temporary queue Q to be slightly larger than R, for example, set to 32 megabytes. This guarantees that all frames can be safely buffered during the window, even if the electrical port is receiving data at full load.

[0032] In practical applications, after establishing an optical link connection, forwarding data frames in the temporary buffer queue through the optical interface means that within the pre-switching timing window W, when the system detects that the carrier signal of the optical link is stable, auto-negotiation is complete, or forced rate link training is successful, the optical link connection is considered established. At this time, the port control logic first notifies the forwarding engine to send all data frames temporarily stored in the temporary buffer queue Q as the first batch of data through the newly activated optical port SerDes channel and optical module. The forwarding engine will expel the data in queue Q as quickly as possible at the rate of successful optical port negotiation, for example, one gigabits per second. Assuming that the queue has 15 megabytes of data buffered, at gigabits per second, the time T_cache required to forward all this buffered data is approximately 15 multiplied by 8 and then divided by 1000, which equals 120 milliseconds. This time for forwarding buffered data overlaps with the normal forwarding of subsequent new packets, and its priority is guaranteed by the scheduler of the switching chip. Subsequently, clearing the temporary buffer queue means that after all data frames in queue Q have been successfully sent, the system releases the memory resources allocated to the queue and marks it as free. Resuming normal forwarding processing means that, after this point, all newly arriving data frames at the Combo port will no longer enter the temporary buffer queue, but will directly enter the standard forwarding pipeline of the switching chip for processing, achieving line-rate forwarding. At this point, the seamless service switching process is complete.

[0033] This application's solution cleverly addresses the pain point of service interruption during hard port mode switching by embedding a pre-switching timing window and a temporary buffer queue mechanism within the secure switching process. Starting a window W and buffering packets via the electrical port during this period is equivalent to pressing a pause button rather than a stop button on ongoing service traffic, ensuring that data arriving during the switching period is fully preserved within the system. Subsequently, once the optical port link is ready, buffered data is forwarded first, ensuring the temporal continuity of the data flow. It is precisely because of this mechanism's precise time buffering and quantitative data storage—for example, by calculating and setting a 200-millisecond window and a 30-megabyte queue depth to match the theoretical traffic of a gigabit port—that the entire port mode switching process is completely transparent to other devices and end users on the network, with no packet loss or connection interruption perceptible.

[0034] Preferably, the step of switching the Combo port from the electrical port mode to the optical port mode includes: before switching, buffering the received data frames through the switching chip and pausing the updating of the outgoing port field corresponding to the Combo port in the MAC address forwarding table; after completing the switching and establishing the optical port link connection, forwarding the data frames buffered through the switching chip through the optical port, and updating the outgoing port field to the optical port identifier.

[0035] Specifically, in this embodiment, before the switchover, the data frames received are buffered by the switching chip. This means that just before the system makes a switchover decision based on security diagnostic results and triggers a hardware switchover action (such as configuring a port multiplexer), the port driver software sends a control command to the traffic management unit of the switching chip to set the receiving queue corresponding to the Combo port to "buffer and pause forwarding" mode. For example, for a switching chip that supports four levels of queues, its default forwarding queue (such as queue 0) can be temporarily converted into a larger-depth buffer queue. In this mode, all data frames received from the electrical port of this switchover, regardless of whether their destination MAC address is already in the forwarding table, will be temporarily stored in this dedicated buffer memory area instead of immediately entering the normal table lookup and forwarding process. The core purpose of this is to completely retain uplink data frames (i.e., ingress traffic) that may continue to arrive and are destined for other devices in the network during the short period of physical link switching (usually tens to hundreds of milliseconds) locally, avoiding their loss due to the changing state of their egress port. Assuming the port is gigabit speed and the switchover process lasts 200 milliseconds, the theoretical maximum amount of data that needs to be buffered is 1 Gbps. 0.2 s / 8 = 25 MB. The system will pre-allocate no less than 32 MB of independent cache space to cope with sudden traffic surges.

[0036] The step of pausing the updating of the outgoing port field corresponding to the Combo port in the MAC address forwarding table entry means that, while port caching is enabled, the MAC address learning and management engine of the switching chip performs an atomic operation: locking (or freezing) all entries in the current MAC forwarding table whose "outgoing port" field is equal to the logical identifier of the electrical port (e.g., port number Eth1 / 0 / 1) of the Combo port. This means that before the handover is complete, even if a data frame with a source MAC address of S enters from the electrical port, the switching chip will not update the learning entry for MAC address S to the electrical port based on this frame. More importantly, if a data frame from another device in the network destined for a certain destination MAC address D (whose outgoing port is the electrical port) that already exists in the forwarding table enters from another port during this period, the switching chip will still forward it to the electrical port after looking up the table. However, since the port is in caching mode, these frames will also be cached and will not be dropped due to outgoing port unreachability. This operation completely avoids network topology oscillations caused by MAC address hopping between electrical and optical ports due to port status changes during the handover window (i.e., MAC flapping).

[0037] In practical applications, after the switchover is completed and the optical port link connection is established, the data frames cached by the switching chip are forwarded through the optical port. This means that when the system detects that the physical optical port link has been established (e.g., the optical module reports normal received optical power and the link protocol status is UP), the port driver software first notifies the traffic management unit of the switching chip to switch the cache queue previously allocated to that port back to normal working mode and immediately initiates a high-priority cache data emptying task. This task will send all temporarily stored data frames in the cache queue out at line speed from the newly established optical port physical channel, according to the order in which they were received. Taking the aforementioned 32MB cache as an example, emptying all cached data on a gigabit optical port takes approximately (32 MB) 8) / 1000 Mbps ≈ 256 milliseconds. This process runs parallel to the forwarding of subsequent new data frames, with the internal scheduler of the switching chip ensuring priority forwarding of buffered data.

[0038] Simultaneously, updating the output port field to the optical port identifier means that at the same moment the buffered data forwarding is initiated, the switching chip control plane will unlock the relevant MAC entries and perform a batch update: all entries with the previous output port field "Eth1 / 0 / 1 (electrical port)" will be uniformly modified to "Opt1 / 0 / 1 (optical port)". For example, assuming there is an entry in the forwarding table corresponding to MAC address 00-1A-2B-3C-4D-5E with an output port of Eth1 / 0 / 1, after the update, the output port of this entry will become Opt1 / 0 / 1. Afterward, all newly received data frames destined for these MAC addresses will be forwarded directly through the optical port without going through the buffer queue. This series of operations is tightly coupled in time: first, ensuring the new physical exit (optical port) is ready; then, removing the backlogged data from the new exit; and finally, updating the logical forwarding table to guide new traffic. This sequence is crucial, as it ensures that at any given time, for any data frame destined for a known destination, the system has a definite and effective forwarding path, thus achieving truly seamless Layer 2 service switching.

[0039] This application's solution combines the data plane caching capability of the switching chip with the entry management strategy of the control plane, constructing a decoupled, buffered transition phase between the physical event of port mode switching and the logical behavior of network Layer 2 forwarding. Cached data frames are equivalent to temporarily suspending traffic that needs to be forwarded from this port on the timeline, buying time for the re-establishment of the physical link; while pausing and subsequently updating MAC address entries in batches freezes the forwarding decisions before the handover at the control plane, and completes the path switching in one go after the handover, avoiding oscillations caused by interference between the learning process and physical events. It is this fine-grained operation of data plane and control plane coordination that makes the entire handover process completely transparent to other nodes in the network. They are unaware of any MAC address migration or topology changes, thus completely eliminating problems such as broadcast storms, temporary loops, or connection interruptions that may be caused by traditional handover methods.

[0040] Furthermore, the step of switching the Combo port from the electrical port mode to the optical port mode further includes: reading the rate register of the optical module to obtain the data transmission rate supported by the optical module; configuring the operating rate of the corresponding port of the switching chip according to the data transmission rate to establish the optical port link connection.

[0041] Specifically, in this embodiment, reading the rate register of the optical module to obtain the data transmission rate supported by the optical module refers to the port control logic accessing the internal storage mapping space of the optical module, which follows protocols such as SFF-8472, via the I2C bus after security diagnostics are passed and before or simultaneously with the formal hardware switch. The rate register is typically located at a specific address offset, such as address 0x03, and stores one or more bytes of encoded values. These encoded values ​​explicitly characterize the physical layer standard followed by the optical module and its supported rate capabilities. For example, a read byte value of 0x04, according to the SFF-8472 protocol definition, indicates that the module supports the 1000BASE-SX Gigabit Ethernet standard, with a nominal data rate of 1.25 Gbps (including 8B / 10B encoding overhead). As another example, a read value of 0x0C may represent support for the 10GBASE-SR 10 Gigabit Ethernet standard, with a nominal rate of 10.3125 Gbps. The system maintains an internal mapping table between encoding and standard rates. By looking up the table, the original register encoding value can be converted into a specific and operable rate parameter, such as 1000Mbps full-duplex or 10Gbps full-duplex.

[0042] The configuration of the operating rate of the corresponding port of the switching chip according to the data transmission rate to establish the optical port link connection refers to the process where, after obtaining specific optical module rate capability parameters, the port driver software or switching chip firmware generates a series of targeted hardware configuration commands. These commands will act on the SerDes channel within the switching chip responsible for the optical port function of the Combo port. The configuration process involves multiple layers: First, at the physical and electrical layer, parameters such as the reference clock frequency, transmit pre-emphasis, and receive equalizer of the SerDes are set to match its signal characteristics with the target rate. For example, for gigabit speeds (1.25 Gbps), the reference clock of the SerDes needs to be configured to 125 MHz or the corresponding phase-locked loop division ratio; for 10 gigabit speeds (10.3125 Gbps), it needs to be configured to 644.53125 MHz or the corresponding mode. Second, at the logical link layer, the corresponding auto-negotiation protocol (such as 1000BASE-X AN at 1G speed) or forced mode enable flag (such as fixed rate mode at 10G speed) is set according to the rate. In practice, this might involve writing "01b" to the "SPEED_SELECTION" field of a specific configuration register of the switching chip (e.g., a register named PORTx_MAC_CONTROL) to represent gigabit speeds, or writing "10b" to represent 10 gigabit speeds. After these configurations are completed, the MAC and PHY layers of the switching chip will initiate link training and signal interaction with timing and protocols that match the optical module, thereby ultimately establishing a stable, end-to-end compatible optical port link connection.

[0043] In practical applications, taking a specific interaction process as an example: After the system passes the security check, it initiates an I2C read transaction, reading one byte from the optical module address 0xA2 at offset 0x03, and obtains a return value of 0x04. The system checks the internal mapping table and confirms that 0x04 corresponds to "1000Mbps Full Duplex". Subsequently, the port driver calls the underlying hardware abstraction layer function, passing in the rate parameter "1000FD". This function performs the following actions: 1) Writes a specific value to the switch chip's SERDESx_CFG register, setting the PLL reference clock to 125 MHz mode; 2) Writes a command to the PORTx_PHY_CTRL register, enabling 1000BASE-X auto-negotiation; 3) Finally, triggers a port soft reset to make the new configuration effective. At this time, the switch chip's SerDes begins sending idle bitstreams or auto-negotiation pages at a line rate of 1.25 Gbps. The optical module receives the compatible signal and responds. After a few milliseconds to tens of milliseconds of negotiation, both parties report the link status as UP. If the read rate encoding is not supported by the switch (e.g., a proprietary 40G non-standard module encoding), the system will fail at this stage and log "Unsupported module rate" instead of making an invalid hardware configuration attempt. This approach shifts the responsibility for rate matching from the network administrator's pre-configuration to automatic information exchange and adaptive configuration between devices, greatly improving compatibility and deployment efficiency.

[0044] This application's solution establishes a deterministic causal link between reading the optical module's rate register and configuring the switching chip's port rate, constructing a closed-loop, adaptive rate negotiation mechanism. Reading the register obtains an objective capability declaration from the physical medium (optical module), which is more direct and reliable than traditional rate self-negotiation based on electrical signal detection or trial-and-error methods, especially for modules that do not support standard self-negotiation protocols or require a forced mode. Subsequently, configuring the switching chip based on this declaration allows the host side to proactively adapt to the peripheral's capabilities, ensuring that both parties reach a consensus at the physical level of communication. This enables the Combo port to seamlessly connect to various standard-compliant but differently rated optical modules, whether 100 Mbps, 1 Gbps, or 10 Gbps, establishing an optimal link without user intervention. This solves the problem of repeated link oscillations or complete failure to establish a link due to rate mismatch in traditional methods, providing crucial technical guarantees for plug-and-play experience and network reliability.

[0045] Furthermore, such as Figure 2 As shown, reading the rate register of the optical module to obtain the data transmission rate supported by the optical module includes: S201, read the manufacturer identification register and model identification register of the optical module through the I2C bus; S202, Check if the local adapter table stores a record of the combination of the manufacturer identifier and the model identifier; S203, when no corresponding record is found, the real-time working parameters are compared with the preset type parameter range to determine the type of the optical module, and based on the preset rate level sequence corresponding to the type, the working rate of the corresponding port of the switching chip is attempted to be configured from high to low until the optical port link connection is established. S204, the manufacturer identifier, model identifier, working speed, and real-time working parameters corresponding to the successful establishment of the link connection are stored as mapping records in the local adaptation table.

[0046] Specifically, in this embodiment, step S201, reading the manufacturer identification register and model identification register of the optical module via the I2C bus, refers to the port control logic further accessing specific fields in the optical module's storage area to obtain its identity information after completing basic security diagnostics. For example, reading multiple bytes consecutively starting from offset 0x00 at I2C address 0xA2 can obtain the manufacturer name conforming to the SFF-8472 standard (such as the ASCII code of "ACME"), while starting from offset 0x14, the manufacturer's standardized identification code (Vendor PN) can be read. Simultaneously, the optical module's model identification serial number is read starting from offset 0x28. This information collectively and uniquely identifies a specific model of optical module. The system will convert the raw ASCII or binary code it reads into a comparable string or number. For example, it will convert the manufacturer name "ACME" into its internally managed manufacturer ID "0x0A3B" and combine the model "SFP-1G-LX" and serial number "SN123456" into a unique model fingerprint "0x0A3B_SFP-1G-LX_SN123456".

[0047] Step S202, querying whether the local adaptation table stores a record containing the combination of the manufacturer identifier and model identifier, refers to the system accessing a data structure named "OpticalModule Adaptation Table" in its non-volatile memory (such as Flash) or configuration database. This table typically contains the following fields: Vendor_ID, Model_Fingerprint, Supported_Rate, Typical_Temp, Typical_Bias, etc. The query operation uses the manufacturer ID and model fingerprint obtained in step S201 as a union key to perform an exact match search in this table. For example, the system uses the key-value pair (0x0A3B, 0x0A3B_SFP-1G-LX_SN123456) for the query. If the query matches, the Supported_Rate field (e.g., 1000M-FD) in the record is read directly, and subsequent probing steps are skipped, directly using this rate for configuration, which greatly improves the access speed of known modules.

[0048] In practical applications, in step S203, when no corresponding record is found, the system enters intelligent learning mode. The real-time operating parameters are compared with preset type parameter ranges to determine the type of the optical module. This refers to the system internally defining typical operating parameter characteristic ranges for various common optical module types (such as "1G SX", "1G LX", "10G SR", "CWDM 1G 1470nm"). These characteristic ranges are mainly based on typical values ​​of laser bias current and operating temperature under stable conditions. For example, the typical bias current range for a "1G SX" multimode module is 6-10 mA, while the typical range for a "1G LX" single-mode module is 8-15 mA. The system compares the currently read real-time bias current (e.g., 9.2 mA) and temperature (e.g., 45°C) with these preset ranges one by one. Assuming the current value of 9.2 mA falls within the "1G LX" range, and the temperature of 45°C is common for both types, the system may initially infer the module as the "1G LX" type based on the higher weighting of the bias current.

[0049] Based on the preset rate level sequence corresponding to the type, configuration attempts are made sequentially from high to low. This means that each inferred type is associated with a preset rate attempt list ordered by probability. For example, for a module inferred as "1GLX", its attempt sequence might be ["1000M-FD", "100M-FD"]. The system first attempts to configure the switching chip port to 1000M full-duplex mode and initiates the link establishment process, waiting for a predetermined timeout (e.g., 500 milliseconds). If the link is not established within this time (e.g., because the module is actually a 100M module), the system automatically backs down and attempts the next rate in the sequence, i.e., 100M full-duplex. Each attempt involves a complete SerDes reconfiguration and link protocol initialization. This process continues until the link status flag is confirmed to be UP at a certain rate, or the attempt list is exhausted. For example, an unknown 100M single-mode module might fail in the "1000M-FD" attempt but successfully establish a link in the "100M-FD" attempt.

[0050] In step S204, the information corresponding to the successful establishment of the link connection is stored as a mapping record in the local adaptation table. This means that when an optical port link is successfully established at a certain rate (e.g., "100M-FD"), the system immediately generates a new record. This record includes not only the original vendor ID and model fingerprint, but also the final successful operating rate ("100M-FD"), and key real-time operating parameters read and averaged at the moment of connection establishment (e.g., average bias current 9.2 mA, average temperature 45°C). The system appends this record to the local adaptation table. For example, the new record is: { Vendor_ID: 0x0A3B, Model_Fingerprint: "UNKNOWN_SN789", Supported_Rate: "100M-FD", Typical_Bias: 9.2, Typical_Temp: 45}. Subsequently, when the same physical module (or another module of the same model) is inserted again, the query in step S202 will hit this record, and the system will directly use the "100M-FD" rate for configuration without having to go through the time-consuming trial and error process again.

[0051] This application's solution cleverly solves the compatibility problem of non-standard, outdated, or unknown manufacturer optical modules by constructing a complete adaptive closed loop that includes identity recognition, table lookup, parameter reasoning, rate probing, and result learning. S201-S202 constitute an efficient cache query mechanism, optimizing the experience of known modules. S203 transforms blind full-rate scanning into guided, probabilistically optimal attempts, significantly improving the identification efficiency and success rate of unknown modules. The learning and persistence mechanism in S204 enables network devices to accumulate experience; over time, their compatible module library will self-enrich, continuously reducing the operational burden.

[0052] Furthermore, after establishing the optical port link connection, the method further includes: periodically reading the internal registers of the optical module through the I2C bus to obtain the received optical power value and temperature value; storing the received optical power value in a circular queue and calculating the power change slope within a preset time window; when the power change slope exceeds a preset threshold and the current received optical power value is lower than a preset safety threshold, generating maintenance alarm information or triggering the switching of the Combo port to the electrical port mode.

[0053] Specifically, in this embodiment, periodically reading the internal registers of the optical module via the I2C bus to obtain the received optical power and temperature values ​​means that after the optical port link status changes to UP, the system starts a background monitoring task, which wakes up at a fixed period T (e.g., every 60 seconds). Each time it wakes up, it accesses a specific register address of the optical module via the I2C protocol. For example, it reads two bytes from offsets 0x22 and 0x23 at address 0xA2 and converts them into a received optical power value (Rx Power) in dBm; simultaneously, it reads from offsets 0x00 and 0x01 and converts them into an operating temperature value (Temperature) in degrees Celsius. This process continues, forming time-series data. For example, in three consecutive periods, the received optical power values ​​read might be -10.2 dBm, -10.5 dBm, and -11.0 dBm; the temperature values ​​might remain at 48°C, 48°C, and 49°C.

[0054] The process of storing the received optical power value in a circular queue and calculating the power change slope within a preset time window refers to the system maintaining a fixed-length, first-in-first-out (FIFO) queue Q in memory. Each time a new power sample value P_new arrives, it is appended to the tail of the queue. If the queue is full (length reaches N), the oldest data point is removed from the head of the queue. The preset time window W is determined by the queue length N and the sampling period T, i.e., W = N. For example, setting N=10 and T=60 seconds, the time window W is 10 minutes. The slope K of the power change within this window is typically calculated using the least squares method of linear regression. The system treats each data point in the queue as a point (t_i, P_i) on a two-dimensional plane, where t_i is the time (in seconds) relative to the start of the window, and P_i is the corresponding power value (in dBm). The formula for calculating the slope K is K = [Σ( (t_i - t_avg)] / (t_i - t_avg)] The formula is (P_i - P_avg) ) ] / Σ( (t_i - t_avg)^2 ), with units of dBm / s. A negative K value indicates that the power is decreasing over time. For ease of understanding, assume that the power decreases linearly from -10 dBm to -13 dBm within a 10-minute window, then the slope K = (-3 dBm) / (600 s) = -0.005 dBm / s. The system is more concerned with its absolute value, i.e., |K| = 0.005 dBm / s.

[0055] In practical applications, an action is triggered when the power change slope exceeds a preset threshold and the current received optical power value is lower than a preset safety threshold. There are two independent preset thresholds: one is the slope degradation threshold K_thresh, used to determine if the degradation rate is too fast; the other is the safe power threshold P_safe, used to determine if the current absolute power level is too low. For example, for a gigabit single-mode module, K_thresh is set to 0.003 dBm / s (meaning a drop exceeding 0.18 dBm per minute is considered abnormally rapid degradation), and P_safe is set to -20.0 dBm (the safety margin boundary for receiver sensitivity). The judgment logic is: if the calculated |K| > 0.003 dBm / s and the current latest power P_current < -20.0 dBm, then the condition is met. Suppose the system detects that the power has accelerated from -12 dBm to -19 dBm within the last 10 minutes. The calculated |K| = 0.0117 dBm / s, which is much greater than 0.003, and the current power of -19 dBm is already below -20 dBm. Therefore, the warning conditions are fully met. Generating a maintenance alarm message means the system generates an SNMP Trap or Syslog message, such as: "Combo port 1 / 0 / 1 optical module received optical power rapidly deteriorates, slope -0.0117 dBm / s, current value -19.0 dBm, it is recommended to check the fiber optic connector or link." Triggering the switch of the Combo port to electrical port mode is a more proactive protection action. The system will immediately initiate a process similar to module unplugging, switching service traffic to the backup electrical port without loss, thus preemptively ensuring service continuity before the optical link may be completely interrupted.

[0056] This application's solution upgrades simple status point monitoring to trend analysis combined with time series analysis, giving the Combo port predictive awareness of potential fiber optic link failures. Periodic readings provide the data foundation, circular queues enable sliding time window analysis, and slope calculation quantifies the degradation rate. The dual threshold design (rate threshold and absolute value threshold) avoids false alarms due to brief, minor fluctuations or normal, slow aging. Danger is only confirmed when power is rapidly decreasing (slope exceeding limits) and has reached a low level (absolute value exceeding limits), significantly improving alarm accuracy and operational value. Compared to traditional solutions that can only passively respond after a complete link outage (LOS), this method can provide early warning minutes or even earlier before a failure occurs, allowing valuable intervention time for maintenance personnel or automatic protection switching by the system. This shifts the operational model from fault repair to fault prevention, greatly improving network availability and robustness.

[0057] Furthermore, the insertion trigger condition includes: the level signal of the status detection pin changes from high level to low level, and the low level is maintained for more than a preset insertion anti-jitter duration; the removal trigger condition includes: the level signal of the status detection pin changes from low level to high level, and the high level is maintained for more than a preset removal anti-jitter duration; or, a physical interruption of the optical port link connection is detected, and the level signal of the status detection pin is low level.

[0058] Specifically, in this embodiment, the insertion trigger condition involves the status detection pin's signal transitioning from high to low, and the low level being maintained for more than a preset insertion debouncing duration. This series of logic describes an anti-interference hardware event capture process. Physically, the status detection pin (usually labeled ModAbs) is connected to the host power supply (e.g., 3.3V) via a pull-up resistor. When the optical module is not inserted, this pin in the slot is floating and pulled up to a high level (e.g., 3.3V, logic '1'), indicating the module's absence. When the optical module is inserted into the slot, this pin inside the module is connected to ground (GND) via a pull-down circuit, thereby pulling the host-side pin level down to near 0V (logic '0'), indicating the module's presence. Therefore, the insertion action is electrically represented as a negative transition from high to low. The system captures this transition edge via GPIO interrupt or polling. However, the moment of physical contact may be accompanied by mechanical jitter, generating multiple rapid level transitions (glitch). The preset insertion debouncing duration (e.g., T_insert_debounce = 50 milliseconds) is designed to filter out these glitches. Specifically, after the system detects the level drop to low for the first time, it starts a 50-millisecond timer and continuously samples the pin within this window. If the pin level remains consistently low throughout these 50 milliseconds, it is considered a valid insertion event. Conversely, if the level jumps back to high within the window, it is considered a jitter or invalid insertion, the timer is reset, and the event is ignored. This ensures that subsequent complex safety diagnostics and switching procedures are only initiated after the module has been securely and reliably inserted.

[0059] The first definition of the pull-out trigger condition is logically the opposite of the insertion trigger, but similar in principle. The transition from a high to a low level on the status detection pin indicates that when the optical module is pulled out of the slot, the internal pull-down connection is broken, and the host-side pin is pulled back to a high level by the pull-up resistor. Electrically, the pull-out action is represented by a positive transition from low to high. The preset pull-out debounce duration (e.g., T_remove_debounce = 30 milliseconds) is also used to prevent misjudgments caused by mechanical vibration or momentary poor contact. Its anti-interference judgment logic is consistent with the insertion debounce process.

[0060] In practical applications, the second composite definition of the pull-out trigger condition is an enhanced detection mechanism for a specific fault scenario. A physical interruption of the optical link connection is detected when the physical layer (PHY) or media access control layer (MAC) of the switching chip reports a change in link status from UP to DOWN, possibly accompanied by a loss of signal (LOS) alarm. This typically indicates that the fiber optic cable has been accidentally pulled out, the optical module's laser has suddenly failed, or the receiver is damaged. However, a link interruption alone cannot definitively confirm that the module has been physically pulled out; it could also be due to a remote device malfunction or excessive bending of the fiber optic cable. In this case, the system simultaneously checks whether the level signal of the status detection pin is low. If it is low, it means that the module is still physically present in the slot (because this pin is only pulled low when the module is present). Therefore, the combination of "link interruption" and "module physically present" strongly suggests a fault in the fiber optic link or the optoelectronic components inside the module, rather than the module being pulled out. This method allows the system to trigger an emergency switchback to electrical port mode even when the module is not removed due to a link failure, thus providing faster backup link switching for critical services. For example, when the fiber optic cable is accidentally severed somewhere far from the switch, the link is broken even though the module is still in the slot. Traditional solutions might continue to wait because the module removal is not detected (the pin is still low), leading to prolonged service interruption time. The combined condition of this application can detect this interruption immediately (typically within milliseconds) and trigger a switchback, significantly reducing the service interruption time (RTO).

[0061] This application's solution significantly improves the accuracy and robustness of the Combo port's perception of physical connection status by designing a complete event judgment system that includes level transition detection, hardware anti-jitter delay, and composite condition judgment. The preset insertion / removal anti-jitter durations (e.g., 50ms and 30ms) are typical values ​​determined through extensive experimentation, effectively filtering out most jitter introduced by mechanical characteristics and preventing malfunctions. The introduction of the composite condition of link interruption and pin being low further demonstrates a deep understanding of real-world network fault scenarios. It breaks the limitation of traditional solutions where removal detection and link fault are independent, creatively correlating the physical layer connection status (pin level) with the data link layer status. This allows for accurate identification of the specific and common fault mode where the module is in place but the optical path is broken, triggering corresponding protective switching. This dual-protection mechanism ensures that the system can respond promptly and accurately, whether under normal module insertion / removal operations or sudden fiber optic link failures, providing a solid and reliable foundation for building a highly available network access layer.

[0062] Furthermore, the method is applied to a switching device including multiple Combo ports; in step S102, after obtaining the real-time operating parameters, it further includes: when multiple Combo ports are detected to meet the insertion triggering conditions within the same time window, comparing the operating temperature and laser bias current in the real-time operating parameters of each optical module; if the operating temperature deviation and laser bias current deviation of each optical module are both less than a preset threshold, it is determined to be a batch insertion event; for the optical modules determined to be batch insertion events, the upper limit of the preset normal operating range is lowered and the lower limit is raised to form a reduced verification range, and the judgment is performed using the reduced verification range.

[0063] Specifically, in this embodiment, detecting that multiple Combo ports meet the insertion trigger condition within the same time window means that the system maintains a global event monitoring logic. This logic sets a time synchronization window W_batch, for example, 500 milliseconds. When the first port (e.g., port 1) reports a valid insertion event, the system records a timestamp T1 and starts the window W_batch. Within the following 500 milliseconds, if other ports (e.g., ports 2, 3, and 4) subsequently report valid insertions, the insertion events of these ports are considered to have occurred "within the same time window." This typically simulates scenarios where all ports are initialized simultaneously after the device powers on, or where maintenance personnel insert a batch of new optical modules into multiple empty slots at once.

[0064] The comparison of the operating temperature and laser bias current in the real-time operating parameters of each optical module refers to the system completing its independent S102 step for each port where a report is inserted within the window W_batch, i.e., reading the DDM parameters of its optical module. Then, the system extracts two key parameters from all these modules: operating temperature (T_i) and laser bias current (I_i). For example, suppose the temperature values ​​read from the four ports are: T1=25℃, T2=26℃, T3=25℃, T4=27℃; and the bias current values ​​read are: I1=7.1mA, I2=7.3mA, I3=7.0mA, I4=7.2mA. If the deviations in operating temperature and laser bias current of each optical module are both less than a preset threshold, it is determined as a batch insertion event, a judgment based on statistical consistency. The deviation here typically refers to the difference between the maximum and minimum values ​​of this parameter across all compared modules. The calculated temperature deviation ΔT = max(T_i) - min(T_i) = 27℃ - 25℃ = 2℃. The calculated current deviation ΔI = max(I_i) - min(I_i) = 7.3mA - 7.0mA = 0.3mA. The system's preset thresholds may be: temperature consistency threshold ΔT_th = 5℃, current consistency threshold ΔI_th = 1.0mA. Since the actual calculated ΔT (2℃) < ΔT_th (5℃) and ΔI (0.3mA) < ΔI_th (1.0mA), the conditions are met, and the system determines that these four modules belong to the same batch of inserted events.

[0065] In practical applications, for optical modules identified as batch insertion events, the upper limit of the preset normal operating range is lowered and the lower limit is raised to form a reduced verification range. This means the system will adopt a more stringent batch inspection standard to replace the general single-piece inspection standard. Assume the general normal operating temperature range for the device is [T_low_general, T_high_general] = [-5℃, +70℃], and the general normal operating bias current range is [I_low_general, I_high_general] = [2mA, 12mA]. When calculating the batch reduction range, the system presets a reduction factor α (e.g., α = 0.2, i.e., 20%). Therefore, the reduced temperature verification range is calculated as follows: The upper limit of the reduction is T_high_strict = T_high_general - α (T_high_general - T_low_general) = 70 - 0.2 (70 - (-5)) = 70 - 15 = 55℃.

[0066] The reduced lower bound T_low_strict = T_low_general + α (T_high_general - T_low_general) = -5 + 0.2 (75) = -5 + 15 = 10℃.

[0067] Therefore, the reduced temperature calibration interval is [10℃, 55℃]. Similarly, the reduced current calibration interval is: I_high_strict = 12 - 0.2 (12-2) = 12 - 2 = 10mA. I_low_strict = 2 + 0.2 (10) = 2 + 2 = 4mA. Therefore, the narrowed current verification range is [4mA, 10mA].

[0068] The use of the reduced verification range for the judgment means that for each of these modules, the system will use [10℃, 55℃] and [4mA, 10mA] to determine whether its temperature and current are normal, instead of the original [-5℃, 70℃] and [2mA, 12mA]. For example, if a module reads 28℃ and 7.5mA, it passes the verification. However, if another module reads as high as 60℃ (although below the general upper limit of 70℃) or its current is as low as 3mA (although above the general lower limit of 2mA), they will be judged as abnormal by the new standard, thus preventing switching and triggering an alarm.

[0069] This application's solution cleverly addresses the unique quality control requirements of batch deployment scenarios by introducing multi-port collaborative analysis and a dynamic threshold adjustment mechanism. Its technological wisdom lies in recognizing that modules inserted simultaneously in the same batch should exhibit high consistency in their initial operating parameters (especially temperature and bias current) because they experience the same environment, use the same materials, and undergo the same manufacturing processes. Leveraging this characteristic, the system first identifies batch events through consistency verification. Once identified, it infers that this batch of modules should be of uniform quality and therefore undergoes inspection using stricter high-quality standards (a narrowed verification range). The core purpose of this is to proactively filter out substandard modules that, while potentially meeting broad general standards, have parameters that are already at the edge of acceptable levels during batch deployment, preventing them from entering the network. This is equivalent to adding a lean screening step for batch scenarios between factory inspection and general safety thresholds, significantly reducing the risk of network instability caused by minor defects in batch materials or processes. This not only improves the reliability of individual devices but also prevents potential, interconnected multi-point failures at the network level.

[0070] Secondly, this application also provides a secure switching device for Combo port modes, such as... Figure 3 As shown, the system includes: The monitoring module 301 is used to monitor the level signal of the status detection pin. When the insertion trigger condition is met, it determines that the optical module is inserted into the Combo port. The Combo port has an electrical port mode and an optical port mode. The electrical port mode is the working state of sending and receiving data frames through the electrical interface, and the optical port mode is the working state of sending and receiving data frames through the optical module and the optical interface. The judgment module 302 is used to read the internal registers of the optical module through the I2C bus, obtain real-time operating parameters, and determine whether the real-time operating parameters are within the corresponding preset normal operating range. The first switching module 303 is used to switch the Combo port from the electrical port mode to the optical port mode and establish an optical port link connection in response to the real-time working parameters being within the preset normal working range, so as to send and receive data frames through the optical module and the optical interface; otherwise, it maintains the electrical port mode and generates an optical module abnormal alarm information. The second switching module 304 monitors the level signal of the status detection pin and switches the Combo port from the optical port mode back to the electrical port mode when the unplug trigger condition is met.

[0071] This system can be used to execute the Combo port mode secure switching method described in the first aspect, which will not be elaborated further here.

[0072] Thirdly, this application also provides an electronic device comprising: one or more processors, and a memory for storing one or more computer programs; the computer programs are configured to be executed by the one or more processors, and the programs include methods for performing the Combo port mode secure switching method as described in the first aspect.

Claims

1. A secure switching method for Combo port mode, characterized in that, include: The level signal of the monitoring status detection pin is used to determine that the optical module is inserted into the Combo port when the insertion trigger condition is met. The Combo port has an electrical port mode and an optical port mode. The electrical port mode is the working state of sending and receiving data frames through the electrical interface, and the optical port mode is the working state of sending and receiving data frames through the optical module and the optical interface. The internal registers of the optical module are read via the I2C bus to obtain real-time operating parameters, and it is determined whether the real-time operating parameters are within the corresponding preset normal operating range. In response to the real-time operating parameters being within the preset normal operating range, the Combo port is switched from the electrical port mode to the optical port mode and an optical port link connection is established to send and receive data frames through the optical module and the optical interface; Otherwise, maintain the electrical port mode and generate an optical module malfunction alarm message; The level signal of the status detection pin is monitored, and when the unplug trigger condition is met, the Combo port is switched from the optical port mode back to the electrical port mode.

2. The secure switching method for Combo port mode according to claim 1, characterized in that, The real-time operating parameters include operating temperature, power supply voltage, and laser bias current. After determining that the real-time operating parameters are within the corresponding preset normal operating range, the method further includes: A pre-switching timing window is initiated. During the pre-switching timing window, the Combo port receives data frames through the electrical interface and temporarily stores the received data frames in a temporary buffer queue. After establishing the optical port link connection, the data frames in the temporary buffer queue are forwarded through the optical interface, and then the temporary buffer queue is cleared and normal forwarding processing is restored.

3. The secure switching method for Combo port mode according to claim 2, characterized in that, Switching the Combo port from electrical port mode to optical port mode includes: Before switching, the received data frames are buffered by the switching chip, and the update of the outgoing port field corresponding to the Combo port in the MAC address forwarding table is paused. After the switchover is completed and the optical port link connection is established, the data frames cached by the switching chip are forwarded through the optical port, and the output port field is updated to the optical port identifier.

4. The secure switching method for Combo port mode according to claim 3, characterized in that, The step of switching the Combo port from the electrical port mode to the optical port mode further includes: Read the rate register of the optical module to obtain the data transmission rate supported by the optical module; Configure the operating speed of the corresponding port of the switching chip according to the data transmission rate to establish the optical port link connection.

5. The secure switching method for Combo port mode according to claim 4, characterized in that, The step of reading the rate register of the optical module to obtain the data transmission rate supported by the optical module includes: The manufacturer identification register and model identification register of the optical module are read through the I2C bus; Check if the local compatibility table stores a record containing the combination of the manufacturer identifier and the model identifier; When no corresponding record is found, the real-time working parameters are compared with the preset type parameter range to determine the type of the optical module. Based on the preset rate level sequence corresponding to the type, the working rate of the corresponding port of the switching chip is attempted to be configured from high to low until the optical port link connection is established. The manufacturer identifier, model identifier, operating speed, and real-time operating parameters corresponding to the successful establishment of the link connection are stored as mapping records in the local adaptation table.

6. The secure switching method for Combo port mode according to claim 1, characterized in that, After establishing the optical port link connection, the method further includes: The internal registers of the optical module are periodically read via the I2C bus to obtain the received optical power value and temperature value; The received optical power value is stored in a circular queue, and the power change slope within a preset time window is calculated. When the power change slope exceeds a preset threshold and the current received optical power value is lower than a preset safety threshold, a maintenance alarm message is generated or the Combo port is switched to the electrical port mode.

7. The secure switching method for Combo port mode according to any one of claims 1-6, characterized in that, The insertion triggering condition includes: the level signal of the state detection pin changes from high level to low level, and the low level is maintained for more than the preset insertion debounce duration; The pull-out trigger condition includes: the level signal of the status detection pin changes from low level to high level, and the high level is maintained for more than the preset pull-out anti-shake duration; Alternatively, a physical interruption of the optical port link connection is detected, and the level signal of the status detection pin is low.

8. The secure switching method for Combo port mode according to claim 1, characterized in that, The method is applied to a switching device including multiple Combo ports; after obtaining the real-time operating parameters, it further includes: When multiple Combo ports are detected to meet the insertion triggering conditions within the same time window, the operating temperature and laser bias current in the real-time operating parameters of each optical module are compared. If the operating temperature deviation of each optical module and the laser bias current deviation are both less than the preset threshold, it is determined to be a batch insertion event. For optical modules identified as batch insertion events, the upper limit of the preset normal working range is lowered and the lower limit is raised to form a narrowed verification range, and the judgment is made using the narrowed verification range.

9. A Combo port mode secure switching device, characterized in that, include: The monitoring module is used to monitor the level signal of the status detection pin. When the insertion trigger condition is met, it determines that the optical module is inserted into the Combo port. The Combo port has an electrical port mode and an optical port mode. The electrical port mode is the working state of sending and receiving data frames through the electrical interface, and the optical port mode is the working state of sending and receiving data frames through the optical module and the optical interface. The judgment module is used to read the internal registers of the optical module through the I2C bus, obtain real-time operating parameters, and determine whether the real-time operating parameters are within the corresponding preset normal operating range. The first switching module is used to switch the Combo port from the electrical port mode to the optical port mode and establish an optical port link connection in response to the real-time working parameters being within the preset normal working range, so as to send and receive data frames through the optical module and the optical interface. Otherwise, maintain the electrical port mode and generate an optical module malfunction alarm message; The second switching module monitors the level signal of the status detection pin and switches the Combo port from the optical port mode back to the electrical port mode when the unplug trigger condition is met.

10. An electronic device, the electronic device comprising: One or more processors, a memory for storing one or more computer programs; characterized in that the computer programs are configured to be executed by the one or more processors, the programs including methods for performing a Combo port mode secure switching method as described in any one of claims 1-8.