High-speed half-duplex communication method and system

By using the method of broadcast bus occupies signals and interactive instructions in high-speed half-duplex communication, the problems of multiple pin requirements and slow communication speed in the existing protocol are solved, efficient data transmission and verification are achieved, and data throughput is improved and accuracy.

CN118921154BActive Publication Date: 2024-12-20SHENZHEN SINONE CHIP ELECTRONIC CO. LTD.
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411416778.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2024-12-20
Estimated Expiration
2044-10-11

AI Technical Summary

Technical Problem

The existing SPI, IIC and QSPI protocols have problems such as many pin requirements, high circuit complexity, slow communication speed, low data throughput efficiency and poor signal integrity in high-speed half-duplex communication, resulting in a degradation of communication performance.

Method used

Using the high-speed half-duplex communication method of the broadcast bus occupies signals, data checksum splicing is performed through interactive instructions (including communication address frames, verification seeds, byte notification frames and programming expansion frames), to realize multiple data lines and communication buses to ensure the correctness and efficiency of data transmission.

Benefits of technology

It improves data throughput and transmission accuracy, reduces resource waste rate, supports efficient data communication between multiple terminal devices, and quickly discovers problems in large-scale data exchange and transmits them early, improving the convenience of overall interaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118921154B_ABST
    Figure CN118921154B_ABST
Patent Text Reader

Abstract

The present application provides a high-speed half-duplex communication method and system, which is applied to terminal devices, and multiple terminal devices are connected to a communication bus through multiple data lines, including: broadcasting a bus occupancy signal to become a first device, and setting other terminal devices as second devices; communicating an address frame, a check seed, a byte notification frame, and a programming extension frame to the second device; establishing a communication connection with a third device that replies to an interactive confirmation; splicing a data check frame with data to be transmitted according to the programming extension frame to obtain a spliced ​​data frame, wherein the data check frame is generated according to the check seed and the data to be transmitted; sending the spliced ​​data frame to the third device and entering a waiting state to receive a reception judgment frame replied by the third device, wherein the reception judgment frame is generated after the third device verifies the data to be transmitted according to the check seed; and determining and executing a target sending process according to the reception judgment frame.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a high-speed half-duplex communication method and system. Background Art

[0002] At present, the SPI protocol requires more pins and requires independent chip select lines to connect each slave device, which increases the number of pins and the complexity of the circuit. The increase in the number of slave devices will also bring greater wiring complexity and electrical interference problems. The communication speed of the IIC protocol is slow, the data throughput efficiency during the communication process is low, and the signal integrity will be affected when long distances or multiple devices are connected, which will eventually lead to a decrease in communication performance. The data throughput efficiency during the communication process is low. The interface and protocol of QSPI are relatively complex and have poor compatibility. The above protocols are all directly transmitted, and data can only be verified through other functional blocks. If an error occurs, all data can only be discarded. Summary of the invention

[0003] The present application provides a high-speed half-duplex communication method and system for improving data throughput and data transmission accuracy in half-duplex communication.

[0004] In a first aspect, an embodiment of the present application provides a high-speed half-duplex communication method, which is applied to a terminal device, wherein a plurality of the terminal devices are connected to a communication bus via a plurality of data lines, and the method comprises:

[0005] Broadcasting a bus occupation signal, becoming the first device, and setting the other terminal devices as the second device;

[0006] broadcasting an interaction instruction to the second device, the interaction instruction comprising: a communication address frame, a check seed, a byte notification frame, and a programming extension frame;

[0007] Setting the second device that replies to the interactive confirmation as a third device, and establishing a communication connection with the third device, wherein the interactive confirmation is replied by the second device after the communication address frame is verified;

[0008] splicing a data check frame with preset data to be transmitted according to the programming extension frame to obtain a spliced ​​data frame, wherein the data check frame is generated according to the check seed and the data to be transmitted;

[0009] Sending the spliced ​​data frame to the third device, entering a waiting state, to receive a reception judgment frame replied by the third device, wherein the reception judgment frame is generated after the third device verifies the data to be transmitted according to the verification seed;

[0010] The target sending process is determined and executed according to the received judgment frame, and the target sending process is any one of: following up the sending process, resending the process, waiting for the sending process, detecting the sending process and ending the sending process.

[0011] In some embodiments, the plurality of terminal devices are all connected to the communication bus via a clock line, and the second device that replies to the interactive confirmation is set as a third device and is communicatively connected to the third device, including:

[0012] determining a third device from the second device according to the reply interaction confirmation;

[0013] A clock synchronization signal is generated according to a preset clock synchronization protocol, and based on the clock line, the clock synchronization signal is sent to the third device, so that the third device enters a clock synchronization state according to the clock synchronization signal to form a communication connection.

[0014] In some embodiments, before broadcasting the interaction instruction to the second device, the method further includes:

