CN110430017B - Data sending method and device and optical module - Google Patents

Data sending method and device and optical module Download PDF

Info

Publication number
CN110430017B
CN110430017B CN201910705988.4A CN201910705988A CN110430017B CN 110430017 B CN110430017 B CN 110430017B CN 201910705988 A CN201910705988 A CN 201910705988A CN 110430017 B CN110430017 B CN 110430017B
Authority
CN
China
Prior art keywords
data
optical module
preset value
sending
preset
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910705988.4A
Other languages
Chinese (zh)
Other versions
CN110430017A (en
Inventor
王庆华
王魁
鄂文晶
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hisense Broadband Multimedia Technology Co Ltd
Original Assignee
Hisense Broadband Multimedia Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hisense Broadband Multimedia Technology Co Ltd filed Critical Hisense Broadband Multimedia Technology Co Ltd
Priority to CN201910705988.4A priority Critical patent/CN110430017B/en
Publication of CN110430017A publication Critical patent/CN110430017A/en
Priority to PCT/CN2020/085066 priority patent/WO2021017527A1/en
Application granted granted Critical
Publication of CN110430017B publication Critical patent/CN110430017B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08CTRANSMISSION SYSTEMS FOR MEASURED VALUES, CONTROL OR SIMILAR SIGNALS
    • G08C23/00Non-electrical signal transmission systems, e.g. optical systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04BTRANSMISSION
    • H04B10/00Transmission systems employing electromagnetic waves other than radio-waves, e.g. infrared, visible or ultraviolet light, or employing corpuscular radiation, e.g. quantum communication
    • H04B10/50Transmitters
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/0078Avoidance of errors by organising the transmitted data in a format specifically designed to deal with errors, e.g. location
    • H04L1/0083Formatting with frames or packets; Protocol or part of protocol for error control
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1829Arrangements specially adapted for the receiver end
    • H04L1/1858Transmission or retransmission of more than one copy of acknowledgement message
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/12Arrangements for detecting or preventing errors in the information received by using return channel
    • H04L1/16Arrangements for detecting or preventing errors in the information received by using return channel in which the return channel carries supervisory signals, e.g. repetition request signals
    • H04L1/18Automatic repetition systems, e.g. Van Duuren systems
    • H04L1/1867Arrangements specially adapted for the transmitter end
    • H04L1/189Transmission or retransmission of more than one copy of a message

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electromagnetism (AREA)
  • Optical Communication System (AREA)

Abstract

The application provides a data transmission method, a data transmission device and an optical module, wherein a zone bit which can interact with an upper computer accessed to the optical module and is used for controlling data transmission, namely a transmission state zone bit, is established in the optical module. When the sending state flag bit is changed into a first preset value, a data sending function is started, and preset data are sent to a receiving end optical module through a low-frequency information channel; and then, when the data is confirmed to be read by the receiving end, the sending state zone bit is changed from the first preset value to the second preset value so as to inform the upper computer that the next data sending can be carried out. Therefore, the problem that the sent data is covered by new data before being read by the receiving end is solved by using the sending state zone bit, the correct transmission of the data can be completed by using a splitting, sending, receiving and integrating mode, and the remote control of the optical module at the receiving end and the upper computer connected with the optical module can be realized.

Description

Data sending method and device and optical module
Technical Field
The present application relates to the field of optical communication technologies, and in particular, to a data transmission method, an apparatus, and an optical module.
Background
In the access network communication system, mutual optical connection is established between an optical line terminal and an optical network unit to realize data communication. Specifically, the optical line terminal is provided with a first optical module, the optical network unit is provided with a second optical module, and optical connection is established between the first optical module and the second optical module; the optical line terminal sends an optical signal to the second optical module through the first optical module to realize that the optical line terminal sends data to the optical network unit; the optical line terminal receives the optical signal from the second optical module through the first optical module, so that the optical line terminal receives the data from the optical network unit.
In the above communication system, the optical line terminal and the optical network unit are upper computers of the optical module. The upper computer inputs the data electrical signal into the optical module, and the optical module converts the data electrical signal into an optical signal to be sent out so as to realize the data sending of the upper computer; the optical module converts an optical signal from the outside into a data electric signal, and the data electric signal is input into the upper computer to realize the data receiving of the upper computer.
Since the optical module is only a data transmitter in the upper computer and the optical module can only be controlled by the upper computer, the optical module needs to be controlled indirectly by the upper computer manually. In the physical network of the access network, the optical line terminal and/or the optical network unit are often located in an environment inconvenient for manual operation, such as a mountain, a forest, or even a water body, and it becomes very difficult to operate the upper computer or use the upper computer to operate the optical module in the environments.
Disclosure of Invention
The application provides a data sending method, a data sending device and an optical module, so that the optical module can realize remote control, and further, remote control on an upper computer can be realized through remote control on the optical module.
According to a first aspect of an embodiment of the present application, a data transmission method is provided, which mainly includes:
inquiring whether the sending state flag bit is a first preset value or not;
if the data is the first preset value, sending the data stored in the preset data storage space through a low-frequency information channel;
judging whether a response message that the data is read is received;
and if a response message that the data is read is received, changing the sending state flag bit from a first preset value to a second preset value.
According to a second aspect of embodiments of the present application, there is provided a data transmission apparatus, the apparatus mainly including a processor and a memory, wherein:
the memory for storing program code;
the processor is configured to read the program code stored in the memory, and execute the method according to the first aspect of the embodiment of the present application.
According to a third aspect of embodiments of the present application, there is provided an optical module mainly including an optical transmission component, a printed circuit board, and an MCU provided on the printed circuit board, wherein:
the MCU is provided with the data transmitting device of the second aspect of the embodiment of the application;
the light sending assembly is connected with the MCU through the printed circuit board, and the MCU can control the light sending assembly to send the optical signal loaded with the low-frequency information channel.
As can be seen from the foregoing embodiments, the data transmission method, the data transmission device, and the optical module according to the embodiments of the present application establish a flag bit, that is, a transmission status flag bit, inside the optical module, where the flag bit can interact with an upper computer to which the optical module is connected and is used for controlling data transmission. When the sending state flag bit is changed into a first preset value, a data sending function is started, and data written in a preset data storage space by an upper computer is sent to a receiving end optical module through a low-frequency information channel; and then, when the transmitted data is confirmed to be read by the receiving end, the transmitting state flag bit is changed from the first preset value to the second preset value so as to inform the upper computer that the next data transmission can be carried out. Therefore, by using the sending state flag bit arranged in the optical module, the problem that the sent data is covered by new data before being read by the receiving end can be avoided, so that the system upgrades the packet, reports the operation and control information data such as diagnostic information and the like, and can complete the correct transmission of the data by using the splitting, sending, receiving and integrating modes, so that the optical module of the receiving end is controlled by the accessed upper computer and can realize the remote control of the optical module, and meanwhile, the remote control of the accessed upper computer can be realized by the remote control of the optical module.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious to those skilled in the art that other drawings can be obtained according to the drawings without any inventive exercise.
Fig. 1 is a schematic diagram of a basic structure of an upper computer of an optical module provided in an embodiment of the present application;
fig. 2 is a schematic partial structure diagram in an upper computer according to an embodiment of the present application;
fig. 3 is a cross-sectional view of an optical module and an optical module interface connection structure provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of an electrical connector in an optical module interface according to an embodiment of the present disclosure;
FIG. 5 is a schematic view of an optical module golden finger structure according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an optical module according to an embodiment of the present disclosure;
fig. 7 is an exploded structural diagram of an optical module according to an embodiment of the present application;
fig. 8 is a schematic basic flow chart of a data transmission method according to this embodiment;
fig. 9 is a schematic basic flow chart of another data transmission method provided in this embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
Aiming at the problem that the optical module is inconvenient to operate because the optical module can only be controlled by an upper computer at present, namely, the optical module needs to be controlled by the upper computer manually and indirectly, a new communication mode can be adopted, so that the optical module is controlled by the upper computer which is accessed to the optical module, remote control can be realized, and further, the remote control of the upper computer can be realized through the remote control of the optical module.
Optical modules are used in the field of optical fiber communication technology to implement a photoelectric conversion function, wherein the interconversion between optical signals and electrical signals is the core function of the optical module. Fig. 1 is a schematic diagram of a basic structure of an upper computer of an optical module 30 according to an embodiment of the present disclosure. Fig. 2 is a schematic view of a partial structure in an upper computer according to an embodiment of the present application. As shown in fig. 1 and 2, the upper computer includes an upper cover 10, a lower cover 20, a circuit board 40 and an optical module 30, the upper cover 10 and the lower cover 20 form a cavity for wrapping the circuit board 40 and the optical module 30, and the circuit board 40 has an optical module interface 401 and a cable interface 402.
The optical module interface 401 is used for accessing the optical module 30, and an electrical connector 4011 is arranged in the optical module interface 401 and used for accessing optical module electrical ports such as golden fingers and the like, so that a bidirectional electrical signal connection is established with the optical module 30; the network cable interface 402 is used for accessing a network cable and establishing bidirectional electrical signal connection with the network cable; the optical module 30 is connected to the network cable through an upper computer, specifically, the upper computer transmits a signal from the optical module 30 to the network cable, transmits the signal from the network cable to the optical module 30, and monitors the operation of the optical module 30.
An optical port of the optical module 30 is connected with an optical fiber, and establishes bidirectional optical signal connection with the optical fiber; the electrical port of the optical module 30 is accessed into the upper computer and establishes bidirectional electrical signal connection with the optical network unit; the optical module 30 realizes the interconversion between an optical signal and an electrical signal, thereby realizing the establishment of connection between an optical fiber and an upper computer; specifically, the optical signal from the optical fiber is converted into an electrical signal by the optical module 30 and then input into the upper computer, and the electrical signal from the upper computer is converted into an optical signal by the optical module 30 and input into the optical fiber.
Fig. 3 is a cross-sectional view of a connection structure between an optical module and an optical module interface according to an embodiment of the present disclosure, fig. 4 is a schematic structural view of an electrical connector in an optical module interface according to an embodiment of the present disclosure, and fig. 5 is a schematic structural view of an optical module golden finger according to an embodiment of the present disclosure. As shown in fig. 3, 4, and 5, the end of the circuit board 301 of the optical module is inserted into the optical module interface 401 of the upper computer, so as to electrically connect the optical module and the upper computer. Specifically, the optical module interface 401 has an electrical connector 4011, the electrical connector 4011 has a gap for accommodating the optical module circuit board 40 and an elastic sheet 4012 press-fitted on the surface of the optical module circuit board 40, the surface of the end of the optical module circuit board 301 has a metal pin-shaped gold finger 3011, and the elastic sheet in the electrical connector 4011 is in contact with the gold finger to realize electrical conduction.
Fig. 6 is a schematic diagram of an optical module according to an embodiment of the present disclosure. Fig. 7 is an exploded structural schematic diagram of an optical module according to an embodiment of the present application. As shown in fig. 6 and 7, an optical module 30 provided in the embodiment of the present application includes a circuit board 301, an upper housing 302, a lower housing 303, an optical transceiver 304, and an unlocking handle 307.
The upper shell 302 and the lower shell 303 form a wrapping cavity with two openings, specifically, two ends (305, 306) in the same direction are opened, or two openings in different directions are opened; one of the openings is an electrical port 305 for inserting into an upper computer such as an optical network unit, the other opening is an optical port 306 for connecting an external optical fiber to an internal optical fiber, and the photoelectric devices such as the circuit board 301 and the optical transceiver 304 are positioned in the packaging cavity.
The upper housing 302 and the lower housing 303 are generally made of metal materials, which is beneficial to electromagnetic shielding and heat dissipation. The unlocking handle 307 is positioned on the outer wall of the wrapping cavity/lower shell 303, and the tail end of the unlocking handle 307 is pulled to enable the unlocking handle 307 to move relatively on the surface of the outer wall; when the optical module is inserted into the host computer, the optical module is fixed in the optical module interface 401 of the host computer by the unlocking handle 307, and the clamping relation between the optical module and the host computer is released by pulling the unlocking handle 307, so that the optical module can be extracted from the optical module interface 401 of the host computer.
The gold finger 3011 on the surface of the optical module circuit board 301 has I2C pins, and information can be transmitted between the upper computer and the optical module through I2C pins by using I2C protocol. The upper computer can write information into the optical module, and particularly, the upper computer can write the information into a register of the optical module; the optical module cannot write information into the upper computer, and when the optical module needs to provide information to the upper computer, the optical module writes the information into a preset register (such as a transmission status register, a data transmission failure register, and the like set in this embodiment) in the optical module, and the upper computer reads the register, and the register of the optical module is generally integrated in a Microprocessor (MCU)3012 of the optical module, or can be independently set on a circuit board 301 of the optical module.
Further, in the working process of the optical module, the optical module is configured to send a relatively high-frequency data optical signal according to a data electrical signal from the optical line terminal to maintain an original external data transmission service of the optical line terminal, and at the same time, the optical module also sends a relatively low-frequency control optical signal according to a non-data electrical signal (i.e., a signal not used for a normal transmission service) to send control information to the optical module at the opposite end, so that the control data is transmitted to the remote system without interrupting the normal service, for example, an upgrade packet of the remote system is transmitted through a low-frequency message channel to implement online upgrade of the remote system, and DDM (Digital Diagnostic Monitoring) information is reported.
Since the optical module and the optical module at the opposite end are both externally connected by one optical fiber, the data optical signal and the control optical signal are mixed in the same light beam to be transmitted by the same optical fiber, and in order to distinguish different signals, the data optical signal and the control optical signal are set to have different frequencies in the embodiment. In its implementation, the microprocessor 3012 may control the optical transceiver 304 by designing the microprocessor 3012 and the optical transceiver 304 in the optical module, and a low-frequency modulation signal (control optical signal) is superimposed on a high-frequency signal (data optical signal) sent by the microprocessor 3012, and this embodiment is referred to as a low-frequency message channel. For example, a low frequency modulation signal of 50Kbps is superimposed on a 10Gbps or 25Gbps signal, wherein the 10Gbps or 25Gbps signal is a normal traffic signal, and another low frequency signal of 50Kbps is added to perform other manipulation functions.
However, the amount of data to be transmitted is usually large in the current handling data to be delivered to the remote system, and the number of bytes of data transmitted at one time by the existing low-frequency message channel is limited. Therefore, in this embodiment, a manner of splitting, sending, receiving and integrating the data packets to be transmitted is provided, and when the manner is adopted, the sending end needs to ensure that the sending end upper computer can perform enabling sending of the next data only after the receiving end upper computer finishes reading the data sent by the sending end each time. In order to meet the above requirements, a two-end system (involving a sending-end upper computer, a sending-end optical module, a receiving-end upper computer, and a receiving-end optical module) is required to establish an interactive system for implementing a data transmission mode of splitting, sending, receiving and integrating the data packets. Based on this, the present embodiment establishes the transmission status flag bit in the optical module at the transmitting end to implement the above transmission function.
Based on the above implementation principle, the data transmission method provided in this embodiment will be described in detail below with reference to the accompanying drawings. Fig. 8 is a schematic basic flow chart of a data transmission method provided in this embodiment. As shown in fig. 8, the method specifically includes the following steps:
s101: and inquiring whether the sending state flag bit is a first preset value or not.
In this embodiment, a sending status flag g _ message sendend is set in a register of an optical module, and for an enabling mode of the flag, the optical module may change its first preset value into a second preset value, for example, from 1 into 0, the upper computer to which the optical module is connected may change its second preset value into the first preset value, for example, from 0 into 1, and of course, if the optical module actually needs to change its second preset value into the first preset value. In addition, when the optical module is initially powered on, the default value of the sending state flag bit g _ messagesendable is a second preset value.
The upper computer (which may be referred to as a sending end upper computer for short) to which the optical module is connected can divide a data packet to be sent into N small data packets, and the N small data packets are sequentially sent out by using a low-frequency message channel of the optical module. Before the upper computer enables the optical module to transmit data, the transmission status flag bit g _ messagesendable is first queried, wherein a register in the optical module can be queried through an I2C communication mode by using an I2C pin on a gold finger on the surface of the optical module circuit board. When the flag bit is a second preset value, for example, 0, it indicates that the optical module is in an idle state, and the optical module can be enabled to transmit data, and at this time, the upper computer needs to set the flag bit to be the first preset value, for example, 1, so as to enable the optical module to transmit data; when the zone bit is the first preset value, the upper computer can not transmit new data until the zone bit is changed into the second preset value in the module, which indicates that the upper computer can transmit the next data
Further, the MCU in the optical module can detect whether the upper computer has an action of changing the sending state mark; and if the action of changing the sending state flag of the upper computer is detected, inquiring whether the value written into a sending state flag bit register by the upper computer is a first preset value or not. If the sending status flag bit is changed to the first preset value by the upper computer, executing the step S102; otherwise, the sending status flag bit may be continuously queried after a preset time interval.
For the query mode of the sending status flag g _ messagesendable, both the optical module and the upper computer may query the sending status flag in a polling manner, for example, when the upper computer queries that the flag is the first preset value, the upper computer queries the flag after a preset time interval, for example, 1 ms.
S102: and if the data is the first preset value, sending the data stored in the preset data storage space out through a low-frequency information channel.
When the upper computer detects that the sending state flag bit g _ messagesendEnable is a second preset value, writing data to be sent into a preset data storage space in the optical module, setting the flag bit to be a first preset value so as to enable the optical module to send the data, and continuously polling the sending state flag bit to determine whether the data is correctly sent. The optical module is configured to store data in a plurality of registers, where the plurality of registers are used for storing data, to form the preset data storage space.
Further, since all the positions in the register are not filled with data every time, the embodiment further provides a transmission data length register g _ SendLength in the optical module, and the upper computer writes the data length that needs to be transmitted in this time into the register. Meanwhile, the data has a default initial position, so that the storage position of the data in the register is represented by the default initial position and the data length together, and the correctness of data transmission can be effectively ensured.
Then, the optical module inquires that the sending state flag bit g _ messagesendEnable is a first preset value, then the data stored in the preset data storage space is sent to the receiving end optical module through a low-frequency information channel, and the sending state flag bit g _ messagesendEnable is kept as the first preset value during the data sending period of the optical module; in practical application, the data transmitted by the optical module may be data obtained after the optical module performs corresponding processing according to initial data written by the upper computer. In addition, when a data length register g _ SendLength is arranged in the optical module, data in a preset data storage space is sent out through a low-frequency message channel according to the sending data length and the default data starting position.
In addition, the encoding format of the transmitted data may include a data frame header, a data length, a command code number, valid data, a checksum, and a data frame trailer. The receiving end can instruct an upper computer of the receiving end to read the data stored in the optical module register according to the length value of the data; the use of the data sent this time can be indicated by using the command code number; the receiving end can check the correctness of the valid data in the received data packet according to the checksum.
S103: and judging whether a response message that the data is read is received.
The embodiment is described by taking as an example that the transmitted data is read by an upper computer (which may be referred to as a receiving end upper computer for short) accessed by the receiving end optical module, so as to realize the functions of upgrading the receiving end system or reporting digital diagnostic information. In order to enable the receiving-end optical module to notify an upper computer connected thereto to read data received by the optical module through the low-frequency message channel, a receiving-state flag g _ MessageReceState is set in the receiving-end optical module. When the receiving-end optical module receives data through the low-frequency information channel and checks the data correctly, the receiving state flag bit is set to a first preset value, for example, the receiving state flag bit g _ messagerecestat is set to 1, which is used for informing the receiving-end upper computer that new data has been received and simultaneously returning a response message that the data has been correctly received to the sending end.
Furthermore, after the receiving end upper computer inquires that the receiving state zone bit is set to be the first preset value in a polling mode, the receiving end upper computer can immediately read the data, and the receiving state zone bit is changed from the first preset value to the second preset value after the reading is finished. The operation of changing the receiving status flag bit from the first preset value to the second preset value can stimulate the receiving end optical module to send back a response message that the data is read to the sending end optical module.
If a response message that the data sent by the receiving-end optical module has been read is received, step S104 is executed. Otherwise, step S105 is executed.
S104: and if a response message that the data is read is received, changing the sending state flag bit from a first preset value to a second preset value.
The optical module changes the sending state zone bit from a first preset value to a second preset value, and is used for informing an upper computer connected with the optical module that the data sending is completed, so that the next data sending can be performed.
Further, in order to prevent a long time waiting for the receiving end optical module to return a message, the present embodiment further sets an internal active clear mechanism of the optical module, and may also set other clear mechanisms, such as clear by an upper computer. The module internal active zero clearing method can comprise the following steps:
s105: and if the response message that the data is read is not received, judging whether the sent time length of the data exceeds a preset time length threshold value.
The preset time length threshold is larger than the time required by the optical module at the receiving end for receiving, checking and returning the message. And after the data stored in the preset data storage space is sent out through the low-frequency information channel, timing is started, a response message that the data returned by the optical module at the receiving end is read is waited, if the preset time length threshold value is exceeded, the response message that the data is read is not received, the step S160 is executed, and if the preset time length threshold value is exceeded, the step S continues to wait for the return message of the optical module at the receiving end.
S106: and if the time length exceeds the preset time length threshold value, changing the sending state zone bit from a first preset value to a second preset value. In addition, identification information of the receiving end fault can be generated.
Wherein, in order to facilitate the differentiation of the fault of the receiving end, corresponding processing measures are taken. In this embodiment, when the optical module receives a response message that the data returned by the receiving end has been correctly received by the optical module of the receiving end, but does not receive a response message that the data has been read by the upper computer of the receiving end, first identification information for indicating a fault of the upper computer of the receiving end may be generated, and then, after the upper computer accessed by the optical module of the sending end receives the identification information, retransmission of the data or generation of a notification of a fault of the upper computer at a far end, and the like may be enabled. In addition, if the optical module has not received a response message that the sending data returned by the optical module at the receiving end has been correctly received, the optical module may change the status flag bit from the first preset value to the second preset value, and at the same time, generate second identification information for indicating that sending between the optical modules has failed, and then, after receiving the identification information, the upper computer at the sending end may take measures such as re-sending of the enabling data.
Corresponding to the two response messages, the preset duration threshold in step S105 may be composed of a first preset duration threshold for waiting for a response message that the data returned by the receiving-end optical module has been correctly received by the receiving-end optical module, and a second preset duration threshold for waiting for a response message that the data returned by the receiving-end optical module has been read after receiving a response message that the data has been correctly received by the receiving-end optical module. Further, if the data retransmission mechanism is adopted after the data transmission fails, the first preset duration threshold consists of N preset sub-duration thresholds, the specific number of the N preset sub-duration thresholds is determined according to the upper limit value of the retransmission times, and the specific duration of each preset sub-duration threshold is set according to the time required for correctly receiving the transmitted data and the returned data.
In this embodiment, a flag bit, i.e., a transmission status flag bit, which can interact with an upper computer connected to the optical module at a transmitting end and is used for controlling data transmission, is established inside the optical module at the transmitting end. When the sending state flag bit is changed to a first preset value by the upper computer, the sending end optical module starts a data sending function, and data written in a preset data storage space by the sending end upper computer is sent to the receiving end optical module through a low-frequency information channel; and then, when the transmitted data is confirmed to be read by the upper computer of the receiving end, the transmitting state zone bit is changed from the first preset value to the second preset value so as to inform the upper computer of the transmitting end that the next data transmission can be carried out. Therefore, in this embodiment, the sending status flag bit set in the sending-end optical module is utilized, which not only can avoid the problem that the sent data is covered by new data before being read by the receiving-end upper computer, but also can realize the function of reporting whether the receiving-end upper computer has correctly read the data, so that the receiving-end optical module is not only controlled by the upper computer to which the receiving-end optical module is connected, and can also realize remote control over the upper computer to which the receiving-end optical module is connected, and meanwhile, can realize remote control over the upper computer to which the receiving-end optical module is connected by remote control over the receiving-end optical module.
Further, when data is transmitted between the optical modules, a situation that data transmission fails due to reasons such as temporary power failure of the optical modules and network problems may occur, and in addition to enabling data retransmission by the upper computer to which the optical modules are accessed, the embodiment further provides a data retransmission mechanism built inside the optical modules. Fig. 9 is a schematic basic flow chart of another data transmission method provided in this embodiment. As shown in fig. 9, the method specifically includes the following steps:
s201: and inquiring whether the sending state flag bit is changed into a first preset value or not.
Wherein, a sending state flag bit g _ messageSendEnble is set in a register of the optical module. If the sending status flag bit is found to be changed to the first preset value by the upper computer, executing step S202 to start a data retransmission mechanism; otherwise, the sending status flag bit may be continuously queried after a preset time interval.
S202: if the first preset value is obtained, the data retransmission flag bit is changed from the fourth preset value to the third preset value.
When the sending status flag bit g _ messagesendend is changed to a first preset value by the upper computer, the optical module changes the data retransmission flag bit from a fourth preset value to a third preset value, such as 1, so as to start a data retransmission mechanism.
S203: and sending out the data stored in the preset data storage space through a low-frequency information channel.
The upper computer can write the data to be transmitted into the preset data storage space in the optical module, and can also write the transmission data length into the transmission data length register g _ SendLength in the optical module. And after the data retransmission flag bit is set to a third preset value by the optical module, the data stored in the preset data storage space is sent to the receiving end optical module through the low-frequency information channel. And when a data length register g _ SendLength is arranged in the optical module, sending out the data in the preset data storage space through a low-frequency message channel according to the sending data length and the default initial position of the data.
Meanwhile, in this embodiment, a sending number register sendcounter and a sending interval period register Runcounter are also set inside the optical module, where when the optical module is initially powered on, the two registers are both default values of 0. When the optical module sends the data through the low-frequency message channel each time, the count value of the sending number register sendcounter is accumulated by 1, meanwhile, the sending interval period register Runcounter is equivalent to a timer starting to time, the count value of the register is added by 1 every time a software cycle passes, and in the embodiment, whether the data retransmission flag bit is a third preset value is checked before the count value of the register is added by 1, if so, the count value is added by 1, otherwise, the count value of the register can be returned to zero. Of course, it is also possible to check whether the data retransmission flag bit is the third preset value or not when the count value of the data retransmission flag bit is about to reach the preset threshold value, and only in the above manner of checking the data retransmission flag bit in each software cycle, compared with the above manner, the manner of checking the data retransmission flag bit in each software cycle can make the data retransmission flag bit in the initialization state in the next use earlier and end the data retransmission earlier.
S204: and judging whether a response message that the data has been received is received within a preset time.
When the register value does not reach a preset threshold value (the time corresponding to the preset threshold value is longer than the time used by the receiving end for receiving the check sum of the data and returning the received message of the data), the count value of the Runcounter register is used, and a response message that the data sent by the receiving end optical module has been received is received, then step S205 is executed; otherwise, if the preset threshold is reached and the response message that the data sent by the receiving-end optical module has been received has not been received, step S209 is executed.
It should be noted that the preset time in this step may also not use a preset threshold value correspondingly set by the Runcounter register, for example, a timer in the optical module MCU is used for timing, and a time threshold value is correspondingly set, where if a response message that data has been received is not received when the set time threshold value is reached, first, whether the data retransmission flag is a third preset value is checked, and if so, step S209 is executed, but this method requires a larger data processing amount of the MCU than the method of setting the Runcounter register.
S205: and if a response message that the data has been received is received, changing the data retransmission flag bit from a third preset value to a fourth preset value.
After receiving the response message that the data returned by the receiving end optical module has been received, the receiving end module can judge that the receiving end module has received the correct data without checking the content of the message, and further change the data retransmission flag bit from the third preset value to the fourth preset value to end the data retransmission, and simultaneously clear the registers of the Runcounter and the sendcounter to make the registers in the initialization state when the receiving end module is used next time. Then, step S206 is executed to wait for a response message that the receiving-end optical module has read the return data.
S206: and judging whether a response message that the data is read is received.
If yes, step S207 is executed, otherwise, step S208 is executed.
S207: and if a response message that the data is read is received, changing the sending state flag bit from a first preset value to a second preset value.
S208: and if the response message that the data is read is not received within the preset time, changing the sending state zone bit from the first preset value to a second preset value, and generating the information of the fault of the upper computer at the receiving end.
S209: and if the response message that the data has been received is not received, judging whether the number of times that the data has been sent does not exceed a preset number threshold.
If so, step S203 is performed. Otherwise, step S210 is executed.
S210: if the number of times of sending the data exceeds a preset number threshold, changing the data retransmission flag bit from a third preset value to a fourth preset value, and changing the sending state flag bit from a first preset value to a second preset value.
After the optical module at the sending end repeatedly sends data for many times, the optical module at the receiving end still does not receive correct data, and the data transmission (also called module bottom layer data transmission) between the optical modules is completely failed, so that the data retransmission flag bit g _ sendMessageAble is changed from a third preset value to a fourth preset value, the sending state flag bit g _ messageSendEnble is changed from a first preset value to a second preset value, and the count values of the sending time registers sendcounter and Runcounter register are reset to zero, so that the data retransmission mechanism of the optical module is ended and all the registers in the optical module are in an initialized state.
Further, in this embodiment, a data transmission failure flag g _ reselectnfail is set in the register, and when the optical module at the receiving end still does not receive correct data after the transmitting end repeatedly transmits data messages for many times, that is, a message that the data returned by the receiving end is correctly received is not received, the data transmission failure flag g _ reselectnfail is set to a first preset value, which is used to inform the transmitting end that the upper computer fails to transmit data. Meanwhile, the sending end upper computer polls and inquires the numerical value of the zone bit, when the first preset value of the zone bit is detected, the first preset value of the zone bit can be changed into a second preset value, if the first preset value is set from 1 to 0, the step S201 is returned again, and the sending end upper computer initiates data retransmission.
In this embodiment, by establishing a data retransmission mechanism inside the optical module, functions of checking, error retransmission, and reporting transmission failure of data transmission can be implemented on a module level, so as to reduce a burden of an upper computer when the mechanism is implemented, and improve efficiency of an overall system when data is transmitted by using a message channel.
Based on the same inventive concept as the above method, the present embodiment further provides a data transmission apparatus, which mainly includes a processor and a memory, wherein: the memory is used for storing program codes; a processor for reading the program code stored in the memory and executing: inquiring whether the sending state flag bit is a first preset value or not; if the data is the first preset value, sending the data stored in the preset data storage space through a low-frequency information channel; judging whether a response message that the data is read is received; if a response message that the data is read is received, changing the sending state flag bit from a first preset value to a second preset value; if the response message that the data is read is not received, judging whether the sent time length of the data exceeds a preset time length threshold value or not; and if the time length exceeds the preset time length threshold value, changing the sending state zone bit from a first preset value to a second preset value, and generating the data sending method of the identification information of the fault of the receiving end.
Alternatively, the processor may perform: inquiring whether the sending state flag bit is a first preset value or not; if the first preset value is the first preset value, changing the data retransmission flag bit from the fourth preset value to a third preset value; sending out the data stored in the preset data storage space through a low-frequency information channel; judging whether a response message that the data has been received is received within a preset time; if a response message that the data has been received is received, changing the data retransmission flag bit from a third preset value to a fourth preset value; if the response message that the data has been received is not received, judging whether the number of times the data has been sent does not exceed a preset number threshold; and if so, sending the data out through the low-frequency information channel again.
The present embodiment further provides an optical module, a specific structure of which may refer to the structures in fig. 3 to fig. 7 and corresponding text descriptions, and meanwhile, the MCU of the optical module is provided with the data transmitting apparatus provided in the foregoing embodiments.
It should be noted that the transmitting-end optical module, the receiving-end optical module, and the host computer corresponding thereto, which are improved in the present embodiment, are proposed only from the perspective of enabling data transmission, and in actual use, one optical module may be used as both the transmitting-end optical module and the receiving-end optical module. In addition, the specific representation modes of the first preset value and the second preset value of different flag bits can be the same or different.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (9)

1. A method for transmitting data, the method comprising:
inquiring whether the sending state flag bit is a first preset value or not;
if the data is the first preset value, sending the data stored in the preset data storage space through a low-frequency information channel;
judging whether a response message that the data is read is received;
and if a response message that the data is read is received, changing the sending state flag bit from a first preset value to a second preset value.
2. The method of claim 1, wherein after determining whether a response message is received that the data has been read, the method further comprises:
if the response message that the data is read is not received, judging whether the sent time length of the data exceeds a preset time length threshold value or not;
and if the time length exceeds the preset time length threshold value, changing the sending state zone bit from a first preset value to a second preset value.
3. The method of claim 2, wherein before transmitting the data stored in the predetermined data storage space through the low frequency information channel, the method further comprises:
changing the data retransmission flag bit from a fourth preset value to a third preset value;
after the data stored in the preset data storage space is sent out through the low-frequency information channel, the method further comprises the following steps:
judging whether a response message that the data has been received is received within a preset time;
if a response message that the data has been received is received, changing the data retransmission flag bit from a third preset value to a fourth preset value;
if the response message that the data has been received is not received, judging whether the number of times the data has been sent does not exceed a preset number threshold;
if the number of times of data retransmission exceeds a preset number threshold, changing the third preset value of the data retransmission zone bit into a fourth preset value, and changing the first preset value of the sending state zone bit into a second preset value;
and if the preset times threshold value is not exceeded, sending the data out through the low-frequency information channel again.
4. The method of claim 3, further comprising:
and if the number of times of sending the data exceeds a preset number threshold, generating identification information of data sending failure between the optical modules.
5. The method of claim 1, wherein transmitting the data stored in the predetermined data storage space through the low frequency information channel comprises:
and sending out the data stored in the preset data storage space through a low-frequency information channel according to the sending data length in the data length register.
6. The method of claim 1, wherein inquiring whether the transmission status flag bit is a first preset value comprises:
detecting whether an upper computer accessed by the optical module has an action of changing a sending state mark;
and if so, inquiring whether the value written into the sending state mark by the upper computer is a first preset value or not.
7. The method of claim 1, wherein the data is encoded in a format comprising a header, a length, a command code, a payload, a checksum, and a trailer.
8. A data transmission apparatus, characterized in that the apparatus comprises a processor and a memory, wherein:
the memory for storing program code;
the processor for reading the program code stored in the memory and executing the method of any one of claims 1 to 7.
9. An optical module comprising an optical transmitting assembly, a printed circuit board, and an MCU disposed on the printed circuit board, wherein:
the MCU is provided with the data transmission device of claim 8;
the light sending assembly is connected with the MCU through the printed circuit board, and the MCU can control the light sending assembly to send the optical signal loaded with the low-frequency information channel.
CN201910705988.4A 2019-08-01 2019-08-01 Data sending method and device and optical module Active CN110430017B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910705988.4A CN110430017B (en) 2019-08-01 2019-08-01 Data sending method and device and optical module
PCT/CN2020/085066 WO2021017527A1 (en) 2019-08-01 2020-04-16 Optical module data sending and receiving methods and devices, and optical module

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910705988.4A CN110430017B (en) 2019-08-01 2019-08-01 Data sending method and device and optical module

Publications (2)

Publication Number Publication Date
CN110430017A CN110430017A (en) 2019-11-08
CN110430017B true CN110430017B (en) 2022-02-11

Family

ID=68413655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910705988.4A Active CN110430017B (en) 2019-08-01 2019-08-01 Data sending method and device and optical module

Country Status (1)

Country Link
CN (1) CN110430017B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021017527A1 (en) * 2019-08-01 2021-02-04 青岛海信宽带多媒体技术有限公司 Optical module data sending and receiving methods and devices, and optical module
CN111031196B (en) * 2019-12-25 2024-04-26 普世(南京)智能科技有限公司 Low-power-consumption unidirectional feedback-free image transmission method and system based on mark frame
WO2021169463A1 (en) * 2020-02-24 2021-09-02 青岛海信宽带多媒体技术有限公司 Data sending method, data receiving method, and optical module
CN113364524B (en) * 2020-03-06 2022-06-28 青岛海信宽带多媒体技术有限公司 Data receiving method and optical module
CN113364523B (en) * 2020-03-06 2022-06-28 青岛海信宽带多媒体技术有限公司 Data sending method and optical module
CN114826410B (en) * 2020-02-24 2024-03-08 青岛海信宽带多媒体技术有限公司 Optical module
CN117353821A (en) * 2020-04-22 2024-01-05 青岛海信宽带多媒体技术有限公司 Optical module
CN112035259A (en) * 2020-09-01 2020-12-04 中国银行股份有限公司 Data processing system, method and server group
CN116980041A (en) * 2021-03-31 2023-10-31 青岛海信宽带多媒体技术有限公司 Optical module
CN113472486A (en) * 2021-06-30 2021-10-01 四川省分析测试服务中心 Efficient retransmission method and device for low-frequency acquisition of instrument operation data

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106533976A (en) * 2016-11-07 2017-03-22 深圳怡化电脑股份有限公司 Data packet processing method and device
CN107707640A (en) * 2017-09-25 2018-02-16 深圳市盛路物联通讯技术有限公司 A kind of Point-to-Point Data Transmission method and apparatus

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098298A (en) * 2006-06-29 2008-01-02 北京邮电大学 Optical burst switch network based burst packet dispatching system and method
US8472801B2 (en) * 2009-02-25 2013-06-25 Futurewei Technologies, Inc. Upgraded bandwidth map for ten gigabit passive optical network
CN202818528U (en) * 2011-12-30 2013-03-20 北京同步科技有限公司 Switch and optical communication device
CN107783727B (en) * 2016-08-31 2022-01-14 华为技术有限公司 Access method, device and system of memory device
CN107682324A (en) * 2017-09-20 2018-02-09 华胜信泰信息产业发展有限公司 Method for message transmission, system, storage medium and computer equipment
CN107844373B (en) * 2017-11-02 2021-11-19 郑州云海信息技术有限公司 Request sending method, system, medium and equipment
CN108762118B (en) * 2018-05-24 2021-09-03 合肥哈工力训智能科技有限公司 Fault processing method and device between communication devices

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106533976A (en) * 2016-11-07 2017-03-22 深圳怡化电脑股份有限公司 Data packet processing method and device
CN107707640A (en) * 2017-09-25 2018-02-16 深圳市盛路物联通讯技术有限公司 A kind of Point-to-Point Data Transmission method and apparatus

Also Published As

Publication number Publication date
CN110430017A (en) 2019-11-08

Similar Documents

Publication Publication Date Title
CN110430017B (en) Data sending method and device and optical module
CN110430025B (en) Data sending method and device and optical module
CN110430016B (en) Data receiving method and device and optical module
WO2021031653A1 (en) Digital diagnosis information acquisition method and device, and optical module
CN110519666B (en) Optical module wavelength configuration method and device and optical module
CN109558371B (en) Method for communicating with a microcontroller, and computing system
WO2021169463A1 (en) Data sending method, data receiving method, and optical module
US20050204072A1 (en) Communication system, communication apparatus, communication method, and computer program thereof
US9569390B2 (en) Protocol for communication
CN113098613B (en) Optical module and wavelength automatic communication method based on double-MCU optical module
JP2005107683A (en) Communication controller, communications system, communication apparatus, and communication method
CN113098596B (en) Optical module and method for acquiring remote monitoring data based on double MCU optical modules
CN111555810A (en) Optical module and data transmission method
CN101393542B (en) Embedded equipment and method for supporting USB interface by GPIO terminal port
CN113364523B (en) Data sending method and optical module
CN113312284A (en) Data transmission method, device, system, storage medium and electronic device
CN115114206A (en) Electric port module and Serdes interface switching method thereof
WO2021017527A1 (en) Optical module data sending and receiving methods and devices, and optical module
KR101428778B1 (en) Apparatus and method for upgrading firmware of automatic meter reading terminal on the remote
CN112822002B (en) SPI-based communication method and device, electronic equipment and storage medium
JP2007013980A (en) Redundant three-wire communication system and method
CN113300773B (en) Optical module
CN113098621B (en) Optical module and wavelength automatic polling method based on double-MCU optical module
CN113364524B (en) Data receiving method and optical module
CN108476245B (en) Method for establishing port connection and port chip

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant