Optical module

By using timer interrupts in the MCU of the optical module to trigger the sampling period and prioritize the processing of the same sampling objects, the problem of the optical module's acquisition in disordered state when quickly monitoring the received optical power is solved, achieving more efficient monitoring and shorter sampling time.

CN119727916APending Publication Date: 2025-03-28HISENSE BROADBAND MULTIMEDIA TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311269349.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-27
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In optical communication technology, when the optical module quickly monitors the received optical power, the interrupted trigger will interrupt the polling execution of other monitoring quantities, resulting in the acquisition being in an unordered state, increasing the sampling time of the monitoring quantities.

Method used

Ordered sampling is achieved by turning on the timer interrupt in the timer module of the MCU, causing it to trigger a sampling cycle, and prioritize the same sampling object during two adjacent sampling cycles, ensuring that its priority is higher than that of different sampling objects, thereby achieving orderly sampling.

Benefits of technology

This method can shorten the sampling period, improve monitoring efficiency, ensure that the sampling of each monitoring quantity is carried out in an orderly and conflict-free state, and reduce sampling time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119727916A_ABST
    Figure CN119727916A_ABST
Patent Text Reader

Abstract

The optical module provided by the invention comprises a circuit board and an MCU. Wherein the MCU comprises a timer module, and the timer module comprises a timer interrupt enable register. And the MCU starts timer interruption by controlling the timer interruption enabling register, so that a sampling period is triggered through the timer interruption. The same sampling object exists in two adjacent sampling periods, and different sampling objects also exist in the two adjacent sampling periods. In the same sampling objects, the priorities of at least part of the same sampling objects are higher than those of different sampling objects. According to the method and the device, fixed sampling objects exist in one sampling period, and sampling is not carried out on all the sampling objects. Since not all the sampling objects are sampled in one sampling period, the duration of one sampling period can be shortened, so that the interval between two adjacent sampling periods is shortened, and the sampling time of the sampling objects in the period is shortened. And meanwhile, disordered sampling is changed into ordered sampling, so that the monitoring efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of optical communication technology, and in particular to an optical module. Background Art

[0002] With the development of new services and application models such as cloud computing, mobile Internet, and video, the advancement of optical communication technology has become increasingly important. In optical communication technology, optical modules, as one of the key components in optical communication equipment, can realize the conversion of optical and electrical signals. In the development of optical communication technology, the data transmission rate of optical modules is required to be continuously improved.

[0003] The Receive Loss of Signal (RXLOS) alarm function can reflect whether the received signal is normal. The RXLOS alarm can be issued by monitoring the size of the received optical power. For example, the RXLOS alarm is issued when the received optical power is lower than the threshold. In order to deal with optical reception anomalies in a timely manner, it is usually required to quickly monitor the size of the received optical power within a very short time, such as within 1ms, to achieve a rapid alarm of RXLOS. At this time, the received optical power can be quickly monitored within the interruption by triggering an interruption. However, the triggering of the interruption will interrupt the polling execution of other monitoring quantities, making the collection of each monitoring quantity in a disordered state, which invisibly increases the sampling time of the monitoring quantity. Summary of the invention

[0004] The present disclosure provides an optical module that converts disordered sampling into ordered sampling, thereby increasing monitoring efficiency.

[0005] The optical module provided by the present disclosure includes:

[0006] Circuit boards;

[0007] An MCU is electrically connected to the circuit board, the MCU includes a timer module, the timer module includes a timer interrupt enable register, and the MCU is configured as follows:

[0008] By controlling the timer interrupt enable register to enable the timer interrupt, a sampling cycle is triggered by the timer interrupt;

[0009] There are identical sampling objects and different sampling objects in two adjacent sampling periods; wherein at least some of the identical sampling objects have a higher priority than the different sampling objects.

[0010] The optical module provided in the present disclosure includes an electrically connected circuit board and an MCU. Among them, the MCU includes a timer module, and the timer module includes a timer interrupt enable register. The MCU controls the timer interrupt enable register to turn on the timer interrupt, thereby triggering a sampling cycle through the timer interrupt. There are the same sampling objects and different sampling objects in two adjacent sampling cycles. In the same sampling object, the priority of all the same sampling objects may be higher than the priority of different sampling objects, and the priority of some of the same sampling objects may be higher than the priority of different sampling objects, so at least the priority of some of the same sampling objects is higher than the priority of different sampling objects. Among them, when the sampling object priority is higher, it is characterized that the sampling value reporting time accuracy of the sampling object is higher and the monitoring demand is higher. In the present disclosure, there are fixed sampling objects in a sampling cycle, and not all sampling objects are sampled. After multiple sampling cycles, it can be achieved that: some sampling objects are sampled multiple times, and some sampling objects are covered by at least one sampling, meeting the monitoring requirements of each sampling object. At the same time, since not all sampling objects are sampled in a sampling cycle, the duration of a sampling cycle can be shortened, thereby shortening the interval between two adjacent sampling cycles and shortening the sampling time of the sampling objects in the cycle. At the same time, there is no need to perform resource mutual exclusion protection processing, and the sampling of various monitoring quantities can be completed in an orderly and non-conflicting manner, changing disordered sampling into ordered sampling, thereby increasing monitoring efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] In order to more clearly illustrate the technical solutions in the present disclosure, the following briefly introduces the drawings used in some embodiments of the present disclosure. Obviously, the drawings described below are only drawings of some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can also be obtained based on these drawings. In addition, the drawings described below can be regarded as schematic diagrams, and are not limitations on the actual size of the product involved in the embodiments of the present disclosure, the actual process of the method, the actual timing of the signal, etc.

[0012] Figure 1 is a partial architecture diagram of an optical communication system according to some embodiments;

[0013] Figure 2 is a partial structural diagram of a host computer according to some embodiments;

[0014] Figure 3 is a structural diagram of an optical module according to some embodiments;

[0015] Figure 4 is an exploded view of an optical module according to some embodiments;

[0016] Figure 5 is a structural diagram of an MCU according to some embodiments;

[0017] Figure 6 is a structural diagram of a first type of sampling object according to some embodiments;

[0018] Figure 7 is a structural diagram of a first sampling object of a first type of sampling object according to some embodiments;

[0019] Figure 8 is a structural diagram of a second type of sampling object according to some embodiments;

[0020] Fig. 9 is a structural diagram of a first sampling object of a second type of sampling object according to some embodiments;

[0021] Fig.10 The figure is a flowchart of an optical module sampling method according to some embodiments. DETAILED DESCRIPTION