[0015] Setting the first address frame of the third device as a communication address frame;

[0016] generating the verification seed according to a preset verification algorithm, the first address frame, and a second address frame of the first device;

[0017] Determine the byte notification frame according to a preset interaction protocol and the first address frame;

[0018] Generate the programming extension frame according to the behavior notification bit, the valid byte notification bit, the data line notification bit and the splicing notification bit;

[0019] The interactive instruction is generated according to the verification seed, the communication address frame, the byte notification frame and the programming extension frame.

[0020] In some embodiments, the step of splicing the data check frame with the preset data to be transmitted according to the programming extension frame to obtain a spliced ​​data frame includes:

[0021] Determine the number of data bits and the number of check bits of the data to be transmitted according to the splicing notification bit, wherein the number of check bits is a power of 2, and obtain a splicing frame of the spliced ​​data frame;

[0022] The data to be transmitted is implanted into the splicing frame according to the number of data bits, and the data check frame is implanted into the splicing frame according to the number of check bits, so as to obtain the splicing data frame.

[0023] In some embodiments, the first check frame, the communication address frame, the byte notification frame and the programming extension frame are all 8 bits.

[0024] In some embodiments, generating the verification seed according to a preset verification algorithm, the first address frame, and the second address frame of the first device includes:

[0025] Using the conversion function of the preset verification algorithm, converting the first address frame into a first transformation array;

[0026] Using the conversion function of the preset verification algorithm, converting the second address frame into a second transformation array;

[0027] Using the combination function of the preset verification algorithm, the first transformation array and the second transformation array are spliced ​​into a combination array;

[0028] Determine a first number according to the first transformation array, and determine a second number according to the second transformation array, wherein the first number is the number of digits of the odd numbers in the first transformation array, and the second number is the number of digits of the odd numbers in the second transformation array;

[0029] If the first number is greater than the second number, the first number is used as a first extraction number, a first scrambled array is determined from the combination array according to the first extraction number, and the first scrambled array is placed into a preset random number generator to generate a check seed of a preset specification;

[0030] If the first number is less than or equal to the second number, use the second number as the second extracted number, determine the second scrambled array from the combination array according to the second extracted number, place the second scrambled array into a preset random number generator, and generate a verification seed of a preset data specification.

[0031] In some embodiments, before splicing the data check frame with the preset data to be transmitted according to the programming extension frame to obtain the spliced ​​data frame, the method further includes:

[0032] According to the preset data specification, a data short frame sequence is generated according to the data to be transmitted, wherein the data short frame sequence includes a plurality of data short frames and a sequence number corresponding to each of the data short frames, wherein the sequence number includes: 1-N;

[0033] According to the check seed, an XOR operation is performed with the data short frame with sequence number 1 to obtain a first check frame;

[0034] According to the first check frame, an XOR operation is performed on the data short frame with sequence number 2 to obtain a second operation frame, and a previous bit of the second operation frame is moved to the end of the second operation frame to obtain a second check frame;

[0035] Until the N-1th check frame is XORed with the data short frame with sequence number N to obtain the Nth operation frame, the first M bits of the Nth operation frame are migrated to the end of the Nth operation frame to obtain the data check frame, where M is obtained by performing a modulo operation on N and 8.

[0036] In some embodiments, the total number of the data lines is 4, and the step of determining and executing the target sending process according to the received judgment frame includes:

[0037] If it is detected that the received judgment frame is 0000, the follow-up sending process is executed to send the next data frame to be transmitted after the data frame to be transmitted;

[0038] If it is detected that the received judgment frame is 0001, the resending process is performed and the spliced ​​data frame is resent immediately;

[0039] If it is detected that the received judgment frame is 0011, wait for the sending process, wait for the received judgment frame to become 0000, and then resend the spliced ​​data frame;

[0040] If it is detected that the received judgment frame is 0111, the sending process is detected, the data verification is judged to be wrong, the spliced ​​data frame is resent, and after the number of times the received judgment frame is detected to be 0111 is greater than a preset number, a transmission error prompt is output;

[0041] If it is detected that the receiving judgment frame is 1111, the sending process is terminated, and the communication connection with the third device is terminated.

[0042] In the second aspect, an embodiment of the present application provides a high-speed half-duplex communication system, which includes: multiple terminal devices and a communication bus, each of which is connected to the communication bus via multiple data lines, and each of which is used to execute a high-speed half-duplex communication method as described in any one of the embodiments of the present application.

