A method for transmitting commands in response to a fiber link switch

CN116865846BActive Publication Date: 2026-10-20TIANJIN JINHANG COMP TECH RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310983463.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-04
Publication Date
2026-10-20
Estimated Expiration
2043-08-04

AI Technical Summary

Technical Problem

使用光纤链路进行开关量数据的传输对继电器进行控制有优点,但也存在缺点,优点时传输速度快,且能达到10Gbit/s以上的速度,对于一些实时性要求高的场合尤为适用,但是传输速度快带来的缺点就是链路传输可靠性下降,因此需要针对光纤链路传输的特点开发一种数据传输的命令响应机制,在传输速度快的同时保证其可靠性和安全性尤为重要

Benefits of technology

[0013]根据本申请实施例提供的技术方案,主机判断所述响应序列中的所述信息标识与所述命令序列中的所述信息标识不一致时,丢弃所述响应序列。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116865846B_ABST
    Figure CN116865846B_ABST
Patent Text Reader

Abstract

The application provides a kind of optical fiber link switch quantity transmission command response method, comprising the following steps: host sends command sequence to slave;When host receives the response sequence sent by slave, when the response sequence is consistent with the information identification in command sequence, control the transmission of one or more data sequences between host and slave, and the data sequence includes a plurality of data frames corresponding to information requirements;One of host and slave is the sending end, and the other is the receiving end;After receiving a data sequence, the receiving end sends a feedback sequence to the sending end, and the feedback sequence includes data check code and the running state of the receiving end;After receiving the feedback sequence, the sending end judges that there is an error in the data check code, and repeats the last data sequence;When the running state of the receiving end is abnormal, stop sending data sequence.The method provided by the application ensures the speed of optical fiber link transmission while ensuring its reliability and safety.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure generally relates to the field of FPGA fiber optic link communication and relay control technology, and specifically to a fiber optic link switch quantity transmission command response method. Background Technology

[0002] With the continuous development of digital communication systems, FPGAs (Field-Programmable Gate Arrays) have been widely used in many fields. As the technology matures, the use of FPGAs in fiber optic communication is also increasing. Developers have described high-speed serial transceivers using hardware description languages ​​and packaged them into dedicated IP cores for user integration within FPGAs. Using fiber optic links for transmitting switch data to control relays has advantages, but also disadvantages. The advantage is high transmission speed, reaching speeds of 10 Gbit / s or higher, making it particularly suitable for applications with high real-time requirements. However, the high transmission speed leads to decreased link reliability. Therefore, it is necessary to develop a command-response mechanism for data transmission tailored to the characteristics of fiber optic links, ensuring both high transmission speed and reliability and security. Summary of the Invention

[0003] In view of the above-mentioned defects or deficiencies in the prior art, it is desirable to provide a fiber optic link switch quantity transmission command response method to solve the above problems.

[0004] This application provides a method for responding to optical fiber link switch signal transmission commands, including the following steps:

[0005] The host sends a command sequence to the slave, the command sequence including an information identifier and an information request, the information identifier being used for mutual identification between the host and the slave;

[0006] When the host determines that it has received a response sequence sent by the slave within a first preset time, it identifies the response sequence.

[0007] When the host determines that the information identifier in the response sequence is consistent with the information identifier in the command sequence, it controls the host and slave to perform data sequence transmission. The data sequence includes several data frames corresponding to the information request. During the data sequence transmission, one of the host and slave acts as the sender and the other as the receiver.

[0008] After receiving each data sequence and determining that it has not received all data frames corresponding to the information requirement, the receiving end sends a feedback sequence to the sending end. The feedback sequence includes a data checksum and the operating status of the receiving end.

[0009] After receiving the feedback sequence, if the transmitting end determines that there is an error in the data checksum, it will retransmit the previous data sequence; if it determines that the operating status of the receiving end is abnormal, it will stop transmitting the data sequence.

[0010] The technical solution provided in the embodiments of this application further includes the following steps:

[0011] After the receiving end determines that it has received all data frames corresponding to the information requirement, it sends a termination sequence to the sending end.

[0012] The transmitting end stops sending data sequences after determining that it has received the termination sequence within a second preset time.

[0013] According to the technical solution provided in the embodiments of this application, when the host determines that the information identifier in the response sequence is inconsistent with the information identifier in the command sequence, it discards the response sequence.

[0014] According to the technical solution provided in the embodiments of this application, the transmission of the data sequence between the host and the slave includes a read command mode and a write command mode;

[0015] When in the write command mode, the host acts as the sender and the slave acts as the receiver.

