Optical module access protection method and related device

By caching access information and delaying reset operations in the programmable logic device, the problem of data being overwritten due to interruption of optical module access process is solved, and efficient optical module access protection is achieved.

CN121664310APending Publication Date: 2026-03-13MAIPU COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-12
Publication Date
2026-03-13

AI Technical Summary

Technical Problem

When accessing optical modules frequently, existing technologies are prone to interrupting the optical module access process due to controller restarts, which can lead to data rewriting.

Method used

The access information sent by the controller is cached by a programmable logic device, and a timer is triggered upon receiving a reset signal to delay the reset operation, thereby ensuring the integrity of the optical module access process.

Benefits of technology

It improves the efficiency of optical module access, reduces the risk of data being overwritten, reduces the number of commands issued by the controller, and avoids interruption of the access process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121664310A_ABST
    Figure CN121664310A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of communication, and provides an optical module access protection method and a related device. The method is applied to a programmable logic device, the programmable logic device is in communication connection with a controller, and the programmable logic device is in communication connection with an optical module through an I2C interface. The method comprises the following steps: receiving access information required by one-time complete reading / writing and sent by a controller, and caching the access information; receiving a one-time read / write access command sent by the controller, and executing an optical module access process according to the access command and the access information; in the process of executing the optical module access process, if a reset signal sent by the controller is received, the timer is triggered, the optical module access process continues to be executed, and when to start reset operation is determined by combining the timing condition of the timer and the execution state of the optical module access process. Therefore, the access efficiency of the optical module is improved, and the risk that the data of the optical module is rewritten is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of communication technology, and more specifically, to a method and related apparatus for protecting access to optical modules. Background Technology

[0002] As communication equipment develops towards higher density and higher speed, more and more communication devices are transmitting data via optical signals. Communication devices typically use an I2C (Inter-Integrated Circuit) interface to interact with optical modules. When a single communication device connects to a large number of optical modules, it will frequently access these modules via the I2C interface. Therefore, it is necessary to consider how to prevent anomalies under such high-frequency access.

[0003] Currently, one existing implementation method is to connect the controller to a programmable logic device to extend the I2C interface for managing the optical module, such as... Figure 1 As shown. Another existing implementation involves connecting the controller to an I2C hub to extend the I2C interface for managing optical modules, such as... Figure 2 As shown, both methods execute each node sequentially in the following order: sending a start signal, sending the device address, sending the access command, sending the data address, reading / writing data, and sending a stop signal. Furthermore, if any node experiences a device malfunction, it is immediately reset to restore the original state. This interrupts the access process. If the access process is initiated again after a restart, the optical module may mistakenly interpret the received information as being from the original access process, resulting in the data in the optical module being overwritten. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method and related apparatus for protecting optical module access.

[0005] To achieve the above objectives, the technical solution adopted by the present invention is as follows:

[0006] In a first aspect, the present invention provides an optical module access protection method applied to a programmable logic device, wherein the programmable logic device is communicatively connected to a controller, and multiple I2C interfaces of the programmable logic device are respectively communicatively connected to multiple optical modules, the method comprising:

[0007] Receive the access information required for a complete read / write operation from the controller, and cache the access information;

[0008] Receive a read / write access command sent by the controller, and execute the optical module access process according to the access command and the access information;

[0009] During the execution of the optical module access process, if a reset signal is received from the controller, a timer is triggered and the optical module access process continues to be executed. The timing of the reset operation is determined based on the timer's timing and the execution status of the optical module access process.

[0010] In an optional implementation, the step of determining when to initiate the reset operation by combining the timer's timing and the execution status of the optical module access process includes:

[0011] Before the timer expires, a reset operation is initiated when the optical module access process ends; otherwise, a reset operation is initiated when the timer expires. The timeout period of the timer is longer than the execution time of the optical module access process.

[0012] In an optional implementation, the optical module access process includes an optical module data reading process and an optical module data writing process;

[0013] The step of executing the optical module access process according to the access command and the access information includes:

[0014] If the access command is a read command, the optical module read data process is executed according to the device address and register address in the access information;

[0015] When the access command is a write command, the optical module write data process is executed according to the device address, register address and data to be written in the access information.

[0016] In an optional implementation, the step of performing the optical module data reading process based on the device address and register address in the access information includes:

[0017] Send a start signal to enable each of the I2C interfaces;