[0022] In optical communication technology, in order to establish information transmission between information processing devices, it is necessary to load information onto light and use the propagation of light to achieve information transmission. Here, the light loaded with information is an optical signal. When optical signals are transmitted in information transmission equipment, the loss of optical power can be reduced, so high-speed, long-distance, and low-cost information transmission can be achieved. The signals that information processing equipment can recognize and process are electrical signals. Information processing equipment usually includes optical network terminals (Optical Network Unit, ONU), gateways, routers, switches, mobile phones, computers, servers, tablets, televisions, etc., and information transmission equipment usually includes optical fibers and optical waveguides.

[0023] The optical module can realize the mutual conversion between optical signals and electrical signals between information processing equipment and information transmission equipment. For example, at least one of the optical signal input end or the optical signal output end of the optical module is connected to an optical fiber, and at least one of the electrical signal input end or the electrical signal output end of the optical module is connected to an optical network terminal; the first optical signal from the optical fiber is transmitted to the optical module, and the optical module converts the first optical signal into a first electrical signal, and transmits the first electrical signal to the optical network terminal; the second electrical signal from the optical network terminal is transmitted to the optical module, and the optical module converts the second electrical signal into a second optical signal, and transmits the second optical signal to the optical fiber. Since multiple information processing devices can transmit information through electrical signals, at least one of the multiple information processing devices needs to be directly connected to the optical module, and all information processing devices do not need to be directly connected to the optical module. Here, the information processing device directly connected to the optical module is called the upper computer of the optical module. In addition, the optical signal input end or the optical signal output end of the optical module can be called an optical port, and the electrical signal input end or the electrical signal output end of the optical module can be called an electrical port.

[0024] Figure 1 FIG. 1 is a partial structural diagram of an optical communication system according to some embodiments. Figure 1 As shown, the optical communication system mainly includes a remote information processing device 1000 , a local information processing device 2000 , a host computer 100 , an optical module 200 , an optical fiber 101 and a network cable 103 .

[0025] One end of the optical fiber 101 extends toward the remote information processing device 1000, and the other end of the optical fiber 101 is connected to the optical module 200 through the optical port of the optical module 200. The optical signal can be totally reflected in the optical fiber 101, and the propagation of the optical signal in the total reflection direction can almost maintain the original optical power. The optical signal undergoes multiple total reflections in the optical fiber 101 to transmit the optical signal from the remote information processing device 1000 to the optical module 200, or to transmit the optical signal from the optical module 200 to the remote information processing device 1000, thereby realizing long-distance, low-power loss information transmission.

[0026] The optical communication system may include one or more optical fibers 101, and the optical fibers 101 are detachably connected or fixedly connected to the optical module 200. The host computer 100 is configured to provide data signals to the optical module 200, receive data signals from the optical module 200, or monitor or control the working state of the optical module 200.

[0027] The host computer 100 includes a substantially rectangular housing and an optical module interface 102 disposed on the housing. The optical module interface 102 is configured to connect to the optical module 200 so that the host computer 100 and the optical module 200 establish a unidirectional or bidirectional electrical signal connection.

[0028] The host computer 100 also includes an external electrical interface, which can be connected to an electrical signal network. For example, the external electrical interface includes a Universal Serial Bus (USB) interface or a network cable interface 104, and the network cable interface 104 is configured to access the network cable 103 so that the host computer 100 establishes a unidirectional or bidirectional electrical signal connection with the network cable 103. One end of the network cable 103 is connected to the local information processing device 2000, and the other end of the network cable 103 is connected to the host computer 100, so as to establish an electrical signal connection between the local information processing device 2000 and the host computer 100 through the network cable 103. For example, the third electrical signal sent by the local information processing device 2000 is transmitted to the host computer 100 through the network cable 103, and the host computer 100 generates a second electrical signal according to the third electrical signal. The second electrical signal from the host computer 100 is transmitted to the optical module 200, and the optical module 200 converts the second electrical signal into a second optical signal, and transmits the second optical signal to the optical fiber 101, and the second optical signal is transmitted to the remote information processing device 1000 in the optical fiber 101. For example, the first optical signal from the remote information processing device 1000 is transmitted through the optical fiber 101, and the first optical signal from the optical fiber 101 is transmitted to the optical module 200, and the optical module 200 converts the first optical signal into a first electrical signal, and the optical module 200 transmits the first electrical signal to the host computer 100, and the host computer 100 generates a fourth electrical signal according to the first electrical signal, and transmits the fourth electrical signal to the local information processing device 2000. It should be noted that the optical module is a tool for realizing the mutual conversion between optical signals and electrical signals. During the conversion process between the optical signals and electrical signals, the information does not change, but the encoding and decoding methods of the information can change.

[0029] In addition to the optical network terminal, the host computer 100 also includes an optical line terminal (OLT), an optical network device (ONT), or a data center server.

[0030] Figure 2 FIG. 1 is a partial structural diagram of a host computer according to some embodiments. In order to clearly show the connection relationship between the optical module 200 and the host computer 100, Figure 2 Only the structure of the host computer 100 related to the optical module 200 is shown. Figure 2 As shown, the host computer 100 further includes a PCB circuit board 105 disposed in the housing, a cage 106 disposed on the surface of the PCB circuit board 105, a heat sink 107 disposed on the cage 106, and an electrical connector disposed inside the cage 106. The electrical connector is configured to access the electrical port of the optical module 200; the heat sink 107 has a protruding structure such as fins to increase the heat dissipation area.

[0031] The optical module 200 is inserted into the cage 106 of the host computer 100, and the cage 106 fixes the optical module 200. The heat generated by the optical module 200 is transferred to the cage 106 and then diffused through the heat sink 107. After the optical module 200 is inserted into the cage 106, the electrical port of the optical module 200 is connected to the electrical connector inside the cage 106, so that the optical module 200 establishes a bidirectional electrical signal connection with the host computer 100. In addition, the optical port of the optical module 200 is connected to the optical fiber 101, so that the optical module 200 establishes a bidirectional optical signal connection with the optical fiber 101.

[0032] Figure 3 is a structural diagram of an optical module according to some embodiments, Figure 4 FIG. 1 is an exploded view of an optical module according to some embodiments. Figure 3 and Figure 4 As shown, the optical module 200 includes a shell, a circuit board 300 disposed in the shell, a light emitting component 400 and a light receiving component 500. However, the present disclosure is not limited thereto. In some embodiments, the optical module 200 includes one of the light emitting component 400 and the light receiving component 500.