[0016] When in the read command mode, the slave device acts as the sender and the master device acts as the receiver.

[0017] According to the technical solution provided in the embodiments of this application, when the sending end sends the data frame to the receiving end, the specific steps include the following:

[0018] When the sending end determines that the total number of bytes in several data frames is less than or equal to a set number of bytes, it sends the data frames to the receiving end through a data sequence, wherein the set number of bytes is the maximum number of bytes included in a data sequence;

[0019] When the sending end determines that the total number of bytes in several data frames is greater than a set number of bytes, it sends the data frames in multiple data sequences.

[0020] According to the technical solution provided in the embodiments of this application, when the sending end sends data to the receiving end, the following steps are further included:

[0021] The sending end obtains a first count value, and stops sending the data sequence when the first count value is greater than or equal to a preset credit value; the first count value is the number of data frames that the sending end has sent but not received by the receiving end, and the preset credit value is the maximum number of data frames that the receiving end is allowed to buffer;

[0022] When the sending end determines that the first count value is less than the preset credit value, it continues to send the data sequence.

[0023] According to the technical solution provided in the embodiments of this application, the command sequence further includes a CRC checksum and the operating status of the host; the response sequence includes a CRC checksum and the operating status of the slave device.

[0024] According to the technical solution provided in the embodiments of this application, the termination command also includes a CRC checksum and the operating status of the receiving end.

[0025] The technical solution provided in the embodiments of this application further includes the following steps:

[0026] After receiving the response sequence, if the host determines that the slave's operating status is abnormal, it will prohibit data sequence transmission between the host and the slave and prompt the host to check the slave.

[0027] Compared with the prior art, the beneficial effects of this application are as follows: When data transmission is required between the host and the slave, the host sends a command sequence including information representation and information request to the slave, so that the slave can know the data to be transmitted according to the information request; the slave sends a response sequence to the host, so that when the host determines that the information identifier of the response sequence is consistent with that of the command sequence, it determines that a connection has been established between the host and the slave, thus improving the accuracy of information transmission; when transmitting data between the host and the slave, after the receiving end receives each data sequence and determines that it has not received all data frames corresponding to the information request, it sends a feedback sequence to the sending end, so that the sending end can receive corresponding feedback for each data sequence when repeatedly sending the data sequence. The sending end can determine whether to continue sending the data sequence, stop sending the data sequence, or retransmit the data sequence based on the feedback received, thereby improving the reliability and security of data transmission while ensuring the high transmission speed of the optical fiber link. Attached Figure Description

[0028] Other features, objects, and advantages of this application will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0029] Figure 1 A flowchart illustrating the steps of the fiber optic link switch quantity transmission command response method provided in this application;

[0030] Figure 2 This diagram illustrates data transmission between the master and slave devices in write command mode.

[0031] Figure 3 This diagram illustrates data transmission between the master and slave devices in read command mode.

[0032] Figure 4 A schematic diagram of a fiber optic link switch quantity transmission command response system;

[0033] Figure 5 This diagram illustrates the state switching between the data frame FIFO and the frame information FIFO in the transmission module.

[0034] Figure 6 This is a schematic diagram illustrating the state switching of the primitive FIFO in the sending module. Detailed Implementation

[0035] The present application will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, only the parts relevant to the invention are shown in the accompanying drawings.

[0036] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.

[0037] Please refer to Figure 1 This application provides a method for responding to optical fiber link switch signal transmission commands, comprising the following steps:

[0038] S1. The host sends a command sequence to the slave, the command sequence including an information identifier and an information requirement, the information identifier being used for mutual identification between the host and the slave;

[0039] S2. When the host determines that it has received a response sequence sent by the slave within a first preset time, it identifies the response sequence.

[0040] S3. When the host determines that the information identifier in the response sequence is consistent with the information identifier in the command sequence, it controls the host and slave to transmit one or more data sequences, the data sequence including several data frames corresponding to the information request; during the data sequence transmission, one of the host and slave acts as the sender and the other as the receiver.

[0041] S4. After receiving each data sequence and determining that it has not received all data frames corresponding to the information requirement, the receiving end sends a feedback sequence to the sending end. The feedback sequence includes a data check code and the operating status of the receiving end.

[0042] S5. After receiving the feedback sequence, if the sending end determines that there is an error in the data check code, it will resend the previous data sequence; if it determines that the operating status of the receiving end is abnormal, it will stop sending the data sequence.

[0043] Specifically, the master and slave devices are connected via a fiber optic link, and data is transmitted through the fiber optic link.