[0018] Identify the optical module corresponding to the device address and use it as the target optical module;

[0019] The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address.

[0020] Data is retrieved from this storage unit to obtain the read data;

[0021] Send a stop signal to release each of the I2C interfaces; and / or,

[0022] The step of executing the optical module write data process based on the device address, register address, and data to be written in the access information includes:

[0023] Send a start signal to enable each of the I2C interfaces;

[0024] Identify the optical module corresponding to the device address and use it as the target optical module;

[0025] The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address.

[0026] Write the data to be written into the storage unit;

[0027] Send a stop signal to release each of the I2C interfaces.

[0028] Secondly, the present invention provides an optical module access protection device applied to a programmable logic device, wherein the programmable logic device controller is communicatively connected, and multiple I2C interfaces of the programmable logic device are respectively communicatively connected to multiple optical modules, the device comprising:

[0029] The caching module is used to receive the access information required for a complete read / write operation sent by the controller and cache the access information.

[0030] The execution module is used to receive a read / write access command sent by the controller and execute the optical module access process according to the access command and the access information;

[0031] The reset module is used to trigger a timer and continue executing the optical module access process if a reset signal is received from the controller during the execution of the optical module access process, and to determine when to start the reset operation based on the timer's timing and the execution status of the optical module access process.

[0032] In an optional implementation, the reset module is further configured to:

[0033] Before the timer expires, a reset operation is initiated when the optical module access process ends; otherwise, a reset operation is initiated when the timer expires. The timeout period of the timer is longer than the execution time of the optical module access process.

[0034] In an optional implementation, the optical module access process includes an optical module data reading process and an optical module data writing process, and the execution module is further configured to:

[0035] If the access command is a read command, the optical module read data process is executed according to the device address and register address in the access information;

[0036] When the access command is a write command, the optical module write data process is executed according to the device address, register address and data to be written in the access information.

[0037] In an optional implementation, the execution module is further configured to:

[0038] Send a start signal to enable each of the I2C interfaces;

[0039] Identify the optical module corresponding to the device address and use it as the target optical module;

[0040] The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address.

[0041] Data is retrieved from this storage unit to obtain the read data;

[0042] Send a stop signal to release each of the I2C interfaces; and / or,

[0043] The step of executing the optical module write data process based on the device address, register address, and data to be written in the access information includes:

[0044] Send a start signal to enable each of the I2C interfaces;

[0045] Identify the optical module corresponding to the device address and use it as the target optical module;

[0046] The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address.

[0047] Write the data to be written into the storage unit;

[0048] Send a stop signal to release each of the I2C interfaces.

[0049] Thirdly, the present invention provides a programmable logic device for implementing the optical module access protection method described in any of the foregoing embodiments.

[0050] Fourthly, the present invention provides a communication device, including a controller and the programmable logic device described in the foregoing embodiments.

[0051] This invention provides a method and related apparatus for protecting optical module access. The method is applied to a programmable logic device (PLD), which is communicatively connected to a controller. Multiple I2C interfaces of the PLD are respectively communicatively connected to multiple optical modules. The method includes: the PLD receiving access information required for a complete read / write operation from the controller and buffering the access information; receiving a read / write access command from the controller and executing an optical module access process based on the access command and access information; during the execution of the optical module access process, if a reset signal is received from the controller, a timer is triggered and the optical module access process continues to execute; the timing of initiating a reset operation is determined by combining the timer's timing and the execution status of the optical module access process. By sending all the information required for a complete read or write operation of the optical module to the PLD at once, and then initiating access through a corresponding read or write command, the number of commands issued by the controller is reduced, improving the access efficiency of the optical modules. Furthermore, by delaying the reset operation, the access process is avoided from being interrupted by an immediate reset and restart, thereby reducing the risk of optical module data being overwritten.

[0052] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0053] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 A schematic diagram of an existing first type of optical module access system is shown;

[0055] Figure 2 A schematic diagram of an existing second type of optical module access system is shown;

[0056] Figure 3 A schematic diagram of the system provided in an embodiment of the present invention is shown;

[0057] Figure 4 A block diagram of a communication device provided in an embodiment of the present invention is shown;

[0058] Figure 5 A flowchart illustrating the optical module access protection method provided in an embodiment of the present invention is shown.

[0059] Figure 6 A functional block diagram of the optical module access protection device provided in an embodiment of the present invention is shown.