[0043] The embodiment of the present application provides a high-speed half-duplex communication method, which is applied to a terminal device, wherein multiple terminal devices are connected to a communication bus through multiple data lines, and the method includes: broadcasting a bus occupancy signal to become a first device, and setting other terminal devices as second devices; broadcasting an interaction instruction to the second device, the interaction instruction including: a communication address frame, a check seed, a byte notification frame, and a programming extension frame; setting the second device that replies to the interaction confirmation as a third device, and establishing a communication connection with the third device, wherein the interaction confirmation is a reply from the second device after the communication address frame is verified to be passed; splicing a data check frame with preset data to be transmitted according to the programming extension frame to obtain a spliced ​​data frame, wherein the data check frame is generated according to the check seed and the data to be transmitted; sending the spliced ​​data frame to the third device, entering a waiting state, to receive a reception judgment frame replied by the third device, wherein the reception judgment frame is generated after the third device verifies the data to be transmitted according to the check seed; determining and executing a target sending process according to the reception judgment frame, wherein the target sending process is any one of: following up a sending process, resending a process, waiting for a sending process, detecting a sending process, and ending a sending process. In the above method, by reasonably planning the interaction instructions and inserting data check frames during the transmission of the data to be transmitted, data can be checked during rapid transmission, and efficient data communication can be achieved between multiple terminal devices. The implanted check frames can quickly discover problems in large-scale data exchanges, and early resumption of transmission makes the overall interaction more convenient and reduces resource waste. It also provides programming extension frames for user convenience and expansion. It uses multi-line data transmission to improve data throughput and greatly improve efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying any creative work.

[0045] Figure 1 A schematic block diagram of a high-speed half-duplex communication system provided in an embodiment of the present application;

[0046] Figure 2 A schematic flow chart of a first high-speed half-duplex communication method provided in an embodiment of the present application;

[0047] Figure 3 A schematic diagram of a first communication waveform provided in an embodiment of the present application;

[0048] Figure 4 A schematic diagram of a second communication waveform provided in an embodiment of the present application;

[0049] Figure 5 A schematic diagram of a third communication waveform provided in an embodiment of the present application;

[0050] Figure 6 A schematic diagram of a fourth communication waveform provided in an embodiment of the present application;

[0051] Figure 7 A schematic diagram of a fifth communication waveform provided in an embodiment of the present application;

[0052] Figure 8 A schematic flow chart of a second high-speed half-duplex communication method provided in an embodiment of the present application;

[0053] Fig. 9 A schematic block diagram of a high-speed half-duplex communication device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0054] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0055] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0056] It should also be understood that the terms used in this application specification are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in this application specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0057] It should be further understood that the term “and / or” used in the specification and appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.

[0058] See also Figure 1 , Figure 1 A schematic block diagram of a high-speed half-duplex communication system provided by an embodiment of the present application is shown. Figure 1 As shown, the high-speed half-duplex communication system 100 includes: a plurality of terminal devices 11 and a communication bus 12, and the plurality of terminal devices 11 are connected to the communication bus 12 via a plurality of data lines.

[0059] See also Figure 2 , Figure 2 FIG. 1 is a schematic flow chart of a first high-speed half-duplex communication method provided by an embodiment of the present application. Figure 2 The high-speed half-duplex communication method shown is applied to Figure 1 For the terminal device shown, the specific steps of the method include: S101-S106.

[0060] S101, broadcast bus occupation signal, become the first device, and set other terminal devices as the second device.

[0061] For example, at the beginning, a terminal device with a read / write demand initiates the process, which pulls down the levels of all its own data lines for a period of time, and then becomes the first device. The communication bus notifies all terminal devices to pull down the levels of their data lines at the same time, so that all terminal devices enter the communication mode. The first device indicates to other terminal devices on the communication bus that there is a read / write demand.

[0062] S102. Broadcast an interaction instruction to the second device, where the interaction instruction includes: a communication address frame, a check seed, a byte notification frame, and a programming extension frame.

[0063] Exemplarily, after the start segment ends, the first device broadcasts a command frame to the second device, and the command frame length is fixed at 32 bits. The command frame includes a communication address frame (8 bits), a check seed (8 bits), a byte notification frame (8 bits), and a programming extension frame (8 bits).

[0064] Communication address frame: provides 8-bit programmable address. Each terminal device on the communication bus has its own unique independent address frame to facilitate mutual access between terminal devices.

[0065] Verification seed: A programmable verification seed is provided to ensure the correctness of data transmission. The interactive instruction contains this information. When the second device receives the data to be transmitted, it uses the verification seed to calculate the data to be transmitted and finally obtains a verification code.

[0066] Byte notification frame: The first device needs to indicate the total number of bytes required for the communication process. For example, a file to be transmitted will be divided into L bytes, then L is the total number of bytes required for the communication process. Both parties conduct relevant communications in accordance with the agreement.

[0067] Programming extension frame: This segment contains specific read / write behavior control, the length of each byte in the data segment, the number of data lines to be used, and user-definable extension bits.

[0068] S103: Set the second device that replies to the interactive confirmation as a third device, and establish a communication connection with the third device, wherein the interactive confirmation is replied by the second device after the communication address frame is verified.