[0044] Specifically, step S2 also includes the following steps:

[0045] If the host determines that the information identifier in the response sequence is inconsistent with the information identifier in the command sequence, it discards the response sequence.

[0046] Furthermore, the following steps are included after step S5:

[0047] After receiving all data frames corresponding to the information requirement, the receiving end sends a termination sequence to the sending end.

[0048] The transmitting end stops sending data sequences after determining that it has received the termination sequence within a second preset time.

[0049] Furthermore, the transmission of the data sequence between the master and slave includes both read command mode and write command mode;

[0050] When in the write command mode, the host acts as the sender and the slave acts as the receiver.

[0051] When in the read command mode, the slave device acts as the sender and the master device acts as the receiver.

[0052] For details, please refer to Figure 2 and Figure 3When in write command mode, the host first sends a command sequence to the slave device. Upon receiving the command sequence, the slave device generates a corresponding sequence and sends it back to the host. If the host does not receive the response sequence within a first preset time, it resends the command sequence to the slave device. If the host still does not receive the response sequence within the first preset time, it indicates a system fault requiring inspection. If the host receives the response sequence within the first preset time, it identifies the response sequence, which also includes an information identifier. When the host determines that the information identifier in the response sequence matches the information identifier in the command sequence, it generates an execution signal for data sequence transmission. Since it is currently in write command mode, the host, as the transmitter, directly sends the data sequence to the slave device one by one. Each time, the slave device... After receiving a data sequence, each received data frame is compared with all data frames corresponding to the information requirement. If the number of received data frames is less than all data frames corresponding to the information requirement, a feedback sequence is generated and sent to the host to inform the host which data frames have been received. After receiving the feedback sequence, the host determines whether the data checksum in the feedback sequence is incorrect. If the data checksum is incorrect, the host retransmits the data sequence corresponding to the feedback sequence. If the data checksum is correct, the host continues to send the next data sequence. After receiving the feedback sequence, the host also determines whether the slave device's operating status is abnormal. If the slave device's operating status is abnormal, the host stops sending data sequences. If the slave device's operating status is normal, the host continues to send data sequences.

[0053] When in the read command mode, the same steps as in the write command mode will not be repeated here. The difference is that the host acts as the receiver of the data sequence and the slave acts as the sender of the data sequence. When the host determines that the information identifier in the response sequence is the same as the information identifier in the command sequence, the host generates an execution signal for data sequence transmission and sends it to the slave. Then, the slave acts as the transmitter and sends the data sequence to the host one by one.

[0054] Working principle: When data transmission is required between the master and slave devices, the master sends a command sequence to the slave, including information representation and information request, so that the slave knows the data to be transmitted according to the information request. The slave sends a response sequence to the master, so that the master determines that a connection has been established between the master and slave when the information identifier of the response sequence matches that of the command sequence, thus improving the accuracy of information transmission. When transmitting data between the master and slave devices, after the receiving end receives each data sequence and determines that it has not received all data frames corresponding to the information request, it sends a feedback sequence to the sending end. This ensures that the sending end receives corresponding feedback for each data sequence when repeatedly sending the data sequence. The sending end can determine whether to continue sending the data sequence, stop sending the data sequence, or retransmit the data sequence based on the feedback received, thereby improving the reliability and security of data transmission while ensuring the high transmission speed of the fiber optic link.

[0055] In a preferred embodiment, the process of the sending end sending the data frame to the receiving end specifically includes the following steps:

[0056] When the sending end determines that the total number of bytes in several data frames is less than or equal to a set number of bytes, it sends the data frames to the receiving end through a data sequence, wherein the set number of bytes is the maximum number of bytes included in a data sequence;

[0057] When the sending end determines that the total number of bytes in several data frames is greater than a set number of bytes, it sends the data frames in multiple data sequences.

[0058] Specifically, in this embodiment, the set byte count is 2048, meaning each data sequence contains a maximum of 2048 bytes of data. If the sending end determines that the total number of bytes in all data frames is less than 2048 bytes, then all data frames are sent to the receiving end through a single data sequence. If the sending end determines that the total number of bytes in all data frames is greater than 2048 bytes, then all data frames are sent to the receiving end one by one in multiple data sequences, ensuring that each data sequence contains 2048 bytes. Since the receiving end generates a corresponding feedback sequence for each data sequence it receives, allowing for verification of each data sequence, sending all data frames in multiple data sequences ensures that each data sequence contains a small amount of data. If an error occurs in the data of a data sequence, only that data sequence needs to be resent. Compared to sending all data frames to the receiving end simultaneously, sending them separately facilitates data verification, thereby improving data transmission efficiency and reliability.