[0060] Icons: 110-Controller; 120-Memory; 130-Programmable Logic Device; 300-Optical Module Access Protection Device; 310-Cache Module; 330-Execution Module; 350-Reset Module. Detailed Implementation

[0061] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0062] Therefore, the following detailed description of the embodiments of the invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the invention without inventive effort are within the scope of protection of the invention.

[0063] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0064] Please see Figure 3 This is a schematic diagram of a system provided in an embodiment of the present invention. The system includes a communication device and multiple optical modules connected in communication. The communication device is a device used to send, receive, or forward information. An optical module is a device using optical fiber communication, used to convert optical signals into electrical signals.

[0065] Please refer to Figure 4This is a block diagram of a communication device provided in an embodiment of the present invention. The communication device includes a controller 110, a memory 120, and a programmable logic device 130. These components are electrically connected directly or indirectly to each other to achieve data transmission or interaction. These components can be electrically connected to each other through one or more communication buses or signal lines. For example, an SPI (Serial Peripheral Interface) bus, an LPC (Low Pin Count) bus, or a Local bus can be used to connect these components.

[0066] The controller 110 is used to read / write data or programs stored in the memory 120 and perform corresponding functions. It can be a general-purpose controller, including CPU (Central Processing Unit), MCU (Microcontroller Unit), etc.

[0067] The memory 120 is used to store programs or data. The memory 120 can be RAM (Random Access Memory), ROM (Read Only Memory), PROM (Programmable Read-Only Memory), EPROM (Erasable Programmable Read-Only Memory), EEPROM (Electric Erasable Programmable Read-Only Memory), etc.

[0068] The Programmable Logic Device (PLD) 130 is used to expand the I2C interface and communicate with multiple optical modules through multiple I2C interfaces to perform signaling and data interaction with optical modules or other terminals.

[0069] Understandable, Figure 4 The structure shown is only a schematic diagram of the communication device; the communication device may also include components that are larger than those shown. Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown. Figure 4 The components shown can be implemented using hardware, software, or a combination thereof.

[0070] The programmable logic device described above will be used as the execution subject to execute the various steps in the methods provided in the embodiments of the present invention and achieve the corresponding technical effects.

[0071] Please see Figure 5 This is a flowchart illustrating the optical module access protection method provided in an embodiment of the present invention.

[0072] Step S202: Receive the access information required for a complete read / write operation sent by the controller, and cache the access information.

[0073] Step S204: Receive a read / write access command sent by the controller, and execute the optical module access process according to the access command and access information.

[0074] Understandably, the existing optical module access process involves the controller issuing execution commands to the programmable logic device (PLD) for each node. The PLD then executes these commands and interacts with the optical module. In a single access process, the controller interacts with the optical module multiple times via the PLD. Therefore, if a communication device malfunctions during one interaction, causing the controller to restart, subsequent nodes cannot be executed, interrupting the access process.

[0075] Therefore, in this embodiment of the invention, the controller first sends all the complete access information required for a single read / write operation to the programmable logic device (PLD), allowing the PLD to pre-cache the necessary access information. Then, the controller sends a single read / write access command to the PLD to notify it to initiate the optical module access process. This allows the PLD to directly execute the optical module access process based on the previously cached access information. In other words, for each access process, the controller only needs to issue one command, thereby reducing the number of commands issued by the controller, improving the access efficiency of the optical module, and reducing the frequency of communication and interaction between the controller and the optical module, as well as the risk of access process interruption.

[0076] Step S206: During the execution of the optical module access process, if a reset signal is received from the controller, the timer is triggered and the optical module access process continues to be executed. The timing of the reset operation is determined by combining the timer's timing and the execution status of the optical module access process.

[0077] Understandably, in the existing method, if the communication equipment malfunctions during the optical module access process, the watchdog program used to ensure the safe operation of the communication equipment will immediately restart the controller. When the controller restarts and resends the command to access the optical module again, the optical module cannot distinguish whether the received command was sent before or after the restart, thus posing a risk of the optical module data being overwritten.

[0078] Therefore, in this embodiment of the invention, if a reset signal is received from the controller during the execution of the optical module access process by the programmable logic device, a timer will be triggered to start timing. Instead of immediately resetting, the optical module access process will continue to execute. The timing of initiating the reset operation is determined based on the timer's timing and the execution status of the optical module access process. In other words, the reset operation is delayed by the programmable logic device to avoid immediately resetting and restarting, thus interrupting the access process and reducing the risk of optical module data being overwritten due to interruption of the access process.