[0069] Exemplarily, in the communication mode, if the second terminal device receives the communication address frame sent by the first device and verifies that the communication address frame is the same as its own independent address frame, it will respond to the first device, establish a communication connection with the first device, and become the third device.

[0070] S104, splicing the data check frame with the preset data to be transmitted according to the programmed extended frame to obtain a spliced ​​data frame, wherein the data check frame is generated according to the check seed and the data to be transmitted.

[0071] Exemplarily, in order to ensure the integrity and reliability of data during the communication process, during the data segment transmission process, the data check frame will be automatically inserted into the data to be transmitted at an appropriate position, and the specific insertion position is determined by the programming extension frame. The content of the data check frame is based on the previously generated check seed and the data to be transmitted, and an 8-bit data check frame is calculated by a preset check algorithm. After the data check frame is transmitted to the third device, the third device compares it with the check code calculated locally (based on the check seed and the data to be transmitted) to confirm the accuracy of the data transmission.

[0072] S105. Send the spliced ​​data frame to the third device and enter a waiting state to receive a reception judgment frame replied by the third device. The reception judgment frame is generated by the third device after verifying the data to be transmitted according to the verification seed.

[0073] Exemplarily, the number of clocks of each spliced ​​data frame is determined by the unit byte length of the data segment and the number of data lines. For example, the data transmission unit is 32 bits and the four-wire mode is used as an example: the first eight clocks represent data, and the last clock is used for the second device to reply to the reception judgment frame. The third device performs verification based on the verification seed, the data verification frame in the spliced ​​data, and the data to be transmitted in the spliced ​​data to verify whether the correct data to be transmitted is received, and outputs the verification result. The third device replies to the corresponding reception judgment frame based on the correctness of the verification result.

[0074] S106. Determine and execute a target sending process according to the received judgment frame, where the target sending process is any one of: following up the sending process, resending the process, waiting for the sending process, detecting the sending process, and ending the sending process.

[0075] Exemplarily, the first device determines whether the second device has correctly received the data based on the reception judgment frame, and executes the target sending process based on the reception situation to determine the next sending process of the data to be transmitted. The data to be transmitted is generated by separating and sorting the total data packets, and the data to be transmitted is the first data in the sorting. The data after transmission is deleted in the sorting, thereby orderly transmitting the data in the total data packet.

[0076] If the first device detects that the third device fails to receive the data to be transmitted based on the received judgment frame, it will automatically roll back to the previous data to be transmitted. After multiple error detections, the first device can also regenerate the verification seed and verification frame and resend them to the third device. This retransmission process will continue until the third device confirms that the data is correct. In order to improve communication efficiency, a timeout mechanism is designed in this step, that is, if multiple retransmissions fail or the third device does not respond for a long time, the first device will enter the error termination process and release the communication bus resources to avoid the overall paralysis of the communication system.

[0077] After all the data to be transmitted are successfully transmitted, the communicating parties notify each other of the completion of the communication through the end frame. The end frame is a type of receiving judgment frame, which contains the communication end flag and the device release signal. After the communication is completed, the first device and the third device will release the data line and the clock line at the same time, indicating that the communication channel is idle and other terminal devices can initiate new communication requests. At this time, all relevant resources for communication (such as registers, buffers, etc.) will be reset to prepare for the start of the next communication. This step ensures that the communication process can be completed in an orderly manner, and provides fair communication opportunities for other terminal devices in the system, thereby improving the resource utilization of the system.

[0078] The embodiment of the present application provides a high-speed half-duplex communication method, which is applied to a terminal device, wherein multiple terminal devices are connected to a communication bus through multiple data lines, and the method includes: broadcasting a bus occupancy signal to become a first device, and setting other terminal devices as second devices; broadcasting an interaction instruction to the second device, the interaction instruction including: a communication address frame, a check seed, a byte notification frame, and a programming extension frame; setting the second device that replies to the interaction confirmation as a third device, and establishing a communication connection with the third device, wherein the interaction confirmation is a reply from the second device after the communication address frame is verified to be passed; splicing a data check frame with preset data to be transmitted according to the programming extension frame to obtain a spliced ​​data frame, wherein the data check frame is generated according to the check seed and the data to be transmitted; sending the spliced ​​data frame to the third device, entering a waiting state, to receive a reception judgment frame replied by the third device, wherein the reception judgment frame is generated after the third device verifies the data to be transmitted according to the check seed; determining and executing a target sending process according to the reception judgment frame, wherein the target sending process is any one of: following up a sending process, resending a process, waiting for a sending process, detecting a sending process, and ending a sending process. In the above method, by reasonably planning the interaction instructions and inserting data check frames during the transmission of the data to be transmitted, data can be checked during rapid transmission, and efficient data communication can be achieved between multiple terminal devices. The implanted check frames can quickly discover problems in large-scale data exchanges, and early resumption of transmission makes the overall interaction more convenient and reduces resource waste. It also provides programming extension frames for user convenience and expansion. It uses multi-line data transmission to improve data throughput and greatly improve efficiency.