[0033] The housing comprises an upper housing 201 and a lower housing 202 . The upper housing 201 covers the lower housing 202 to form the housing having two openings 204 and 205 . The outer contour of the housing is generally a square body.

[0034] In some embodiments, the lower shell 202 includes a bottom plate 2021 and two lower side plates 2022 located on both sides of the bottom plate 2021 and arranged perpendicular to the bottom plate 2021; the upper shell 201 includes a cover plate 2011, and the cover plate 2011 covers the two lower side plates 2022 of the lower shell 202 to form the above-mentioned shell.

[0035] In some embodiments, the lower shell 202 includes a bottom plate 2021 and two lower side plates 2022 located on both sides of the bottom plate 2021 and vertically arranged with the bottom plate 2021; the upper shell 201 includes a cover plate 2011 and two upper side plates located on both sides of the cover plate 2011 and vertically arranged with the cover plate 2011, and the two upper side plates are combined with the two lower side plates 2022 to realize that the upper shell 201 covers the lower shell 202.

[0036] The direction of the line connecting the two openings 204 and 205 may be consistent with the length direction of the optical module 200, or may be inconsistent with the length direction of the optical module 200. For example, the opening 204 is located at the end of the optical module 200 ( Figure 3 The opening 205 is also located at the end of the optical module 200 ( Figure 3Alternatively, the opening 204 is located at the end of the optical module 200, and the opening 205 is located at the side of the optical module 200. The opening 204 is an electrical port, and the gold finger 301 of the circuit board 300 extends from the opening 204 and is inserted into the electrical connector of the host computer 100; the opening 205 is an optical port, which is configured to access the external optical fiber 101, so that the optical fiber 101 connects the optical emitting component 400 and the optical receiving component 500 in the optical module 200.

[0037] The assembly method of combining the upper shell 201 and the lower shell 202 is adopted, which facilitates the installation of the circuit board 300, the light emitting component 400, the light receiving component 500, etc. into the above shell, and the upper shell 201 and the lower shell 202 can encapsulate and protect the above components. In addition, when assembling the circuit board 300, the light emitting component 400 and the light receiving component 500, etc., it is convenient to deploy the positioning components, heat dissipation components and electromagnetic shielding components of these components, which is conducive to the automated production.

[0038] In some embodiments, the upper shell 201 and the lower shell 202 are made of metal materials to facilitate electromagnetic shielding and heat dissipation.

[0039] In some embodiments, the optical module 200 further includes an unlocking component 600 located outside its housing. The unlocking component 600 is configured to achieve a fixed connection between the optical module 200 and the host computer, or to release the fixed connection between the optical module 200 and the host computer.

[0040] For example, the unlocking component 600 is located on the outside of the two lower side plates 2022 of the lower housing 202, and includes a snap-fit ​​component that matches the cage 106 of the host computer 100. When the optical module 200 is inserted into the cage 106, the snap-fit ​​component of the unlocking component 600 fixes the optical module 200 in the cage 106; when the unlocking component 600 is pulled, the snap-fit ​​component of the unlocking component 600 moves accordingly, thereby changing the connection relationship between the snap-fit ​​component and the host computer, so as to release the fixation of the optical module 200 and the host computer, so that the optical module 200 can be pulled out of the cage 106.

[0041] The circuit board 300 includes circuit traces, electronic components and chips, etc. The electronic components and chips are connected according to the circuit design through the circuit traces to realize the functions of power supply, electrical signal transmission and grounding. The electronic components may include capacitors, resistors, transistors, metal-oxide-semiconductor field-effect transistors (Metal-Oxide-Semiconductor Field-Effect Transistor, MOSFET), etc. The chips may include microcontroller units (Microcontroller Unit, MCU), laser driver chips, transimpedance amplifiers (Transimpedance Amplifier, TIA), limiting amplifiers (Limiting amplifier), clock and data recovery chips (Clock and Data Recovery, CDR), power management chips, digital signal processing (Digital Signal Processing, DSP) chips.

[0042] The circuit board 300 is generally a rigid circuit board. Due to its relatively hard material, the rigid circuit board can also realize the load-bearing function. For example, the rigid circuit board can stably carry the above-mentioned electronic components and chips; the rigid circuit board can also be inserted into the electrical connector in the cage 106 of the host computer 100.

[0043] The circuit board 300 also includes a gold finger 301 formed on the end surface thereof. The gold finger 301 is composed of a plurality of independent pins. The circuit board 300 is inserted into the cage 106, and the gold finger 301 is connected to the electrical connector in the cage 106. The gold finger 301 can be provided on only one side of the circuit board 300 (e.g. Figure 4 The upper surface shown in the figure) can also be set on the upper and lower surfaces of the circuit board 300 to provide more pins, so as to adapt to occasions where the number of pins is large. The gold finger 301 is configured to establish an electrical connection with the host computer to achieve power supply, grounding, two-wire synchronous serial (Inter-Integrated Circuit, I2C) signal transmission, data signal transmission, etc. Of course, flexible circuit boards are also used in some optical modules. Flexible circuit boards are generally used in conjunction with rigid circuit boards to supplement rigid circuit boards.

[0044] At least one of the light emitting component 400 or the light receiving component 500 is located on a side of the circuit board 300 away from the gold finger 301 .

[0045] In some embodiments, the light emitting component 400 and the light receiving component 500 are physically separated from the circuit board 300 and then electrically connected to the circuit board 300 through corresponding flexible circuit boards or electrical connectors.

[0046] In some embodiments, at least one of the light emitting component or the light receiving component may be directly disposed on the circuit board 300. For example, at least one of the light emitting component or the light receiving component may be disposed on a surface of the circuit board 300 or a side of the circuit board 300.

[0047] In some embodiments, in order to ensure the normal operation of the optical module, it is necessary to monitor multiple monitoring quantities, such as monitoring the received optical power to determine whether to issue an RXLOS alarm; such as monitoring the temperature to determine the operating temperature of the electrical device, etc. A microcontroller unit (MCU) is provided on the surface of the circuit board 300, and an analog-to-digital converter (ADC) conversion chip is provided inside the MCU, and each monitoring quantity is sampled through the ADC conversion chip.

[0048] In some embodiments, the MCU includes an ADC conversion chip, and only one monitoring quantity can be sampled at the same time; in some embodiments, the MCU includes multiple ADC conversion chips, and multiple monitoring quantities can be monitored by different ADC conversion chips at the same time. In most cases, the MCU includes one ADC conversion chip. The following embodiments are illustrative examples of MCU including one ADC conversion chip.

[0049] In some embodiments, in order to monitor the received optical power in a timely manner, an interruption is usually triggered, but the interruption will interrupt the execution of the polling sampling, resulting in the failure of the polling sampling being executed. Exemplarily, at this time, the resource conflict between the interruption and the polling can be handled by resource mutual exclusion protection, but the logic of resource mutual exclusion protection is relatively complex, which reduces the monitoring efficiency. At the same time, the triggering of the interruption will interrupt the polling execution of other monitoring quantities, making the collection of each monitoring quantity in a disordered state, which invisibly increases the sampling time of the monitoring quantity.

[0050] Figure 5 FIG. 4 is a structural diagram of an MCU according to some embodiments. Figure 5 As shown, in some embodiments, a sampling cycle is triggered by a timer interrupt, and a timer interrupt indicates the end of a previous sampling cycle and the beginning of a next sampling cycle. Two adjacent sampling cycles are connected by a timer interrupt.

[0051] In some embodiments, the MCU includes a timer module, and the timer module includes a timer interrupt enable register, and the timer interrupt is turned on or off by setting different register values ​​in the timer interrupt enable register. Exemplarily, a first register value is set in the timer interrupt enable register, such as "1", to turn on the timer interrupt; a second register value is set in the timer interrupt enable register, such as "0", to turn off the timer interrupt.

[0052] In some embodiments, the MCU includes an ADC sampling module, and the ADC sampling module is disposed in an ADC conversion chip. The ADC sampling module includes an ADC sampling interrupt enable register, and the ADC sampling interrupt is enabled or disabled by setting different register values ​​in the ADC sampling interrupt enable register. Exemplarily, a first register value is set in the ADC sampling interrupt enable register, such as "1", to enable the ADC sampling interrupt; a second register value is set in the ADC sampling interrupt enable register, such as "0", to disable the ADC sampling interrupt.

[0053] In some embodiments, the received optical power needs to be sampled at intervals of 1 ms. Accordingly, the timer interrupt is configured to be triggered once every 800 us, and the ADC sampling interrupt is configured to be a software single trigger mode.

[0054] In the present disclosure, there are fixed sampling objects within a sampling cycle, and not all sampling objects are sampled. After multiple sampling cycles, it can be achieved that: some sampling objects are sampled multiple times, and some sampling objects are covered with sampling at least once, so as to meet the monitoring needs of each sampling object. At the same time, since not all sampling objects are sampled within a sampling cycle, the length of a sampling cycle can be shortened, thereby shortening the interval between two adjacent sampling cycles and shortening the sampling time of the sampling objects within the cycle. At the same time, there is no need to perform resource mutual exclusion protection processing, and the sampling of each monitoring quantity is completed in an orderly and non-conflicting manner, changing disordered sampling to ordered sampling, thereby increasing monitoring efficiency.

[0055] Different sampling objects have different monitoring requirements. For example, in some embodiments, it is necessary to monitor the received optical power in time so as to issue the RXLOS alarm in time. Then, such sampling objects require higher sampling value reporting time accuracy and higher monitoring requirements. However, sampling objects such as temperature and voltage do not require high reporting time accuracy. Therefore, among the sampling objects, there is a type of sampling object with higher monitoring requirements, and another type of sampling object with relatively lower monitoring requirements. The priority of the type of sampling object with higher monitoring requirements is higher than that of the type of sampling object with relatively lower monitoring requirements. For the convenience of description, the type of sampling object with higher priority is called the first type of sampling object, and the type of sampling object with lower priority is called the second type of sampling object. Exemplarily, the sampling interval of the first type of sampling object is shorter and the sampling frequency is higher, and the sampling requirement is called the first sampling attribute. The sampling frequency of the second type of sampling object does not need to be too much, so the sampling interval can be appropriately lengthened, and the sampling frequency can be released to reduce, and the sampling requirement is called the second sampling attribute. The first type of sampling object includes each sampling object with the first sampling attribute; the second type of sampling object includes each sampling object with the second sampling attribute.

[0056] In some embodiments of the present disclosure, there are the same sampling objects and different sampling objects in two adjacent sampling periods. Among the same sampling objects, the priority of all the same sampling objects may be higher than the priority of different sampling objects, and the priority of some of the same sampling objects may be higher than the priority of different sampling objects. Therefore, the priority of at least some of the same sampling objects is higher than the priority of different sampling objects. Among them, when the priority of the sampling object is higher, it indicates that the time accuracy of reporting the sampling value of the sampling object is higher and the monitoring demand is higher. In the present disclosure, there are fixed sampling objects in a sampling period, and not all sampling objects are sampled. After multiple sampling periods, it can be achieved that: some sampling objects are sampled multiple times, and some sampling objects are covered by sampling at least once, so as to meet the monitoring requirements of each sampling object.

[0057] In some embodiments of the present disclosure, the priority of all the same sampling objects may be higher than the priority of different sampling objects. Take the first category of sampling objects including monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, etc. as an example; take the second category of sampling objects including monitoring quantity A, monitoring quantity B, monitoring quantity C, etc. as an example for exemplary description. In the first sampling period, monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, and monitoring quantity A are sampled respectively; in the second sampling period, monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, and monitoring quantity B are sampled respectively; in the third sampling period, monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, and monitoring quantity C are sampled respectively. It can be seen that in two adjacent sampling periods, the first category of sampling objects are collected as fixed sampling objects in each sampling period. Each monitoring quantity in the first category of sampling objects is used as all the same sampling objects, and each monitoring quantity in the second category of sampling objects is scattered in different sampling periods for sampling. At this time, the priority of all the same sampling objects is higher than the priority of different sampling objects.

[0058] In some embodiments of the present disclosure, the priority of some of the same sampling objects may be higher than the priority of different sampling objects. Similarly, take the first category of sampling objects including monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, etc. as an example; take the second category of sampling objects including monitoring quantity A, monitoring quantity B, monitoring quantity C, etc. as an example for exemplary description. In the first sampling period, the monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, monitoring quantity A, and monitoring quantity B are sampled respectively; in the second sampling period, the monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, monitoring quantity A, and monitoring quantity C are sampled respectively; in the third sampling period, the monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, monitoring quantity B, and monitoring quantity C are sampled respectively. It can be seen that in the adjacent first sampling period and the second sampling period, the same sampling objects include monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, and monitoring quantity A, and different sampling objects include monitoring quantity B and monitoring quantity C. Among the same sampling objects, the priority of monitoring quantity 1, monitoring quantity 2, and monitoring quantity 3 is higher than that of monitoring quantity B and monitoring quantity C. At the same time, in the same sampling object, monitoring quantity A has the same sampling object as monitoring quantity B and monitoring quantity C, so some of the same sampling objects have the same priority as different sampling objects. At the same time, in the same sampling object, the priority of monitoring quantity 1, monitoring quantity 2, and monitoring quantity 3 is higher than that of monitoring quantity A, so the priority of some sampling objects in the same sampling object is higher than that of other sampling objects.

[0059] Figure 6 is a structural diagram of a first type of sampling object according to some embodiments; Figure 7 FIG. 4 is a structural diagram of a first sampling object of a first type of sampling object according to some embodiments. Figure 6 and Figure 7 As shown, in some embodiments, the first type of sampling objects is stored in the MCU. Exemplarily, the first type of sampling objects includes different sampling objects such as the first sampling object, the second sampling object, and the third sampling object. Among them, each sampling object in the first type of sampling objects carries its own corresponding sampling channel information and storage variables, or the MCU stores the sampling channel information and storage variables corresponding to the sampling object. According to the sampling channel information, the sampling channel of the sampling object can be configured to sample the sampling object; according to the storage variable, the sampled value can be stored to store the sampling value of the sampling object.

[0060] In some embodiments, the first type of sampling object includes optical receiving power. When the received optical power is less than a threshold, a RXLOS alarm is issued; when the received optical power is not less than the threshold, no RXLOS alarm is issued.

[0061] Since there is a one-to-one correspondence between ADC sampling channels and pins, and each ADC sampling channel has a fixed, corresponding pin, each ADC sampling channel and the sampling object also have a one-to-one correspondence. Exemplarily, each sampling object should preset its ADC sampling channel so that the ADC sampling channel of the sampling object can be configured according to the sampling channel information. At the same time, by configuring the corresponding ADC sampling channel, ADC sampling resources can be preempted to avoid resource conflicts.

[0062] There is a mapping relationship between each sampling object and the corresponding sampling channel information, and there is also a mapping relationship between each sampling object and the corresponding storage variable.

[0063] Figure 8 is a structural diagram of a second type of sampling object according to some embodiments; Fig. 9 FIG. 4 is a structural diagram of a first sampling object of a second type of sampling object according to some embodiments. Figure 8 and Fig. 9 As shown, the second type of sampling objects are stored in the MCU, and the second type of sampling objects include different sampling objects such as the first sampling object, the second sampling object, and the third sampling object. Among them, each sampling object in the second type of sampling objects carries its own corresponding sampling channel information and storage variables, or the MCU stores the sampling channel information and storage variables corresponding to the sampling object. According to the sampling channel information, the sampling channel of the sampling object can be configured to sample the sampling object; according to the storage variable, the sampled value can be stored to store the sampling value of the sampling object.

[0064] The first sampling object in the first category of sampling objects and the first sampling object in the second category of sampling objects are two different sampling objects, and the sampling attributes corresponding to the two are the first sampling attribute and the second sampling attribute. Correspondingly, the sampling interval of the first sampling object in the first category of sampling objects is shorter than the sampling interval of the first sampling object in the second category of sampling objects, and the sampling frequency of the first sampling object in the first category of sampling objects is greater than the sampling frequency of the first sampling object in the second category of sampling objects. The same is true for the second sampling object in the first category of sampling objects and the second sampling object in the second category of sampling objects.

[0065] In some embodiments, each sampling object in the first category of sampling objects has a first sampling identifier to indicate that each sampling object has a first sampling attribute; each sampling object in the second category of sampling objects has a second sampling identifier to indicate that each sampling object has a second sampling attribute. The MCU determines the monitoring requirements and sampling attributes of each sampling object by identifying the first sampling identifier and the second sampling identifier. When the sampling object has the first sampling identifier, it means that the sampling object has a monitoring requirement of a short sampling interval and a high sampling frequency; when the sampling object has the second sampling identifier, it means that the sampling object has a monitoring requirement that the sampling interval can be appropriately lengthened and the sampling frequency can be appropriately shortened.

[0066] In some embodiments of the present disclosure, there are the same sampling objects and different sampling objects in two adjacent sampling periods. In some embodiments, the sampling objects in the first category of sampling objects are collected separately in the first sampling period, and then at least one but not all sampling objects in the second category of sampling objects are collected; the sampling objects in the first category of sampling objects are collected separately in the second sampling period adjacent to the first sampling period, and then at least one but not all sampling objects in the second category of sampling objects are collected; wherein, there is at least one different sampling object between the second category of sampling objects collected in the second sampling period and the second category of sampling objects collected in the first sampling period. Exemplarily, all sampling objects of the first category of sampling objects are collected in both the first sampling period and the second sampling period. Then, all sampling objects in the first category of sampling objects are collected sequentially as fixed sampling objects in any sampling period; each sampling object in the second category of sampling objects is collected in different sampling periods, and the second category of sampling objects is covered and collected by each sampling period.

[0067] In some embodiments of the present disclosure, there are the same sampling objects and different sampling objects in two adjacent sampling periods. In some embodiments, in some embodiments, all sampling objects in the first category of sampling objects are sampled in one sampling period, and at least one but not all sampling objects in the second category of sampling objects are sampled. Take the first sampling object, the second sampling object, the third sampling object, etc. of the first category of sampling objects as an example, which are monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, etc. respectively; take the first sampling object, the second sampling object, the third sampling object, etc. of the second category of sampling objects as an example, which are monitoring quantity A, monitoring quantity B, monitoring quantity C, etc. respectively. In the first sampling period, the monitoring quantity 1, the monitoring quantity 2, the monitoring quantity 3, and the monitoring quantity A are sampled respectively; in the second sampling period, the monitoring quantity 1, the monitoring quantity 2, the monitoring quantity 3, and the monitoring quantity B are sampled respectively; in the third sampling period, the monitoring quantity 1, the monitoring quantity 2, the monitoring quantity 3, and the monitoring quantity C are sampled respectively. In this way, through three sampling cycles, three rounds of sampling are performed on monitoring quantity 1, monitoring quantity 2, and monitoring quantity 3 to increase the sampling frequency; monitoring quantity A, monitoring quantity B, and monitoring quantity C are sampled in three sampling cycles respectively. After the three sampling cycles are completed, each sampling object in the second type of sampling object is covered and sampled once, realizing the polling sampling purpose of the second monitoring array, thereby meeting the monitoring needs of the second monitoring array.

[0068] In some embodiments of the present disclosure, there are the same sampling objects and different sampling objects in two adjacent sampling periods. In some embodiments, all sampling objects in the first category of sampling objects are sampled in one sampling period, and at least one but not all sampling objects in the second category of sampling objects are sampled. Take the first sampling object, the second sampling object, the third sampling object, etc. of the first category of sampling objects as an example, which are monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, etc. respectively; take the first sampling object, the second sampling object, the third sampling object, etc. of the second category of sampling objects as an example, which are monitoring quantity A, monitoring quantity B, monitoring quantity C, etc. respectively. In the first sampling period, the monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, monitoring quantity A, and monitoring quantity B are sampled respectively; in the second sampling period, the monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, monitoring quantity A, and monitoring quantity C are sampled respectively; in the third sampling period, the monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, monitoring quantity B, and monitoring quantity C are sampled respectively. In this way, through three sampling cycles, three rounds of sampling are performed on monitoring quantity 1, monitoring quantity 2, and monitoring quantity 3 to increase the sampling frequency; monitoring quantity A, monitoring quantity B, and monitoring quantity C are sampled in three sampling cycles respectively. After the three sampling cycles are completed, each sampling object in the second type of sampling object is covered and sampled twice, achieving the purpose of polling sampling of the second monitoring array, thereby meeting the monitoring needs of the second monitoring array.

[0069] In some embodiments of the present disclosure, within one sampling period, all sampling objects in the first category of sampling objects and some sampling objects in the second category of sampling objects are sampled, thereby shortening the duration of one sampling period and shortening the interval between two adjacent sampling periods. Then, multiple rounds of sampling can be performed on all sampling objects in the first category of sampling objects to increase the sampling frequency, thereby meeting the monitoring needs of the first category of sampling objects and adapting to the monitoring needs of the second category of sampling objects.

[0070] Fig.10 FIG. 1 is a flow chart of an optical module sampling method according to some embodiments. Fig.10 As shown, in some embodiments, in order to sample the first type of sampling objects and the second type of sampling objects respectively and meet the monitoring requirements of the first type of sampling objects and the second type of sampling objects at the same time, the sampling method provided by the present disclosure includes:

[0071] S100: Start a timer interrupt to trigger a sampling cycle, and in the sampling cycle, send each sampling object in the first category of sampling objects to the ADC sampling module in sequence, and configure the ADC sampling channel according to the sampling channel information corresponding to the sampling object;

[0072] S200: triggering an ADC sampling interrupt by controlling an ADC sampling module, so as to trigger sampling of a sampling object through the ADC sampling interrupt;

[0073] S300: When sampling of each sampling object in the first category of sampling objects is completed, at least one but not all sampling objects in the second category of sampling objects are sent to the ADC sampling module, and the ADC sampling channel is configured according to the sampling channel information corresponding to the sampling object;

[0074] S400: triggering an ADC sampling interrupt by controlling an ADC sampling module, so as to trigger sampling of a sampling object through the ADC sampling interrupt, and then disabling a timer interrupt.

[0075] In some embodiments of the present disclosure, all sampling objects in the first category of sampling objects are sampled within one sampling cycle, and at least one but not all sampling objects in the second category of sampling objects are sampled. In this way, after multiple sampling cycles, all sampling objects in the first category of sampling objects are sampled multiple times, and all sampling objects in the second category of sampling objects are covered and sampled at least once. Since only part of the second category of sampling objects is collected within one sampling cycle, the length of one sampling cycle can be shortened, thereby shortening the interval between two adjacent sampling cycles and shortening the sampling time of the sampling objects. At the same time, disordered sampling is changed to ordered sampling, thereby increasing monitoring efficiency.

[0076] The following is an expanded description of the execution of the above sampling method.

[0077] In some embodiments of the present disclosure, the MCU sets a first preset value in a timer interrupt enable register to enable a timer interrupt, thereby enabling a timer interrupt. A sampling cycle is triggered by a timer interrupt. Then, in the sampling cycle, each sampling object in the first type of sampling object is sent to the ADC sampling module in sequence by identifying the first sampling identifier, and the ADC sampling channel is configured according to the sampling channel information carried by the sampling object, thereby preempting the ADC sampling resource. Then, the ADC sampling interrupt is enabled by setting a first preset value in the ADC sampling interrupt enable register, so as to trigger the sampling of the sampling object through ADC sampling, and the sampled ADC sampling value is stored in the storage variable corresponding to the sampling object, and the MCU determines whether to issue an RXLOS alarm by reading the ADC sampling value in the storage variable. It can be seen that the sampling process of a sampling object includes: sending the sampling object to the ADC sampling module by identifying the first sampling identifier; configuring the ADC sampling channel according to the sampling channel information corresponding to the sampling object; enabling the ADC sampling interrupt to trigger the sampling of the sampling object through ADC sampling, and storing the sampled ADC sampling value in the storage variable corresponding to the sampling object. In this way, each sampling object in the first type of sampling object is sampled in sequence. Similarly, the sampling of the sampling objects in the second type of sampling objects is also the above process.

[0078] In some embodiments, taking the first sampling object, the second sampling object, the third sampling object, etc. of the first category of sampling objects as monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, etc. respectively, as an example, within a sampling cycle, monitoring quantity 1 is sent to the ADC sampling module, and then the ADC sampling channel is configured, and the ADC sampling value is sampled and stored; then the monitoring quantity 2 is sent to the ADC sampling module, and then the ADC sampling channel is configured, and the ADC sampling value is sampled and stored; then the monitoring quantity 3 is sent to the ADC sampling module, and then the ADC sampling channel is configured, and the ADC sampling value is sampled and stored, thereby completing the sampling of all sampling objects in the first category of sampling objects.

[0079] In some embodiments, after the sampling of the first sampling object of the first category of sampling objects is completed, the ADC sampling interrupt is exited; after the second sampling object of the first category of sampling objects is received, the ADC sampling channel is configured according to the sampling channel information to seize the ADC sampling resources, and then the ADC sampling interrupt is enabled, and when the sampling is completed, the ADC sampling interrupt is exited. The sampling of all sampling objects in the first category of sampling objects is completed in this cycle in turn.

[0080] In some embodiments, within the same sampling cycle, when the sampling of all sampling objects in the first category of sampling objects is completed, at least one but not all sampling objects in the second category of sampling objects are sent to the ADC sampling module by identifying the second sampling identifier, and the ADC sampling channel is configured according to the sampling channel information, thereby preempting the ADC sampling resources. Then, by setting the first preset value in the ADC sampling interrupt enable register, the ADC sampling interrupt is enabled, the sampling of the sampling object is triggered by ADC sampling, and the sampled ADC sampling value is stored in the storage variable corresponding to the sampling object. The MCU determines whether to issue an RXLOS alarm by reading the ADC sampling value in the storage variable.

[0081] In some embodiments, the first sampling object, the second sampling object, the third sampling object, etc. of the first type of sampling object are respectively monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, etc.; the first sampling object, the second sampling object, the third sampling object, etc. of the second type of sampling object are respectively monitoring quantity A, monitoring quantity B, monitoring quantity C, etc. for example. In the first sampling cycle, monitoring quantity 1 is sent to the ADC sampling module, and then the ADC sampling channel is configured, and the ADC sampling value is sampled and stored; then the monitoring quantity 2 is sent to the ADC sampling module, and then the ADC sampling channel is configured, and the ADC sampling value is sampled and stored; then the monitoring quantity 3 is sent to the ADC sampling module, and then the ADC sampling channel is configured, and the ADC sampling value is sampled and stored, so as to complete the sampling of all sampling objects in the first type of sampling object. Then, the monitoring quantity A is sent to the ADC sampling module, and then the ADC sampling channel is configured, and the ADC sampling value is sampled and stored. In the second sampling cycle, the monitoring quantity 1 is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored; then the monitoring quantity 2 is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored; then the monitoring quantity 3 is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored, thus completing the sampling of all sampling objects in the first category of sampling objects. Then, the monitoring quantity B is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored. In the last sampling cycle, the monitoring quantity 1 is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored; then the monitoring quantity 2 is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored; then the monitoring quantity 3 is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored, thus completing the sampling of all sampling objects in the first category of sampling objects. Then, the monitoring quantity C is sent to the ADC sampling module, and then the ADC sampling channel is configured, the ADC sampling value is sampled and stored. In this way, through three sampling cycles, three rounds of sampling are performed on monitoring quantity 1, monitoring quantity 2, and monitoring quantity 3 to increase the sampling frequency; monitoring quantity A, monitoring quantity B, and monitoring quantity C are sampled in three sampling cycles respectively. After the three sampling cycles are over, each sampling object in the second type of sampling object is covered and sampled twice, achieving the purpose of polling sampling of the second monitoring array, thereby meeting the monitoring needs of the second monitoring array. At the same time, the disordered sampling is changed to ordered sampling, thereby increasing the monitoring efficiency.

[0082] In some embodiments of the present disclosure, all sampling objects in the first category of sampling objects are treated as fixed data and will be sampled in any sampling period; each sampling object in the second category of sampling objects is assigned to different sampling periods for sampling until all sampling objects in the second category of sampling objects are covered and sampled. Since only part of the second category of sampling objects is collected in one sampling period, the length of one sampling period can be shortened, thereby shortening the interval between two adjacent sampling periods and shortening the sampling time of the sampling objects. At the same time, disordered sampling is changed to ordered sampling, thereby increasing monitoring efficiency.

[0083] In some embodiments of the present disclosure, when the MCU has an ADC conversion chip, there is no need to perform resource mutual exclusion processing, and each sampling object can be sampled in an orderly manner, and there is no need to be limited by the number of ADCs of the MCU peripherals. The present disclosure combines timer interrupts and ADC sampling interrupts to perform sampling of all sampling objects in the first category of sampling objects and some sampling objects in the second category of sampling objects within a sampling period. By executing multiple sampling periods, it is achieved that: all sampling objects in the first category of sampling objects are sampled multiple times, and all sampling objects in the second category of sampling objects are covered and sampled at least once, while meeting the monitoring requirements and sampling properties of the first category of sampling objects and the second category of sampling objects.

[0084] In some embodiments of the present disclosure, by configuring the ADC sampling channel, ADC sampling resources can be seized, and the sampling of each monitored quantity can be completed in an orderly manner without conflict or influence, and there is no need to perform complex logical processing of resource mutual exclusion protection, thereby improving monitoring efficiency. The present disclosure occupies the ADC sampling channel by configuring the ADC sampling channel, thereby realizing the seizure of ADC resources. To this end, the ADC sampling module also includes a channel configuration register, and the sampling channel is configured by setting different register values ​​in the channel configuration register.

[0085] Taking the first sampling object, the second sampling object, the third sampling object, etc. of the first category of sampling objects as monitoring quantity 1, monitoring quantity 2, monitoring quantity 3, etc. respectively, as an example, the sampling channel information corresponding to monitoring quantity 1 is "monitoring quantity 1, channel=1", indicating that monitoring quantity 1 is sampled through the first ADC sampling channel, and the register value "1" is set in the channel configuration register, so that the first ADC sampling channel is configured as the ADC sampling channel of monitoring quantity 1. The sampling channel information corresponding to monitoring quantity 2 is "monitoring quantity 2, channel=2", indicating that monitoring quantity 2 is sampled through the second ADC sampling channel, and the register value "2" is set in the channel configuration register, so that the second ADC sampling channel is configured as the ADC sampling channel of monitoring quantity 3. The sampling channel information corresponding to monitoring quantity 3 is "monitoring quantity 3, channel=3", indicating that monitoring quantity 3 is sampled through the third ADC sampling channel, and the register value "3" is set in the channel configuration register, so that the third ADC sampling channel is configured as the ADC sampling channel of monitoring quantity 3.

[0086] In some embodiments of the present disclosure, within the same sampling period, it is determined whether all sampling objects in the first category of sampling objects have completed sampling. If all sampling objects in the first category of sampling objects have completed sampling, at least one but not all sampling objects in the second category of sampling objects are sampled.

[0087] In some embodiments, in order to facilitate the determination of whether all sampling objects in the first category of sampling objects have completed sampling, a value representing the number of sampling objects to be sampled is stored in the MCU. When the sampling objects in the first category of sampling objects are sent to the ADC sampling module in sequence, the value representing the number of sampling objects to be sampled is reduced by 1 one by one. When the value representing the number of sampling objects to be sampled is 0, there is no unsampled sampling object in the first category of sampling objects, thereby indicating that all sampling objects in the first category of sampling objects have completed sampling.

[0088] In some embodiments, in order to facilitate the determination of whether all sampling objects in the first category of sampling objects have completed sampling, a sampling quantity characterization value is stored in the MCU. When the sampling objects in the first category of sampling objects are sent to the ADC sampling module in sequence, the sampling quantity characterization value is incremented by 1. When the number characterization value to be sampled reaches a preset value, it indicates that all sampling objects in the first category of sampling objects have completed sampling.

[0089] In the present disclosure, the first type of sampling object includes the received optical power, and the received optical power can be sampled multiple times, and the sampling interval is short, so that when the received optical power is lower than the threshold, the RXLOS alarm is issued in time. In some embodiments, the optical module has an RXLOS signal pin. When the received optical power is less than the threshold, the RXLOS alarm is issued, and the RXLOS signal pin outputs a low level at this time; when the received optical power is not less than the threshold, the RXLOS alarm is not issued, and the RXLOS signal pin outputs a high level at this time. The host computer monitors the high and low level states of the RXLOS signal pin to determine whether the optical reception is abnormal. In some embodiments, the optical module does not have an RXLOS signal pin inside, and the optical reception can be monitored by a multiplexed pin, such as a multiplexed INTL pin. When the received optical power is less than the threshold, the RXLOS alarm is issued, and the multiplexed pin outputs a low level at this time; when the received optical power is not less than the threshold, the RXLOS alarm is not issued, and the multiplexed pin outputs a high level at this time. The host computer monitors the high and low level states of the multiplexed pin to determine whether the optical reception is abnormal.

[0090] In the present disclosure, there are the same sampling objects and different sampling objects in two adjacent sampling periods. In the same sampling objects, the priority of all the same sampling objects may be higher than the priority of different sampling objects, and the priority of some of the same sampling objects may be higher than the priority of different sampling objects. Therefore, the priority of at least some of the same sampling objects is higher than the priority of different sampling objects. Among them, when the priority of the sampling object is higher, it is characterized that the sampling value reporting time accuracy of the sampling object is higher and the monitoring demand is higher. In the present disclosure, there are fixed sampling objects in a sampling period, and not all sampling objects are sampled. After multiple sampling periods, it can be achieved that: some sampling objects are sampled multiple times, and some sampling objects are covered by sampling at least once, so as to meet the monitoring requirements of each sampling object. At the same time, since not all sampling objects are sampled in a sampling period, the length of a sampling period can be shortened, thereby shortening the interval between two adjacent sampling periods and shortening the sampling time of the sampling objects in the period. At the same time, there is no need to perform resource mutual exclusion protection processing, and the sampling of each monitoring quantity is completed in an orderly and non-conflicting manner, changing the disordered sampling into the ordered sampling, thereby increasing the monitoring efficiency.

[0091] The above is only a specific embodiment of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any changes or substitutions that can be thought of by any person skilled in the art within the technical scope disclosed in the present disclosure should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.

Claims

1. An optical module, characterized in that: include: Circuit boards; An MCU is electrically connected to the circuit board, the MCU includes a timer module, the timer module includes a timer interrupt enable register, and the MCU is configured as follows: By controlling the timer interrupt enable register to enable the timer interrupt, a sampling cycle is triggered by the timer interrupt; There are identical sampling objects and different sampling objects in two adjacent sampling periods; wherein at least some of the identical sampling objects have a higher priority than the different sampling objects.

2. The optical module according to claim 1, characterized in that: Some of the same sampling objects and the different sampling objects have the same priority.

3. The optical module according to claim 1, characterized in that: Among the same sampling objects, the priorities of some sampling objects are higher than the priorities of other sampling objects.

4. The optical module according to claim 1, characterized in that: The MCU also includes an ADC sampling module; the MCU stores sampling channel information corresponding to the sampling objects; The MCU is configured as: When collecting the sampling object, configuring the ADC sampling channel according to the sampling channel information; The ADC sampling interrupt is enabled by controlling the ADC sampling module, so as to trigger the sampling of the sampling object through the ADC sampling interrupt.

5. The optical module according to claim 4, characterized in that: The ADC sampling module includes an ADC sampling interrupt enable register and a channel configuration register respectively; The MCU is configured as: Setting the register value of the timer interrupt enable register to a first preset value to enable the timer interrupt; Setting the register value of the timer interrupt enable register to a second preset value to disable the timer interrupt; The MCU is configured as: The register value of the ADC sampling interrupt enable register is set to a first preset value to enable the ADC sampling interrupt; the register value of the ADC sampling interrupt enable register is set to a second preset value to exit the ADC sampling interrupt; The MCU is also configured to: According to the sampling channel information, the register value of the channel configuration register is set to a register value corresponding to the sampling channel information to configure the ADC sampling channel.

6. An optical module, characterized in that: include: Circuit boards; An MCU is electrically connected to the circuit board, wherein the MCU includes a timer module and is configured as follows: By controlling the timer module to start a timer interrupt, a sampling cycle is triggered by the timer interrupt; In a first sampling period, sampling objects in the first category of sampling objects are respectively collected, and then at least one but not all sampling objects in the second category of sampling objects are collected; In a second sampling period, sampling objects in the first category of sampling objects are collected respectively, and then at least one but not all sampling objects in the second category of sampling objects are collected; the second category of sampling objects collected in the second sampling period and the second category of sampling objects collected in the first sampling period have at least one different sampling object; Until the first type of sampling objects are collected multiple times, the second type of sampling objects are covered and collected at least once.

7. The optical module according to claim 6, characterized in that: The first type of sampling objects includes sampling objects having a first sampling attribute; the second type of sampling objects includes sampling objects having a second sampling attribute; The MCU also stores sampling channel information corresponding to the first type of sampling objects and the second type of sampling objects respectively; The MCU is configured as: When collecting the sampling object, the ADC sampling channel is configured according to the sampling channel information.

8. The optical module according to claim 6, characterized in that: The MCU also includes an ADC sampling module; The MCU is configured as: The ADC sampling interrupt is enabled by controlling the ADC sampling module, so as to trigger the sampling of the sampling object through the ADC sampling interrupt.

9. The optical module according to claim 6, characterized in that: The MCU includes an ADC sampling module, and the MCU stores a value representing the quantity to be sampled; The MCU is configured to: when sending each sampling object in the first type of sampling objects to the ADC sampling module in sequence, the representation value of the number to be sampled is reduced by 1 successively; When the value representing the number of samples to be sampled is 0, it represents that the sampling of each sampling object in the first category of sampling objects has been completed.

10. The optical module according to claim 8, characterized in that: Each sampling object in the first category of sampling objects has a first sampling identifier to indicate that each sampling object in the first category of sampling objects has a first sampling attribute; Each sampling object in the second type of sampling objects has a second sampling identifier to indicate that each sampling object in the second type of sampling objects has a second sampling attribute; and the MCU is configured as follows: By identifying the first sampling identifier or the second sampling identifier, each sampling object in the first category of sampling objects or each sampling object in the second category of sampling objects is sent to the ADC sampling module respectively.