[0079] As can be seen from the above steps, the programmable logic device (PLD) receives the access information required for a complete read / write operation from the controller and caches the access information. Then, the PLD receives an access command from the controller and executes the optical module access process according to the access command and access information. During the execution of the optical module access process, if a reset signal is received from the controller, a timer is triggered and the optical module access process continues. The timing of the reset operation is determined by combining the timer's timing and the execution status of the optical module access process. By sending the complete information required for a single read / write operation of the optical module to the PLD at once, and then initiating the access with the corresponding read / write command, the number of commands issued by the controller is reduced, improving the access efficiency of the optical module. Furthermore, by delaying the reset operation, the access process is avoided from being interrupted by an immediate reset and restart, thereby reducing the risk of the optical module data being overwritten.

[0080] Optionally, for the process of starting the reset operation in step S206 based on the duration recorded by the timer and the execution status of the optical module access process, this embodiment of the invention provides a possible implementation method, namely: before the timer expires, the reset operation is started when the optical module access process ends; otherwise, the reset operation is started when the timer expires; wherein, the timeout period of the timer is greater than the execution time of the optical module access process.

[0081] It is understood that the intended purpose of this embodiment of the invention is to perform a reset operation after the completion of the current optical module access process. This would directly prevent the access process from being interrupted and thus avoid the optical module data from being overwritten. However, to prevent deadlocks caused by abnormal execution of the optical module access process, which would result in corresponding resources such as the I2C interface being continuously occupied, this embodiment of the invention sets a time limit as the upper limit for the delayed reset operation, and this upper limit is greater than the time required to complete one optical module access process.

[0082] In this embodiment, if the optical module access process ends before the timer expires, it means that the time taken to complete this optical module access process is less than or equal to the time limit, indicating that the execution of this optical module access process is normal. In this case, a reset operation is initiated to restore the original state. Since the access process is executed completely, the data of the optical module can be prevented from being overwritten.

[0083] If the optical module access process has not ended when the timer expires, it means that the time required to complete the current optical module access process will exceed the time limit. This indicates that the execution of the current optical module access process is abnormal. In this case, a reset operation is initiated, that is, a forced reset is used to restore the original state in order to avoid deadlock.

[0084] This invention can be understood as follows: the timing of initiating the reset operation is determined based on whether the timer has timed out and whether the optical module access process has ended. This ensures that the reset only occurs after the optical module access process has been fully executed, effectively preventing the optical module data from being overwritten. Furthermore, a forced reset terminates any abnormal optical module access process, preventing resources from being occupied for extended periods.

[0085] Optionally, for step S204, which involves executing the optical module access process based on the access command and access information, this embodiment of the invention provides a possible implementation method.

[0086] Step S204A: If the access command is a read command, execute the optical module read data process according to the device address and register address in the access information;

[0087] Step S204B: If the access command is a write command, execute the optical module write data process according to the device address, register address and data to be written in the access information.

[0088] It is understandable that the controller has two access modes for the optical module: read and write. Therefore, the required access information differs for these two access modes, and the optical module access process executed by the programmable logic device also differs.

[0089] In this embodiment, for the read access mode, the required access information is the device address and register address. That is, the controller sends all the access information, including the device address and register address, needed for a complete read operation to the programmable logic device (PLD) at once, so that the PLD caches this access information. Then, the controller sends a read command to the PLD, which, based on the previously cached access information (device address and register address), executes the optical module read data process, thereby enabling the controller to read the data from the optical module.

[0090] For write access mode, the required access information includes the device address, register address, and data to be written. Specifically, the controller sends all the necessary access information for a complete write operation—the device address, register address, and data to be written—to the programmable logic device (PLD) at once, allowing the PLD to cache this information. Then, the controller sends a write command to the PLD. Based on this write command and the previously cached access information (device address, register address, and data to be written), the PLD executes the optical module write data process, thus enabling the controller to write data to the optical module.

[0091] Optionally, for step S204A, this embodiment of the invention provides a possible implementation.

[0092] Step S204A-1: Send a start signal to enable each I2C interface.

[0093] Step S204A-3: Determine the optical module corresponding to the device address and use it as the target optical module.

[0094] Step S204A-5: Access the target optical module through the I2C interface connected to the target optical module, and determine the corresponding storage unit in the register of the target optical module according to the register address.