[0079] Through the above method, the terminal device can be directly instantiated into the APB bus structure through the standard peripheral interface, which is convenient for making FPGA or chip. The above method is easy to use, has a wide range of instruction set support, and has high communication efficiency. The embedded data check frame in the process can detect transmission problems in time and improve the overall communication efficiency. It supports communication between multiple peripherals, which is convenient for users.

[0080] In order to more clearly introduce the technical solution of the present application, the technical solution of the present application will be introduced through specific embodiments below. It should be noted that the specific embodiments are used to expand the technical solution of the present application, but are not intended to limit the present application.

[0081] In some embodiments, multiple terminal devices are connected to the communication bus via a clock line, and the second device that replies to the interactive confirmation is set as a third device, and a communication connection is established with the third device, including: determining the third device from the second device based on the reply to the interactive confirmation; generating a clock synchronization signal according to a preset clock synchronization protocol, and sending the clock synchronization signal to the third device based on the clock line, so that the third device enters a clock synchronization state according to the clock synchronization signal to form a communication connection.

[0082] In the half-duplex communication method, the communication environment needs to be initialized first to ensure that both parties can effectively transmit data. The party that initiates the communication request (such as the first device) pulls all data lines low, and after a specific time, the first device passes the clock synchronization signal to the second device. The clock synchronization signal is sent through the clock line to ensure that both parties can enter the communication state at the same time. The goal of this synchronization phase is to ensure that all devices are under the same time reference to avoid timing deviation. At this stage, the priority of communication and the status information of the device are also transmitted to ensure that subsequent communication requests are responded to in a timely manner. After successful synchronization, the clock synchronization signal will stabilize at the preset frequency, providing a stable time base for subsequent data transmission.

[0083] In some embodiments, before broadcasting the interaction instruction to the second device, the method also includes: setting a communication address frame according to the first address frame of the second device; generating a verification seed according to a preset verification algorithm, the first address frame and the second address frame of the first device; determining a byte notification frame according to a preset interaction protocol and the first address frame; generating a programming extension frame according to a behavior notification bit, a valid byte notification bit, a data line notification bit and a splicing notification bit; and generating an interaction instruction according to the verification seed, the communication address frame, the byte notification frame and the programming extension frame.

[0084] In some embodiments, the verification seed, communication address frame, byte notification frame and programming extension frame generation interaction instruction are all 8 bits.

[0085] For example, see Figure 3 , Figure 3 The schematic diagram of the first communication waveform provided by the embodiment of the present application is shown. Figure 3 As shown in the figure, taking 1 clock line (clk) and 4 data lines (data1, data2, data3 and data4) as an example, after the start phase (start), it enters the instruction phase (instruction phase), and 8 clocks are the length of the instruction phase. The first device sends the interactive instruction to the second device in the instruction phase. Each data line is responsible for sending the verification seed, communication address frame, byte notification frame and programming extension frame. After sending the interactive instruction, it enters the confirmation phase (ack), and 1 clock is the length of the confirmation phase. The first device receives the reception judgment frame replied by the second device in the confirmation phase.

[0086] It should be noted that, after receiving the interactive instruction and passing the verification, the second device will also reply with a reception determination frame, usually 0000, so that the second device becomes the third device.

[0087] For example, see Figure 4 , Figure 4The schematic diagram of the second communication waveform provided by the embodiment of the present application is shown. Figure 4 As shown, the first device sends an interactive instruction to the third device in the instruction phase, and the third device receives and responds to the interactive instruction. In some cases, due to the fluctuation of the main frequency of the third device or other factors, it takes a certain amount of time for the third device to process the interactive instruction, and 1 clock number cannot meet the time requirement. Therefore, after the confirmation phase, a waiting phase (wait) is combined to reserve sufficient processing time for the third device.

[0088] In some embodiments, a data check frame is spliced ​​with preset data to be transmitted according to a programmed extension frame to obtain a spliced ​​data frame, including: determining the number of data bits and the number of check bits of the data to be transmitted according to a splicing notification bit, the number of check bits being a power of 2, to obtain a splicing frame of the spliced ​​data frame; implanting the data to be transmitted into the splicing frame according to the number of data bits, and implanting the data check frame into the splicing frame according to the number of check bits to obtain a spliced ​​data frame.

[0089] For example, see Figure 5 , Figure 5 The third communication waveform provided by the embodiment of the present application is shown in FIG. Figure 5 As shown, after the second device becomes the third device, the first device enters the data sending phase (data phase). In the data sending phase, the first device sends the spliced ​​data. After the sending is completed, it enters the confirmation phase (ack) again, waiting for the third device to verify the spliced ​​data, that is, waiting for the third device to reply with a receiving judgment frame.