[0059] In a preferred embodiment, when the sending end sends data to the receiving end, the method further includes the following steps:

[0060] The sending end obtains a first count value, and stops sending the data sequence when the first count value is greater than or equal to a preset credit value; the first count value is the number of data frames that the sending end has sent but not received by the receiving end, and the preset credit value is the maximum number of data frames that the receiving end is allowed to buffer;

[0061] When the sending end determines that the first count value is less than the preset credit value, it continues to send the data sequence.

[0062] Specifically, before sending the data sequence to the receiving end, the sending end first acquires a first count value. The first count value is incremented by 1 each time the sending end sends a data frame on the link, and decremented by 1 each time it receives an acknowledgment primitive for a data frame from the receiving end. Next, the first count value is compared with a preset credit value at the receiving end. If the sending end determines that the first count value is greater than or equal to the preset credit value, it indicates that the receiving end's buffer space is insufficient, and the sending end stops sending the data sequence. If the sending end determines that the first count value is less than the preset credit value, it indicates that the receiving end's buffer space is sufficient, and the sending end continues sending the data sequence. This method facilitates control over data frame transmission to ensure sufficient buffer space at the other end of the link, preventing data frames from being discarded by the receiving end due to insufficient buffer space.

[0063] In a preferred embodiment, the command sequence further includes a CRC checksum and the host's operating status; the response sequence includes a CRC checksum and the slave's operating status.

[0064] In a preferred embodiment, the termination command further includes a CRC checksum and the operating status of the receiving end.

[0065] In a preferred embodiment, the method further includes the following steps:

[0066] After receiving the response sequence, if the host determines that the slave's operating status is abnormal, it will prohibit data sequence transmission between the host and the slave and prompt the host to check the slave.

[0067] Further, please refer to Figure 4This application provides a fiber optic link switch quantity transmission command response method based on a fiber optic link switch quantity transmission command response system. The system includes a master and a slave unit connected via a fiber optic link. Transmission modules are provided between the master unit and the fiber optic link, and between the slave unit and the fiber optic link. Each transmission module includes a data frame FIFO, a frame information FIFO, and a primitive FIFO. The FIFOs are used to buffer data frames, frame information, and primitives, respectively. The frame information FIFO includes two sub-functions: sending command frames and sending response frames. The transmission module reads data from the upstream module into its corresponding FIFO, and then schedules the primitives and data to be sent to the fiber optic link.

[0068] In a preferred embodiment, the sending module further includes a counter for counting the first count value.

[0069] The system's working process:

[0070] like Figure 5 As shown, the system enters the initial state when it is reset;

[0071] The state changes are detected at the initial state. When the frame information FIFO of the command frame in the sending module is not empty, the read enable is valid (indicating that the data frame FIFO in the sending module can still hold a maximum frame), and the full signal of the frame information FIFO in the sending module is invalid, the state of reading command packet information is entered.

[0072] At the same time, the frame information FIFO of the sending response frame in the sending module is not empty, the read enable is valid (indicating that the data frame FIFO in the sending module can still hold a maximum frame), and the full signal of the frame information FIFO in the sending module is invalidated, and the module enters the state of reading response packet information.

[0073] Furthermore, the state of reading command packet or reading response packet information is maintained for one clock cycle. In this state, the information data of the information FIFO is read and the state of reading command packet / response packet data pre-read is entered. At this time, the sending module buffers the data frame and frame information of the upstream module into the corresponding FIFO.

[0074] Furthermore, the command / response packet data pre-read state is maintained for one clock cycle. In this state, the data in the command / response packet technical state is read and the state of reading command / response packet data is entered.

[0075] Furthermore, the read command / response packet data state needs to be maintained for the length of the data frame for a number of clock cycles to read all the data in the command / response packet FIFO and then enter the read command / response packet end state;

[0076] Furthermore, at the end of reading command / response packets, the state change is detected. When the frame information FIFO of the response frame in the sending module is not empty, the read enable is valid (indicating that the data frame FIFO in the sending module can still hold one maximum frame), and the full signal of the frame information FIFO in the sending module is invalid, the state of reading response packet information is entered. At the same time, when the frame information FIFO of the command frame in the sending module is not empty, the read enable is valid (indicating that the data frame FIFO in the sending module can still hold one maximum frame), and the full signal of the frame information FIFO in the sending module is invalid, the state of reading command packet information is entered. The detection action in this state is basically the same as in the initial state. The only difference is that the priority of detecting command packets and response packets is different. In the initial state, command packets are detected first, and in this state, response packets are detected first.