[0095] Step S204A-7: Obtain data from the storage unit to get the read data.

[0096] Step S204A-9: Send a stop signal to release each I2C interface.

[0097] In this embodiment, the programmable logic device (PLD) executes the optical module data reading process as follows: First, the PLD sends a start signal to enable each I2C interface; then, the PLD determines the corresponding optical module and uses it as the target optical module based on the device address (Device ID) in the cached access information; next, the PLD accesses the target optical module through the I2C interface connected to it, and determines the corresponding storage unit in the register of the target optical module according to the register address, then retrieves the data from the storage unit, i.e., obtains the read data and caches it; finally, the PLD sends a stop signal to release each I2C interface.

[0098] Optionally, for step S204B, this embodiment of the invention provides a possible implementation.

[0099] Step S204B-1: Send a start signal to enable each I2C interface.

[0100] Step S204B-3: Determine the optical module corresponding to the device address and use it as the target optical module.

[0101] Step S204B-5: Access the target optical module through the I2C interface connected to the target optical module, and determine the corresponding storage unit in the register of the target optical module according to the register address.

[0102] Step S204B-7: Write the data to be written to the storage unit.

[0103] Step S204B-9: Send a stop signal to release each I2C interface.

[0104] In this embodiment, the programmable logic device (PLD) executes the optical module write data process as follows: First, the PLD sends a start signal to enable each I2C interface; then, the PLD determines the corresponding optical module based on the device address (Device ID) in the cached access information and uses it as the target optical module; next, the PLD accesses the target optical module through the I2C interface connected to it, and determines the corresponding storage unit in the register of the target optical module according to the register address, and then writes the data to be written into the storage unit; finally, the PLD sends a stop signal to release each I2C interface.

[0105] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of an optical module access protection device is given below. Please refer to... Figure 6 This is a functional block diagram of the optical module access protection device provided in this embodiment of the invention. It should be noted that the basic principle and technical effects of the optical module access protection device 300 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The optical module access protection device 300 includes:

[0106] The cache module 310 is used to receive the access information required for a complete read / write operation sent by the controller and cache the access information.

[0107] The execution module 330 is used to receive a read / write access command sent by the controller and execute the optical module access process according to the access command and access information;

[0108] The reset module 350 is used to trigger a timer and continue executing the optical module access process if a reset signal is received from the controller during the execution of the optical module access process. It determines when to start the reset operation by combining the timer's timing and the execution status of the optical module access process.

[0109] Optionally, the reset module 350 is also used to: initiate a reset operation before the timer expires and the optical module access process ends, or initiate a reset operation when the timer expires; wherein the timeout period of the timer is longer than the execution time of the optical module access process.

[0110] Optionally, the execution module 330 is further configured to: when the access command is a read command, execute the optical module read data process according to the device address and register address in the access information; and when the access command is a write command, execute the optical module write data process according to the device address, register address and data to be written in the access information.

[0111] Optionally, the execution module 330 is further configured to: send a start signal to enable each I2C interface; determine the optical module corresponding to the device address and use it as the target optical module; access the target optical module through the I2C interface connected to the target optical module, and determine the corresponding storage unit in the register of the target optical module according to the register address; obtain data from the storage unit to obtain the read data; send a stop signal to release each I2C interface; and / or, send a start signal to enable each I2C interface; determine the optical module corresponding to the device address and use it as the target optical module; access the target optical module through the I2C interface connected to the target optical module, and determine the corresponding storage unit in the register of the target optical module according to the register address; write the data to be written to the storage unit; and send a stop signal to release each I2C interface.

[0112] This invention also provides a programmable logic device for implementing the optical module access protection method disclosed in this invention.

[0113] This invention also provides a communication device, including a controller and a programmable logic device provided in this invention.

[0114] In summary, the optical module access protection method and related apparatus provided in this embodiment of the invention have the following beneficial effects: (1) It realizes full-process monitoring of optical module access by programmable logic devices, which can ensure the integrity of data interaction in the access process, avoid interruption of the access process due to reset, and reduce the risk of optical module data being rewritten due to interruption of the access process and secondary access insertion. (2) The controller only needs to issue one command to execute one access process, which reduces the number of controller operations and improves access efficiency. (3) It realizes that the programmable logic device can manage multiple optical modules through multiple extended I2C interfaces, without the need to set up a separate power management module to protect the optical modules, thus reducing hardware costs. (4) It realizes the avoidance of abnormal situations during high-frequency access to optical modules.