[0090] Through this comparison method, the data check frame is inserted into the data to be transmitted according to a preset rule, and the third device can accurately detect the error position in the data packet through the data check frame. If an error is found and the error is uncorrectable, the third device will trigger a retransmission mechanism to make the first device resend the data to ensure the integrity of the data.

[0091] In some embodiments, generating a check seed according to a preset check algorithm, a first address frame, and a second address frame of a first device includes: using a conversion function of a preset check algorithm to convert the first address frame into a first transformation array; using a conversion function of a preset check algorithm to convert the second address frame into a second transformation array; using a combination function of a preset check algorithm to splice the first transformation array and the second transformation array into a combination array; determining a first number according to the first transformation array, and determining a second number according to the second transformation array, the first number being the number of digits of odd numbers in the first transformation array, and the second number being the number of digits of odd numbers in the second transformation array; if the first number is greater than the second number, using the first number as a first extraction number, determining a first scrambled array from the combination array according to the first extraction number, placing the first scrambled array into a preset random number generator, and generating a check seed of a preset specification; if the first number is less than or equal to the second number, using the second number as a second extraction number, determining a second scrambled array from the combination array according to the second extraction number, placing the second scrambled array into a preset random number generator, and generating a check seed of a preset data specification.

[0092] Exemplarily, in the process of generating the combination array, the randomness of the combination array can be enhanced by adding a time array, so that it can be ensured that the verification seed cannot be used for data destruction after being intercepted during the transmission process. The preset random number generator is a quantum random number generator, through which a verification seed of a preset data specification is generated according to the input scrambled data, and the preset data specification is 8 bits.

[0093] For example, see Figure 6 , Figure 6 The fourth communication waveform provided by the embodiment of the present application is shown in FIG. Figure 6 As shown, during the communication process, the first device can also replace the verification seed and enter the verification phase, thereby reducing the possibility of leakage of the verification seed data. After replacing the verification seed, the third device uses the replaced verification seed to verify the latest spliced ​​data.

[0094] Through the above steps, it is ensured that the communicating parties reach an agreement on the transmission content, verification mechanism and data length before data transmission. The third device can also verify the verification seed by the same method to ensure the correctness of the verification seed.

[0095] In some embodiments, before splicing the data check frame with the preset data to be transmitted according to the programmed extension frame to obtain the spliced ​​data frame, the method also includes: generating a data short frame sequence according to the preset data specification and the data to be transmitted, the data short frame sequence including multiple data short frames and a sequence number corresponding to each data short frame, the sequence number including: 1-N; performing an XOR operation with the data short frame with sequence number 1 according to the check seed to obtain a first check frame; performing an XOR operation with the data short frame with sequence number 2 according to the first check frame to obtain a second operation frame, and migrating the previous bit of the second operation frame to the end of the second operation frame to obtain a second check frame; until the N-1th check frame is XORed with the data short frame with sequence number N to obtain the Nth operation frame, migrating the first M bits of the Nth operation frame to the end of the Nth operation frame to obtain a data check frame, wherein M is obtained by performing a modulo operation of N and 8.

[0096] Exemplarily, the verification process occurs after the third device receives the spliced ​​data, and the third device uses the verification seed as the basis for verifying the spliced ​​data. The third device first extracts the data verification frame and the data to be transmitted from the spliced ​​data according to the splicing notification bit in the programming extension frame.

[0097] The third device performs the following calculations based on the check seed, data check frame and spliced ​​data: the data to be transmitted is sequentially cut into several data short frames with a unit length of 8 bits, and arranged into a data short frame sequence. According to the data short frame sequence, the first data short frame is XORed with the check seed to obtain the first operation result. Then the second data short frame is XORed with the first operation result, and then shifted left by 1 bit, and the low bit is supplemented with the 1 bit value shifted left, that is, the previous bit of the second operation frame is moved to the end of the second operation frame, thereby obtaining the second operation result. Then the third data short frame is XORed with the second operation result, the result is shifted left by 2 bits, and the low bit is supplemented with the 2 bit value shifted out, to obtain the third operation result. And so on. That is, each data short frame is XORed with the previous operation result, and then shifted left by N%8 bits (N is the short frame number, % is the modulus operation). Taking 4-wire communication as an example, a data check frame is interspersed after every 8 frames of data (8*32bit), and the check code is the operation result of the last calculation.