[0077] Furthermore, the system enters a state of reading command / response packet information and loops through it. This method polls and checks the command / response packet data, preventing data congestion caused by prolonged inability to read data from a particular FIFO.

[0078] Furthermore, when sending data to the fiber optic link, the sending module needs to complete a periodic sending function. This sending is also controlled by a state machine, which mainly schedules the sending of primitives and data frames, with primitives having higher priority. The sending state machine is as follows: Figure 6 As shown, the state transition conditions are described as follows:

[0079] When the system is reset, it enters the initial state. During the initial state, the state changes are detected. When the primitive FIFO is not empty, it enters the read primitive state.

[0080] Furthermore, the data read from the primitive FIFO is sent to the fiber optic link;

[0081] Furthermore, returning to the initial state, if the primitive FIFO is empty and the data frame FIFO and frame information FIFO are not empty, then enter the data information reading state;

[0082] Furthermore, the data in the frame information FIFO is read and maintained for one clock cycle before entering the data read state;

[0083] Furthermore, while maintaining the data frame length for a number of clock cycles in the data read state, the data in the data frame FIFO is read out and sent to the fiber optic link, and then the process enters the end state, completing one cycle of transmission.

[0084] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions disclosed in this application.

Claims

1. A method for responding to switch input commands in an optical fiber link, characterized in that, Includes the following steps: The host sends a command sequence to the slave, the command sequence including an information identifier and an information request, the information identifier being used for mutual identification between the host and the slave; When the host determines that it has received a response sequence sent by the slave within a first preset time, it identifies the response sequence. When the host determines that the information identifier in the response sequence is consistent with the information identifier in the command sequence, it controls the transmission of one or more data sequences between the host and the slave. The data sequence includes several data frames corresponding to the information request. During the transmission of the data sequence, one of the host and the slave acts as the sender and the other acts as the receiver. After receiving each data sequence and determining that it has not received all data frames corresponding to the information requirement, the receiving end sends a feedback sequence to the sending end. The feedback sequence includes a data checksum and the operating status of the receiving end. After receiving the feedback sequence, if the transmitting end determines that there is an error in the data check code, it will retransmit the previous data sequence; if it determines that the operating status of the receiving end is abnormal, it will stop transmitting the data sequence. It also includes the following steps: After the receiving end determines that it has received all data frames corresponding to the information requirement, it sends a termination sequence to the sending end. After the sending end determines that it has received the termination sequence within a second preset time, it stops sending the data sequence. If the host determines that the information identifier in the response sequence is inconsistent with the information identifier in the command sequence, it discards the response sequence. The transmission of the data sequence between the master and slave includes both read command mode and write command mode. When in the write command mode, the host acts as the sender and the slave acts as the receiver. When in the read command mode, the slave device acts as the sender and the master device acts as the receiver. The specific steps involved in sending the data frame from the sending end to the receiving end are as follows: When the sending end determines that the total number of bytes in several data frames is less than or equal to a set number of bytes, it sends the data frames to the receiving end through a data sequence, wherein the set number of bytes is the maximum number of bytes included in a data sequence; When the sending end determines that the total number of bytes in several data frames is greater than a set number of bytes, it sends the data frames in multiple data sequences. When the sending end sends data to the receiving end, the following steps are also included: The sending end obtains a first count value, and stops sending the data sequence when the first count value is greater than or equal to a preset credit value; the first count value is the number of data frames that the sending end has sent but not received by the receiving end, and the preset credit value is the maximum number of data frames that the receiving end is allowed to buffer; When the sending end determines that the first count value is less than the preset credit value, it continues to send the data sequence.

2. The fiber optic link switch quantity transmission command response method according to claim 1, characterized in that, The command sequence also includes a CRC checksum and the host's operating status; the response sequence includes a CRC checksum and the slave's operating status.

3. The fiber optic link switch quantity transmission command response method according to claim 2, characterized in that, The termination sequence also includes a CRC checksum and the operating status of the receiving end.

4. The fiber optic link switch quantity transmission command response method according to claim 3, characterized in that, It also includes the following steps: After receiving the response sequence, if the host determines that the slave's operating status is abnormal, it will prohibit data sequence transmission between the host and the slave and prompt the host to check the slave.

Citation Information

Patent Citations

  • Communication method and communication system based on fiber

    CN109327286A

  • SPI-based master-slave communication method and device

    CN112817886A