[0115] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of the invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0116] In addition, the functional modules in the various embodiments of the present invention can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0117] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0118] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A method for protecting access to an optical module, characterized in that, The method, applied to a programmable logic device (PLD) which is communicatively connected to a controller, wherein multiple I2C interfaces of the PLD are respectively communicatively connected to multiple optical modules, includes: Receive access information required for a complete read / write operation from the controller and cache the access information; Receive a read / write access command sent by the controller, and execute the optical module access process according to the access command and the access information; During the execution of the optical module access process, if a reset signal is received from the controller, a timer is triggered and the optical module access process continues to be executed. The timing of the reset operation is determined by combining the timer's timing and the execution status of the optical module access process.

2. The optical module access protection method according to claim 1, characterized in that, The step of determining when to initiate the reset operation by combining the timer's timing and the execution status of the optical module access process includes: Before the timer expires, a reset operation is initiated when the optical module access process ends; otherwise, a reset operation is initiated when the timer expires. The timeout period of the timer is longer than the execution time of the optical module access process.

3. The optical module access protection method according to claim 1, characterized in that, The optical module access process includes an optical module data reading process and an optical module data writing process; The step of executing the optical module access process according to the access command and the access information includes: If the access command is a read command, the optical module read data process is executed according to the device address and register address in the access information; When the access command is a write command, the optical module write data process is executed according to the device address, register address and data to be written in the access information.

4. The optical module access protection method according to claim 3, characterized in that, The step of executing the optical module data reading process based on the device address and register address in the access information includes: Send a start signal to enable each of the I2C interfaces; Identify the optical module corresponding to the device address and use it as the target optical module; The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address. Data is retrieved from this storage unit to obtain the read data; Send a stop signal to release each of the I2C interfaces; and / or, The step of executing the optical module write data process based on the device address, register address, and data to be written in the access information includes: Send a start signal to enable each of the I2C interfaces; Identify the optical module corresponding to the device address and use it as the target optical module; The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address. Write the data to be written into the storage unit; Send a stop signal to release each of the I2C interfaces.

5. An optical module access protection device, characterized in that, A device applied to a programmable logic device (PLD), wherein the PLD is communicatively connected to a controller, and multiple I2C interfaces of the PLD are respectively communicatively connected to multiple optical modules, the device comprising: The caching module is used to receive the access information required for a complete read / write operation sent by the controller and cache the access information. The execution module is used to receive a read / write access command sent by the controller and execute the optical module access process according to the access command and the access information; The reset module is used to trigger a timer and continue executing the optical module access process if a reset signal is received from the controller during the execution of the optical module access process. The timer's timing and the execution status of the optical module access process are used to determine when to start the reset operation.

6. The optical module access protection device according to claim 5, characterized in that, The reset module is also used for: Before the timer expires, a reset operation is initiated when the optical module access process ends; otherwise, a reset operation is initiated when the timer expires. The timeout period of the timer is longer than the execution time of the optical module access process.

7. The optical module access protection device according to claim 5, characterized in that, The optical module access process includes an optical module data reading process and an optical module data writing process. The execution module is also used for: If the access command is a read command, the optical module read data process is executed according to the device address and register address in the access information; When the access command is a write command, the optical module write data process is executed according to the device address, register address and data to be written in the access information.

8. The optical module access protection device according to claim 7, characterized in that, The execution module is also used for: Send a start signal to enable each of the I2C interfaces; Identify the optical module corresponding to the device address and use it as the target optical module; The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address. Data is retrieved from this storage unit to obtain the read data; Send a stop signal to release each of the I2C interfaces; And / or, The step of executing the optical module write data process based on the device address, register address, and data to be written in the access information includes: Send a start signal to enable each of the I2C interfaces; Identify the optical module corresponding to the device address and use it as the target optical module; The target optical module is accessed through the I2C interface connected to it, and the corresponding storage unit is determined in the register of the target optical module according to the register address. Write the data to be written into the storage unit; Send a stop signal to release each of the I2C interfaces.

9. A programmable logic device, characterized in that, Used to implement the optical module access protection method according to any one of claims 1 to 4.

10. A communication device, characterized in that, It includes the controller and the programmable logic device as described in claim 9.