[0098] In some embodiments, the total number of data lines is 4, and the target sending process is determined and executed according to the receiving judgment frame, including: if the receiving judgment frame is detected to be 0000, the follow-up sending process is executed to send the next data frame to be transmitted after the data frame to be transmitted. If the receiving judgment frame is detected to be 0001, the sending process is resent and the spliced ​​data frame is resent immediately. If the receiving judgment frame is detected to be 0011, the sending process is waited for, and the spliced ​​data frame is resent after the receiving judgment frame becomes 0000. If the receiving judgment frame is detected to be 0111, the sending process is detected, the data check error is determined, the spliced ​​data frame is resent, and after the number of times the receiving judgment frame is detected to be 0111 is greater than the preset number, a transmission error prompt is output. If the receiving judgment frame is detected to be 1111, the sending process is terminated, and the communication connection with the third device is terminated.

[0099] After each data segment ends, the second device will return a reception judgment frame to inform the first device whether the data has been successfully received. If the first device receives a reception judgment frame of "0000", it means that the data has been received successfully, otherwise the previous frame of data needs to be retransmitted. Otherwise, sending "0111" indicates a transmission error, and the first device will suspend subsequent data transmission and automatically roll back to the previous frame of data. The first device will regenerate the check code and resend the frame of data to the second device. This retransmission process will continue until the second device confirms that the data is correct. This step effectively improves the error detection capability in large data transmission by introducing a real-time verification mechanism, and reduces the overall probability of communication failure due to data errors.

[0100] For example, see Figure 7 , Figure 7 The fifth communication waveform provided by the embodiment of the present application is shown in FIG. Figure 7 As shown, after the first device receives "1111" in the confirmation phase (ack), it enters the end phase (finish) and disconnects the communication with the third device.

[0101] See also Figure 8 , Figure 8 FIG. 1 is a schematic flow chart of a second high-speed half-duplex communication method provided by an embodiment of the present application. Figure 8 The high-speed half-duplex communication method shown is applied to a receiving device, namely, a second device or a third device. In the data verification result classification, the classification categories include: request retransmission, request waiting and normal transmission, etc., and each category corresponds to a separate reception judgment frame.

[0102] See also Fig. 9 , Fig. 93 is a schematic block diagram of a high-speed half-duplex communication device provided in an embodiment of the present application, wherein the high-speed half-duplex communication device 300 is used to execute the high-speed half-duplex communication method described above, wherein the high-speed half-duplex communication device 300 can be configured in a server.

[0103] Among them, the server can be an independent server or a server cluster, or it can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN) and big data and artificial intelligence platforms.

[0104] like Fig. 9 As shown, the high-speed half-duplex communication device 300 includes: an identity confirmation module 301, an interaction implementation module 302, an interaction confirmation module 303, a data splicing module 304, an interaction judgment module 305 and a sending management module 306.

[0105] The interaction generation module 301 is used to broadcast a bus occupation signal, become the first device, and set other terminal devices as the second device.

[0106] The interaction implementation module 302 is used to broadcast the interaction instruction to the second device, and the interaction instruction includes: a communication address frame, a check seed, a byte notification frame and a programming extension frame.

[0107] The interactive confirmation module 303 is used to set the second device that replies to the interactive confirmation as a third device and establish a communication connection with the third device, wherein the interactive confirmation is replied by the second device after the communication address frame is verified.

[0108] The data splicing module 304 is used to splice the data check frame with the preset data to be transmitted according to the programmed extension frame to obtain a spliced ​​data frame, wherein the data check frame is generated according to the check seed and the data to be transmitted.

[0109] The judgment interaction module 305 is used to send the spliced ​​data frame to the third device and enter a waiting state to receive a reception judgment frame replied by the third device. The reception judgment frame is generated by the third device after verifying the data to be transmitted according to the verification seed.

[0110] The sending management module 306 is used to determine and execute the target sending process according to the received judgment frame. The target sending process is any one of: following up the sending process, resending the process, waiting for the sending process, detecting the sending process and ending the sending process.

[0111] An embodiment of the present application provides a terminal device, which includes a memory and a processor; the memory is used to store a computer program; the processor is used to execute the computer program and implement a high-speed half-duplex communication method such as any one of the embodiments of the present application when executing the computer program.

[0112] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements a high-speed half-duplex communication method as described in any one of the embodiments of the present application.

[0113] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A high-speed half-duplex communication method, characterized in that: Applied to terminal devices, a plurality of the terminal devices are connected to a communication bus via a plurality of data lines, and the method comprises: The broadcast bus occupancy signal becomes the first device, and the other terminal devices are set as the second device; the communication address frame is set according to the first address frame of the second device; the first address frame is converted into a first transformation array using the conversion function of the preset verification algorithm; the second address frame of the first device is converted into a second transformation array using the conversion function of the preset verification algorithm; the first transformation array and the second transformation array are spliced ​​into a combination array using the combination function of the preset verification algorithm; the first number is determined according to the first transformation array, and the second number is determined according to the second transformation array, the first number is the number of odd digits in the first transformation array, and the second number is the number of odd digits in the second transformation array; if the first number is greater than the second number word, taking the first number as the first extraction number, determining the first scrambled array from the combination array according to the first extraction number, placing the first scrambled array into a preset random number generator, and generating a check seed of a preset specification; if the first number is less than or equal to the second number, taking the second number as the second extraction number, determining the second scrambled array from the combination array according to the second extraction number, placing the second scrambled array into a preset random number generator, and generating a check seed of a preset data specification; determining a byte notification frame according to a preset interaction protocol and the first address frame; generating a programming extension frame according to a behavior notification bit, a valid byte notification bit, a data line notification bit, and a splicing notification bit; generating an interaction instruction according to the check seed, the communication address frame, the byte notification frame, and the programming extension frame; broadcasting the interaction instruction to the second device, the interaction instruction comprising: a communication address frame, a check seed, a byte notification frame, and a programming extension frame; Setting the second device that replies to the interactive confirmation as a third device, and establishing a communication connection with the third device, wherein the interactive confirmation is replied by the second device after the communication address frame is verified; splicing a data check frame with preset data to be transmitted according to the programming extension frame to obtain a spliced ​​data frame, wherein the data check frame is generated according to the check seed and the data to be transmitted; Sending the spliced ​​data frame to the third device, entering a waiting state, to receive a reception judgment frame replied by the third device, wherein the reception judgment frame is generated after the third device verifies the data to be transmitted according to the verification seed; The target sending process is determined and executed according to the received judgment frame, and the target sending process is any one of: following up the sending process, resending the process, waiting for the sending process, detecting the sending process and ending the sending process.

2. The high-speed half-duplex communication method according to claim 1, wherein: The plurality of terminal devices are all connected to the communication bus via a clock line, and the second device that replies to the interactive confirmation is set as a third device and is communicatively connected to the third device, including: determining a third device from the second device according to the interactive confirmation; A clock synchronization signal is generated according to a preset clock synchronization protocol, and based on the clock line, the clock synchronization signal is sent to the third device, so that the third device enters a clock synchronization state according to the clock synchronization signal to form a communication connection.

3. The high-speed half-duplex communication method according to claim 1, wherein: The step of splicing the data check frame with the preset data to be transmitted according to the programming extension frame to obtain a spliced ​​data frame includes: Determine the number of data bits and the number of check bits of the data to be transmitted according to the splicing notification bit, wherein the number of check bits is a power of 2, and obtain a splicing frame of the spliced ​​data frame; The data to be transmitted is implanted into the splicing frame according to the number of data bits, and the data check frame is implanted into the splicing frame according to the number of check bits, so as to obtain the splicing data frame.

4. The high-speed half-duplex communication method according to claim 1, wherein: The communication address frame, the byte notification frame and the programming extension frame are all 8 bits.

5. The high-speed half-duplex communication method according to claim 1, wherein: Before splicing the data check frame with the preset data to be transmitted according to the programming extension frame to obtain the spliced ​​data frame, the method further includes: According to the preset data specification, a data short frame sequence is generated according to the data to be transmitted, wherein the data short frame sequence includes a plurality of data short frames and a sequence number corresponding to each of the data short frames, wherein the sequence number includes: 1-N; According to the check seed, an XOR operation is performed with the data short frame with a sequence number of 1 to obtain a first check frame, where the first check frame is 8 bits; According to the first check frame, an XOR operation is performed on the data short frame with sequence number 2 to obtain a second operation frame, and a previous bit of the second operation frame is moved to the end of the second operation frame to obtain a second check frame; Until the N-1th check frame is XORed with the data short frame with sequence number N to obtain the Nth operation frame, the first M bits of the Nth operation frame are migrated to the end of the Nth operation frame to obtain the data check frame, where M is obtained by performing a modulo operation on N and 8.

6. The high-speed half-duplex communication method according to claim 1, wherein: The total number of the data lines is 4, and the step of determining and executing the target sending process according to the received judgment frame includes: If it is detected that the received judgment frame is 0000, the follow-up sending process is executed to send the next data frame to be transmitted after the data frame to be transmitted; If it is detected that the received judgment frame is 0001, the resending process is performed and the spliced ​​data frame is resent immediately; If it is detected that the received judgment frame is 0011, wait for the sending process, wait for the received judgment frame to become 0000, and then resend the spliced ​​data frame; If it is detected that the received judgment frame is 0111, the sending process is detected, the data verification is judged to be wrong, the spliced ​​data frame is resent, and after the number of times the received judgment frame is detected to be 0111 is greater than a preset number, a transmission error prompt is output; If it is detected that the receiving judgment frame is 1111, the sending process is terminated, and the communication connection with the third device is terminated.

7. A high-speed half-duplex communication system, characterized in that: The high-speed half-duplex communication system includes: multiple terminal devices and a communication bus, each of the multiple terminal devices is connected to the communication bus via multiple data lines, and the multiple terminal devices are used to execute the high-speed half-duplex communication method as described in any one of claims 1-6.