WO2022078426A1 - Data transmission method and system, and computer-readable storage medium - Google Patents

Data transmission method and system, and computer-readable storage medium Download PDF

Info

Publication number
WO2022078426A1
WO2022078426A1 PCT/CN2021/123743 CN2021123743W WO2022078426A1 WO 2022078426 A1 WO2022078426 A1 WO 2022078426A1 CN 2021123743 W CN2021123743 W CN 2021123743W WO 2022078426 A1 WO2022078426 A1 WO 2022078426A1
Authority
WO
WIPO (PCT)
Prior art keywords
algorithm
data
error detection
transmission
correction
Prior art date
Application number
PCT/CN2021/123743
Other languages
French (fr)
Chinese (zh)
Inventor
杜思清
常鸣
糟永明
乐培玉
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Publication of WO2022078426A1 publication Critical patent/WO2022078426A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers

Definitions

  • the present application relates to the field of communication technologies, and in particular, to a data transmission method, system, and computer-readable storage medium.
  • the present application provides a data transmission method, system, and computer-readable storage medium, which are used to improve data transmission efficiency on the basis of ensuring data transmission reliability.
  • an embodiment of the present application provides a data transmission method, which is applied to a first device, and the method includes:
  • the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, encode the acquired transmission data through the first error detection and correction algorithm, generate first encoded data, and send the first encoded data to the second device;
  • the acquired transmission data is encoded by the second error detection and correction algorithm, second encoded data is generated, and the second encoded data is sent to the second device.
  • the second error detection and correction algorithm is different from the first error detection and correction algorithm.
  • the method further includes: acquiring environmental parameters of the transmission channel.
  • the environmental parameter of the transmission channel includes a bit error rate; the obtaining the environmental parameter of the transmission channel includes:
  • the bit error rate is calculated according to the correct number of bits of the second sequence sent by the second device and the total number of bits of the second sequence sent by the second device.
  • the method further includes:
  • the environment parameter of the transmission channel includes a system transmission rate; the obtaining the environment parameter of the transmission channel includes:
  • the system transfer rate is read from the Cutoff Status Register.
  • the environment parameter of the transmission channel includes a packet loss rate; the obtaining the environment parameter of the transmission channel includes:
  • the method before the encoding of the acquired transmission data by the first error detection and correction algorithm and before the encoding of the acquired transmission data by the second error detection and correction algorithm, the method further includes:
  • the transmission channel environment parameter includes one of a bit error rate, a system transmission rate, and the packet loss rate or any combination thereof;
  • the transmission channel environment parameter meeting the first algorithm enabling condition includes: the bit error rate is greater than or equal to a first threshold, the system transmission rate is greater than or equal to a second threshold, and the packet loss rate is greater than or equal to a third threshold one or any combination thereof;
  • the transmission channel environment parameter meeting the condition for enabling the second algorithm includes: the bit error rate is less than the first threshold, the system transmission rate is less than the second threshold, and the packet loss rate is less than one of the third threshold or any combination thereof .
  • the first error detection and correction algorithm includes at least two error detection and correction algorithms
  • the second error detection and correction algorithm includes at least one error detection and correction algorithm
  • the first error detection and correction algorithm includes at least one error detection and correction algorithm.
  • the number of error detection and correction algorithms is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
  • the first error detection and correction algorithm includes a forward error correction (FEC) algorithm, a clean core cyclic redundancy check (CRC) algorithm, and a packet header error correction code ECC algorithm; or
  • the first error detection and correction algorithm includes an FEC algorithm and a CRC algorithm; or
  • the first error detection and correction algorithm includes an FEC algorithm and an ECC algorithm.
  • the second error detection and correction algorithm includes an FEC algorithm
  • the second error detection and correction algorithm includes a CRC algorithm
  • the second error detection and correction algorithm includes an ECC algorithm
  • the second error detection and correction algorithm includes a CRC algorithm and an ECC algorithm.
  • the first encoded data includes an indication field, where the indication field is used to indicate that the environmental parameter complies with the condition for enabling the first algorithm.
  • the indication field includes a reserved field or a newly added field.
  • the first device includes a camera module
  • the second device includes a motherboard or an electronic device
  • the first device includes a motherboard, a host or an electronic device
  • the second device includes a display screen.
  • an embodiment of the present application provides a data transmission method, which is applied to a second device, and the method includes:
  • the first encoded data sent by the first device is received, the first encoded data is checked by a first error detection and correction algorithm to generate transmission data;
  • the second encoded data sent by the first device is received, the second encoded data is verified by a second error detection and correction algorithm to generate transmission data.
  • the environmental parameter of the transmission channel includes a bit error rate; the method further includes:
  • bit error rate complies with the enabling condition of the first algorithm
  • a first bit error rate status is sent to the first device, where the first bit error rate status is used to indicate that the bit error rate conforms to the first algorithm open condition
  • bit error rate complies with the enabling condition of the second algorithm
  • the environmental parameter of the transmission channel includes a packet loss rate; the method further includes:
  • a second packet loss rate status is sent to the first device, where the first packet loss rate status is used to indicate that the packet loss rate complies with the second algorithm Turn on condition.
  • the first error detection and correction algorithm includes at least two error detection and correction algorithms
  • the second error detection and correction algorithm includes at least one error detection and correction algorithm
  • the first error detection and correction algorithm includes at least one error detection and correction algorithm.
  • the number of error detection and correction algorithms is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
  • the first error detection and correction algorithm includes an FEC algorithm, a CRC algorithm and an ECC algorithm; or
  • the first error detection and correction algorithm includes an FEC algorithm and a CRC algorithm; or
  • the first error detection and correction algorithm includes an FEC algorithm and an ECC algorithm.
  • the second error detection and correction algorithm includes an FEC algorithm
  • the second error detection and correction algorithm includes a CRC algorithm
  • the second error detection and correction algorithm includes an ECC algorithm
  • the second error detection and correction algorithm includes a CRC algorithm and an ECC algorithm.
  • the performing verification on the first encoded data by using a first error detection and correction algorithm includes:
  • the first encoded data includes an indication field
  • perform FEC check on the first encoded data and the indication field is used to indicate that the environment parameter complies with the first algorithm enabling condition
  • CRC check and/or ECC check is performed on the first encoded data after the FEC check.
  • the performing verification on the first encoded data by using a first error detection and correction algorithm includes:
  • the first encoded data includes an indication field
  • perform CRC check and/or ECC check on the FEC-checked first encoded data and the indication field is used to indicate that the environmental parameter conforms to the first encoded data. Algorithm start condition.
  • the indication field includes a reserved field or a newly added field.
  • embodiments of the present application provide a first device, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory wherein, the one or more computer programs include instructions, which, when executed by the device, cause the device to execute the first aspect or the data transmission method in any possible implementation manner of the first aspect.
  • embodiments of the present application provide a second device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory wherein, the one or more computer programs include instructions, which, when executed by the device, cause the device to execute the data transmission method in the second aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides a data transmission system, including: a first device and a second device, where the first device and the second device are communicatively connected through a transmission channel;
  • the first device is configured to encode the acquired transmission data through a first error detection and correction algorithm if the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, generate first encoded data, and convert the first encoded data to the first device.
  • Send to the second device if the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, encode the acquired transmission data through the second error detection and correction algorithm, generate second encoded data, and send the second encoded data to a second device, wherein the second error detection and correction algorithm is different from the first error detection and correction algorithm;
  • the second device is configured to, if receiving the first encoded data sent by the first device, verify the first encoded data through a first error detection and correction algorithm to generate transmission data; if receiving the first encoded data sent by the first device The second encoded data is checked by a second error detection and correction algorithm to generate transmission data.
  • an embodiment of the present application provides an electronic device, including: a first device and a second device, where the first device and the second device are communicatively connected through a transmission channel;
  • the first device is configured to encode the acquired transmission data through a first error detection and correction algorithm if the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, generate first encoded data, and convert the first encoded data to the first device.
  • Send to the second device if the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, encode the acquired transmission data through the second error detection and correction algorithm, generate second encoded data, and send the second encoded data to a second device, wherein the second error detection and correction algorithm is different from the first error detection and correction algorithm;
  • the second device is configured to, if receiving the first encoded data sent by the first device, verify the first encoded data through a first error detection and correction algorithm, and generate transmission data; if receiving the first encoded data sent by the first device The second encoded data is checked by a second error detection and correction algorithm to generate transmission data.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used for program code executed by a device, and the program code includes the first aspect or any of the first aspect. Instructions for a method in a possible implementation.
  • an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used for program code executed by a device, and the program code includes a program code for executing the second aspect or the second aspect. Instructions for a method in a possible implementation.
  • an embodiment of the present application provides a computer program product containing instructions, wherein when the computer program product is run on a computer or any at least one processor, the computer is made to execute the above-mentioned first step.
  • a data transmission method in one aspect or any possible implementation manner of the first aspect.
  • an embodiment of the present application provides a computer program product containing instructions, wherein when the computer program product is run on a computer or any at least one processor, the computer is made to execute the above-mentioned first step.
  • the first device selects a first error detection and correction algorithm to encode the transmission data to generate the first encoded data according to the environmental parameters of the transmission channel meeting the conditions for enabling the first algorithm, or the first device generates the first encoded data according to the transmission channel. If the environmental parameters meet the conditions for enabling the second algorithm, select the second error detection and correction algorithm to encode the transmission data to generate the second encoded data, and the second device receives the encoded data. The algorithm verifies the encoded data to generate transmission data. If it is determined that the second algorithm is enabled, the encoded data is verified by the second error detection and correction algorithm to generate transmission data. The transmission data in the transmission process is subjected to error detection and correction processing, thereby improving the data transmission efficiency on the basis of ensuring the reliability of data transmission.
  • 1 is a schematic diagram of an error detection and correction technique in some embodiments
  • FIG. 2 is a schematic structural diagram of a D-PHY-based data transmission system in the related art
  • FIG. 3 is a flowchart of a data transmission method based on D-PHY in the data transmission system in FIG. 2;
  • FIG. 4 is a schematic diagram of the format of a second data block transmitted based on D-PHY in the related art
  • FIG. 5 is a schematic structural diagram of a data transmission system based on C-PHY in the related art
  • FIG. 6 is a flowchart of a data transmission method based on C-PHY in the data transmission system in FIG. 5;
  • FIG. 7 is a schematic diagram of the format of a data packet transmitted based on C-PHY in the related art
  • FIG. 8 is a schematic diagram of a layered structure of a data transmission system based on CSI-3 in the related art
  • Fig. 9 is based on the format schematic diagram of the MIPI UniPro L2 layer data frame of the data transmission system in Fig. 8;
  • FIG. 10 is a schematic structural diagram of an HDMI-based data transmission system in the related art
  • FIG. 11 is a flowchart of a data transmission method based on HDMI in the data transmission system in FIG. 10;
  • FIG. 12 is a schematic diagram of the format of a second data block transmitted based on HDMI in the related art
  • FIG. 13 is a schematic diagram of the format of a third data block transmitted based on HDMI in the related art
  • 16 is a schematic diagram of the format of a DP-based link layer (Link Layer) data frame
  • 17 is a schematic diagram of the format of a data frame that implements single-channel FEC at the PHY layer based on DP;
  • FIG. 18a is a schematic communication diagram of a data transmission system provided by some embodiments of the present application.
  • 18b is a schematic diagram of a board-level connection between a first device and a second device provided by some embodiments of the present application;
  • 18c is a schematic diagram of a board-level connection between a first device and a second device provided by other embodiments of the present application;
  • 18d is a flowchart of a data transmission method provided by an embodiment of the present application.
  • FIG. 19 is a schematic structural diagram of a data transmission system provided by some embodiments of the present application.
  • 21 is a schematic diagram of a data format of a training code stream in some embodiments of the present application.
  • FIG. 22 is a schematic diagram of the format of a data block transmitted based on D-PHY in some embodiments of the present application.
  • 24 is a schematic structural diagram of a data transmission system provided by other embodiments.
  • 25 is a flowchart of a data transmission method provided by other embodiments.
  • 26 is a schematic diagram of the format of a data block transmitted based on HDMI in an embodiment of the present application.
  • FIG. 27 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • bit error refers to random errors or burst errors in the received data caused by channels, equipment, etc.
  • packet loss refers to that the data of one or more data packets cannot be transmitted to the destination.
  • bit error rate and packet loss rate can improve the reconstruction quality of the image and video at the receiving end, and make the transmission process of the image and video have the characteristics of low complexity and simple implementation.
  • error detection and correction technology used in the image and video transmission process can be divided into the sending end error detection and correction technology and the receiving end error detection and correction technology according to the link in the communication.
  • error detection and correction techniques may include source coding, channel coding, transmission line transmission, channel decoding and information source decoding, wherein, the source coding belongs to the source processing part, Channel coding, transmission line transmission and channel decoding belong to the channel processing part, and source decoding belongs to the sink processing part.
  • the error detection and correction technology at the transmitting end is a method of adding redundant information during channel coding to enhance the error detection and correction capability of the coded bit stream.
  • the error detection and correction technology at the receiving end is completed based on channel decoding.
  • the decoder approximately restores the lost or erroneous data according to the decoding rules, and does not need to do technical processing at the sending end in advance, such as error compensation in fax images and video error compensation. Error hiding techniques, etc.
  • the error detection and correction technology at the transmitting end the error detection and correction technology in the channel decoding stage is processed in advance at the transmitting end, adding redundant information that can be used for error detection or error correction.
  • the data transmission method provided by the embodiment of the present application uses the error detection and correction technology at the transmitting end to perform error detection and correction processing on the transmission data.
  • CSI-2 is an interface developed by the MIPI organization to transmit image data between the camera chip and the main control chip of an electronic device.
  • CSI-2 is compatible with two port physical layers (Port Physical Layer, PHY for short), namely C-PHY and D-PHY, so CSI-2 corresponds to two different error detection and correction algorithms.
  • PHY Port Physical Layer
  • FIG. 2 is a schematic structural diagram of a D-PHY-based data transmission system in the related art.
  • the data transmission system may include a first device and a second device, the first device includes an image processing unit and a sending device, and the first device includes a transmission device.
  • the second device includes a main processor unit and a receiving device, the transmitting device and the receiving device are communicatively connected through a transmission channel, the image processing unit is communicatively connected with the sending device, and the main processor unit is communicatively connected with the receiving device.
  • the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module.
  • the protocol sending unit includes an error correction code (Error Correction Code, ECC for short) coding module and a clean core cyclic redundancy check (Cyclic Redundancy Check, CRC for short) coding module.
  • ECC Error Correction Code
  • CRC Cyclic Redundancy Check
  • the receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module, and the protocol receiving unit includes a packet header ECC decoding module and a clean core CRC decoding module. Wherein, the PHY layer sending module and the PHY layer receiving module are communicated and connected through a transmission channel.
  • the related art provides a data transmission method based on D-PHY
  • the first device includes a camera module
  • the second device includes a mainboard of a mobile phone
  • the protocol sending unit includes a CSI-2 sending unit
  • the protocol receiving unit includes a CSI-2 receiving unit
  • the PHY layer sending module includes a D-PHY sending module
  • the PHY layer receiving module includes a D-PHY receiving module.
  • FIG. 3 is a flowchart of the data transmission method based on D-PHY in the data transmission system in FIG. 2. As shown in FIG. 3, the method includes:
  • Step 102 The main processor unit configures parameters for the image processing unit.
  • the main board can configure the working parameters of the camera module, so that the camera module can work according to the requirements of the working parameters.
  • the working parameters may include resolution, frame rate, interface rate, and the like.
  • Step 104 The protocol sending unit sends the training code stream to the protocol receiving unit.
  • the protocol sending unit sends the training code stream to the PHY layer sending module
  • the PHY layer sending module sends the training code stream to the PHY layer receiving module through the transmission channel
  • the PHY layer receiving module sends the training code stream to the protocol receiving unit
  • the protocol The receiving unit receives the training code stream and adjusts the parameters adaptively to realize the CSI-2 state machine equalization training process. After the state machine equalization training is implemented, the first device starts to transmit the image data stream.
  • Step 106 The image processing unit collects the image data stream, and sends the collected image data stream to the first format conversion module.
  • Step 108 The first format conversion module converts the encoding format of the image data stream, generates a first data block, and adds a data packet header to the first data block.
  • FIG. 4 is a schematic diagram of the format of the second data block transmitted based on D-PHY in the related art.
  • the first format conversion module (as shown in FIG. 2 ) performs binary encoding format conversion on the image data stream to Form a payload.
  • "Payload” is used to represent the first data block.
  • the data packet header may include a data type identifier (Data Identifier, referred to as Data ID), the number of bytes (16-bit WC) and a virtual channel identifier (Virtual Channel Extension, referred to as VCX).
  • Data ID data type identifier
  • VCX Virtual Channel Extension
  • the number of bytes is used to mark the number of "Payload”
  • WC is the abbreviation of Word Count.
  • the first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit.
  • Step 110 The protocol sending unit performs ECC encoding on the data packet header through the packet header ECC encoding module to generate a first ECC field.
  • the packet header ECC encoding module (as shown in Figure 2) performs ECC encoding on Data ID, WC and VCX through a 6-bit extended Hamming code to generate a first ECC field, where, for example, the ECC field is: 6 -bit field. It should be noted that: the ECC field shown in FIG. 4 is the first ECC field.
  • Step 112 The protocol sending unit performs CRC encoding on the first data block through the clean core CRC encoding module to generate a CRC field.
  • the net core CRC encoding module (as shown in Figure 2) performs CRC encoding on "Payload" through a polynomial to generate a CRC field.
  • the polynomial is, for example, X 16 +X 12 +X 5 +X 0
  • the CRC field is, for example, a 16-bit field
  • the CRC field is “16-bit CRC” in FIG. 4 .
  • Step 114 The protocol sending unit generates a second data block according to the first data block, the data packet header, the first ECC field and the CRC field.
  • the protocol sending unit places the first ECC field and the CRC field at the head and tail of the "Payload” respectively, and places the Data ID, WC and VCX in the packet header at the The designated position of the data packet, and the Start of Transmit (SoT) mark is set at the beginning of the data packet and the End of Transmit (EoT) mark is set at the end of the data packet to form Figure 4 The second data block in the long packet format shown.
  • SoT Start of Transmit
  • EoT End of Transmit
  • Step 116 The protocol sending unit sends the second data block to the PHY layer sending module, the PHY layer sending module sends the second data block to the PHY layer receiving module through the transmission channel, and the PHY layer receiving module sends the second data block to the protocol receiving module. unit.
  • Step 118 The protocol receiving unit performs CRC check on the CRC field in the second data block through the clean core CRC decoding module, and generates a CRC check result.
  • the net-core CRC decoding module (as shown in Figure 2) divides the CRC field in the second data block and the polynomial by modulo 2 to obtain the remainder, which is the CRC check result. If the CRC check result is 0, it indicates that the received "Payload” is correct data; if the CRC check result is not 0, it indicates that the received "Payload” is wrong data.
  • the polynomial may include X 16 +X 12 +X 5 +X 0 .
  • Step 120 The protocol receiving unit performs ECC verification on the data packet header in the second data block through the packet header ECC decoding module, and generates an ECC verification result.
  • the packet header ECC decoding module encodes the Data ID, WC and VCX in the packet header to generate the second ECC field, and performs XOR calculation on the first ECC field and the second ECC field to obtain the ECC check result . If the ECC check result is 0, it indicates that the data packet header is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of the data packet header needs to be corrected; if If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it indicates that an uncorrectable error has occurred in the data packet header.
  • the packet header ECC decoding module can use the same coding rules as the packet header ECC encoding module to perform ECC encoding on the Data ID, WC and VCX in the data packet header, that is, the packet header ECC decoding module can pass 6-bit extended Hamming code to Data ID, WC and VCX. WC and VCX perform ECC encoding to generate the second ECC field.
  • Step 122 If the protocol receiving unit recognizes that the CRC check result is 0 and the ECC check result is 0, it performs unpacking processing on the second data block to generate the first data block.
  • the protocol receiving unit removes the SoT identifier, the EoT identifier, the first ECC field, the CRC field, the Data ID, the WC, and the VCX in the second data block, so that the second data block can be unpacked to obtain the first data block. .
  • the protocol receiving unit sends the unpacked first data block to the second format conversion module.
  • Step 124 The second format conversion module converts the encoding format of the first data block, generates an image data stream, and uploads the image data stream to the main processor unit.
  • the second format conversion module (as shown in FIG. 2 ) converts the first data block to pixel image coding format to generate an image data stream, and uploads the image data stream to the main processor unit.
  • the protocol receiving unit recognizes that the ECC check result is not 0 and the ECC check result indicates that there are 1-bit errors and erroneous bits
  • the protocol receiving unit corrects the erroneous bits of the data packet header, and corrects the second data
  • the block is unpacked to generate a first data block, and then the first data block is converted into a pixel image coding format to generate an image data stream, and the image data stream is uploaded to the main processor unit.
  • the protocol receiving unit recognizes that the CRC check result is not 0 and/or that the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, then The second data block is discarded, skipped directly, or retransmitted. In this case, the developer can determine the processing method for the second data block.
  • FIG. 5 is a schematic structural diagram of a data transmission system based on C-PHY in the related art.
  • the data transmission system may include a first device and a second device.
  • the first device includes an image processing unit and a sending device.
  • the second device includes a main processor unit and a receiving device, the transmitting device and the receiving device are communicatively connected through a transmission channel, the image processing unit is communicatively connected with the sending device, and the main processor unit is communicatively connected with the receiving device.
  • the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module.
  • the protocol sending unit includes a packet header CRC encoding module and a clean core CRC encoding module.
  • the receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module, and the protocol receiving unit includes a packet header CRC decoding module and a clean core CRC decoding module.
  • the PHY layer sending module and the PHY layer receiving module are communicated and connected through a transmission channel.
  • the related art also provides a data transmission method based on C-PHY.
  • the first device includes a camera module
  • the second device includes a mainboard of a mobile phone
  • the protocol sending unit includes a CSI-2 sending unit
  • the protocol receiving unit includes a CSI-2 receiving unit.
  • the PHY layer sending module includes a C-PHY sending module
  • the PHY layer receiving module includes a C-PHY receiving module.
  • FIG. 6 is a flowchart of the data transmission method based on C-PHY in the data transmission system in FIG. 5 . As shown in FIG. 6 , the method includes:
  • Step 202 The main processor unit configures parameters for the image processing unit.
  • Step 204 The protocol sending unit sends the training code stream to the protocol receiving unit.
  • Step 206 The image processing unit collects the image data stream, and sends the collected image data stream to the first format conversion module.
  • steps 202 to 206 For the description of steps 202 to 206, reference may be made to steps 102 to 106, and details are not repeated here.
  • Step 208 The first format conversion module converts the encoding format of the image data stream, generates a first data block, and adds a data packet header to the first data block.
  • FIG. 7 is a schematic diagram of the format of a data packet transmitted based on C-PHY in the related art.
  • the first format conversion module (as shown in FIG. 5 ) performs binary encoding format conversion on the image data stream, to form the first data block "Payload".
  • the packet header can include Data ID, 16-bit WC and VCX.
  • the first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit.
  • Step 210 The protocol sending unit performs CRC encoding on the data packet header through the packet header CRC encoding module to generate a PH-CRC field.
  • the packet header CRC encoding module (as shown in Figure 5) performs CEC encoding on the Data ID, WC and VCX in the data packet through a polynomial to generate a PH-CRC field.
  • the polynomial may include X 16 +X 12 +X 5 +X 0 .
  • Step 212 The protocol sending unit performs CRC encoding on the first data block through the clean core CRC encoding module to generate a PF-CRC field.
  • the clean core CRC encoding module (as shown in Figure 5) performs CRC encoding on "Payload" through a polynomial to generate a PF-CRC field.
  • the polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
  • C-PHY adopts a unique three-line encoding method, that is, three levels are encoded at the same time, if one level is wrongly encoded, the subsequent level encoding will also be wrong, resulting in multi-bit errors. Therefore, in order to enhance data reliability , detects multi-bit errors, and the CRC encoding module can perform CRC encoding and verification on the transmitted data.
  • Step 214 The protocol sending unit generates a second data block according to the first data block, the data packet header, the PH-CRC field, the PF-CRC field and the reserved field (Reserved Field, RES for short).
  • the protocol sending unit places the PH-CRC field and the PF-CRC field at the head and tail of the "Payload" respectively, and sets the Data ID, WC, VCX,
  • the RES and Filler fields are respectively placed at the designated positions of the second data block, and the SoT mark is set at the start position of the second data block and the EoT mark is set at the end position of the second data block, so as to form as shown in FIG. 7 .
  • the second data block in long packet format.
  • Step 216 The protocol sending unit sends the second data block to the PHY layer sending module, the PHY layer sending module sends the second data block to the PHY layer receiving module through the transmission channel, and the PHY layer receiving module sends the second data block to the protocol receiving module. unit.
  • Step 218 The protocol receiving unit performs CRC check on the PH-CRC field in the second data block through the header CRC decoding module, and generates a first CRC check result.
  • the packet header CRC decoding module (as shown in FIG. 7 ) performs modulo-2 division calculation on the PH-CRC field in the second data block and the polynomial to obtain the remainder, which is the first CRC check result.
  • the first CRC check result may be 0 or not.
  • the polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
  • Step 220 The protocol receiving unit performs CRC check on the PF-CRC field in the second data block through the clean core CRC decoding module, and generates a second CRC check result.
  • the net-core CRC decoding module divides the PF-CRC field in the second data block and the polynomial by modulo 2 to obtain the remainder, and the remainder is the second CRC check result.
  • the second CRC check result may be 0 or not.
  • the polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
  • Step 222 If the protocol receiving unit recognizes that the first CRC check result and the second CRC check result are both 0, it unpacks the second data block to generate the first data block.
  • the protocol receiving unit recognizes that the first CRC check result and the second CRC check result are both 0, it indicates that the information of the second data block is completely correct, and can continue to unpack the second data block.
  • the protocol receiving unit removes the SoT identifier, EoT identifier, PH-CRC field, PF-CRC field, Data ID, WC, VCX, RES, and Filler in the second data block, so as to unpack the second data block
  • the processing obtains the first data block.
  • the protocol receiving unit sends the unpacked first data block to the second format conversion module.
  • Step 224 The second format conversion module converts the encoding format of the first data block, generates an image data stream, and uploads the image data stream to the main processor unit.
  • the protocol receiving unit performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the main processor unit.
  • the protocol receiving unit will The second data block is discarded, skipped directly, or retransmitted. In this case, the developer can determine the processing method for the second data block.
  • FIG. 8 is a schematic diagram of a layered structure of a data transmission system based on CSI-3 in the related art.
  • the data transmission system includes a first device and a second device.
  • the first device includes an image processing unit, a sending device, a device management entity (Device Management Entity) and a PHY layer sending module, wherein the image processing unit includes a camera application layer (Camera Application Layer), and the sending device includes a transport layer (Transport) L4 layer, network layer (Network) L3 layer, Data Link layer (Data Link) L2 layer, PHY Adaptor layer (PHY Adaptor) L1.5 layer;
  • the second device includes a main processor unit, a receiving device, a device management entity ( Device Management Entity) and a PHY layer receiving module, wherein the main processor unit includes a host application layer (Host Application Layer), and the receiving device includes a PHY Adaptor layer (PHY Adaptor) L1.5 layer, a data link layer (Data Link)
  • FIG. 9 is a schematic diagram of the format of the MIPI UniPro L2 layer data frame based on the data transmission system in Figure 8, as shown in Figure 8 and Figure 9, for all camera modules in actual use scenarios, on the first device side, when the L3 layer
  • the L2 layer adds the L2 layer header character on the basis of the image data block of the L3 layer, and uses the CCITT CRC-16 algorithm to perform the verification calculation on the image data block of the L3 layer to generate 16-bit CRC check field.
  • the L2 layer data frame also includes the Data Link Layer Control Symbol Identifier (ESC_DL) field, L2 Layer data packet end frame identifier (End of Frame for even L2 SDU, referred to as EOF_EVEN) field, frame sequence number (Frame Sequence Number, referred to as Frame Seq Number) and traffic type (Traffic Class, referred to as TC) field.
  • ESC_DL Data Link Layer Control Symbol Identifier
  • EOF_EVEN L2 Layer data packet end frame identifier
  • frame sequence number Fre Sequence Number, referred to as Frame Seq Number
  • Traffic Class Traffic Class
  • the developer can determine the processing method of the data packet.
  • the C-PHY-based data transmission method shown in FIG. 6 For the flow of the CSI-3-based data transmission method in the related art, reference may be made to the C-PHY-based data transmission method shown in FIG. 6 , and the description will not be repeated here.
  • the data redundancy is small, so that the data redundancy can be reduced. Improve the efficiency of data transmission.
  • the reliable transmission of data cannot be effectively guaranteed for burst errors, and the transmission channel is interfered (for example, by additive noise and random noise) and the bit error rate is high. In this case, data packets will be lost, which will lead to image freezes and distortions, which greatly affects the user experience.
  • HDMI is an interface developed by HDMI Forum for high-definition multimedia transmission, which is mainly used for the transmission of video, images, etc. between devices.
  • HDMI can be applied to multimedia transmission between a first device and a second device inside an electronic device, for example, the first device is, for example, a mainboard of a mobile phone, and the second device is, for example, a display screen of a mobile phone; or, HDMI can be applied to different Multimedia transmission between electronic devices, such as multimedia transmission between the host and the display screen.
  • FIG. 10 is a schematic structural diagram of an HDMI-based data transmission system in the related art.
  • the data transmission system may include a first device and a second device.
  • the first device includes a video data processing unit and a sending device
  • the second device includes a video data processing unit and a sending device.
  • the equipment includes a sink unit and a receiving device, the sending device and the receiving device are communicatively connected through a transmission channel, the video data processing unit is communicatively connected with the sending device, and the load unit is communicatively connected with the receiving device.
  • the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module.
  • the protocol sending unit includes a Transition-minimized Differential Signaling (TMDS) encoding module for Consumer Electronics Control (CEC) and a Forward Error Correction (FEC) encoding module.
  • TMDS Transition-minimized Differential Signaling
  • CEC Consumer Electronics Control
  • FEC Forward Error Correction
  • the receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module, the protocol receiving unit includes a TMDS CEC decoding module and an FEC decoding module, wherein the PHY layer sending module and the PHY layer receiving module are communicated and connected through a transmission channel.
  • FIG. 11 is a flowchart of a data transmission method based on HDMI in the data transmission system in FIG. 10 . As shown in FIG. 11 , the method includes:
  • Step 302 The video data processing unit configures the working parameters of the load unit.
  • the video processing unit can configure the working parameters of the video/image data controller of the display screen, so that the display screen can work according to the requirements of the working parameters.
  • the working parameters may include resolution, frame rate, interface rate, and the like.
  • Step 304 The video data processing unit collects the image or video data stream, and sends the collected image or video data stream to the first format conversion module.
  • Step 306 The first format conversion module converts the encoding format of the image or video data stream, generates a first data block, and adds a data packet header to the first data block.
  • FIG. 12 is a schematic diagram of the format of the second data block transmitted based on HDMI in the related art.
  • the data packet header includes a preamble (Premble), data synchronization information (Sync), control/data information (C/D) and Reserved Field (Rsvd).
  • the first format conversion module adds the preamble (Premble), data synchronization information (Sync), control/data information (C/D) and reserved field (Rsvd) to the first data block (Payload) 's head.
  • the preamble is used to indicate that "Payload” is various types of packet information (Data Island) or video pixel data (Video Data), wherein the content of the packet information includes audio data packets or image information packets.
  • the first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit.
  • the first data block (Payload) may include a command (Commad) or data (Data).
  • Step 308 The protocol sending unit performs ECC encoding on the first data block through the TMDS CEC encoding module to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
  • the TMDS CEC encoding module uses 6-bit extended Hamming code to perform ECC encoding on "Payload” to generate the first ECC field and the parity (Parity) field; the TMDS CEC encoding module uses 16-bit CRC to perform ECC encoding on "Payload” CRC encoding generates a CRC (16-bit CRC) field and a parity (Parity) field.
  • Step 310 The protocol sending unit adds the first ECC field and the CRC field to the end of the first data block to generate a second data block.
  • parity field may also be set after the first ECC field and the CRC field in the second data block.
  • Step 312 The protocol sending unit divides the second data block into multiple FEC data blocks through the FEC encoding module.
  • FIG. 13 is a schematic diagram of the format of a third data block transmitted based on HDMI in the related art.
  • the FEC data block includes a Symbol data block (Super Block Payload).
  • Super Block Payload can include command (Commad) or data (Data).
  • Step 314 The protocol sending unit performs FEC encoding on each FEC data block through the FEC encoding module to generate an FEC check code.
  • the FEC encoding module performs FEC encoding on each FEC data block through the RS code encoding algorithm to generate an FEC check code (RS Block/Parity).
  • Step 316 The protocol sending unit adds the FEC check code to the end of the FEC data block through the FEC encoding module to generate a third data block.
  • the specific format of the third data block formed can be referred to as shown in FIG. 13 , and the third data block also includes a start bit (Start Super Block) field and a number of bytes (RS Block Symbol/Byte) field.
  • Start Super Block Start Super Block
  • RS Block Symbol/Byte number of bytes
  • Step 318 The protocol sending unit sends the third data block to the PHY layer sending module, the PHY layer sending module sends the third data block to the PHY layer receiving module through the transmission channel, and the PHY layer receiving module sends the third data block to the protocol receiving module. unit.
  • Step 320 The protocol receiving unit performs FEC verification on the third data block through the FEC decoding module, and generates an FEC verification result.
  • the FEC decoding module performs FEC check on the third data block by using the RS code decoding algorithm, and generates an FEC check result.
  • FEC verification results include verification success, correctable error results or uncorrectable error results.
  • the correctable error result is the error within the verification capability of the FEC algorithm, and this type of error can be corrected, so that the FEC algorithm can realize the error detection and correction of multi-bit error data;
  • the uncorrectable error result is FEC Errors beyond the capabilities of the algorithm's verification capabilities, this type of erroneous data cannot be corrected.
  • Step 322 if the protocol receiving unit recognizes that the FEC check result includes a correctable error result through the FEC decoding module, the error data of the third data block is corrected and processed, and the protocol receiving unit unpacks the third data block to generate. second data block.
  • the protocol receiving unit removes the start bit (Start Super Block) field, the number of bytes (RS Block Symbol/Byte) field and the FEC check code in the third data block to obtain the second data block.
  • the protocol receiving unit identifies through the FEC decoding module that the FEC verification result includes verification success, indicating that there is no erroneous data in the third data block, it can directly unpack the third data block to generate the second data block.
  • the protocol receiving unit sends the second data block to the TMDS CEC decoding module.
  • the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result through the FEC decoding module, the third data block will be discarded, skipped directly or retransmitted. How data blocks are handled.
  • Step 324 the protocol receiving unit performs CRC check on the CRC field in the second data block by the TMDS CEC decoding module, and generates a CRC check result.
  • the TMDS CEC decoding module performs modulo-2 division calculation on the CRC field in the second data block and the polynomial to obtain the remainder, which is the CRC check result.
  • the CRC check result can be 0 or not.
  • the polynomial may include X 16 +X 12 +X 5 +X 0 .
  • Step 326 The protocol receiving unit performs ECC verification on the first ECC field in the second data block through the TMDS CEC decoding module, and generates an ECC verification result.
  • the TMDS CEC decoding module performs ECC encoding on "Payload" in the second data block to generate a second ECC field, and performs XOR calculation on the first ECC field and the second ECC field to obtain an ECC check result. If the ECC check result is 0, it indicates that the "Payload” is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of "Payload” needs to be corrected ; If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it means that an uncorrectable error has occurred in the "Payload".
  • the TMDS CEC decoding module can use the same encoding rules as the TMDS CEC encoding module to perform ECC encoding on "Payload", that is, the TMDS CEC decoding module can perform ECC encoding on "Payload” through 6-bit extended Hamming code to generate a second ECC field.
  • Step 328 The protocol receiving unit judges whether the CRC check result and the ECC check result are both 0, and if so, go to Step 330; if it is judged to retransmit, go to Step 312.
  • Step 330 The protocol receiving unit depacketizes the second data block to generate the first data block, and sends the first data block to the second format conversion unit.
  • the protocol receiving unit removes the preamble (Premble), data synchronization information (Sync), control/data information (C/D), reserved field (Rsvd), first ECC field, CRC field and A parity (Parity) field is used to obtain the first data block by unpacking the second data block.
  • Premble preamble
  • Sync data synchronization information
  • C/D control/data information
  • Rsvd reserved field
  • first ECC field CRC field
  • a parity field is used to obtain the first data block by unpacking the second data block.
  • Step 332 The second format conversion module converts the encoding format of the first data block, generates an image or video data stream, and uploads the image or video data stream to the load unit.
  • the second format conversion module converts the first data block to pixel image coding format to generate an image or video data stream, and uploads the image or video data stream to the load unit.
  • the protocol receiving unit recognizes that the ECC check result is not 0 and the ECC check result indicates that there are 1-bit errors and erroneous bits, it corrects the erroneous bits of the second data block, and corrects the error bits of the second data block.
  • the two data blocks are unpacked to generate a first data block, and then, the protocol receiving unit converts the first data block to pixel image coding format to generate an image or video data stream, and uploads the image or video data stream to the load unit.
  • the protocol receiving unit recognizes that the CRC check result is not 0 and/or that the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, then The second data block is discarded, skipped directly, or retransmitted. In this case, the developer can determine the processing method for the data packet. If it is determined that the second data block is to be retransmitted, step 312 can be continued. At this time, the protocol receiving unit can return an error notification to the protocol sending unit through the auxiliary channel, informing the protocol sending unit that an error occurs in the second data block and needs to be retransmitted. pass.
  • FIG 14 is a schematic structural diagram of a DP-based data transmission system in the related art. As shown in Figure 14, the difference between the data transmission system in Figure 14 and Figure 10 is: in Figure 14, the TMDS CEC encoding module and the FEC encoding module are located in In the PHY layer sending module, the PHY layer sending module further includes a channel encoding module, the TMDS CEC decoding module and the FEC decoding module are both located in the PHY layer receiving module, and the PHY layer receiving module also includes a channel decoding module.
  • FIG. 15 is a flowchart of a DP-based data transmission method in the related art. As shown in Figure 15, the difference in the process between the data transmission method in Figure 15 and the data transmission method in Figure 11 is:
  • step 310 in FIG. 15 it further includes: step S1, the protocol sending unit performs channel coding on the second data block through the channel coding module to generate the coded second data block, and then in step 312, the coded second data block is divided into for multiple FEC data blocks.
  • channel coding may include 128b/132b coding or 8b/10b coding.
  • step S2 the protocol sending unit performs channel decoding on the first data block through the channel decoding module to generate the decoded first data block.
  • channel decoding may include 128b/132b decoding or 8b/10b decoding.
  • Figure 16 is a schematic diagram of the format of a DP-based link layer (Link Layer) data frame, as shown in Figure 16, Figure 16 shows a plurality of data frames, and the plurality of data frames include a data frame (Link Layer Frame) N-1 , data frame (Link Layer Frame) N and data frame (Link Layer Frame) N+1.
  • Each data frame includes a control data packet (Control Packet) and a transmission data packet (Transport Packet).
  • Control Packet Control Packet
  • Transport Packet Transmission Packet
  • the transport packet in FIG. 16 corresponds to the second data block in FIG. 12 .
  • the transmission data packet has the characteristics of a multi-lane data stream, and both the ECC field and the CRC field insert check bits at the end of the data packet to check and protect the data.
  • the last byte of the data stream is generally mapped to the CRC byte for use.
  • the CRC check bit with only one byte (the lowest bit), the highest bit must be filled with 0 to generate the CRC value, and other CRCs do not need to be filled. .
  • Each CRC used can have a different number of bytes.
  • the Link Layer data frame of DP will be compressed during the data transmission process, so the check fields such as CRC and ECC are all mapped and checked in the Byte data stream.
  • Figure 17 is a schematic diagram of the format of a data frame for implementing single-channel FEC at the PHY layer based on DP. As shown in Figure 17, it shows a data frame obtained after channel coding and FEC coding on the second data block.
  • the data frame It can include FEC data block link layer code (LL Codes for FEC Block), FEC data block parity code (FEC Parity Codes for Block), polarity bit code (CD_ADJ Code, CAJ Code for short) and FEC marker (FEC_PM) ).
  • LL Codes for FEC Block FEC data block link layer code
  • FEC Parity Codes for Block FEC Parity Codes for Block
  • CD_ADJ Code polarity bit code
  • CD_ADJ Code polarity bit code
  • CAJ is the reserved coding polarity bit
  • PM is the marker of the FEC data frame format.
  • the channel decoding module performs the reverse decoding process of the channel encoding module, and performs FEC check and channel decoding on the obtained data frame to generate a second data block.
  • DP implements FEC coding, decoding and error correction at the PHY layer to ensure reliable data transmission.
  • the scheme of the data transmission method based on HDMI and DP in the above-mentioned related art because the FEC algorithm is used to perform error detection and correction processing on the image or video data, the error detection and correction of multi-bit error data can be performed on the image or video data, thereby improving the performance of the image or video data. reliability of data transmission.
  • the data transmission method based on HDMI and DP is only suitable for specific display application scenarios, and cannot be extended to the data reliability transmission of other high-speed data transmission systems.
  • the embodiment of the present application provides a data transmission method.
  • the selected error detection and correction algorithm performs error detection and correction processing on the transmission data during the data transmission process, thereby improving the data transmission efficiency on the basis of ensuring the reliability of data transmission.
  • the technical solutions of the embodiments of the present application can be flexibly extended to data reliability transmission of other high-speed data transmission systems.
  • Fig. 18a is a schematic communication diagram of a data transmission system provided by some embodiments of the present application.
  • the data transmission system includes a first device and a second device, the first device includes a sending device and a first device control interface, and the second The device includes a receiving device and a second device control interface.
  • a plurality of transmission channels and clock channels are set between the sending device and the receiving device, the transmission channels and the clock channels are both unidirectional channels, and the transmission channel can transmit image data from the first device to the second device; the first device controls An auxiliary channel (eg, I 2 C bus) is provided between the interface and the second device control interface, the auxiliary channel is a bidirectional transmission channel, and the auxiliary channel includes a data line SDA and a clock signal line SCL.
  • data can be transmitted between the sending device and the receiving device through a high-speed interface, and data can be transmitted between the first device control interface and the second device control interface through a low-speed interface.
  • the first device and the second device may be different devices, that is, the first device and the second device are two devices that are separate devices.
  • the first device is a camera module
  • the second device is a host
  • the first device is a host
  • the second device is a display screen.
  • the host include, but are not limited to, devices equipped with iOS, Android, Microsoft or other operating systems, optionally, the host is a mobile phone, a tablet computer, a wearable device, a smart TV, or a personal computer.
  • the data transmission system is provided in an electronic device, that is, the electronic device includes a first device and a second device.
  • the first device is a camera module
  • the second device is a motherboard
  • the first device is a motherboard
  • the second device is a display screen.
  • electronic devices include, but are not limited to, devices powered by iOS, Android, Microsoft, or other operating systems, and alternatively, electronic devices include mobile phones, tablet computers, wearable devices, security devices, smart TVs, or personal computers.
  • the security equipment may include security camera equipment.
  • Fig. 18b is a schematic diagram of a board-level connection between a first device and a second device provided by some embodiments of the present application.
  • the mainboard includes an Application Processor (AP), and the mainboard is connected to the camera module through a connector (Band to Board, BTB) and a flexible printed circuit (Flexible Printed Circuit, FPC).
  • AP Application Processor
  • the BTB is mainly used to connect the camera module and the main board.
  • the BTB includes multiple CSI-2 signal pins; the FPC is full of CSI-2 signal transmission lines to cooperate with the BTB to complete the connection between the camera module and the main board.
  • Fig. 18c is a schematic diagram of a board-level connection between a first device and a second device provided by other embodiments of the present application.
  • the mobile phone Including the main board
  • the main board includes the AP
  • the display screen (not shown in the figure) includes the mobile phone display driver IC (Display Driver IC, DDIC for short) module.
  • the main board is connected with the DDIC module through BTB and FPC.
  • the BTB is mainly used to connect the DDIC module and the main board.
  • the BTB includes multiple DSI-2 signal pins; the FPC is full of DSI-2 signal transmission lines to cooperate with the BTB to complete the connection between the FFIC module and the main board.
  • the DSI-2 protocol is a protocol interface developed by MIPI to connect the SoC and the DDIC.
  • an embodiment of the present application provides a data transmission method, the method comprising:
  • the first device encodes the acquired transmission data through the first error detection and correction algorithm, generates first encoded data, and sends the first encoded data to the second device .
  • the second device receives the encoded data; if it is determined that the conditions for enabling the first algorithm are met, the encoded data is verified by the first error detection and correction algorithm to generate transmission data; The error algorithm verifies the encoded data and generates the transmission data.
  • the second error detection and correction algorithm is different from the first error detection and correction algorithm.
  • FIG. 18d is a flowchart of a data transmission method provided by an embodiment of the present application. As shown in FIG. 18d , the method includes:
  • step 100a the first device determines that the environmental parameter of the transmission channel meets the first algorithm opening condition or meets the second algorithm opening condition. If the first algorithm opening condition is met, step 100b is executed; if the second algorithm opening condition is met, step 100b is executed. 100c.
  • judging that the environment parameter of the transmission channel complies with the enabling condition of the first algorithm or the enabling condition of the second algorithm may be performed by the first device or the second device.
  • step 100a is performed by the first device.
  • step 100a is performed by the second device, if the second device determines that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, it returns the first environmental parameter state to the first device.
  • the first environmental parameter state is, for example, the first error.
  • the code rate state or the first packet loss rate state, and the first environment parameter state is used to indicate that the environment parameter complies with the opening condition of the first algorithm; if the second device determines that the environment parameter of the transmission channel meets the opening condition of the second algorithm, Then, the second environment parameter state is returned to the first device.
  • the second environment parameter state is, for example, the second bit error rate state or the second packet loss rate state.
  • the second environment parameter state is used to indicate that the environment parameter conforms to the first Second algorithm enable condition.
  • Step 100b The first device encodes the acquired transmission data through a first error detection and correction algorithm, generates first encoded data, sends the first encoded data to the second device, and proceeds to step 100d.
  • Step 100c The first device encodes the acquired transmission data through a second error detection and correction algorithm, generates second encoded data, and sends the second encoded data to the second device.
  • Step 100d the second device receives the encoded data.
  • step 100e if the second device determines that the first algorithm enabling condition is met, the encoded data is verified by the first error detection and correction algorithm to generate transmission data; An error correction algorithm verifies the encoded data to generate transmission data.
  • the first device may acquire the environmental parameters of the transmission channel, and determine that the environmental parameters of the transmission channel meet the first algorithm enabling condition or the second algorithm enabling condition.
  • the first device acquiring the environmental parameters of the transmission channel may include: the first device sends the first sequence and the second sequence to the second device in sequence, for the second device to count the number of bits of the correct second sequence received, and the first sequence is used to implement state machine equalization training; receive the number of bits of the correct second sequence sent by the second device; The bit error rate is calculated according to the correct number of bits of the second sequence sent by the second device and the total number of bits of the second sequence sent by the second device.
  • the first device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the first device judging whether the bit error rate is greater than or equal to the first threshold; A threshold value indicates that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the bit error rate is less than the first threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm.
  • the first device acquiring the environment parameter of the transmission channel includes: the first device reading the system transmission rate from the speed cut state register.
  • the first device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the first device judging whether the system transmission rate is greater than or equal to the second threshold; Two thresholds, indicating that the environmental parameters of the transmission channel meet the opening conditions of the first algorithm; if it is determined that the system transmission rate is less than the second threshold, it indicates that the environmental parameters of the transmission channel meet the opening conditions of the second algorithm. For example, for this case, see step 506 and step 508 in Fig. 23 .
  • the first device acquiring the environmental parameter of the transmission channel includes: the first device sends a test data packet to the second device, and records the sent test data packet The number of data packets; the number of correct test data packets received according to the statistics returned by the second device; the packet loss is calculated according to the number of correct test data packets and the number of sent test data packets Rate.
  • the first device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the first device judging whether the packet loss rate is greater than or equal to the third threshold; The three thresholds indicate that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the packet loss rate is less than the third threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm. For example, for this situation, please refer to step 606 and step 612 in FIG. 25 .
  • the second device may also acquire environmental parameters of the transmission channel, and determine that the environmental parameters of the transmission channel meet the first algorithm enabling condition or the second algorithm enabling condition.
  • the second device receives the first sequence and the second sequence sent in sequence by the first device, and the first sequence is used to implement state machine equalization training; Calculate the bit error rate according to the received correct number of bits of the second sequence and the total number of bits of the second sequence sent; if the bit error rate meets the first algorithm enabling condition, send the first device to the first device.
  • a bit error rate status the first bit error rate status is used to indicate that the bit error rate meets the enabling condition of the first algorithm; if the bit error rate meets the enabling condition of the second algorithm, the first bit error rate status is sent to the first The device sends a second bit error rate status, where the second bit error rate status is used to indicate that the bit error rate complies with the condition for enabling the second algorithm.
  • the second device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the second device judging whether the bit error rate is greater than or equal to the first threshold; A threshold value indicates that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the bit error rate is less than the first threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm.
  • the first device can know that the bit error rate meets the enabling condition of the first algorithm according to the first bit error rate state, and can use the first error detection and correction algorithm to perform encoding; the first device can know the bit error according to the second bit error rate state If the rate meets the enabling condition of the second algorithm, the second error detection and correction algorithm can be used for encoding.
  • the rate meets the enabling condition of the second algorithm, the second error detection and correction algorithm can be used for encoding.
  • steps 406 to 416 and step 446 in FIG. 20 please refer to steps 406 to 416 and step 446 in FIG. 20 .
  • the second device receives the test data packet sent by the first device; according to the number of received correct test data packets and the sent test data The number of packets, and the packet loss rate is calculated; if the packet loss rate meets the conditions for enabling the first algorithm, the first packet loss rate status is sent to the first device, and the first packet loss rate status is used to indicate The packet loss rate complies with the enabling condition of the first algorithm; if the packet loss rate meets the enabling condition of the second algorithm, a second packet loss rate status is sent to the first device, the first packet loss rate status It is used to indicate that the packet loss rate complies with the condition for enabling the second algorithm.
  • the second device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the second device judging whether the packet loss rate is greater than or equal to the third threshold; The three thresholds indicate that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the packet loss rate is less than the third threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm.
  • the first device can learn that the packet loss rate conforms to the enabling condition of the first algorithm according to the first packet loss rate state, and can use the first error detection and correction algorithm for encoding; the first device can learn the packet loss rate according to the second packet loss rate state If the rate meets the enabling condition of the second algorithm, the second error detection and correction algorithm can be used for encoding.
  • the method further includes: collecting raw data by the first device; converting the encoding format of the raw data to generate the transmission data.
  • the original data includes but is not limited to: image data stream, video data stream, instruction data, storage data or network data, wherein the network data is, for example, 2G/3G/4G/5G data or WLAN data.
  • the first device performing encoding format conversion on the original data to generate the transmission data includes: performing binary encoding format conversion on the original data to generate the transmission data.
  • the first device executes the step of collecting raw data; or after the first device determines that the environmental parameters of the transmission channel meet the first algorithm enabling conditions; After an algorithm is turned on, the first device performs the step of collecting raw data.
  • the first device performs the step of collecting raw data.
  • step 510 and step 538 in FIG. 23 refer to step 510 and step 538 in FIG. 23 .
  • the first device performs the step of collecting the original data; Or after the second device determines that the environmental parameter of the transmission channel meets the first algorithm enabling condition, and returns the first bit error rate state to the first device, the first device performs the step of collecting the original data.
  • the second device determines that the environmental parameter of the transmission channel meets the first algorithm enabling condition, and returns the first bit error rate state to the first device, the first device performs the step of collecting the original data.
  • step 418 and step 448 in FIG. 20 please refer to step 418 and step 448 in FIG. 20 .
  • the acquisition of the original data is performed before the first device encodes the acquired transmission data by using the first error detection and correction algorithm and before encoding the acquired transmission data by using the second error detection and correction algorithm.
  • the first device does not need to wait for the environmental parameters of the transmission channel to meet the first algorithm enabling condition or the judgment result that meets the second algorithm enabling condition, and can collect raw data in real time. For example, in this case, refer to step 614 and step 650 in FIG. 25 .
  • judging that the environmental channel parameters meet the conditions for enabling the first algorithm may further include: the bit error rate is greater than or equal to a first threshold, the system transmission rate is greater than or equal to a second threshold, and the packet loss rate is greater than or equal to or any combination equal to the third threshold.
  • judging that the transmission channel environment parameters meet the conditions for enabling the second algorithm may further include: the bit error rate is less than a first threshold, the system transmission rate is less than a second threshold, and the packet loss rate is less than a third threshold any combination of .
  • the first error detection and correction algorithm includes at least two error detection and correction algorithms
  • the second error detection and correction algorithm includes at least one error detection and correction algorithm
  • the first error detection and correction algorithm includes The number of error detection and correction algorithms is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
  • the first error detection and correction algorithm includes an FEC algorithm, a CRC algorithm and an ECC algorithm (for example, steps 420 to 444 in FIG. 20 and steps 512 to 524 in FIG. 23 ); or , the first error detection and correction algorithm includes an FEC algorithm and a CRC algorithm; or, the first error detection and correction algorithm includes an FEC algorithm and an ECC algorithm.
  • the transmission data includes the first data block, and the first encoded data includes the fourth data block.
  • the FEC algorithm includes but is not limited to the Reed-Solomon codes (Reed-solomon codes, RS code for short) algorithm.
  • the second error detection and correction algorithm includes an FEC algorithm (for example, steps 654 to 666 in FIG. 25 ); or, the second error detection and correction algorithm includes a CRC algorithm; or, The second error detection and correction algorithm includes an ECC algorithm; or, the second error detection and correction algorithm includes a CRC algorithm and an ECC algorithm (for example, steps 450 to 468 in FIG. 20 and steps 540 to 540 in FIG. 23 ) step 558).
  • the transmission data includes the first data block, and the first encoded data includes the third data block.
  • the transmission data includes the first data block, and the first encoded data includes the fifth data block.
  • the first encoded data includes an indication field, and the indication field of the first encoded data is used to indicate that the environment parameter complies with the condition for enabling the first algorithm; and/or the second encoded data
  • the data includes an indication field, and the indication field of the second encoded data is used to indicate that the environmental parameter complies with the condition for enabling the second algorithm.
  • the indication field is, for example, 1.
  • determining by the second device that the conditions for enabling the first algorithm are met specifically includes: determining that the encoded data includes an indication field; determining that the enabling conditions for the second algorithm are met by the second device specifically includes: determining that the encoded data contains an indication field; Indication field is not included.
  • the indication field is, for example, 1.
  • determining by the second device that the conditions for enabling the first algorithm are met specifically includes: determining by the second device that the encoded data does not include an indication field; determining by the second device that the enabling conditions for the second algorithm are met specifically includes: determining that the second device meets the enabling conditions for the second algorithm.
  • the out-coded data includes an indication field.
  • both the first encoded data and the second encoded data include an indication field
  • the indication field in the first encoded data and the indication field in the second encoded data may be set to different values.
  • the indication field in the first encoded data is a first value, for example, the first value is 1, and the indication field in the second encoded field is a second value, and the second value is, for example, 0.
  • determining by the second device that the conditions for enabling the first algorithm are met specifically includes: the second device determining that the indication field in the encoded data is 1; and determining by the second device that the conditions for enabling the second algorithm are met may specifically include: the second The device determines that the indication field in the encoded data is 0.
  • the first value is used to indicate that the environmental parameter complies with the enabling condition of the first algorithm
  • the second value is used to indicate that the environmental parameter complies with the enabling condition of the second algorithm.
  • the indication fields include reserved fields or newly added fields.
  • the indication field is, for example, a bit error rate confirmation field (as shown in step 428 in FIG. 20 ), a transmission rate confirmation field (as shown in step 520 in FIG. 23 ), or a packet loss rate confirmation field ( Step 622 in Figure 25).
  • the checking of the encoded data by using the first error detection and correction algorithm includes: if it is determined that the encoded data includes an indication field, performing FEC check on the encoded data, and the indication field is used to indicate The environment parameter conforms to the condition for enabling the first algorithm; CRC check and/or ECC check is performed on the encoded data after the FEC check.
  • CRC check and/or ECC check is performed on the encoded data after the FEC check.
  • the checking of the encoded data by the first error detection and correction algorithm includes: performing FEC checking on the encoded data; if it is determined that the encoded data includes an indication field, performing FEC checking on the encoded data.
  • CRC check and/or ECC check the indication field is used to indicate that the environment parameter complies with the enabling condition of the first algorithm.
  • the indication field is used to indicate that the environment parameter complies with the enabling condition of the first algorithm.
  • the first device selects a first error detection and correction algorithm to encode the transmission data according to the environmental parameters of the transmission channel meeting the conditions for enabling the first algorithm to generate the first encoded data, or the first
  • the device selects the second error detection and correction algorithm to encode the transmission data to generate the second encoded data according to the environmental parameters of the transmission channel that meet the conditions for enabling the second algorithm, and the second device receives the encoded data.
  • the first error detection and correction algorithm verifies the encoded data to generate transmission data. If it is determined that the conditions for enabling the second algorithm are met, the second error detection and correction algorithm is used to verify the encoded data to generate transmission data.
  • the error detection algorithm performs error detection and correction processing on the transmission data in the data transmission process, thereby improving the data transmission efficiency on the basis of ensuring the reliability of the data transmission.
  • FIG. 19 is a schematic structural diagram of a data transmission system provided by some embodiments of the present application.
  • the data transmission system is, for example, a MIPI CSI-2 D-PHY data transmission system, and the data transmission system adopts CSI-2 Protocol Architecture.
  • the system includes a first device and a second device, the first device includes an image processing unit and a sending device, and the second device includes a main processor unit and a receiving device.
  • the first device is a camera module
  • the image processing unit is a camera sensor (Sensor)
  • the sending module is an interface circuit
  • the second device is a motherboard, then the main processor unit is an AP, and the receiving module is an interface circuit.
  • the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module.
  • the protocol sending unit includes an ECC encoding module, a CRC encoding module and an FEC encoding module.
  • the receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module.
  • the protocol receiving unit includes a packet header ECC decoding module, a clean core CRC decoding module and an FEC decoding module, wherein the PHY layer transmitting module and the PHY layer receiving module are between the
  • the communication connection is made through a transmission channel, and a transmission channel is used as an example for description in FIG. 19 .
  • the protocol sending unit includes a CSI-2 sending unit, the protocol receiving unit includes a CSI-2 receiving unit, the PHY layer sending module includes a D-PHY sending module, and the PHY layer receiving module includes a D-PHY receiving module.
  • FIG. 20 is a flowchart of a data transmission method provided by some embodiments of the present application. As shown in FIG. 20 , the method includes:
  • Step 402 The second device configures the working parameters of the first device.
  • the main processor unit of the second device configures the working parameters of the image processing unit.
  • the main board can configure the working parameters of the camera module, so that the camera module can work according to the requirements of the working parameters.
  • the working parameters may include resolution, frame rate, interface rate, and the like.
  • Step 404 The first device sends the first sequence to the second device.
  • FIG. 21 is a schematic diagram of the data format of the training code stream in some embodiments of the present application.
  • the first device when the link is in a high speed (High Speed, HS for short) transmission state, the first device sends the data to the second device through the transmission channel A training stream to complete the training process of the system.
  • the protocol sending unit (as shown in Figure 19) sends the training code stream to the protocol receiving unit through the transmission channel.
  • the protocol sending unit sends the training code stream to the PHY layer sending module, the PHY layer sending module sends the training code stream to the PHY layer receiving module through the transmission channel, and then the PHY layer receiving module sends the training code stream to the protocol receiving unit to Implement the CSI-2 state machine equalization training process.
  • the training code stream includes a data type sequence, an equalization sequence, a first sequence, a second sequence and a third sequence.
  • the first device sends a data type sequence to the second device, and the data type sequence includes "Control Word", and "Control Word” can indicate that the training code stream is a control packet, For example, the Control Word" may be 0101.
  • the first device sends an equalization (Equalization) sequence to the second device.
  • the first device sends a first sequence to the second device, and the first sequence may include a pseudo-random binary number sequence (Pseudo-Random Binary Sequence, PRBS for short) 15 sequence, for example, the first device can send 1 million PRBS15 sequences to the second device to implement the state machine equalization training process.
  • PRBS pseudo-random Binary Sequence
  • Step 406 The first device sends the second sequence to the second device.
  • the first device sends a second sequence to the second device, and the second sequence may include a PRBS31 sequence.
  • the first device may send a second sequence to the second device. 1 million PRBS31 sequences.
  • Step 408 The first device sends the third sequence to the second device.
  • the first device sends a third sequence to the second device, and the third sequence may include an idle (IDLE) sequence.
  • the second device can directly discard the IDLE sequence, ignore the IDLE sequence, and keep the link recovery clock locked all the time.
  • Step 410 The second device counts the received bits of the correct second sequence.
  • the second device During the time period when the first device sends the IDLE sequence, the second device counts the correct number of bits of the second sequence.
  • the protocol receiving unit (as shown in FIG. 19 ) counts the received bits of the correct second sequence.
  • Step 412 The second device calculates the bit error rate according to the correct number of bits of the second sequence and the total number of bits of the second sequence sent by the first device.
  • the second device calculates the bit error rate. Specifically, the second device calculates the bit error rate by using the formula 1-n/N, where n is the correct number of bits of the second sequence, and N is the total number of bits of the second sequence.
  • the protocol receiving unit (as shown in Figure 19) calculates the bit error rate.
  • Step 414 The second device determines whether the bit error rate is greater than or equal to the first threshold, and if so, executes step 416; if not, executes step 446.
  • the second device determines whether the bit error rate is greater than or equal to the first threshold.
  • the first threshold is for example: 1e-12, 1e-15 or 1e-10.
  • the protocol receiving unit (as shown in FIG. 19 ) judges whether the bit error rate is greater than or equal to the first threshold.
  • steps 406 to 416 and step 446 can be replaced by: the first device sends the first sequence and the second sequence to the second device in sequence, so that the second device can count the received correct The number of bits of the second sequence of The bit error rate is calculated from the number of bits of the sequence and the total number of bits of the second sequence sent. The first device determines whether the bit error rate is greater than or equal to the first threshold.
  • Step 416 The second device returns the first bit error rate status to the first device.
  • the second device determines that the bit error rate is greater than or equal to the first threshold, it indicates that the bit error rate is relatively large. At this time, the second device generates the first bit error rate state corresponding to the judgment result that the bit error rate is greater than or equal to the first threshold.
  • Bit Error Rate State referred to as BER State
  • the first bit error rate state may be 1.
  • the protocol receiving unit of the second device returns the first bit error rate status to the protocol sending unit of the first device through the auxiliary channel (AUX).
  • the time period for sending the third sequence can be used for calculating and judging the bit error rate, so that the steps of calculating and judging the bit error rate can be completed in the process of sending the training code stream.
  • Step 418 The first device collects the image data stream, and converts the encoding format of the image data stream to generate a first data block.
  • the image processing unit collects the image data stream, and sends the collected image data stream to the first format conversion module (as shown in Figure 19), and the first format conversion module performs encoding format conversion on the image data stream .
  • Step 420 The first device adds a data packet header to the first data block.
  • FIG. 22 is a schematic diagram of the format of a data block transmitted based on D-PHY in some embodiments of the present application.
  • the first format conversion module (as shown in FIG. 19 ) performs binary encoding format conversion on the image data stream, to form the "Payload".
  • the packet header can include Data ID, 16-bit WC and VCX.
  • the first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit (as shown in FIG. 19 ).
  • Step 422 The first device performs ECC encoding on the data packet header to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
  • the protocol sending unit performs ECC encoding on the data packet header through the packet header ECC encoding module (as shown in FIG. 19 ) to generate the first ECC field.
  • the packet header ECC encoding module performs ECC encoding on the Data ID, WC, and VCX through a 6-bit extended Hamming code to generate a first ECC field, where the ECC field is a 6-bit field. It should be noted that the ECC field shown in FIG. 22 includes the first ECC field.
  • the protocol sending unit performs CRC coding on the first data block through the clean core CRC coding module (as shown in Figure 19) to generate a CRC field.
  • the net core CRC encoding module performs CRC encoding on "Payload" through a polynomial to generate a CRC field.
  • the polynomial is, for example, X 16 +X 12 +X 5 +X 0
  • the CRC field is a 16-bit field.
  • Step 424 The first device inserts the first ECC field and the CRC field into the packet header and the packet trailer of the first data block to generate a second data block.
  • the protocol sending unit places the first ECC field and the CRC field at the header and end of the "Payload" packet, respectively.
  • Data ID, WC, and VCX are located in the second data block, respectively. the specified location.
  • the ECC field shown in FIG. 22 is the first ECC field.
  • Step 426 The first device performs FEC encoding on different data segments of the second data block, generates an FEC check code corresponding to each data segment, and places each FEC check code at the end of the corresponding data segment.
  • the FEC encoding module divides the second data block into multiple data segments, for example, multiple data segments
  • the segment may include second data blocks Part 0 to Part N-1.
  • the FEC encoding module performs FEC encoding on different data segments of the second data block, generates an FEC parity (FEC Parity) corresponding to each data segment, and places each FEC parity at the end of the corresponding data segment.
  • FEC Parity FEC parity
  • Step 428 The first device adds an indication field before the second data block to generate a third data block.
  • the indication field is a newly added field, and the indication field is, for example, a bit error rate confirmation (Bit Error Rate Ensure, BER EN for short) field.
  • the bit error rate confirmation field is used to indicate that the bit error rate is greater than or equal to the first threshold.
  • the protocol sending unit adds a BER EN field before the second data block through the FEC encoding module (as shown in Figure 19).
  • the value of the bit error rate confirmation field is, for example, 1.
  • the indication field is a reserved field.
  • step 428 may include: the first device sets the value of the reserved field, so that the reserved field is used to indicate that the bit error rate is greater than or equal to the first threshold.
  • the value of the reserved field is, for example, 1.
  • Step 430 The first device sets the SoT flag at the start position of the third data block and the EoT flag at the end position of the third data block to form a fourth data block.
  • the protocol sending unit (as shown in FIG. 19 ) sets the SoT flag at the start position of the third data block and the EoT at the end position of the third data block to form the fourth data block.
  • Step 432 The first device sends the fourth data block to the second device.
  • the protocol sending unit sends the fourth data block to the PHY layer sending module (shown in Figure 19), and the PHY layer sending module sends the fourth data block to the PHY through the transmission channel Layer receiving module (as shown in Figure 19), the PHY layer receiving module sends the fourth data block to the protocol receiving unit (as shown in Figure 19).
  • Step 434 The second device removes the SoT and EoT of the fourth data block to generate a third data block.
  • the protocol reception unit removes the SoT and EoT of the fourth data block to generate the third data block.
  • Step 436 The second device parses the third data block.
  • the protocol receiving unit parses the third data block.
  • Step 438 If the second device parses the indication field, it performs FEC detection and error correction check on the third data block to generate a second data block.
  • the protocol receiving unit parses the indication field, the judgment result that the bit error rate is greater than or equal to the first threshold can be obtained through the indication field, and then it is determined that the first error detection and correction algorithm is adopted, and the FEC decoding module ( As shown in FIG. 19 ), the FEC decoding module performs FEC verification on the third data block through the RS code decoding algorithm to generate an FEC verification result.
  • FEC verification results include verification success, correctable error results or uncorrectable error results.
  • the protocol receiving unit If the protocol receiving unit recognizes that the FEC check result includes a correctable error result, it corrects the erroneous data of the third data block, and unpacks the third data block to generate the second data block.
  • the protocol receiving unit If the protocol receiving unit recognizes that the FEC verification result includes verification success, indicating that there is no erroneous data in the third data block, it can directly unpack the third data block to generate the second data block.
  • the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result, the third data block will be discarded, skipped directly or retransmitted. In this case, the developer can determine the processing of the third data block. Way.
  • Step 440 The second device performs CRC check on the CRC field in the second data block to generate a CRC check result.
  • the protocol receiving unit (as shown in FIG. 19 ) divides the CRC field in the second data block and the polynomial by modulo 2 through the clean core CRC decoding module to obtain the remainder, which is the CRC check result. If the CRC check result is 0, it indicates that the received "Payload” is correct data; if the CRC check result is not 0, it indicates that the received "Payload” is wrong data.
  • the polynomial may include X 16 +X 12 +X 5 +X 0 .
  • Step 442 The second device performs ECC verification on the data packet header in the second data block, and generates an ECC verification result.
  • the protocol receiving unit performs ECC encoding on the Data ID, WC and VCX in the packet header through the packet header ECC decoding module (as shown in Figure 19) to generate the second ECC field, and the first ECC field and the second ECC The field is XORed to obtain the ECC check result. If the ECC check result is 0, it indicates that the data packet header is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of the data packet header needs to be corrected; if If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it indicates that an uncorrectable error has occurred in the data packet header.
  • the packet header ECC decoding module can use the same coding rules as the packet header ECC encoding module to perform ECC encoding on the Data ID, WC and VCX in the data packet header, that is, the packet header ECC decoding module can pass 6-bit extended Hamming code to Data ID, WC and VCX. WC and VCX perform ECC encoding to generate the second ECC field.
  • Step 444 if the second device recognizes that the verification result is 0 and the verification result is 0, it performs unpacking processing on the second data block to generate the first data block, and performs encoding format conversion on the first data block to generate the image data stream, Process ends.
  • the protocol receiving unit (as shown in FIG. 19 ) recognizes that the verification result is 0 and the verification result is 0, the packet header of the second data block is removed to obtain the first data block.
  • the second format conversion module (as shown in FIG. 19 ) converts the encoding format of the first data block to generate an image data stream, uploads the image data stream to the main processor unit, and uploads the image data stream to the main processor unit. Specifically, the second format conversion module performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the main processor unit.
  • Step 446 The second device returns the second bit error rate status to the first device.
  • the second device determines that the bit error rate is less than the first threshold, it indicates that the bit error rate is small. At this time, the second device generates a second bit error rate state (Bit Error Rate corresponding to the judgment result that the bit error rate is less than the first threshold). State, referred to as BER State), for example, the second bit error rate state may be 0.
  • the protocol receiving unit of the second device returns the second bit error rate status to the protocol sending unit of the first device through the auxiliary channel (AUX).
  • Step 448 The first device collects the image data stream, and converts the encoding format of the image data stream to generate a first data block.
  • the image processing unit collects the image data stream, and sends the collected image data stream to the first format conversion module (as shown in Figure 19), and the first format conversion module performs encoding format conversion on the image data stream , generate the first data block.
  • Step 450 The first device adds a data packet header to the first data block.
  • the first format conversion module (as shown in FIG. 19 ) performs binary encoding format conversion on the image data stream to form “Payload”.
  • the packet header can include Data ID, 16-bit WC and VCX.
  • the first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit (as shown in FIG. 19 ).
  • Step 452 The first device performs ECC encoding on the data packet header to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
  • the protocol sending unit encodes the data packet header through the packet header ECC encoding module (as shown in FIG. 19 ) to generate the first ECC field.
  • the packet header ECC encoding module performs ECC encoding on the Data ID, WC, and VCX through a 6-bit extended Hamming code to generate a first ECC field, where the ECC field is a 6-bit field. It should be noted that the ECC field shown in FIG. 22 includes the first ECC field.
  • the protocol sending unit performs CRC coding on the first data block through the clean core CRC coding module (as shown in Figure 19) to generate a CRC field.
  • the net core CRC encoding module performs CRC encoding on "Payload" through a polynomial to generate a CRC field.
  • the polynomial is, for example, X 16 +X 12 +X 5 +X 0
  • the CRC field is a 16-bit field.
  • Step 454 The first device inserts the first ECC field and the CRC field into the packet header and the packet trailer of the first data block to generate a second data block.
  • the protocol sending unit places the first ECC field and the CRC field at the header and end of the "Payload" packet, respectively.
  • Data ID, WC, and VCX are located in the second data block, respectively. the specified location.
  • Step 456 The first device sets the SoT flag at the start position of the second data block and the EoT flag at the end position of the second data block to form a fifth data block.
  • the protocol sending unit (as shown in FIG. 19 ) sets the SoT flag at the beginning of the second data block and the EoT flag at the end of the second data block to form a fifth data block.
  • Step 458 The first device sends the fifth data block to the second device.
  • the protocol sending unit sends the fifth data block to the PHY layer sending module (shown in Figure 19), and the PHY layer sending module sends the fifth data block to the PHY through the transmission channel Layer receiving module (as shown in Figure 19), the PHY layer receiving module sends the fifth data block to the protocol receiving unit (as shown in Figure 19).
  • Step 460 The second device removes the SoT and EoT of the fifth data block to generate a second data block.
  • the protocol reception unit removes the SoT and EoT of the fifth data block to generate the second data block.
  • Step 462 The second device parses the second data block.
  • the protocol receiving module parses the second data block through the FEC decoding module.
  • Step 464 If the second device does not parse out the indication field, it performs CRC check on the CRC field in the second data block to generate a CRC check result.
  • the protocol receiving unit does not parse the indication field, it obtains the judgment result that the bit error rate is less than the first threshold, and then determines that the second error detection and correction algorithm is used, and activates the clean core CRC decoding module (as shown in the figure). 19), CRC check and ECC check are performed by the clean core CRC decoding module.
  • the second device does not parse out the indication field, it can also perform step 466 first, and then perform the CRC check on the CRC field in the second data block in step 464 to generate CRC check result steps.
  • the protocol receiving unit (as shown in FIG. 19 ) divides the CRC field in the second data block and the polynomial by modulo 2 through the clean core CRC decoding module to obtain the remainder, which is the CRC check result. If the CRC check result is 0, it indicates that the received "Payload” is correct data; if the CRC check result is not 0, it indicates that the received "Payload” is wrong data.
  • the polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
  • Step 466 The second device performs ECC verification on the data packet header in the second data block, and generates an ECC verification result.
  • the protocol receiving unit performs ECC encoding on the Data ID, WC and VCX in the packet header through the packet header ECC decoding module (as shown in Figure 19) to generate the second ECC field, and the first ECC field and the second ECC The field is XORed to obtain the ECC check result. If the ECC check result is 0, it indicates that the data packet header is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of the data packet header needs to be corrected; if If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it indicates that an uncorrectable error has occurred in the data packet header.
  • the packet header ECC decoding module can use the same coding rules as the packet header ECC encoding module to perform ECC encoding on the Data ID, WC and VCX in the data packet header, that is, the packet header ECC decoding module can pass 6-bit extended Hamming code to Data ID, WC and VCX. WC and VCX perform ECC encoding to generate the second ECC field.
  • Step 468 If the second device recognizes that the verification result is 0 and the verification result is 0, it unpacks the second data block to generate a first data block, and performs encoding format conversion on the first data block to generate an image data stream.
  • the protocol receiving unit (as shown in FIG. 19 ) recognizes that the verification result is 0 and the verification result is 0, the packet header of the second data block is removed to obtain the first data block.
  • the second format conversion module converts the encoding format of the first data block to generate an image data stream, uploads the image data stream to the main processor unit, and uploads the image data stream to the main processor unit. Specifically, the second format conversion module performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the main processor unit.
  • Steps 420 to 444 in FIG. 20 can be replaced with: the encoding scheme using the FEC algorithm and the CRC algorithm; or the encoding scheme using the FEC algorithm and the ECC algorithm.
  • Steps 450 to 468 in FIG. 20 can be replaced with: a scheme of performing verification through an FEC algorithm; or a scheme of performing verification through a CRC algorithm; or a scheme of performing verification through an ECC algorithm.
  • the bit error rate is obtained by detecting the transmission channel environment, and when the bit error rate is large, a combination of the FEC algorithm, the CRC algorithm and the ECC algorithm is selected to detect and correct the transmission data in the data transmission process.
  • Error processing realizes error detection and correction of multi-bit error data, thereby improving the reliability of data transmission; when the bit error rate is small, the combination of CRC algorithm and ECC algorithm is selected to detect and correct the transmission data during the data transmission process. , which avoids the situation of large data redundancy during error detection and correction processing, thereby improving the data transmission efficiency.
  • Using the data transmission method of this embodiment improves data transmission efficiency on the basis of ensuring data transmission reliability.
  • multi-bit error correction can be implemented, thereby improving the reliability of data transmission.
  • FIG. 23 is a flowchart of a data transmission method provided by other embodiments of the present application. As shown in FIG. 23 , the difference between FIG. 23 and the data transmission method shown in FIG. 20 is: Error detection and correction algorithm or second error detection and correction algorithm, the difference steps can be as follows:
  • Step 504 The first device sends the first sequence to the second device.
  • the first device sends a data type sequence to the second device, where the data type sequence includes "Control Word", and "Control Word” may indicate that the training code stream is a control packet, for example, the "Control Word” may be 0101. Then, the first device sends an equalization (Equalization) sequence to the second device. Next, the first device sends a first sequence to the second device, the first sequence may include a PRBS15 sequence, for example, the first device may send 1 million PRBS15 sequences to the second device to implement a state machine equalization training process. Since this embodiment does not need to calculate the bit error rate in the future, it is unnecessary to send the second sequence and the third sequence in the future, thereby improving the training efficiency.
  • the data type sequence includes "Control Word”
  • Control Word may indicate that the training code stream is a control packet, for example, the "Control Word” may be 0101.
  • the first device sends an equalization (Equalization) sequence to the second device.
  • the first device sends a first sequence to the second device, the first sequence
  • the protocol sending unit (as shown in FIG. 19 ) sends the first sequence to the protocol receiving unit through the transmission channel.
  • Step 506 The first device reads the system transmission rate from the speed cut state register.
  • the protocol sending unit (shown in Figure 19) reads the system transfer rate from the speed cut status register.
  • Step 508 The first device determines whether the system transmission rate is greater than or equal to the second threshold, and if so, executes step 510; if not, executes step 538.
  • the protocol sending unit determines whether the system transmission rate is greater than or equal to the second threshold.
  • the second threshold is for example: 16Gbps, 32Gbps, 8Gbps, 28Gbps, 56Gbps, 10Gbps or 40Gbps.
  • step 402 for step 502 .
  • steps 510 to 536 may refer to steps 418 to 444 .
  • the indication field includes a transmission rate confirmation (Transport Rate Ensure, referred to as TR EN) field, and the transmission rate confirmation field is used to indicate that the system transmission rate is greater than or equal to the second threshold, and the transmission rate confirmation field
  • TR EN Transmission Rate Ensure
  • the transmission rate confirmation field is used to indicate that the system transmission rate is greater than or equal to the second threshold
  • the transmission rate confirmation field The value is 1, for example.
  • the indication field is a reserved field.
  • step 520 may include: the first device sets the value of the reserved field, so that the reserved field is used to indicate that the system transmission rate is greater than or equal to the second threshold, and the value of the reserved field is For example, 1. .
  • steps 538 to 558 may refer to steps 448 to 448 .
  • the first device directly reads the system transmission rate from the speed-cut state register, and selects a suitable error detection and correction algorithm according to the transmission rate, without obtaining the bit error rate by sending the second sequence, reducing the need for The frequent interaction process between the first device and the second device improves the training efficiency of the system.
  • FIG. 24 is a schematic structural diagram of a data transmission system provided by other embodiments.
  • the data transmission system is, for example, an HDMI data transmission system.
  • the data transmission system may include a first device and a second device.
  • the first device Including a video data processing unit and a sending device
  • the second device includes a load (sink) unit and a receiving device
  • the sending device and the receiving device are communicatively connected through a transmission channel
  • the video data processing unit is communicatively connected with the sending device
  • the load unit is communicatively connected with the receiving device. .
  • the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module.
  • the protocol sending unit includes a TMDS CEC encoding module, an FEC encoding module and a channel encoding module.
  • the receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module.
  • the protocol receiving unit includes a TMDS CEC decoding module, an FEC decoding module and a channel decoding module, wherein the PHY layer sending module and the PHY layer receiving module are transmitted through the transmission module.
  • Channel communication connection includes a TMDS CEC decoding module, an FEC decoding module and a channel decoding module, wherein the PHY layer sending module and the PHY layer receiving module are transmitted through the transmission module. Channel communication connection.
  • FIG. 25 is a flowchart of a data transmission method provided by other embodiments. As shown in FIG. 25 , the method includes:
  • Step 602 The first device configures working parameters for the second device.
  • the video data processing unit of the first device configures working parameters for the load unit of the second device.
  • the main board can configure the working parameters of the display module, so that the display module can work according to the requirements of the working parameters.
  • the working parameters may include resolution, frame rate, interface rate, and the like.
  • Step 604 The first device sends the first sequence to the second device.
  • the first device sends a data type sequence to the second device, where the data type sequence includes "Control Word", and "Control Word” may indicate that the training code stream is a control packet, for example, the "Control Word” may be 0101. Then, the first device sends an equalization (Equalization) sequence to the second device. Next, the first device sends a first sequence to the second device, the first sequence may include a PRBS15 sequence, for example, the first device may send 1 million PRBS15 sequences to the second device to implement a state machine equalization training process. Since this embodiment does not need to calculate the bit error rate in the future, it is unnecessary to send the second sequence and the third sequence in the future, thereby improving the training efficiency.
  • the data type sequence includes "Control Word”
  • Control Word may indicate that the training code stream is a control packet, for example, the "Control Word” may be 0101.
  • the first device sends an equalization (Equalization) sequence to the second device.
  • the first device sends a first sequence to the second device, the first sequence
  • the protocol sending unit (as shown in Figure 24) sends the first sequence to the protocol receiving unit through the transmission channel.
  • Step 606 The first device sends a test data packet to the second device, and records the number of the sent test data packets.
  • test data packets may include application layer data packets or control data packets.
  • the protocol sending unit of the first device (as shown in FIG. 24 ) records the number of sent test data packets through the register.
  • Step 608 The second device counts the number of correct test data packets received, and returns the counted number of correct test data packets to the first device.
  • the protocol receiving unit of the second device (as shown in FIG. 24 ) counts the number of correct test packets received, and returns the correct number of test packets to the protocol sending unit of the first device through the auxiliary channel.
  • Step 610 The first device calculates the packet loss rate according to the number of correct test data packets and the number of sent test data packets.
  • the first device calculates the bit error rate by using the formula 1-m/M, where m is the number of correct test data packets, and N is the number of sent test data packets.
  • the protocol sending unit (as shown in Figure 24) calculates the packet loss rate.
  • Step 612 The first device determines whether the packet loss rate is greater than or equal to the third threshold, and if so, executes step 616; if not, executes step 652.
  • the protocol sending unit determines whether the packet loss rate is greater than or equal to the third threshold.
  • the packet loss rate is, for example: 0.1% to 1%.
  • steps 606 to 612 in this embodiment may be replaced with: the second device receives the test data packet sent by the first device; The number of data packets, and the packet loss rate is calculated; if the packet loss rate meets the conditions for enabling the first algorithm, the first packet loss rate status is sent to the first device, and the first packet loss rate status is used for Indicates that the packet loss rate complies with the enabling condition of the first algorithm; if the packet loss rate meets the enabling condition of the second algorithm, a second packet loss rate status is sent to the first device, and the first packet loss rate The status is used to indicate that the packet loss rate complies with the condition for enabling the second algorithm.
  • the second device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the second device judging whether the packet loss rate is greater than or equal to the third threshold; The three thresholds indicate that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the packet loss rate is less than the third threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm.
  • Step 614 The first device collects an image or video data stream, and performs encoding format conversion on the image data stream to generate a first data block.
  • the video data processing unit collects the image or video data stream, and sends the collected image or video data stream to the first format conversion module (as shown in FIG. 24 ).
  • step 614 may be performed after step 604 .
  • Step 616 The first device adds a data packet header to the first data block.
  • the first format conversion module (as shown in FIG. 24 ) performs binary encoding format conversion on the image or video data stream to form “Payload”.
  • FIG. 26 is a schematic diagram of the format of a data block transmitted based on HDMI in an embodiment of the present application.
  • the data packet header includes a preamble (Premble), data synchronization information (Sync), and control/data information (C/D) and reserved fields (Rsvd).
  • the protocol sending unit adds a preamble (Premble), data synchronization information (Sync), control/data information (C/D) and Rsvd to the header of the data block (Payload).
  • the preamble (Premble) is used to indicate that "Payload” is various types of packet information (Data Island) or video pixel data (Video Data), wherein the content of the packet information includes audio data packets or image information packets.
  • Step 618 The first device performs ECC encoding on the first data block to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
  • the protocol sending unit uses the 6-bit extended Hamming code to perform ECC encoding on "Payload” through the TMDS CED encoding module to generate the first ECC field and the parity (Parity) field; the TMDS CED encoding module uses a 16-bit CRC pair "Payload” performs CRC encoding to generate a CRC (16-bit CRC) field and a parity (Parity) field.
  • the ECC field shown in FIG. 26 is the first ECC field.
  • Step 620 The first device adds the first ECC field and the CRC field to the end of the first data block.
  • the protocol transmission unit adds the first ECC field and the CRC field to the end of "Payload".
  • Step 622 The first device adds an indication field to the header of the first data block to generate a second data block.
  • the indication field is a newly added field, and the indication field is, for example, a packet loss rate confirmation field (Packet Loss Rate Ensure, PLR EN for short).
  • the packet loss rate confirmation field is used to indicate that the packet loss rate is greater than or equal to the third threshold.
  • the specific format of the generated second data block can be referred to as shown in FIG. 26 .
  • the value of the packet loss rate confirmation field is, for example, 1.
  • a parity (Parity) field may also be set after the first ECC field and the CRC field in the second data block.
  • the indication field is a reserved field.
  • step 622 may include: the first device sets a value of the reserved field, so that the reserved field is used to indicate that the packet loss rate is greater than or equal to the first threshold.
  • the value of the reserved field is, for example, 1.
  • Step 624 The first device performs channel coding on the second data block to generate an encoded second data block.
  • the protocol sending unit performs channel coding on the second data block through the channel coding module to generate the coded second data block.
  • Step 626 The first device divides the second data block into multiple FEC data blocks.
  • the FEC data block includes a Symbol data block (Super Block Payload).
  • the protocol sending unit divides the second data block into multiple FEC data blocks through the FEC encoding module (as shown in FIG. 24 ).
  • Step 628 The first device performs FEC encoding on each FEC data block to generate an FEC check code.
  • the protocol sending unit uses the RS code encoding algorithm to perform FEC encoding on each FEC data block through the FEC encoding module to generate an FEC check code (RS Block/Parity).
  • Step 630 The first device adds the FEC check code to the end of the FEC data block to generate a third data block.
  • the specific format of the third data block formed can be referred to as shown in FIG. 13 , and the third data block also includes a start bit (Start Super Block) field and a number of bytes (RS Block Symbol/Byte) field.
  • Start Super Block Start Super Block
  • RS Block Symbol/Byte number of bytes
  • Step 632 The first device sends the third data block to the second device.
  • the protocol sending unit (as shown in Figure 24) sends the third data block to the PHY layer sending module (as shown in Figure 24), and the PHY layer sending module sends the third data block to the PHY layer receiving module through the transmission channel (as shown in Figure 24). 24), the PHY layer receiving module sends the third data block to the protocol receiving unit.
  • Step 634 The second device performs FEC detection and error correction check on the third data block to generate a second data block.
  • the protocol receiving unit uses the RS code decoding algorithm to perform FEC check on the third data block through the FEC decoding module (as shown in Figure 24), and generates an FEC check result.
  • FEC verification results include verification success, correctable error results or uncorrectable error results.
  • the protocol receiving unit If the protocol receiving unit recognizes that the FEC check result includes a correctable error result, it corrects the erroneous data of the third data block, and unpacks the third data block to generate the second data block.
  • the third data block can be directly unpacked to generate the second data block.
  • the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result, the third data block will be discarded, skipped directly or retransmitted. In this case, the developer can determine the processing of the third data block. Way.
  • Step 636 The second device parses the second data block.
  • the protocol receiving unit parses the second data block.
  • Step 638 If the second device parses the indication field, it performs CRC check on the CRC field in the second data block to generate a CRC check result.
  • the protocol receiving unit parses the indication field, obtains the judgment result that the packet loss rate is greater than or equal to the third threshold, and then determines that the first error detection and correction algorithm is used, and activates the TMDS CEC decoding module (as shown in the figure). 24) by the TMDS CEC decoding module, the CRC field in the second data block and the polynomial are divided by modulo 2 to obtain the remainder, and the remainder is the CRC check result.
  • the CRC check result can be 0 or not.
  • the polynomial may include X 16 +X 12 +X 5 +X 0 .
  • Step 640 If the second device parses out the indication field, it performs ECC check on the first ECC field in the second data block to generate an ECC check result.
  • the TMDS CEC decoding module (as shown in Figure 24) performs ECC encoding on "Payload" in the second data block to generate a second ECC field, and performs XOR calculation on the first ECC field and the second ECC field to obtain the ECC check result . If the ECC check result is 0, it indicates that the "Payload” is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of "Payload” needs to be corrected ; If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it means that an uncorrectable error has occurred in the "Payload".
  • the TMDS CEC decoding module can use the same encoding rules as the TMDS CEC encoding module to perform ECC encoding on "Payload", that is, the TMDS CEC decoding module can perform ECC encoding on "Payload” through 6-bit extended Hamming code to generate a second ECC field.
  • step 640 may be performed first, and then step 638 may be performed.
  • Step 642 The second device determines whether the CRC check result and the ECC check result are both 0, and if so, executes step 644; if it determines retransmission, executes step 626.
  • the protocol receiving unit judges whether the CRC check result and the ECC check result are both 0.
  • Step 644 The second device unpacks the second data block to generate the first data block.
  • the protocol receiving unit (as shown in FIG. 24 ) unpacks the second data block to generate the first data block.
  • the protocol protocol receiving unit removes the preamble (Premble), data synchronization information (Sync), control/data information (C/D), reserved field (Rsvd), and packet loss rate confirmation field (PLR) in the second data block EN)), the first ECC field, the CRC field, and the parity (Parity) field, so as to realize the first data block by depacketizing the second data block.
  • Premble preamble
  • Sync data synchronization information
  • C/D control/data information
  • Rsvd reserved field
  • PLR packet loss rate confirmation field
  • Step 646 The second device performs channel decoding on the first data block to generate the decoded first data block.
  • the protocol receiving unit performs channel decoding on the first data block through the channel decoding module (as shown in FIG. 24 ) to generate the decoded first data block.
  • Step 648 The second device converts the encoding format of the first data block to generate an image or video data stream, and the process ends.
  • the second format conversion module (as shown in FIG. 24 ) performs coding format conversion on the first data block, generates an image or video data stream, and uploads the image or video data stream to the load unit (as shown in FIG. 24 ). Specifically, the second format conversion module performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the load unit.
  • the second device recognizes that the ECC check result is not 0 and the ECC check result indicates that there are 1-bit errors and erroneous bits, it corrects the erroneous bits of the second data block, and corrects the error bits of the second data block.
  • Two data blocks are unpacked to generate a first data block, then channel decoding is performed on the first data block to generate a decoded first data block, and pixel image coding format conversion is performed on the first data block to generate an image or video data stream.
  • the second device recognizes that the ECC verification result is not 0 and/or that the ECC verification result is not 0 and the verification result indicates that there are more than 2-bit errors, it will The second data block is discarded, skipped directly or retransmitted. In this case, the developer can determine the processing method of the data packet. If it is determined that the second data block is to be retransmitted, step 626 may be continued.
  • Step 650 The first device collects an image or video data stream, and performs encoding format conversion on the image or video data stream to generate a first data block.
  • step 650 may be performed after step 604 .
  • the first format conversion module (as shown in FIG. 24 ) performs binary encoding format conversion on the image or video data stream to form “Payload”.
  • Step 652 The first device performs channel coding on the first data block to generate an encoded first data block.
  • the protocol sending unit (as shown in FIG. 24 ) performs channel coding on the first data block through the channel coding module to generate the coded first data block.
  • Step 654 The first device divides the first data block into multiple FEC data blocks.
  • Step 656 The first device performs FEC encoding on each FEC data block to generate an FEC check code.
  • Step 658 The first device adds the FEC check code to the end of the FEC data block to generate a fourth data block.
  • Step 660 The first device sends the fourth data block to the second device.
  • Step 662 The second device parses the fourth data block.
  • Step 664 If the second device fails to parse out the indication field, it performs FEC detection and error correction check on the fourth data block to generate the first data block.
  • the protocol receiving unit does not parse the indication field, obtain the judgment result that the packet loss rate is less than the third threshold, and then determine to use the second error detection and correction algorithm, and use the RS code decoding algorithm through the FEC decoding module.
  • FEC verification is performed on the fourth data block to generate an FEC verification result.
  • FEC verification results include verification success, correctable error results or uncorrectable error results.
  • the protocol receiving unit identifies that the FEC check result includes a correctable error result, it corrects the erroneous data of the fourth data block, and unpacks the fourth data block to generate the first data block.
  • the protocol receiving unit If the protocol receiving unit recognizes that the FEC verification result includes verification success, indicating that there is no erroneous data in the fourth data block, it can directly unpack the third data block to generate the first data block.
  • the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result, the fourth data block will be discarded, skipped directly or retransmitted. In this case, the developer can determine the processing of the fourth data block. Way.
  • Step 666 The second device unpacks the fourth data block to generate the first data block.
  • Step 668 The second device performs channel decoding on the first data block to generate a decoded first data block.
  • Step 670 The second device converts the encoding format of the first data block to generate an image or video data stream.
  • the protocol receiving unit converts the encoding format of the first data block, generates an image or video data stream, and uploads the image or video data stream to the load unit (as shown in FIG. 24 ).
  • Steps 616 to 646 in FIG. 25 can be replaced with: the encoding scheme using the FEC algorithm and the CRC algorithm; or the encoding scheme using the FEC algorithm and the ECC algorithm.
  • Steps 654 to 666 in FIG. 25 can be replaced with: a scheme of performing verification by CRC algorithm and ECC algorithm; or, a scheme of performing verification by CRC algorithm; or, a scheme of performing verification by ECC algorithm.
  • the packet loss rate is obtained by detecting the transmission channel environment, and when the packet loss rate is relatively large, a combination of the FEC algorithm, the CRC algorithm and the ECC algorithm is selected to detect and correct the transmission data in the data transmission process.
  • Error processing realizes error detection and correction of multi-bit error data, thereby improving the reliability of data transmission; when the packet loss rate is small, the FEC algorithm is selected to perform error detection and correction processing on the transmission data during data transmission, avoiding detection and correction.
  • the data redundancy is relatively large during error processing, thereby improving the data transmission efficiency.
  • Using the data transmission method of this embodiment improves data transmission efficiency on the basis of ensuring data transmission reliability.
  • An embodiment of the present application further provides a first device, where the first device may be a terminal device or a circuit device built in the terminal device.
  • the device may be used to perform the functions/steps in the above method embodiments.
  • the first device is a host, and the host can use an electronic device as shown in Figure 27 below.
  • the embodiment of the present application further provides a second device, where the second device may be a terminal device or a circuit device built in the terminal device.
  • the device may be used to perform the functions/steps in the above method embodiments.
  • the second device is a host, and the host can use an electronic device as shown in Figure 27 below.
  • FIG. 27 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • the electronic device 900 includes a processor 910 and a transceiver 920 .
  • the electronic device 900 may further include a memory 930 .
  • the processor 910, the transceiver 920 and the memory 930 can communicate with each other through an internal connection path to transmit control and/or data signals. Invoke and run the computer program.
  • the electronic device 900 may further include an antenna 940 for transmitting the wireless signal output by the transceiver 920.
  • the above-mentioned processor 910 and the memory 930 can be combined into a processing device, and more commonly, they are independent components, and the processor 910 is used to execute the program codes stored in the memory 930 to realize the above-mentioned functions.
  • the memory 930 may also be integrated in the processor 910 , or be independent of the processor 910 .
  • the electronic device 900 may further include one or more of an input unit 960, a display unit 970, an audio circuit 980, a camera 990, a sensor 901, etc., the audio The circuit may also include a speaker 982, a microphone 984, and the like.
  • the display unit 970 may include a display screen
  • the above electronic device 900 may further include a power supply 950 for providing power to various devices or circuits in the terminal device.
  • the electronic device 900 shown in FIG. 27 can implement each process of the method embodiment shown in FIG. 20 , FIG. 23 or FIG. 25 .
  • the operations and/or functions of each unit in the electronic device 900 are respectively to implement the corresponding processes in the foregoing method embodiments.
  • the processor 910 in the electronic device 900 shown in FIG. 27 may be a system on a chip (SOC), and the processor 910 may include a central processing unit (CPU), and may further Including other types of processors, the CPU may be referred to as the main CPU.
  • SOC system on a chip
  • CPU central processing unit
  • Each part of the processor cooperates to implement the previous method flow, and each part of the processor can selectively execute a part of the software driver.
  • each part of the processors or processing units inside the processor 910 can cooperate to implement the previous method process, and the corresponding software programs of each part of the processors or processing units can be stored in the memory 930 .
  • the present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes the data shown in FIG. 20 , FIG. 23 or FIG. 25 The various steps in the transfer method.
  • the present application also provides a computer program product containing instructions, when the computer program product is run on a computer or any one of at least one processor, causing the computer to perform data transmission as shown in FIG. 20 , FIG. 23 or FIG. 25 steps in the method.
  • the present application also provides a chip including a processor.
  • the processor is used to read and run the computer program stored in the memory, so as to execute the corresponding operations and/or processes performed by the data transmission method provided in this application.
  • the chip further includes a memory, the memory and the processor are connected to the memory through a circuit or a wire, and the processor is used for reading and executing the computer program in the memory.
  • the chip further includes a communication interface, and the processor is connected to the communication interface.
  • the communication interface is used to receive data and/or information to be processed, and the processor acquires the data and/or information from the communication interface and processes the data and/or information.
  • the communication interface may be an input-output interface.
  • the involved processor 910 may include, for example, a central processing unit (CPU), a microprocessor, a microcontroller or a digital signal processor, and may also include a GPU, an NPU, and an ISP.
  • CPU central processing unit
  • microprocessor a microcontroller or a digital signal processor
  • GPU graphics processing unit
  • NPU an NPU
  • ISP an ISP
  • Necessary hardware accelerators or logic processing hardware circuits may also be included, such as application-specific integrated circuits (ASICs), or one or more integrated circuits used to control the execution of the programs of the technical solution of the present application.
  • ASICs application-specific integrated circuits
  • the processor may have the functionality to operate one or more software programs, which may be stored in the memory.
  • the memory can be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types of storage devices that can store information and instructions
  • the dynamic storage device can also be electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or may also be capable of carrying or storing desired program code in the form of instructions or data structures and capable of Any other medium accessed by a computer, etc.
  • “at least one” refers to one or more, and “multiple” refers to two or more.
  • “And/or”, which describes the association relationship of the associated objects means that there can be three kinds of relationships, for example, A and/or B, which can indicate the existence of A alone, the existence of A and B at the same time, and the existence of B alone. where A and B can be singular or plural.
  • the character “/” generally indicates that the associated objects are an “or” relationship.
  • “At least one of the following” and similar expressions refer to any combination of these items, including any combination of single or plural items.
  • At least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple.
  • any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Detection And Prevention Of Errors In Transmission (AREA)

Abstract

Provided are a data transmission method and system, and a computer-readable storage medium. The method comprises: if an environmental parameter of a transmission channel meets a first algorithm enabling condition, encoding acquired transmission data by means of a first error detection and correction algorithm, so as to generate first encoded data, and sending the first encoded data to a second device; and if the environmental parameter of the transmission channel meets a second algorithm enabling condition, encoding the acquired transmission data by means of a second error detection and correction algorithm, so as to generate second encoded data, and sending the second encoded data to the second device, wherein the second error detection and correction algorithm is different from the first error detection and correction algorithm. In the embodiments of the present application, the data transmission efficiency is improved while also ensuring the data transmission reliability.

Description

数据传输方法、系统和计算机可读存储介质Data transmission method, system and computer readable storage medium
本申请要求于2020年10月15日提交中国专利局、申请号为202011106012.4、申请名称为“数据传输方法、系统和计算机可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application with the application number 202011106012.4 and the application title "Data Transmission Method, System and Computer-readable Storage Medium" filed with the China Patent Office on October 15, 2020, the entire contents of which are incorporated by reference in this application.
技术领域technical field
本申请涉及通信技术领域,具体地涉及一种数据传输方法、系统和计算机可读存储介质。The present application relates to the field of communication technologies, and in particular, to a data transmission method, system, and computer-readable storage medium.
背景技术Background technique
随着通信技术的发展,电子设备的应用对图像和视频处理的要求越来越高。在图像和视频传输过程中,需要通过检纠错技术对传输数据进行检纠错处理,以保证数据传输的可靠性。With the development of communication technology, the application of electronic equipment has higher and higher requirements for image and video processing. In the process of image and video transmission, it is necessary to perform error detection and correction processing on the transmission data through error detection and correction technology to ensure the reliability of data transmission.
但是,相关技术中还没有一种数据传输方法能够实现在保证数据传输可靠性的基础上提高数据传输效率。However, there is no data transmission method in the related art that can improve the data transmission efficiency on the basis of ensuring the reliability of the data transmission.
发明内容SUMMARY OF THE INVENTION
有鉴于此,本申请提供一种数据传输方法、系统和计算机可读存储介质,用于实现在保证数据传输可靠性的基础上提高数据传输效率。In view of this, the present application provides a data transmission method, system, and computer-readable storage medium, which are used to improve data transmission efficiency on the basis of ensuring data transmission reliability.
第一方面,本申请实施例提供了一种数据传输方法,应用于第一设备,所述方法包括:In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a first device, and the method includes:
若传输通道的环境参数符合第一算法开启条件,通过第一检纠错算法对获取的传输数据进行编码,生成第一编码数据,并将所述第一编码数据发送至第二设备;If the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, encode the acquired transmission data through the first error detection and correction algorithm, generate first encoded data, and send the first encoded data to the second device;
若传输通道的环境参数符合第二算法开启条件,通过第二检纠错算法对获取的传输数据进行编码,生成第二编码数据,并将所述第二编码数据发送至第二设备,所述第二检纠错算法与所述第一检纠错算法不同。If the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, the acquired transmission data is encoded by the second error detection and correction algorithm, second encoded data is generated, and the second encoded data is sent to the second device. The second error detection and correction algorithm is different from the first error detection and correction algorithm.
在一种可能的实现方式中,还包括:获取传输通道的环境参数。In a possible implementation manner, the method further includes: acquiring environmental parameters of the transmission channel.
在一种可能的实现方式中,所述传输通道的环境参数包括误码率;所述获取传输通道的环境参数包括:In a possible implementation manner, the environmental parameter of the transmission channel includes a bit error rate; the obtaining the environmental parameter of the transmission channel includes:
向所述第二设备依次发送第一序列和第二序列,以供所述第二设备统计接收到的正确的第二序列的比特数,所述第一序列用于实现状态机均衡训练;Send the first sequence and the second sequence to the second device in sequence, so that the second device can count the number of bits of the correct second sequence received, and the first sequence is used to implement state machine equalization training;
接收所述第二设备发送的正确的第二序列的比特数;receiving the correct number of bits of the second sequence sent by the second device;
根据所述第二设备发送的正确的第二序列的比特数和发送的第二序列的总比特数计算出误码率。The bit error rate is calculated according to the correct number of bits of the second sequence sent by the second device and the total number of bits of the second sequence sent by the second device.
在一种可能的实现方式中,若所述传输通道的环境参数符合第一算法开启条件以及若 所述传输通道的环境参数符合第二算法开启条件,所述方法还包括:In a possible implementation, if the environmental parameter of the transmission channel meets the first algorithm opening condition and if the environmental parameter of the transmission channel meets the second algorithm opening condition, the method further includes:
采集原始数据;collect raw data;
对所述原始数据进行编码格式转换,生成所述传输数据。Convert the encoding format to the original data to generate the transmission data.
在一种可能的实现方式中,所述传输通道的环境参数包括系统传输速率;所述获取传输通道的环境参数包括:In a possible implementation manner, the environment parameter of the transmission channel includes a system transmission rate; the obtaining the environment parameter of the transmission channel includes:
从切速状态寄存器读取所述系统传输速率。The system transfer rate is read from the Cutoff Status Register.
在一种可能的实现方式中,所述传输通道的环境参数包括丢包率;所述获取传输通道的环境参数包括:In a possible implementation manner, the environment parameter of the transmission channel includes a packet loss rate; the obtaining the environment parameter of the transmission channel includes:
向第二设备发送测试数据包,并记录发送的所述测试数据包的个数;Send a test data packet to the second device, and record the number of the sent test data packet;
接收第二设备返回的统计出的接收到的正确的测试数据包的个数;Receive the number of correct test data packets received according to statistics returned by the second device;
根据正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率。Calculate the packet loss rate according to the number of correct test packets and the number of sent test packets.
在一种可能的实现方式中,所述通过第一检纠错算法对获取的传输数据进行编码之前以及所述通过第二检纠错算法对获取的传输数据进行编码之前,还包括:In a possible implementation manner, before the encoding of the acquired transmission data by the first error detection and correction algorithm and before the encoding of the acquired transmission data by the second error detection and correction algorithm, the method further includes:
采集原始数据;collect raw data;
对所述原始数据进行编码格式转换,生成所述传输数据。Convert the encoding format to the original data to generate the transmission data.
在一种可能的实现方式中,所述传输通道环境参数包括误码率、系统传输速率和所述丢包率中之一或其任意组合;In a possible implementation manner, the transmission channel environment parameter includes one of a bit error rate, a system transmission rate, and the packet loss rate or any combination thereof;
所述传输通道环境参数符合第一算法开启条件包括:所述误码率大于或等于第一阈值、所述系统传输速率大于或等于第二阈值以及所述丢包率大于或等于第三阈值中之一或其任意组合;The transmission channel environment parameter meeting the first algorithm enabling condition includes: the bit error rate is greater than or equal to a first threshold, the system transmission rate is greater than or equal to a second threshold, and the packet loss rate is greater than or equal to a third threshold one or any combination thereof;
所述传输通道环境参数符合第二算法开启条件包括:所述误码率小于第一阈值、所述系统传输速率小于第二阈值以及所述丢包率小于第三阈值中之一或其任意组合。The transmission channel environment parameter meeting the condition for enabling the second algorithm includes: the bit error rate is less than the first threshold, the system transmission rate is less than the second threshold, and the packet loss rate is less than one of the third threshold or any combination thereof .
在一种可能的实现方式中,所述第一检纠错算法包括至少二个检纠错算法,第二检纠错算法包括至少一个检纠错算法,所述第一检纠错算法中的检纠错算法的数量大于所述第二检纠错算法中的检纠错算法的数量。In a possible implementation manner, the first error detection and correction algorithm includes at least two error detection and correction algorithms, the second error detection and correction algorithm includes at least one error detection and correction algorithm, and the first error detection and correction algorithm includes at least one error detection and correction algorithm. The number of error detection and correction algorithms is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
在一种可能的实现方式中,所述第一检纠错算法包括前向纠错FEC算法、净核循环冗余校验CRC算法和包头错误纠正码ECC算法;或者In a possible implementation manner, the first error detection and correction algorithm includes a forward error correction (FEC) algorithm, a clean core cyclic redundancy check (CRC) algorithm, and a packet header error correction code ECC algorithm; or
所述第一检纠错算法包括FEC算法和CRC算法;或者The first error detection and correction algorithm includes an FEC algorithm and a CRC algorithm; or
所述第一检纠错算法包括FEC算法和ECC算法。The first error detection and correction algorithm includes an FEC algorithm and an ECC algorithm.
在一种可能的实现方式中,所述第二检纠错算法包括FEC算法;或者In a possible implementation manner, the second error detection and correction algorithm includes an FEC algorithm; or
所述第二检纠错算法包括CRC算法;或者The second error detection and correction algorithm includes a CRC algorithm; or
所述第二检纠错算法包括ECC算法;或者The second error detection and correction algorithm includes an ECC algorithm; or
所述第二检纠错算法包括CRC算法和ECC算法。The second error detection and correction algorithm includes a CRC algorithm and an ECC algorithm.
在一种可能的实现方式中,所述第一编码数据包括指示字段,所述指示字段用于指示所述环境参数符合所述第一算法开启条件。In a possible implementation manner, the first encoded data includes an indication field, where the indication field is used to indicate that the environmental parameter complies with the condition for enabling the first algorithm.
在一种可能的实现方式中,所述指示字段包括保留字段或新增字段。In a possible implementation manner, the indication field includes a reserved field or a newly added field.
在一种可能的实现方式中,所述第一设备包括摄像头模组,第二设备包括主板或者电子设备;或者In a possible implementation manner, the first device includes a camera module, and the second device includes a motherboard or an electronic device; or
所述第一设备包括主板、主机或者电子设备,所述第二设备包括显示屏。The first device includes a motherboard, a host or an electronic device, and the second device includes a display screen.
第二方面,本申请实施例提供了一种数据传输方法,应用于第二设备,所述方法包括:In a second aspect, an embodiment of the present application provides a data transmission method, which is applied to a second device, and the method includes:
若接收到第一设备发送的第一编码数据,通过第一检纠错算法对所述第一编码数据进行校验,生成传输数据;If the first encoded data sent by the first device is received, the first encoded data is checked by a first error detection and correction algorithm to generate transmission data;
若接收到第一设备发送的第二编码数据,通过第二检纠错算法对所述第二编码数据进行校验,生成传输数据。If the second encoded data sent by the first device is received, the second encoded data is verified by a second error detection and correction algorithm to generate transmission data.
在一种可能的实现方式中,所述传输通道的环境参数包括误码率;所述方法还包括:In a possible implementation manner, the environmental parameter of the transmission channel includes a bit error rate; the method further includes:
接收第一设备依次发送的第一序列和第二序列,所述第一序列用于实现状态机均衡训练;receiving a first sequence and a second sequence sequentially sent by the first device, where the first sequence is used to implement state machine equalization training;
根据接收到的正确的第二序列的比特数和发送的第二序列的总比特数计算出误码率;Calculate the bit error rate according to the number of bits of the correct second sequence received and the total number of bits of the second sequence sent;
若所述误码率符合第一算法开启条件时,向所述第一设备发送第一误码率状态,所述第一误码率状态用于表示所述误码率符合所述第一算法开启条件;If the bit error rate complies with the enabling condition of the first algorithm, a first bit error rate status is sent to the first device, where the first bit error rate status is used to indicate that the bit error rate conforms to the first algorithm open condition;
若所述误码率符合第二算法开启条件时,向所述第一设备发送第二误码率状态,所述第二误码率状态用于表示所述误码率符合所述第二算法开启条件。If the bit error rate complies with the enabling condition of the second algorithm, send a second bit error rate status to the first device, where the second bit error rate status is used to indicate that the bit error rate conforms to the second algorithm Turn on condition.
在一种可能的实现方式中,所述传输通道的环境参数包括丢包率;所述方法还包括:In a possible implementation manner, the environmental parameter of the transmission channel includes a packet loss rate; the method further includes:
接收第一设备发送的测试数据包;receiving the test data packet sent by the first device;
根据接收到的正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率;Calculate the packet loss rate according to the number of correct test packets received and the number of test packets sent;
若所述丢包率符合第一算法开启条件时,向所述第一设备发送第一丢包率状态,所述第一丢包率状态用于表示所述丢包率符合所述第一算法开启条件;If the packet loss rate complies with the enabling condition of the first algorithm, send a first packet loss rate status to the first device, where the first packet loss rate status is used to indicate that the packet loss rate complies with the first algorithm open condition;
若所述丢包率符合第二算法开启条件时,向所述第一设备发送第二丢包率状态,所述第一丢包率状态用于表示所述丢包率符合所述第二算法开启条件。If the packet loss rate complies with the enabling condition of the second algorithm, a second packet loss rate status is sent to the first device, where the first packet loss rate status is used to indicate that the packet loss rate complies with the second algorithm Turn on condition.
在一种可能的实现方式中,所述第一检纠错算法包括至少二个检纠错算法,第二检纠错算法包括至少一个检纠错算法,所述第一检纠错算法中的检纠错算法的数量大于所述第二检纠错算法中的检纠错算法的数量。In a possible implementation manner, the first error detection and correction algorithm includes at least two error detection and correction algorithms, the second error detection and correction algorithm includes at least one error detection and correction algorithm, and the first error detection and correction algorithm includes at least one error detection and correction algorithm. The number of error detection and correction algorithms is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
在一种可能的实现方式中,所述第一检纠错算法包括FEC算法、CRC算法和ECC算法;或者In a possible implementation manner, the first error detection and correction algorithm includes an FEC algorithm, a CRC algorithm and an ECC algorithm; or
所述第一检纠错算法包括FEC算法和CRC算法;或者The first error detection and correction algorithm includes an FEC algorithm and a CRC algorithm; or
所述第一检纠错算法包括FEC算法和ECC算法。The first error detection and correction algorithm includes an FEC algorithm and an ECC algorithm.
在一种可能的实现方式中,所述第二检纠错算法包括FEC算法;或者In a possible implementation manner, the second error detection and correction algorithm includes an FEC algorithm; or
所述第二检纠错算法包括CRC算法;或者The second error detection and correction algorithm includes a CRC algorithm; or
所述第二检纠错算法包括ECC算法;或者The second error detection and correction algorithm includes an ECC algorithm; or
所述第二检纠错算法包括CRC算法和ECC算法。The second error detection and correction algorithm includes a CRC algorithm and an ECC algorithm.
在一种可能的实现方式中,所述通过第一检纠错算法对所述第一编码数据进行校验,包括:In a possible implementation manner, the performing verification on the first encoded data by using a first error detection and correction algorithm includes:
若确定出所述第一编码数据包括指示字段,对第一编码数据进行FEC校验,所述指示字段用于指示所述环境参数符合所述第一算法开启条件;If it is determined that the first encoded data includes an indication field, perform FEC check on the first encoded data, and the indication field is used to indicate that the environment parameter complies with the first algorithm enabling condition;
对FEC校验后的第一编码数据进行CRC校验和/或ECC校验。CRC check and/or ECC check is performed on the first encoded data after the FEC check.
在一种可能的实现方式中,所述通过第一检纠错算法对所述第一编码数据进行校验,包括:In a possible implementation manner, the performing verification on the first encoded data by using a first error detection and correction algorithm includes:
对第一编码数据进行FEC校验;Perform FEC check on the first encoded data;
若确定出所述第一编码数据包括指示字段,对FEC校验后的第一编码数据进行CRC校验和/或ECC校验,所述指示字段用于指示所述环境参数符合所述第一算法开启条件。If it is determined that the first encoded data includes an indication field, perform CRC check and/or ECC check on the FEC-checked first encoded data, and the indication field is used to indicate that the environmental parameter conforms to the first encoded data. Algorithm start condition.
在一种可能的实现方式中,所述指示字段包括保留字段或者新增字段。In a possible implementation manner, the indication field includes a reserved field or a newly added field.
第三方面,本申请实施例提供了一种第一设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得设备执行上述第一方面或者第一方面的任一可能的实现方式中的数据传输方法。In a third aspect, embodiments of the present application provide a first device, including: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory wherein, the one or more computer programs include instructions, which, when executed by the device, cause the device to execute the first aspect or the data transmission method in any possible implementation manner of the first aspect.
第四方面,本申请实施例提供了一种第二设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得设备执行上述第二方面或者第一方面的任一可能的实现方式中的数据传输方法。In a fourth aspect, embodiments of the present application provide a second device, comprising: one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory wherein, the one or more computer programs include instructions, which, when executed by the device, cause the device to execute the data transmission method in the second aspect or any possible implementation manner of the first aspect.
第五方面,本申请实施例提供了一种数据传输系统,包括:第一设备和第二设备,所述第一设备和所述第二设备通过传输通道通信连接;In a fifth aspect, an embodiment of the present application provides a data transmission system, including: a first device and a second device, where the first device and the second device are communicatively connected through a transmission channel;
所述第一设备,用于若传输通道的环境参数符合第一算法开启条件,通过第一检纠错算法对获取的传输数据进行编码,生成第一编码数据,并将所述第一编码数据发送至第二设备;若传输通道的环境参数符合第二算法开启条件,通过第二检纠错算法对获取的传输数据进行编码,生成第二编码数据,并将所述第二编码数据发送至第二设备,所述第二检纠错算法与所述第一检纠错算法不同;The first device is configured to encode the acquired transmission data through a first error detection and correction algorithm if the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, generate first encoded data, and convert the first encoded data to the first device. Send to the second device; if the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, encode the acquired transmission data through the second error detection and correction algorithm, generate second encoded data, and send the second encoded data to a second device, wherein the second error detection and correction algorithm is different from the first error detection and correction algorithm;
所述第二设备,用于若接收到第一设备发送的第一编码数据,通过第一检纠错算法对所述第一编码数据进行校验,生成传输数据;若接收到第一设备发送的第二编码数据,通过第二检纠错算法对所述第二编码数据进行校验,生成传输数据。The second device is configured to, if receiving the first encoded data sent by the first device, verify the first encoded data through a first error detection and correction algorithm to generate transmission data; if receiving the first encoded data sent by the first device The second encoded data is checked by a second error detection and correction algorithm to generate transmission data.
第六方面,本申请实施例提供了一种电子设备,包括:第一设备和第二设备,所述第一设备和所述第二设备通过传输通道通信连接;In a sixth aspect, an embodiment of the present application provides an electronic device, including: a first device and a second device, where the first device and the second device are communicatively connected through a transmission channel;
所述第一设备,用于若传输通道的环境参数符合第一算法开启条件,通过第一检纠错算法对获取的传输数据进行编码,生成第一编码数据,并将所述第一编码数据发送至第二设备;若传输通道的环境参数符合第二算法开启条件,通过第二检纠错算法对获取的传输数据进行编码,生成第二编码数据,并将所述第二编码数据发送至第二设备,所述第二检纠错算法与所述第一检纠错算法不同;The first device is configured to encode the acquired transmission data through a first error detection and correction algorithm if the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, generate first encoded data, and convert the first encoded data to the first device. Send to the second device; if the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, encode the acquired transmission data through the second error detection and correction algorithm, generate second encoded data, and send the second encoded data to a second device, wherein the second error detection and correction algorithm is different from the first error detection and correction algorithm;
所述第二设备,用于若接收到第一设备发送的第一编码数据,通过第一检纠错算法对所述第一编码数据进行校验,生成传输数据;若接收到第一设备发送的第二编码数据,通过第二检纠错算法对所述第二编码数据进行校验,生成传输数据。The second device is configured to, if receiving the first encoded data sent by the first device, verify the first encoded data through a first error detection and correction algorithm, and generate transmission data; if receiving the first encoded data sent by the first device The second encoded data is checked by a second error detection and correction algorithm to generate transmission data.
第七方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质用于设备执行的程序代码,所述程序代码包括用于执行第一方面或者第一方面的任一可能的实现方式中的方法的指令。In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used for program code executed by a device, and the program code includes the first aspect or any of the first aspect. Instructions for a method in a possible implementation.
第八方面,本申请实施例提供了一种计算机可读存储介质,所述计算机可读存储介质用于设备执行的程序代码,所述程序代码包括用于执行第二方面或者第二方面的任一可能的实现方式中的方法的指令。In an eighth aspect, an embodiment of the present application provides a computer-readable storage medium, where the computer-readable storage medium is used for program code executed by a device, and the program code includes a program code for executing the second aspect or the second aspect. Instructions for a method in a possible implementation.
第九方面,本申请实施例提供了一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机或任一至少一种处理器上运行时,使得所述计算机执行上述第 一方面或者第一方面的任一可能的实现方式中的数据传输方法。In a ninth aspect, an embodiment of the present application provides a computer program product containing instructions, wherein when the computer program product is run on a computer or any at least one processor, the computer is made to execute the above-mentioned first step. A data transmission method in one aspect or any possible implementation manner of the first aspect.
第十方面,本申请实施例提供了一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机或任一至少一种处理器上运行时,使得所述计算机执行上述第二方面或者第二方面的任一可能的实现方式中的数据传输方法。In a tenth aspect, an embodiment of the present application provides a computer program product containing instructions, wherein when the computer program product is run on a computer or any at least one processor, the computer is made to execute the above-mentioned first step. The data transmission method in the second aspect or any possible implementation manner of the second aspect.
本申请实施例提供的技术方案中,第一设备根据传输通道的环境参数符合第一算法开启条件选择第一检纠错算法对传输数据进行编码生成第一编码数据,或者第一设备根据传输通道的环境参数符合第二算法开启条件选择第二检纠错算法对传输数据进行编码生成第二编码数据,第二设备接收编码数据,若确定出符合第一算法开启条件时通过第一检纠错算法对编码数据进行校验生成传输数据,若确定出符合第二算法开启条件时通过第二检纠错算法对编码数据进行校验生成传输数据,实现了通过选择出的检纠错算法对数据传输过程中的传输数据进行检纠错处理,从而在保证数据传输可靠性的基础上提高了数据传输效率。In the technical solutions provided by the embodiments of the present application, the first device selects a first error detection and correction algorithm to encode the transmission data to generate the first encoded data according to the environmental parameters of the transmission channel meeting the conditions for enabling the first algorithm, or the first device generates the first encoded data according to the transmission channel. If the environmental parameters meet the conditions for enabling the second algorithm, select the second error detection and correction algorithm to encode the transmission data to generate the second encoded data, and the second device receives the encoded data. The algorithm verifies the encoded data to generate transmission data. If it is determined that the second algorithm is enabled, the encoded data is verified by the second error detection and correction algorithm to generate transmission data. The transmission data in the transmission process is subjected to error detection and correction processing, thereby improving the data transmission efficiency on the basis of ensuring the reliability of data transmission.
附图说明Description of drawings
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其它的附图。In order to illustrate the technical solutions of the embodiments of the present application more clearly, the following briefly introduces the accompanying drawings used in the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can also be obtained from these drawings without any creative effort.
图1是一些实施例中检纠错技术的示意图;1 is a schematic diagram of an error detection and correction technique in some embodiments;
图2是相关技术中基于D-PHY的数据传输系统的结构示意图;2 is a schematic structural diagram of a D-PHY-based data transmission system in the related art;
图3是图2中数据传输系统基于D-PHY的数据传输方法的流程图;3 is a flowchart of a data transmission method based on D-PHY in the data transmission system in FIG. 2;
图4是相关技术中基于D-PHY进行传输的第二数据块的格式示意图;4 is a schematic diagram of the format of a second data block transmitted based on D-PHY in the related art;
图5是相关技术中基于C-PHY的数据传输系统的结构示意图;5 is a schematic structural diagram of a data transmission system based on C-PHY in the related art;
图6是图5中数据传输系统基于C-PHY的数据传输方法的流程图;6 is a flowchart of a data transmission method based on C-PHY in the data transmission system in FIG. 5;
图7是相关技术中基于C-PHY进行传输的数据包的格式示意图;7 is a schematic diagram of the format of a data packet transmitted based on C-PHY in the related art;
图8为相关技术中基于CSI-3的数据传输系统的分层结构示意图;8 is a schematic diagram of a layered structure of a data transmission system based on CSI-3 in the related art;
图9是基于图8中数据传输系统的MIPI UniPro L2层数据帧的格式示意图;Fig. 9 is based on the format schematic diagram of the MIPI UniPro L2 layer data frame of the data transmission system in Fig. 8;
图10是相关技术中基于HDMI的数据传输系统的结构示意图;10 is a schematic structural diagram of an HDMI-based data transmission system in the related art;
图11是图10中数据传输系统基于HDMI的数据传输方法的流程图;11 is a flowchart of a data transmission method based on HDMI in the data transmission system in FIG. 10;
图12是相关技术中基于HDMI进行传输的第二数据块的格式示意图;12 is a schematic diagram of the format of a second data block transmitted based on HDMI in the related art;
图13是相关技术中基于HDMI进行传输的第三数据块的格式示意图;13 is a schematic diagram of the format of a third data block transmitted based on HDMI in the related art;
图14是相关技术中基于DP的数据传输系统的结构示意图;14 is a schematic structural diagram of a DP-based data transmission system in the related art;
图15是相关技术中基于DP的数据传输方法的流程图;15 is a flowchart of a DP-based data transmission method in the related art;
图16是基于DP的链路层(Link Layer)数据帧的格式示意图;16 is a schematic diagram of the format of a DP-based link layer (Link Layer) data frame;
图17是基于DP在PHY层实现单通道FEC的数据帧的格式示意图;17 is a schematic diagram of the format of a data frame that implements single-channel FEC at the PHY layer based on DP;
图18a是本申请一些实施例提供的一种数据传输系统的通信示意图;FIG. 18a is a schematic communication diagram of a data transmission system provided by some embodiments of the present application;
图18b是本申请一些实施例提供的第一设备和第二设备之间的板级连接的示意图;18b is a schematic diagram of a board-level connection between a first device and a second device provided by some embodiments of the present application;
图18c是本申请另一些实施例提供的第一设备和第二设备之间的板级连接的示意图;18c is a schematic diagram of a board-level connection between a first device and a second device provided by other embodiments of the present application;
图18d是本申请实施例提供的一种数据传输方法的流程图;18d is a flowchart of a data transmission method provided by an embodiment of the present application;
图19是本申请一些实施例提供的一种数据传输系统的结构示意图;19 is a schematic structural diagram of a data transmission system provided by some embodiments of the present application;
图20是本申请一些实施例提供的数据传输方法的流程图;20 is a flowchart of a data transmission method provided by some embodiments of the present application;
图21是本申请一些实施例中训练码流的数据格式示意图;21 is a schematic diagram of a data format of a training code stream in some embodiments of the present application;
图22是本申请一些实施例中基于D-PHY进行传输的数据块的格式示意图;FIG. 22 is a schematic diagram of the format of a data block transmitted based on D-PHY in some embodiments of the present application;
图23是本申请另一些实施例提供的数据传输方法的流程图;23 is a flowchart of a data transmission method provided by other embodiments of the present application;
图24是另一些实施例提供的数据传输系统的结构示意图;24 is a schematic structural diagram of a data transmission system provided by other embodiments;
图25是另一些实施例提供的数据传输方法的流程图;25 is a flowchart of a data transmission method provided by other embodiments;
图26是本申请实施例中基于HDMI进行传输的数据块的格式示意图;26 is a schematic diagram of the format of a data block transmitted based on HDMI in an embodiment of the present application;
图27是本申请一实施例提供的一种电子设备的结构示意图。FIG. 27 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
具体实施方式Detailed ways
为了更好的理解本申请的技术方案,下面结合附图对本申请实施例进行详细描述。In order to better understand the technical solutions of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
应当明确,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本申请保护的范围。It should be clear that the described embodiments are only a part of the embodiments of the present application, but not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.
在本申请实施例中使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请实施例和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the embodiments of this application and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms as well, unless the context clearly dictates otherwise.
应当理解,本文中使用的术语“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,甲和/或乙,可以表示:单独存在甲,同时存在甲和乙,单独存在乙这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" used in this article is only an association relationship to describe related objects, indicating that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, and A and B exist at the same time. B, there are three cases of B alone. In addition, the character "/" in this text generally indicates that the related objects are an "or" relationship.
随着电子设备的进步,电子设备的应用对图像和数据处理的要求越来越高。在电子设备内部,这种要求主要体现在对系统级芯片(System on Chip,简称SOC)和外围设备之间接口的传输速率的要求。以移动产业处理器接口(Mobile Industry Processor Interface,简称MIPI)的相机串行接口2(Camera Serial Interface 2,简称CSI-2)、相机串行接口3(Camera Serial Interface 3,简称CSI-3)、高清多媒体接口(High-Definition Multimedia Interface,简称HDMI)、显示端口(Display Port,简称DP)为代表的图像和视频传输技术,在处理灵活性、功能性等方面表现了诸多的优点。With the advancement of electronic equipment, the application of electronic equipment has higher and higher requirements for image and data processing. Inside the electronic device, this requirement is mainly reflected in the requirement for the transfer rate of the interface between the System on Chip (SOC) and the peripheral device. Camera Serial Interface 2 (CSI-2), Camera Serial Interface 3 (CSI-3), Camera Serial Interface 3 (CSI-3), Mobile Industry Processor Interface (MIPI), The image and video transmission technologies represented by High-Definition Multimedia Interface (HDMI) and Display Port (DP) have shown many advantages in terms of processing flexibility and functionality.
但是,由于复杂的信道环境,在图像和视频的传输过程中不可避免的出现传输差错,尤其是信号传输路径损耗、信道干扰及终端移动等因素而造成的误码率较高。对于图像和视频传输而言,由于其对信道引入差错或突发的数据丢包较为敏感,一定数量的误码或丢包即可能会将图像质量降低很多数量级,直接影响到最终解码恢复和视觉内容的表达,因此需要采用强有力的信道编码方式来保证一定的误码率。其中,误码是指信道、设备等原因造成的接收数据中随机错误或突发错误;丢包是指一个或多个数据包(packet)的数据无法传输到达目的地。由于不同的检纠错算法适用于不同的信道环境,所以在图像和视频的传输过程中需要根据误码率、丢包率等大小情况采用不同的检纠错算法,以降低图像和视频传输的误码率和丢包率,提高接收端图像和视频的重构质量,且使得图像和视频的传输过程兼具复杂度低、实现简单的特点。However, due to the complex channel environment, transmission errors inevitably occur during the transmission of images and videos, especially the high bit error rate caused by factors such as signal transmission path loss, channel interference and terminal movement. For image and video transmission, since it is more sensitive to channel-introduced errors or burst data packet loss, a certain number of bit errors or packet loss may reduce the image quality by many orders of magnitude, directly affecting the final decoding recovery and vision. Therefore, it is necessary to adopt a strong channel coding method to ensure a certain bit error rate. Among them, bit error refers to random errors or burst errors in the received data caused by channels, equipment, etc.; packet loss refers to that the data of one or more data packets cannot be transmitted to the destination. Since different error detection and correction algorithms are suitable for different channel environments, different error detection and correction algorithms need to be used according to the bit error rate, packet loss rate, etc. The bit error rate and packet loss rate can improve the reconstruction quality of the image and video at the receiving end, and make the transmission process of the image and video have the characteristics of low complexity and simple implementation.
目前,图像和视频传输过程中采用的检纠错技术按照其在通信中所处的环节,可以分为发送端检纠错技术和接收端检纠错技术。如图1所示,在图像和视频的传输过程中,检 纠错技术可包括信源编码、信道编码、传输线路传输、信道解码和信源解码,其中,信源编码属于信源处理部分,信道编码、传输线路传输和信道解码属于信道处理部分,信源解码属于信宿处理部分。发送端检纠错技术是信道编码时加入冗余信息来增强编码比特流检纠错能力的方法。接收端检纠错技术是基于信道解码来完成的,解码器根据解码规则近似地还原丢失或出错的数据,不需要在发送端提前做技术处理,如传真图像中的误码补偿、视频中的错误隐藏技术等。发送端检纠错技术中,信道解码阶段的检纠错技术是在发送端预先进行了处理,增加了可以进行检错或纠错的冗余信息。需要说明的是:本申请实施例提供的数据传输方法采用发送端检纠错技术对传输数据进行检纠错处理。At present, the error detection and correction technology used in the image and video transmission process can be divided into the sending end error detection and correction technology and the receiving end error detection and correction technology according to the link in the communication. As shown in Figure 1, in the transmission process of images and videos, error detection and correction techniques may include source coding, channel coding, transmission line transmission, channel decoding and information source decoding, wherein, the source coding belongs to the source processing part, Channel coding, transmission line transmission and channel decoding belong to the channel processing part, and source decoding belongs to the sink processing part. The error detection and correction technology at the transmitting end is a method of adding redundant information during channel coding to enhance the error detection and correction capability of the coded bit stream. The error detection and correction technology at the receiving end is completed based on channel decoding. The decoder approximately restores the lost or erroneous data according to the decoding rules, and does not need to do technical processing at the sending end in advance, such as error compensation in fax images and video error compensation. Error hiding techniques, etc. In the error detection and correction technology at the transmitting end, the error detection and correction technology in the channel decoding stage is processed in advance at the transmitting end, adding redundant information that can be used for error detection or error correction. It should be noted that: the data transmission method provided by the embodiment of the present application uses the error detection and correction technology at the transmitting end to perform error detection and correction processing on the transmission data.
CSI-2是一种MIPI组织制定的用于在电子设备的摄像头芯片与主控芯片间传输图像数据的接口。CSI-2兼容两种端口物理层(Port Physical Layer,简称PHY),即C-PHY和D-PHY,因此CSI-2对应于两种不同的检纠错算法。CSI-2 is an interface developed by the MIPI organization to transmit image data between the camera chip and the main control chip of an electronic device. CSI-2 is compatible with two port physical layers (Port Physical Layer, PHY for short), namely C-PHY and D-PHY, so CSI-2 corresponds to two different error detection and correction algorithms.
图2是相关技术中基于D-PHY的数据传输系统的结构示意图,如图2所示,该数据传输系统可包括第一设备和第二设备,第一设备包括图像处理单元和发送装置,第二设备包括主处理器单元和接收装置,发送装置和接收装置通过传输通道通信连接,图像处理单元与发送装置通信连接,主处理器单元与接收装置通信连接。其中,发送装置包括第一格式转换模块、协议发送单元和PHY层发送模块。协议发送单元包括包头错误纠正码(Error Correction Code,简称ECC)编码模块和净核循环冗余校验(Cyclic Redundancy Check,简称CRC)编码模块。接收装置包括第二格式转换模块、协议接收单元和PHY层接收模块,协议接收单元包括包头ECC解码模块和净核CRC解码模块。其中,PHY层发送模块和PHY层接收模块之间通过传输通道通信连接。FIG. 2 is a schematic structural diagram of a D-PHY-based data transmission system in the related art. As shown in FIG. 2, the data transmission system may include a first device and a second device, the first device includes an image processing unit and a sending device, and the first device includes a transmission device. The second device includes a main processor unit and a receiving device, the transmitting device and the receiving device are communicatively connected through a transmission channel, the image processing unit is communicatively connected with the sending device, and the main processor unit is communicatively connected with the receiving device. Wherein, the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module. The protocol sending unit includes an error correction code (Error Correction Code, ECC for short) coding module and a clean core cyclic redundancy check (Cyclic Redundancy Check, CRC for short) coding module. The receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module, and the protocol receiving unit includes a packet header ECC decoding module and a clean core CRC decoding module. Wherein, the PHY layer sending module and the PHY layer receiving module are communicated and connected through a transmission channel.
相关技术提供了一种基于D-PHY的数据传输方法,第一设备包括摄像头模组,第二设备包括手机的主板,协议发送单元包括CSI-2发送单元,协议接收单元包括CSI-2接收单元,PHY层发送模块包括D-PHY发送模块,PHY层接收模块包括D-PHY接收模块。The related art provides a data transmission method based on D-PHY, the first device includes a camera module, the second device includes a mainboard of a mobile phone, the protocol sending unit includes a CSI-2 sending unit, and the protocol receiving unit includes a CSI-2 receiving unit , the PHY layer sending module includes a D-PHY sending module, and the PHY layer receiving module includes a D-PHY receiving module.
图3是图2中数据传输系统基于D-PHY的数据传输方法的流程图,如图3所示,该方法包括:FIG. 3 is a flowchart of the data transmission method based on D-PHY in the data transmission system in FIG. 2. As shown in FIG. 3, the method includes:
步骤102、主处理器单元对图像处理单元进行参数配置。Step 102: The main processor unit configures parameters for the image processing unit.
具体地,在所有实际使用的场景下,主板可对摄像头模组进行工作参数配置,使得摄像头模组能够按照工作参数的要求工作。其中,工作参数可包括分辨率、帧率和接口速率等。Specifically, in all actual use scenarios, the main board can configure the working parameters of the camera module, so that the camera module can work according to the requirements of the working parameters. The working parameters may include resolution, frame rate, interface rate, and the like.
步骤104、协议发送单元向协议接收单元发送训练码流。Step 104: The protocol sending unit sends the training code stream to the protocol receiving unit.
具体地,协议发送单元向PHY层发送模块发送训练码流,PHY层发送模块通过传输通道向PHY层接收模块发送训练码流,而后,PHY层接收模块将训练码流发送至协议接收单元,协议接收单元接收训练码流,自适应调整参数,以实现CSI-2状态机均衡训练过程。在实现状态机均衡训练之后,第一设备开始进行图像数据流的传输过程。Specifically, the protocol sending unit sends the training code stream to the PHY layer sending module, the PHY layer sending module sends the training code stream to the PHY layer receiving module through the transmission channel, and then the PHY layer receiving module sends the training code stream to the protocol receiving unit, and the protocol The receiving unit receives the training code stream and adjusts the parameters adaptively to realize the CSI-2 state machine equalization training process. After the state machine equalization training is implemented, the first device starts to transmit the image data stream.
步骤106、图像处理单元采集图像数据流,并将采集的图像数据流发送至第一格式转换模块。Step 106: The image processing unit collects the image data stream, and sends the collected image data stream to the first format conversion module.
步骤108、第一格式转换模块对图像数据流进行编码格式转换,生成第一数据块,并为第一数据块添加数据包头。Step 108: The first format conversion module converts the encoding format of the image data stream, generates a first data block, and adds a data packet header to the first data block.
图4是相关技术中基于D-PHY进行传输的第二数据块的格式示意图,如图4所示, 第一格式转换模块(如图2所示)对图像数据流进行二进制编码格式转换,以形成负载(Payload)。其中,“Payload”用于表示第一数据块。数据包头可包括数据类型符(Data Identifier,简称Data ID)、字节数(16-bit WC)和虚拟通道标识符(Virtual Channel Extension,简称VCX)。其中,字节数用于标记“Payload”的数量,WC为字统计(Word Count)的简称。第一格式转换模块将添加了数据包头的第一数据块发送至协议发送单元。FIG. 4 is a schematic diagram of the format of the second data block transmitted based on D-PHY in the related art. As shown in FIG. 4 , the first format conversion module (as shown in FIG. 2 ) performs binary encoding format conversion on the image data stream to Form a payload. Among them, "Payload" is used to represent the first data block. The data packet header may include a data type identifier (Data Identifier, referred to as Data ID), the number of bytes (16-bit WC) and a virtual channel identifier (Virtual Channel Extension, referred to as VCX). Among them, the number of bytes is used to mark the number of "Payload", and WC is the abbreviation of Word Count. The first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit.
步骤110、协议发送单元通过包头ECC编码模块对数据包头进行ECC编码,生成第一ECC字段。Step 110: The protocol sending unit performs ECC encoding on the data packet header through the packet header ECC encoding module to generate a first ECC field.
如图4所示,包头ECC编码模块(如图2所示)通过6-bit的扩展汉明码对Data ID、WC和VCX进行ECC编码,生成第一ECC字段,其中,ECC字段例如为:6-bit字段。需要说明的是:图4中所示的ECC字段为第一ECC字段。As shown in Figure 4, the packet header ECC encoding module (as shown in Figure 2) performs ECC encoding on Data ID, WC and VCX through a 6-bit extended Hamming code to generate a first ECC field, where, for example, the ECC field is: 6 -bit field. It should be noted that: the ECC field shown in FIG. 4 is the first ECC field.
步骤112、协议发送单元通过净核CRC编码模块对第一数据块进行CRC编码,生成CRC字段。Step 112: The protocol sending unit performs CRC encoding on the first data block through the clean core CRC encoding module to generate a CRC field.
如图4所示,净核CRC编码模块(如图2所示)通过多项式对“Payload”进行CRC编码生成CRC字段。其中,多项式例如为:X 16+X 12+X 5+X 0,CRC字段例如为16-bit字段,CRC字段即图4中的“16-bit CRC”。 As shown in Figure 4, the net core CRC encoding module (as shown in Figure 2) performs CRC encoding on "Payload" through a polynomial to generate a CRC field. The polynomial is, for example, X 16 +X 12 +X 5 +X 0 , the CRC field is, for example, a 16-bit field, and the CRC field is “16-bit CRC” in FIG. 4 .
步骤114、协议发送单元根据第一数据块、数据包头、第一ECC字段和CRC字段,生成第二数据块。Step 114: The protocol sending unit generates a second data block according to the first data block, the data packet header, the first ECC field and the CRC field.
如图4所示,协议发送单元(如图2所示)将第一ECC字段和CRC字段分别放置于“Payload”的头部和尾部,将数据包头中的Data ID、WC和VCX分别放置于数据包的指定位置,并在数据包的开始位置设置传输开始(Start of Transmit,简称SoT)标识以及在数据包的结束位置设置传输结束(End of transmit,简称EoT)标识,以形成图4中所示的长包格式的第二数据块。As shown in Figure 4, the protocol sending unit (as shown in Figure 2) places the first ECC field and the CRC field at the head and tail of the "Payload" respectively, and places the Data ID, WC and VCX in the packet header at the The designated position of the data packet, and the Start of Transmit (SoT) mark is set at the beginning of the data packet and the End of Transmit (EoT) mark is set at the end of the data packet to form Figure 4 The second data block in the long packet format shown.
步骤116、协议发送单元将第二数据块发送至PHY层发送模块,PHY层发送模块通过传输通道将第二数据块发送至PHY层接收模块,PHY层接收模块将第二数据块发送至协议接收单元。Step 116: The protocol sending unit sends the second data block to the PHY layer sending module, the PHY layer sending module sends the second data block to the PHY layer receiving module through the transmission channel, and the PHY layer receiving module sends the second data block to the protocol receiving module. unit.
步骤118、协议接收单元通过净核CRC解码模块对第二数据块中的CRC字段进行CRC校验,生成CRC校验结果。Step 118: The protocol receiving unit performs CRC check on the CRC field in the second data block through the clean core CRC decoding module, and generates a CRC check result.
净核CRC解码模块(如图2所示)将第二数据块中的CRC字段与多项式进行模2除计算,得到余数,余数即为CRC校验结果。若CRC校验结果为0,则表明接收到的“Payload”是正确的数据;若CRC校验结果不为0,则表明接收到的“Payload”是错误的数据。其中,多项式可包括X 16+X 12+X 5+X 0The net-core CRC decoding module (as shown in Figure 2) divides the CRC field in the second data block and the polynomial by modulo 2 to obtain the remainder, which is the CRC check result. If the CRC check result is 0, it indicates that the received "Payload" is correct data; if the CRC check result is not 0, it indicates that the received "Payload" is wrong data. Wherein, the polynomial may include X 16 +X 12 +X 5 +X 0 .
步骤120、协议接收单元通过包头ECC解码模块对第二数据块中的数据包头进行ECC校验,生成ECC校验结果。Step 120: The protocol receiving unit performs ECC verification on the data packet header in the second data block through the packet header ECC decoding module, and generates an ECC verification result.
包头ECC解码模块(如图2所示)对数据包头中的Data ID、WC和VCX进行编码生成第二ECC字段,将第一ECC字段与第二ECC字段进行异或计算得出ECC校验结果。若ECC校验结果为0,表明数据包头正确;若ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则表明需要对数据包头的错误位进行纠正;若ECC校验结果不为0且ECC校验结果指示出有2-bit以上的错误,则表明数据包头发生了不可纠正的错误。The packet header ECC decoding module (as shown in Figure 2) encodes the Data ID, WC and VCX in the packet header to generate the second ECC field, and performs XOR calculation on the first ECC field and the second ECC field to obtain the ECC check result . If the ECC check result is 0, it indicates that the data packet header is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of the data packet header needs to be corrected; if If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it indicates that an uncorrectable error has occurred in the data packet header.
其中,包头ECC解码模块可采用与包头ECC编码模块相同的编码规则对数据包头中的Data ID、WC和VCX进行ECC编码,即包头ECC解码模块可通过6-bit的扩展汉明码对Data ID、WC和VCX进行ECC编码生成第二ECC字段。Among them, the packet header ECC decoding module can use the same coding rules as the packet header ECC encoding module to perform ECC encoding on the Data ID, WC and VCX in the data packet header, that is, the packet header ECC decoding module can pass 6-bit extended Hamming code to Data ID, WC and VCX. WC and VCX perform ECC encoding to generate the second ECC field.
步骤122、协议接收单元若识别出CRC校验结果为0且ECC校验结果为0时,对第二数据块进行解包处理生成第一数据块。Step 122: If the protocol receiving unit recognizes that the CRC check result is 0 and the ECC check result is 0, it performs unpacking processing on the second data block to generate the first data block.
具体地,协议接收单元去除第二数据块中的SoT标识、EoT标识、第一ECC字段、CRC字段、Data ID、WC和VCX,以实现对第二数据块进行解包处理得到第一数据块。Specifically, the protocol receiving unit removes the SoT identifier, the EoT identifier, the first ECC field, the CRC field, the Data ID, the WC, and the VCX in the second data block, so that the second data block can be unpacked to obtain the first data block. .
协议接收单元将解包得到的第一数据块发送至第二格式转换模块。The protocol receiving unit sends the unpacked first data block to the second format conversion module.
步骤124、第二格式转换模块对第一数据块进行编码格式转换,生成图像数据流,并将图像数据流上传至主处理器单元。Step 124: The second format conversion module converts the encoding format of the first data block, generates an image data stream, and uploads the image data stream to the main processor unit.
第二格式转换模块(如图2所示)将第一数据块进行像素图像编码格式转换生成图像数据流,并将图像数据流上传至主处理器单元。The second format conversion module (as shown in FIG. 2 ) converts the first data block to pixel image coding format to generate an image data stream, and uploads the image data stream to the main processor unit.
作为一种可选方案,协议接收单元若识别出ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则对数据包头的错误位进行纠正,对第二数据块进行解包处理生成第一数据块,而后将第一数据块进行像素图像编码格式转换生成图像数据流,并将图像数据流上传至主处理器单元。As an optional solution, if the protocol receiving unit recognizes that the ECC check result is not 0 and the ECC check result indicates that there are 1-bit errors and erroneous bits, the protocol receiving unit corrects the erroneous bits of the data packet header, and corrects the second data The block is unpacked to generate a first data block, and then the first data block is converted into a pixel image coding format to generate an image data stream, and the image data stream is uploaded to the main processor unit.
作为另一种可选方案,协议接收单元若识别出CRC校验结果不为0和/或识别出则ECC校验结果不为0且ECC校验结果指示出有2-bit以上的错误,则将第二数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对第二数据块的处理方式。As another optional solution, if the protocol receiving unit recognizes that the CRC check result is not 0 and/or that the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, then The second data block is discarded, skipped directly, or retransmitted. In this case, the developer can determine the processing method for the second data block.
图5是相关技术中基于C-PHY的数据传输系统的结构示意图,如图5所示,该数据传输系统可包括第一设备和第二设备,第一设备包括图像处理单元和发送装置,第二设备包括主处理器单元和接收装置,发送装置和接收装置通过传输通道通信连接,图像处理单元与发送装置通信连接,主处理器单元与接收装置通信连接。其中,发送装置包括第一格式转换模块、协议发送单元和PHY层发送模块。协议发送单元包括包头CRC编码模块和净核CRC编码模块。接收装置包括第二格式转换模块、协议接收单元和PHY层接收模块,协议接收单元包括包头CRC解码模块和净核CRC解码模块。其中,PHY层发送模块和PHY层接收模块之间通过传输通道通信连接。FIG. 5 is a schematic structural diagram of a data transmission system based on C-PHY in the related art. As shown in FIG. 5 , the data transmission system may include a first device and a second device. The first device includes an image processing unit and a sending device. The second device includes a main processor unit and a receiving device, the transmitting device and the receiving device are communicatively connected through a transmission channel, the image processing unit is communicatively connected with the sending device, and the main processor unit is communicatively connected with the receiving device. Wherein, the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module. The protocol sending unit includes a packet header CRC encoding module and a clean core CRC encoding module. The receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module, and the protocol receiving unit includes a packet header CRC decoding module and a clean core CRC decoding module. Wherein, the PHY layer sending module and the PHY layer receiving module are communicated and connected through a transmission channel.
相关技术还提供了一种基于C-PHY的数据传输方法,第一设备包括摄像头模组,第二设备包括手机的主板,协议发送单元包括CSI-2发送单元,协议接收单元包括CSI-2接收单元,PHY层发送模块包括C-PHY发送模块,PHY层接收模块包括C-PHY接收模块。图6是图5中数据传输系统基于C-PHY的数据传输方法的流程图,如图6所示,该方法包括:The related art also provides a data transmission method based on C-PHY. The first device includes a camera module, the second device includes a mainboard of a mobile phone, the protocol sending unit includes a CSI-2 sending unit, and the protocol receiving unit includes a CSI-2 receiving unit. unit, the PHY layer sending module includes a C-PHY sending module, and the PHY layer receiving module includes a C-PHY receiving module. FIG. 6 is a flowchart of the data transmission method based on C-PHY in the data transmission system in FIG. 5 . As shown in FIG. 6 , the method includes:
步骤202、主处理器单元对图像处理单元进行参数配置。Step 202: The main processor unit configures parameters for the image processing unit.
步骤204、协议发送单元向协议接收单元发送训练码流。Step 204: The protocol sending unit sends the training code stream to the protocol receiving unit.
步骤206、图像处理单元采集图像数据流,并将采集的图像数据流发送至第一格式转换模块。Step 206: The image processing unit collects the image data stream, and sends the collected image data stream to the first format conversion module.
对步骤202至步骤206的描述可参见步骤102至步骤106,此处不再赘述。For the description of steps 202 to 206, reference may be made to steps 102 to 106, and details are not repeated here.
步骤208、第一格式转换模块对图像数据流进行编码格式转换,生成第一数据块,并为第一数据块添加数据包头。Step 208: The first format conversion module converts the encoding format of the image data stream, generates a first data block, and adds a data packet header to the first data block.
图7是相关技术中基于C-PHY进行传输的数据包的格式示意图,如图5和图7所示,第一格式转换模块(如图5所示)对图像数据流进行二进制编码格式转换,以形成第一数据块“Payload”。数据包头可包括Data ID、16-bit WC和VCX。第一格式转换模块将添加了数据包头的第一数据块发送至协议发送单元。FIG. 7 is a schematic diagram of the format of a data packet transmitted based on C-PHY in the related art. As shown in FIG. 5 and FIG. 7 , the first format conversion module (as shown in FIG. 5 ) performs binary encoding format conversion on the image data stream, to form the first data block "Payload". The packet header can include Data ID, 16-bit WC and VCX. The first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit.
步骤210、协议发送单元通过包头CRC编码模块对数据包头进行CRC编码,生成PH-CRC字段。Step 210: The protocol sending unit performs CRC encoding on the data packet header through the packet header CRC encoding module to generate a PH-CRC field.
如图7所示,包头CRC编码模块(如图5所示)通过多项式对数据包中的Data ID、WC和VCX进行CEC编码生成PH-CRC字段。其中,多项式可包括X 16+X 12+X 5+X 0As shown in Figure 7, the packet header CRC encoding module (as shown in Figure 5) performs CEC encoding on the Data ID, WC and VCX in the data packet through a polynomial to generate a PH-CRC field. Wherein, the polynomial may include X 16 +X 12 +X 5 +X 0 .
步骤212、协议发送单元通过净核CRC编码模块对第一数据块进行CRC编码,生成PF-CRC字段。Step 212: The protocol sending unit performs CRC encoding on the first data block through the clean core CRC encoding module to generate a PF-CRC field.
如图7所示,净核CRC编码模块(如图5所示)通过多项式对“Payload”进行CRC编码生成PF-CRC字段。其中,多项式例如为:X 16+X 12+X 5+X 0As shown in Figure 7, the clean core CRC encoding module (as shown in Figure 5) performs CRC encoding on "Payload" through a polynomial to generate a PF-CRC field. The polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
由于C-PHY采用独特的三线编码方式,即:三个电平同时进行编码,若一个电平编码错误,会导致后续电平编码也出现错误,从而发生多位错误,因此为了增强数据可靠性,检测出多bits错误,可净核CRC编码模块对传输的数据进行CRC编码和校验。Since C-PHY adopts a unique three-line encoding method, that is, three levels are encoded at the same time, if one level is wrongly encoded, the subsequent level encoding will also be wrong, resulting in multi-bit errors. Therefore, in order to enhance data reliability , detects multi-bit errors, and the CRC encoding module can perform CRC encoding and verification on the transmitted data.
步骤214、协议发送单元根据第一数据块、数据包头、PH-CRC字段、PF-CRC字段和保留字段(Reserved Field,简称RES),生成第二数据块。Step 214: The protocol sending unit generates a second data block according to the first data block, the data packet header, the PH-CRC field, the PF-CRC field and the reserved field (Reserved Field, RES for short).
如图7所示,协议发送单元(如图5所示)将PH-CRC字段和PF-CRC字段分别放置于“Payload”的头部和尾部,将数据包头中的Data ID、WC、VCX、RES和填充(Filler)字段分别放置于第二数据块的指定位置,并在第二数据块的开始位置设置SoT标识以及在第二数据块的结束位置设置EoT标识,以形成图7中所示的长包格式的第二数据块。As shown in Figure 7, the protocol sending unit (as shown in Figure 5) places the PH-CRC field and the PF-CRC field at the head and tail of the "Payload" respectively, and sets the Data ID, WC, VCX, The RES and Filler fields are respectively placed at the designated positions of the second data block, and the SoT mark is set at the start position of the second data block and the EoT mark is set at the end position of the second data block, so as to form as shown in FIG. 7 . The second data block in long packet format.
步骤216、协议发送单元将第二数据块发送至PHY层发送模块,PHY层发送模块通过传输通道将第二数据块发送至PHY层接收模块,PHY层接收模块将第二数据块发送至协议接收单元。Step 216: The protocol sending unit sends the second data block to the PHY layer sending module, the PHY layer sending module sends the second data block to the PHY layer receiving module through the transmission channel, and the PHY layer receiving module sends the second data block to the protocol receiving module. unit.
步骤218、协议接收单元通过包头CRC解码模块对第二数据块中的PH-CRC字段进行CRC校验,生成第一CRC校验结果。Step 218: The protocol receiving unit performs CRC check on the PH-CRC field in the second data block through the header CRC decoding module, and generates a first CRC check result.
包头CRC解码模块(如图7所示)将第二数据块中的PH-CRC字段与多项式进行模2除计算,得到余数,余数即为第一CRC校验结果。第一CRC校验结果可以为0或者不为0。其中,多项式例如为:X 16+X 12+X 5+X 0The packet header CRC decoding module (as shown in FIG. 7 ) performs modulo-2 division calculation on the PH-CRC field in the second data block and the polynomial to obtain the remainder, which is the first CRC check result. The first CRC check result may be 0 or not. The polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
步骤220、协议接收单元通过净核CRC解码模块对第二数据块中的PF-CRC字段进行CRC校验,生成第二CRC校验结果。Step 220: The protocol receiving unit performs CRC check on the PF-CRC field in the second data block through the clean core CRC decoding module, and generates a second CRC check result.
净核CRC解码模块将第二数据块中的PF-CRC字段与多项式进行模2除计算,得到余数,余数即为第二CRC校验结果。第二CRC校验结果可以为0或者不为0。其中,多项式例如为:X 16+X 12+X 5+X 0The net-core CRC decoding module divides the PF-CRC field in the second data block and the polynomial by modulo 2 to obtain the remainder, and the remainder is the second CRC check result. The second CRC check result may be 0 or not. The polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
步骤222、协议接收单元若识别出第一CRC校验结果和第二CRC校验结果均为0时,对第二数据块进行解包处理生成第一数据块。Step 222: If the protocol receiving unit recognizes that the first CRC check result and the second CRC check result are both 0, it unpacks the second data block to generate the first data block.
协议接收单元若识别出第一CRC校验结果和第二CRC校验结果均为0时,表明第二数据块的信息完全正确,可继续对第二数据块进行解包处理。If the protocol receiving unit recognizes that the first CRC check result and the second CRC check result are both 0, it indicates that the information of the second data block is completely correct, and can continue to unpack the second data block.
具体地,协议接收单元去除第二数据块中的SoT标识、EoT标识、PH-CRC字段、 PF-CRC字段、Data ID、WC、VCX、RES和Filler,以实现对第二数据块进行解包处理得到第一数据块。Specifically, the protocol receiving unit removes the SoT identifier, EoT identifier, PH-CRC field, PF-CRC field, Data ID, WC, VCX, RES, and Filler in the second data block, so as to unpack the second data block The processing obtains the first data block.
协议接收单元将解包得到的第一数据块发送至第二格式转换模块。The protocol receiving unit sends the unpacked first data block to the second format conversion module.
步骤224、第二格式转换模块对第一数据块进行编码格式转换,生成图像数据流,并将图像数据流上传至主处理器单元。Step 224: The second format conversion module converts the encoding format of the first data block, generates an image data stream, and uploads the image data stream to the main processor unit.
协议接收单元将第一数据块进行像素图像编码格式转换生成图像数据流,并将图像数据流上传至主处理器单元。The protocol receiving unit performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the main processor unit.
作为一种可选方案,协议接收单元若第一CRC校验结果不为0和/或第二CRC校验结果不为0时,表明第二数据块中的字段发生不可纠正的错误,则将第二数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对第二数据块的处理方式。As an optional solution, if the first CRC check result is not 0 and/or the second CRC check result is not 0, indicating that an uncorrectable error occurs in the field in the second data block, the protocol receiving unit will The second data block is discarded, skipped directly, or retransmitted. In this case, the developer can determine the processing method for the second data block.
图8为相关技术中基于CSI-3的数据传输系统的分层结构示意图,如图8所示,该数据传输系统包括第一设备和第二设备,第一设备和第二设备之间通过传输通道通信连接。其中,第一设备包括图像处理单元、发送装置、设备管理实体(Device Management Entity)和PHY层发送模块,其中,图像处理单元包括相机应用层(Camera Application Layer,发送装置包括传输层(Transport)L4层、网络层(Network)L3层、数据链路层(Data Link)L2层、PHY适配层(PHY Adaptor)L1.5层;第二设备包括主处理器单元、接收装置、设备管理实体(Device Management Entity)和PHY层接收模块,其中,主处理器单元包括主机应用层(Host Application Layer),接收装置包括PHY适配层(PHY Adaptor)L1.5层、数据链路层(Data Link)L2层、网络层(Network)L3层和传输层(Transport)L4层。其中,PHY层发送模块和PHY层接收模块通过传输通道通信连接。FIG. 8 is a schematic diagram of a layered structure of a data transmission system based on CSI-3 in the related art. As shown in FIG. 8 , the data transmission system includes a first device and a second device. Channel communication connection. The first device includes an image processing unit, a sending device, a device management entity (Device Management Entity) and a PHY layer sending module, wherein the image processing unit includes a camera application layer (Camera Application Layer), and the sending device includes a transport layer (Transport) L4 layer, network layer (Network) L3 layer, Data Link layer (Data Link) L2 layer, PHY Adaptor layer (PHY Adaptor) L1.5 layer; the second device includes a main processor unit, a receiving device, a device management entity ( Device Management Entity) and a PHY layer receiving module, wherein the main processor unit includes a host application layer (Host Application Layer), and the receiving device includes a PHY Adaptor layer (PHY Adaptor) L1.5 layer, a data link layer (Data Link) The L2 layer, the network layer (Network) L3 layer, and the transport layer (Transport) layer L4. Among them, the PHY layer sending module and the PHY layer receiving module are communicated and connected through a transmission channel.
相关技术还提供了一种基于CSI-3的数据传输方法。图9是基于图8中数据传输系统的MIPI UniPro L2层数据帧的格式示意图,如图8和图9所示,对于所有摄像头模组实际使用场景下,在第一设备一侧,当L3层的图像数据块传输至L2层时,L2层在L3层的图像数据块的基础上添加L2层包头字符,并且采用CCITT CRC-16算法对L3层的图像数据块进行校验计算生成16-bit CRC校验字段。将16-bit CRC校验字段添加在L2层数据帧的尾部,如图9所示,L2层数据帧还包括数据链路层控制标识符(Data Link Layer Control Symbol Identifier,简称ESC_DL)字段、L2层数据包结束帧标识符(End of Frame for even L2 SDU,简称EOF_EVEN)字段、帧序列号(Frame Sequence Number,简称Frame Seq Number)和流量类型符(Traffic Class,简称TC)字段。然后在第二设备的L2层根据模2除法对图像数据块进行校验得到余数,若余数均为0,则表明当前数据包信息完全正确,则将L2层图像数据块还原出L3层图像数据块,并将还原出的L3层图像数据块传至L3层;若余数不为0,则表明L2层图像数据块发生了不可纠正的错误,将错误的数据包进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对数据包的处理方式。相关技术中基于CSI-3的数据传输方法的流程可参见图6所示的基于C-PHY的数据传输方法,此处不再重复描述。The related art also provides a data transmission method based on CSI-3. Figure 9 is a schematic diagram of the format of the MIPI UniPro L2 layer data frame based on the data transmission system in Figure 8, as shown in Figure 8 and Figure 9, for all camera modules in actual use scenarios, on the first device side, when the L3 layer When the image data block of the L3 layer is transmitted to the L2 layer, the L2 layer adds the L2 layer header character on the basis of the image data block of the L3 layer, and uses the CCITT CRC-16 algorithm to perform the verification calculation on the image data block of the L3 layer to generate 16-bit CRC check field. Add the 16-bit CRC check field to the end of the L2 layer data frame, as shown in Figure 9, the L2 layer data frame also includes the Data Link Layer Control Symbol Identifier (ESC_DL) field, L2 Layer data packet end frame identifier (End of Frame for even L2 SDU, referred to as EOF_EVEN) field, frame sequence number (Frame Sequence Number, referred to as Frame Seq Number) and traffic type (Traffic Class, referred to as TC) field. Then, at the L2 layer of the second device, the remainder is obtained by checking the image data block according to the modulo 2 division. If the remainder is 0, it means that the current data packet information is completely correct, and the L2 layer image data block is restored to the L3 layer image data. If the remainder is not 0, it means that an uncorrectable error has occurred in the L2 layer image data block, and the erroneous data packet will be discarded, skipped directly or repeated. In this case, the developer can determine the processing method of the data packet. For the flow of the CSI-3-based data transmission method in the related art, reference may be made to the C-PHY-based data transmission method shown in FIG. 6 , and the description will not be repeated here.
上述相关技术的基于CSI-2和CSI-3的数据传输方法的方案中,由于采用了CRC算法和ECC算法或者采用了CRC算法对数据进行检纠错处理,导致数据冗余较小,从而可提高数据传输的效率。但是由于无法实现多bits错误数据的纠错,对于突发错误无法有效保证数据的可靠传输,在传输信道受到干扰(例如,加性噪声及随机噪声等干扰)而使得 误码率较高的情况下,会导致数据丢包进而引起图像画面卡顿、失真等情况,从而极大的影响了用户的使用体验。In the scheme of the data transmission method based on CSI-2 and CSI-3 in the above-mentioned related art, because the CRC algorithm and the ECC algorithm or the CRC algorithm is used to perform error detection and correction processing on the data, the data redundancy is small, so that the data redundancy can be reduced. Improve the efficiency of data transmission. However, due to the inability to achieve error correction of multi-bit error data, the reliable transmission of data cannot be effectively guaranteed for burst errors, and the transmission channel is interfered (for example, by additive noise and random noise) and the bit error rate is high. In this case, data packets will be lost, which will lead to image freezes and distortions, which greatly affects the user experience.
HDMI是HDMI Forum制定的用于高清晰度多媒体传输的接口,主要用于设备间视频、图像等的传输。HDMI可应用于电子设备内部的第一设备与第二设备之间的多媒体传输,例如,第一设备例如为:手机的主板,第二设备例如为手机的显示屏;或者,HDMI可应用于不同的电子设备之间的多媒体传输,例如主机与显示屏之间的多媒体传输。HDMI is an interface developed by HDMI Forum for high-definition multimedia transmission, which is mainly used for the transmission of video, images, etc. between devices. HDMI can be applied to multimedia transmission between a first device and a second device inside an electronic device, for example, the first device is, for example, a mainboard of a mobile phone, and the second device is, for example, a display screen of a mobile phone; or, HDMI can be applied to different Multimedia transmission between electronic devices, such as multimedia transmission between the host and the display screen.
图10是相关技术中基于HDMI的数据传输系统的结构示意图,如图10所示,该数据传输系统可包括第一设备和第二设备,第一设备包括视频数据处理单元和发送装置,第二设备包括负载(sink)单元和接收装置,发送装置和接收装置通过传输通道通信连接,视频数据处理单元与发送装置通信连接,负载单元与接收装置通信连接。其中,发送装置包括第一格式转换模块、协议发送单元和PHY层发送模块。协议发送单元包括最小化传输差分信号(Transition-minimized differential signaling,简称TMDS)消费性电子控制(Consumer Electronics Control,简称CEC)编码模块和前向纠错(Forward Error Correction,简称FEC)编码模块。接收装置包括第二格式转换模块、协议接收单元和PHY层接收模块,协议接收单元包括TMDS CEC解码模块和FEC解码模块,其中,PHY层发送模块和PHY层接收模块之间通过传输通道通信连接。FIG. 10 is a schematic structural diagram of an HDMI-based data transmission system in the related art. As shown in FIG. 10 , the data transmission system may include a first device and a second device. The first device includes a video data processing unit and a sending device, and the second device includes a video data processing unit and a sending device. The equipment includes a sink unit and a receiving device, the sending device and the receiving device are communicatively connected through a transmission channel, the video data processing unit is communicatively connected with the sending device, and the load unit is communicatively connected with the receiving device. Wherein, the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module. The protocol sending unit includes a Transition-minimized Differential Signaling (TMDS) encoding module for Consumer Electronics Control (CEC) and a Forward Error Correction (FEC) encoding module. The receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module, the protocol receiving unit includes a TMDS CEC decoding module and an FEC decoding module, wherein the PHY layer sending module and the PHY layer receiving module are communicated and connected through a transmission channel.
相关技术还提供了一种基于HDMI的数据传输方法,负载单元包括显示屏,协议发送单元包括HDMI发送单元,协议接收单元包括HDMI接收单元。图11是图10中数据传输系统基于HDMI的数据传输方法的流程图,如图11所示,该方法包括:The related art also provides an HDMI-based data transmission method, wherein the load unit includes a display screen, the protocol sending unit includes an HDMI sending unit, and the protocol receiving unit includes an HDMI receiving unit. FIG. 11 is a flowchart of a data transmission method based on HDMI in the data transmission system in FIG. 10 . As shown in FIG. 11 , the method includes:
步骤302、视频数据处理单元对负载单元进行工作参数配置。Step 302: The video data processing unit configures the working parameters of the load unit.
具体地,在所有实际使用的场景下,视频处理单元可对显示屏的视频/图像数据控制器进行工作参数配置,使得显示屏能够按照工作参数的要求工作。其中,工作参数可包括分辨率、帧率和接口速率等。Specifically, in all actual use scenarios, the video processing unit can configure the working parameters of the video/image data controller of the display screen, so that the display screen can work according to the requirements of the working parameters. The working parameters may include resolution, frame rate, interface rate, and the like.
步骤304、视频数据处理单元采集图像或视频数据流,并将采集的图像或视频数据流发送至第一格式转换模块。Step 304: The video data processing unit collects the image or video data stream, and sends the collected image or video data stream to the first format conversion module.
步骤306、第一格式转换模块对图像或视频数据流进行编码格式转换,生成第一数据块并为第一数据块添加数据包头。Step 306: The first format conversion module converts the encoding format of the image or video data stream, generates a first data block, and adds a data packet header to the first data block.
图12是相关技术中基于HDMI进行传输的第二数据块的格式示意图,图12所示,数据包头包括前导码(Premble)、数据同步信息(Sync)、控制/数据信息(C/D)和保留字段(Rsvd)。第一格式转换模块(如图10所示)将前导码(Premble)、数据同步信息(Sync)、控制/数据信息(C/D)和保留字段(Rsvd)添加到第一数据块(Payload)的头部。其中,前导码(Premble)用于表明“Payload”是各种类型的包信息(Data Island)或是视频像素数据(Video Data),其中,包信息的内容包括音频数据包或者图像信息包等。第一格式转换模块将添加了数据包头的第一数据块发送至协议发送单元。FIG. 12 is a schematic diagram of the format of the second data block transmitted based on HDMI in the related art. As shown in FIG. 12 , the data packet header includes a preamble (Premble), data synchronization information (Sync), control/data information (C/D) and Reserved Field (Rsvd). The first format conversion module (as shown in FIG. 10 ) adds the preamble (Premble), data synchronization information (Sync), control/data information (C/D) and reserved field (Rsvd) to the first data block (Payload) 's head. Among them, the preamble (Premble) is used to indicate that "Payload" is various types of packet information (Data Island) or video pixel data (Video Data), wherein the content of the packet information includes audio data packets or image information packets. The first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit.
如图12所示,例如:第一数据块(Payload)可包括指令(Commad)或者数据(Data)。As shown in FIG. 12 , for example, the first data block (Payload) may include a command (Commad) or data (Data).
步骤308、协议发送单元通过TMDS CEC编码模块对第一数据块进行ECC编码生成第一ECC字段以及对第一数据块进行CRC编码生成CRC字段。Step 308: The protocol sending unit performs ECC encoding on the first data block through the TMDS CEC encoding module to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
具体地,TMDS CEC编码模块采用6-bit的扩展汉明码对“Payload”进行ECC编码生成第一ECC字段和校验位(Parity)字段;TMDS CEC编码模块采用16-bit CRC对 “Payload”进行CRC编码生成CRC(16-bit CRC)字段和校验位(Parity)字段。Specifically, the TMDS CEC encoding module uses 6-bit extended Hamming code to perform ECC encoding on "Payload" to generate the first ECC field and the parity (Parity) field; the TMDS CEC encoding module uses 16-bit CRC to perform ECC encoding on "Payload" CRC encoding generates a CRC (16-bit CRC) field and a parity (Parity) field.
步骤310、协议发送单元将第一ECC字段和CRC字段添加至第一数据块的尾部,以生成第二数据块。Step 310: The protocol sending unit adds the first ECC field and the CRC field to the end of the first data block to generate a second data block.
生成的第二数据块的具体格式可参见图12所示。如图12所示,第二数据块中第一ECC字段和CRC字段之后还可设置校验位(Parity)字段。The specific format of the generated second data block can be referred to as shown in FIG. 12 . As shown in FIG. 12 , a parity (Parity) field may also be set after the first ECC field and the CRC field in the second data block.
步骤312、协议发送单元通过FEC编码模块将第二数据块分成多个FEC数据块。Step 312: The protocol sending unit divides the second data block into multiple FEC data blocks through the FEC encoding module.
图13是相关技术中基于HDMI进行传输的第三数据块的格式示意图,如图13所示,FEC数据块包括Symbol数据块(Super Block Payload)。其中,“Super Block Payload”可包括指令(Commad)或者数据(Data)。FIG. 13 is a schematic diagram of the format of a third data block transmitted based on HDMI in the related art. As shown in FIG. 13 , the FEC data block includes a Symbol data block (Super Block Payload). Among them, "Super Block Payload" can include command (Commad) or data (Data).
步骤314、协议发送单元通过FEC编码模块对每个FEC数据块进行FEC编码,生成FEC校验码。Step 314: The protocol sending unit performs FEC encoding on each FEC data block through the FEC encoding module to generate an FEC check code.
具体地,FEC编码模块通过RS码编码算法对每个FEC数据块进行FEC编码生成FEC校验码(RS Block/Parity)。Specifically, the FEC encoding module performs FEC encoding on each FEC data block through the RS code encoding algorithm to generate an FEC check code (RS Block/Parity).
步骤316、协议发送单元通过FEC编码模块将FEC校验码添加至FEC数据块的尾部,以生成第三数据块。Step 316: The protocol sending unit adds the FEC check code to the end of the FEC data block through the FEC encoding module to generate a third data block.
形成的第三数据块的具体格式可参见图13所示,第三数据块还包括开始位(Start Super Block)字段和字节数(RS Block Symbol/Byte)字段。The specific format of the third data block formed can be referred to as shown in FIG. 13 , and the third data block also includes a start bit (Start Super Block) field and a number of bytes (RS Block Symbol/Byte) field.
步骤318、协议发送单元将第三数据块发送至PHY层发送模块,PHY层发送模块通过传输通道将第三数据块发送至PHY层接收模块,PHY层接收模块将第三数据块发送至协议接收单元。Step 318: The protocol sending unit sends the third data block to the PHY layer sending module, the PHY layer sending module sends the third data block to the PHY layer receiving module through the transmission channel, and the PHY layer receiving module sends the third data block to the protocol receiving module. unit.
步骤320、协议接收单元通过FEC解码模块对第三数据块进行FEC校验,生成FEC校验结果。Step 320: The protocol receiving unit performs FEC verification on the third data block through the FEC decoding module, and generates an FEC verification result.
具体地,FEC解码模块通过RS码解码算法对第三数据块进行FEC校验,生成FEC校验结果。FEC校验结果包括校验成功、可纠正的错误结果或者不可纠正的错误结果。其中,可纠正的错误结果为FEC算法验证能力范围内的错误,此种类型的错误均可被纠正,从而使得FEC算法实现了对多bits错误数据进行检纠错;不可纠正的错误结果为FEC算法验证能力范围之外的错误,此种类型的错误数据无法被纠正。Specifically, the FEC decoding module performs FEC check on the third data block by using the RS code decoding algorithm, and generates an FEC check result. FEC verification results include verification success, correctable error results or uncorrectable error results. Among them, the correctable error result is the error within the verification capability of the FEC algorithm, and this type of error can be corrected, so that the FEC algorithm can realize the error detection and correction of multi-bit error data; the uncorrectable error result is FEC Errors beyond the capabilities of the algorithm's verification capabilities, this type of erroneous data cannot be corrected.
步骤322、协议接收单元通过FEC解码模块若识别出FEC校验结果包括可纠正的错误结果时,对第三数据块的错误数据进行纠正处理,并且协议接收单元将第三数据块进行解包生成第二数据块。 Step 322, if the protocol receiving unit recognizes that the FEC check result includes a correctable error result through the FEC decoding module, the error data of the third data block is corrected and processed, and the protocol receiving unit unpacks the third data block to generate. second data block.
协议接收单元去除第三数据块中的开始位(Start Super Block)字段、字节数(RS Block Symbol/Byte)字段和FEC校验码,得出第二数据块。The protocol receiving unit removes the start bit (Start Super Block) field, the number of bytes (RS Block Symbol/Byte) field and the FEC check code in the third data block to obtain the second data block.
协议接收单元若通过FEC解码模块识别出FEC校验结果包括校验成功,表明第三数据块中不存在错误数据,可直接将第三数据块进行解包生成第二数据块。If the protocol receiving unit identifies through the FEC decoding module that the FEC verification result includes verification success, indicating that there is no erroneous data in the third data block, it can directly unpack the third data block to generate the second data block.
而后,协议接收单元将第二数据块发送至TMDS CEC解码模块。Then, the protocol receiving unit sends the second data block to the TMDS CEC decoding module.
协议接收单元若通过FEC解码模块识别出FEC校验结果包括不可纠正的错误结果,将第三数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对第三数据块的处理方式。If the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result through the FEC decoding module, the third data block will be discarded, skipped directly or retransmitted. How data blocks are handled.
步骤324、协议接收单元通过TMDS CEC解码模块对第二数据块中的CRC字段进行 CRC校验,生成CRC校验结果。 Step 324, the protocol receiving unit performs CRC check on the CRC field in the second data block by the TMDS CEC decoding module, and generates a CRC check result.
TMDS CEC解码模块将第二数据块中的CRC字段与多项式进行模2除计算,得到余数,余数即为CRC校验结果。CRC校验结果可以为0或者不为0。其中,多项式可包括X 16+X 12+X 5+X 0The TMDS CEC decoding module performs modulo-2 division calculation on the CRC field in the second data block and the polynomial to obtain the remainder, which is the CRC check result. The CRC check result can be 0 or not. Wherein, the polynomial may include X 16 +X 12 +X 5 +X 0 .
步骤326、协议接收单元通过TMDS CEC解码模块对第二数据块中的第一ECC字段进行ECC校验,生成ECC校验结果。Step 326: The protocol receiving unit performs ECC verification on the first ECC field in the second data block through the TMDS CEC decoding module, and generates an ECC verification result.
TMDS CEC解码模块对第二数据块中的“Payload”进行ECC编码生成第二ECC字段,将第一ECC字段与第二ECC字段进行异或计算得出ECC校验结果。若ECC校验结果为0,表明“Payload”正确;若ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则表明需要对“Payload”的错误位进行纠正;若ECC校验结果不为0且ECC校验结果指示出有2-bit以上的错误,则表明“Payload”发生了不可纠正的错误。其中,TMDS CEC解码模块可采用与TMDS CEC编码模块相同的编码规则对“Payload”进行ECC编码,即TMDS CEC解码模块可通过6-bit的扩展汉明码对“Payload”进行ECC编码生成第二ECC字段。The TMDS CEC decoding module performs ECC encoding on "Payload" in the second data block to generate a second ECC field, and performs XOR calculation on the first ECC field and the second ECC field to obtain an ECC check result. If the ECC check result is 0, it indicates that the "Payload" is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of "Payload" needs to be corrected ; If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it means that an uncorrectable error has occurred in the "Payload". Among them, the TMDS CEC decoding module can use the same encoding rules as the TMDS CEC encoding module to perform ECC encoding on "Payload", that is, the TMDS CEC decoding module can perform ECC encoding on "Payload" through 6-bit extended Hamming code to generate a second ECC field.
步骤328、协议接收单元判断CRC校验结果和ECC校验结果是否均为0,若是,则执行步骤330;若判断出重传时,则执行步骤312。Step 328: The protocol receiving unit judges whether the CRC check result and the ECC check result are both 0, and if so, go to Step 330; if it is judged to retransmit, go to Step 312.
步骤330、协议接收单元对第二数据块进行解包处理生成第一数据块,并将第一数据块发送至第二格式转换单元。Step 330: The protocol receiving unit depacketizes the second data block to generate the first data block, and sends the first data block to the second format conversion unit.
具体地,协议接收单元去除第二数据块中的前导码(Premble)、数据同步信息(Sync)、控制/数据信息(C/D)、保留字段(Rsvd)、第一ECC字段、CRC字段和校验位(Parity)字段,以实现对第二数据块进行解包处理得到第一数据块。Specifically, the protocol receiving unit removes the preamble (Premble), data synchronization information (Sync), control/data information (C/D), reserved field (Rsvd), first ECC field, CRC field and A parity (Parity) field is used to obtain the first data block by unpacking the second data block.
步骤332、第二格式转换模块对第一数据块进行编码格式转换,生成图像或视频数据流,并将图像或视频数据流上传至负载单元。Step 332: The second format conversion module converts the encoding format of the first data block, generates an image or video data stream, and uploads the image or video data stream to the load unit.
第二格式转换模块将第一数据块进行像素图像编码格式转换生成图像或视频数据流,并将图像或视频数据流上传至负载单元。The second format conversion module converts the first data block to pixel image coding format to generate an image or video data stream, and uploads the image or video data stream to the load unit.
作为一种可选方案,协议接收单元若识别出ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则对第二数据块的错误位进行纠正,对第二数据块进行解包处理生成第一数据块,而后,协议接收单元将第一数据块进行像素图像编码格式转换生成图像或视频数据流,并将图像或视频数据流上传至负载单元。As an optional solution, if the protocol receiving unit recognizes that the ECC check result is not 0 and the ECC check result indicates that there are 1-bit errors and erroneous bits, it corrects the erroneous bits of the second data block, and corrects the error bits of the second data block. The two data blocks are unpacked to generate a first data block, and then, the protocol receiving unit converts the first data block to pixel image coding format to generate an image or video data stream, and uploads the image or video data stream to the load unit.
作为另一种可选方案,协议接收单元若识别出CRC校验结果不为0和/或识别出则ECC校验结果不为0且ECC校验结果指示出有2-bit以上的错误,则将第二数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对数据包的处理方式。其中若判断出对第二数据块进行重传时,可继续执行步骤312,此时协议接收单元可通过辅助通道向协议发送单元返回错误通知,告知协议发送单元第二数据块出现错误,需要重传。As another optional solution, if the protocol receiving unit recognizes that the CRC check result is not 0 and/or that the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, then The second data block is discarded, skipped directly, or retransmitted. In this case, the developer can determine the processing method for the data packet. If it is determined that the second data block is to be retransmitted, step 312 can be continued. At this time, the protocol receiving unit can return an error notification to the protocol sending unit through the auxiliary channel, informing the protocol sending unit that an error occurs in the second data block and needs to be retransmitted. pass.
DP是一个由PC及芯片制造商联盟开发,视频电子标准协会(VESA)标准化的数字式视频接口标准。图14是相关技术中基于DP的数据传输系统的结构示意图,如图14所示,图14中的数据传输系统与图10的区别在于:图14中,TMDS CEC编码模块和FEC编码模块均位于PHY层发送模块中,PHY层发送模块还包括信道编码模块,TMDS CEC解码模块和FEC解码模块均位于PHY层接收模块中,PHY层接收模块还包括信道解码模 块。DP is a digital video interface standard developed by a consortium of PC and chip manufacturers and standardized by the Video Electronics Standards Association (VESA). Figure 14 is a schematic structural diagram of a DP-based data transmission system in the related art. As shown in Figure 14, the difference between the data transmission system in Figure 14 and Figure 10 is: in Figure 14, the TMDS CEC encoding module and the FEC encoding module are located in In the PHY layer sending module, the PHY layer sending module further includes a channel encoding module, the TMDS CEC decoding module and the FEC decoding module are both located in the PHY layer receiving module, and the PHY layer receiving module also includes a channel decoding module.
图15是相关技术中基于DP的数据传输方法的流程图。如图15所示,图15中的数据传输方法与图11中的数据传输方法在流程上的区别在于:FIG. 15 is a flowchart of a DP-based data transmission method in the related art. As shown in Figure 15, the difference in the process between the data transmission method in Figure 15 and the data transmission method in Figure 11 is:
图15中步骤310之后还包括:步骤S1、协议发送单元通过信道编码模块对第二数据块进行信道编码,生成编码后的第二数据块,而后步骤312中将编码后的第二数据块分为多个FEC数据块。After step 310 in FIG. 15, it further includes: step S1, the protocol sending unit performs channel coding on the second data block through the channel coding module to generate the coded second data block, and then in step 312, the coded second data block is divided into for multiple FEC data blocks.
例如,信道编码可包括128b/132b编码或者8b/10b编码。For example, channel coding may include 128b/132b coding or 8b/10b coding.
图15中步骤330之后还包括:步骤S2、协议发送单元通过信道解码模块对第一数据块进行信道解码,生成解码后的第一数据块。After step 330 in FIG. 15, the method further includes: step S2, the protocol sending unit performs channel decoding on the first data block through the channel decoding module to generate the decoded first data block.
例如,信道解码可包括128b/132b解码或者8b/10b解码。For example, channel decoding may include 128b/132b decoding or 8b/10b decoding.
图16是基于DP的链路层(Link Layer)数据帧的格式示意图,如图16所示,图16示出了多个数据帧,多个数据帧包括数据帧(Link Layer Frame)N-1、数据帧(Link Layer Frame)N和数据帧(Link Layer Frame)N+1。每个数据帧包括控制数据包(Control Packet)和传输数据包(Transport Packet)。图16中的传输数据包相当于图12中的第二数据块。其中传输数据包具有多通道(lane)数据流的特点,其中的ECC字段及CRC字段均在数据包尾部插入校验位,对数据进行检验保护。数据流的最后一个字节一般会映射到CRC字节使用,对于只有一个字节的(在最低位)的CRC校验位必须以0填充最高位以生成CRC的值,其他的CRC不需要填充。每个使用到的CRC可以具有不同的字节数。DP的Link Layer数据帧在数据传输过程中会进行压缩,所以对于CRC及ECC等校验字段均在Byte数据流进行映射校验。Figure 16 is a schematic diagram of the format of a DP-based link layer (Link Layer) data frame, as shown in Figure 16, Figure 16 shows a plurality of data frames, and the plurality of data frames include a data frame (Link Layer Frame) N-1 , data frame (Link Layer Frame) N and data frame (Link Layer Frame) N+1. Each data frame includes a control data packet (Control Packet) and a transmission data packet (Transport Packet). The transport packet in FIG. 16 corresponds to the second data block in FIG. 12 . The transmission data packet has the characteristics of a multi-lane data stream, and both the ECC field and the CRC field insert check bits at the end of the data packet to check and protect the data. The last byte of the data stream is generally mapped to the CRC byte for use. For the CRC check bit with only one byte (the lowest bit), the highest bit must be filled with 0 to generate the CRC value, and other CRCs do not need to be filled. . Each CRC used can have a different number of bytes. The Link Layer data frame of DP will be compressed during the data transmission process, so the check fields such as CRC and ECC are all mapped and checked in the Byte data stream.
图17是基于DP在PHY层实现单通道FEC的数据帧的格式示意图,如图17所示,示出的是经过对第二数据块进行信道编码以及FEC编码之后得到的数据帧,该数据帧可包括FEC数据块链路层编码(LL Codes for FEC Block)、FEC数据块校验位码(FEC Parity Codes for Block)、极性位码(CD_ADJ Code,简称CAJ Code)和FEC标记符(FEC_PM)。其中,CAJ为保留的编码极性位,PM为FEC数据帧格式的标记符。信道解码模块执行的是信道编码模块的逆向译码过程,对得到的数据帧进行FEC校验和信道解码后生成第二数据块。DP在PHY层实现FEC的编译码纠错,保证数据的可靠传输。Figure 17 is a schematic diagram of the format of a data frame for implementing single-channel FEC at the PHY layer based on DP. As shown in Figure 17, it shows a data frame obtained after channel coding and FEC coding on the second data block. The data frame It can include FEC data block link layer code (LL Codes for FEC Block), FEC data block parity code (FEC Parity Codes for Block), polarity bit code (CD_ADJ Code, CAJ Code for short) and FEC marker (FEC_PM) ). Among them, CAJ is the reserved coding polarity bit, and PM is the marker of the FEC data frame format. The channel decoding module performs the reverse decoding process of the channel encoding module, and performs FEC check and channel decoding on the obtained data frame to generate a second data block. DP implements FEC coding, decoding and error correction at the PHY layer to ensure reliable data transmission.
上述相关技术的基于HDMI和DP的数据传输方法的方案,由于采用了FEC算法对图像或视频数据进行检纠错处理,因此可以对图像或视频数据进行多bits错误数据的检纠错,从而提高了数据传输的可靠性。但是由于在数据传输过程中只能采用FEC算法、CRC算法和ECC算法的组合算法进行检纠错处理,因此会导致数据冗余较大,从而降低了数据传输的效率。另外,基于HDMI和DP的数据传输方法仅适用于特定的显示应用场景,无法扩展到其它高速数据传输系统的数据可靠性传输中。The scheme of the data transmission method based on HDMI and DP in the above-mentioned related art, because the FEC algorithm is used to perform error detection and correction processing on the image or video data, the error detection and correction of multi-bit error data can be performed on the image or video data, thereby improving the performance of the image or video data. reliability of data transmission. However, in the data transmission process, only the combined algorithm of the FEC algorithm, the CRC algorithm and the ECC algorithm can be used for error detection and correction processing, which leads to large data redundancy, thereby reducing the efficiency of data transmission. In addition, the data transmission method based on HDMI and DP is only suitable for specific display application scenarios, and cannot be extended to the data reliability transmission of other high-speed data transmission systems.
综上所述,相关技术中还没有一种数据传输方法能够实现在保证数据传输可靠性的基础上提高数据传输效率。为解决上述相关技术中提出的无法实现在保证数据传输可靠性的基础上提高数据传输效率的技术问题,本申请实施例提供了一种数据传输方法,通过检测传输通道环境,选择适合传输通道环境的检纠错算法,通过选择出的检纠错算法对数据传输过程中的传输数据进行检纠错处理,从而在保证数据传输可靠性的基础上提高了数据传输效率。本申请实施例的技术方案能够灵活的扩展到其它高速数据传输系统的数据可靠性 传输中。To sum up, there is no data transmission method in the related art that can improve the data transmission efficiency on the basis of ensuring the reliability of the data transmission. In order to solve the technical problem in the above-mentioned related art that it is impossible to improve the data transmission efficiency on the basis of ensuring the reliability of data transmission, the embodiment of the present application provides a data transmission method. The selected error detection and correction algorithm performs error detection and correction processing on the transmission data during the data transmission process, thereby improving the data transmission efficiency on the basis of ensuring the reliability of data transmission. The technical solutions of the embodiments of the present application can be flexibly extended to data reliability transmission of other high-speed data transmission systems.
图18a是本申请一些实施例提供的一种数据传输系统的通信示意图,如图18a该数据传输系统包括第一设备和第二设备,第一设备包括发送装置和第一设备控制接口,第二设备包括接收装置和第二设备控制接口。其中,发送装置和接收装置之间设置有多条传输通道和时钟通道,传输通道和时钟通道均为单向通道,传输通道能够将图像数据从第一设备传输至第二设备;第一设备控制接口和第二设备控制接口之间设置有辅助通道(例如,I 2C总线),辅助通道为双向传输通道,辅助通道包括数据线SDA和时钟信号线SCL。其中,发送装置和接收装置之间可通过高速接口传输数据,第一设备控制接口和第二设备控制接口之间可通过低速接口传输数据。 Fig. 18a is a schematic communication diagram of a data transmission system provided by some embodiments of the present application. As shown in Fig. 18a, the data transmission system includes a first device and a second device, the first device includes a sending device and a first device control interface, and the second The device includes a receiving device and a second device control interface. Among them, a plurality of transmission channels and clock channels are set between the sending device and the receiving device, the transmission channels and the clock channels are both unidirectional channels, and the transmission channel can transmit image data from the first device to the second device; the first device controls An auxiliary channel (eg, I 2 C bus) is provided between the interface and the second device control interface, the auxiliary channel is a bidirectional transmission channel, and the auxiliary channel includes a data line SDA and a clock signal line SCL. Wherein, data can be transmitted between the sending device and the receiving device through a high-speed interface, and data can be transmitted between the first device control interface and the second device control interface through a low-speed interface.
本申请实施例中,作为一种可选方案,第一设备和第二设备可以为不同的设备,即第一设备和第二设备为单独设备的两个设备。例如,第一设备为摄像头模组,第二设备为主机;又例如,第一设备为主机,第二设备为显示屏。主机的示例包括但不限于搭载iOS、Android、Microsoft或者其他操作系统的设备,可选地,主机为手机、平板电脑、可穿戴设备、智能电视或者个人计算机。In this embodiment of the present application, as an optional solution, the first device and the second device may be different devices, that is, the first device and the second device are two devices that are separate devices. For example, the first device is a camera module, and the second device is a host; for another example, the first device is a host, and the second device is a display screen. Examples of the host include, but are not limited to, devices equipped with iOS, Android, Microsoft or other operating systems, optionally, the host is a mobile phone, a tablet computer, a wearable device, a smart TV, or a personal computer.
本申请实施例中,作为另一种可选方案,数据传输系统设置于一个电子设备中,即电子设备包括第一设备和第二设备。例如,第一设备为摄像头模组,第二设备为主板;又例如,第一设备为主板,第二设备为显示屏。电子设备的示例包括但不限于搭载iOS、Android、Microsoft或者其他操作系统的设备,可选地,电子设备包括手机、平板电脑、可穿戴设备、安防设备、智能电视或者个人计算机。其中,安防设备可包括安防摄像头设备。In the embodiment of the present application, as another optional solution, the data transmission system is provided in an electronic device, that is, the electronic device includes a first device and a second device. For example, the first device is a camera module, and the second device is a motherboard; in another example, the first device is a motherboard, and the second device is a display screen. Examples of electronic devices include, but are not limited to, devices powered by iOS, Android, Microsoft, or other operating systems, and alternatively, electronic devices include mobile phones, tablet computers, wearable devices, security devices, smart TVs, or personal computers. Wherein, the security equipment may include security camera equipment.
图18b是本申请一些实施例提供的第一设备和第二设备之间的板级连接的示意图,如图18b所示,以第一设备为摄像头模组且第二设备为手机为例,手机包括主板,主板包括应用处理器(Application Processor,简称AP),主板通过连接器(Band to Board,简称BTB)和柔性电路板(Flexible Printed Circuit,简称FPC)与摄像头模组连接。其中,BTB主要为了连接摄像头模组和主板,通常BTB包括多个CSI-2的信号管脚;FPC中布满了CSI-2信号传输线,以与BTB配合完成摄像头模组和主板的连接。Fig. 18b is a schematic diagram of a board-level connection between a first device and a second device provided by some embodiments of the present application. As shown in Fig. 18b, taking the first device as a camera module and the second device as a mobile phone as an example, the mobile phone Including a mainboard, the mainboard includes an Application Processor (AP), and the mainboard is connected to the camera module through a connector (Band to Board, BTB) and a flexible printed circuit (Flexible Printed Circuit, FPC). Among them, the BTB is mainly used to connect the camera module and the main board. Usually, the BTB includes multiple CSI-2 signal pins; the FPC is full of CSI-2 signal transmission lines to cooperate with the BTB to complete the connection between the camera module and the main board.
图18c是本申请另一些实施例提供的第一设备和第二设备之间的板级连接的示意图,如图18c所示,以第一设备为手机且第二设备为显示屏为例,手机包括主板,主板包括AP,显示屏(图中未画出)包括手机显示驱动IC(Display Driver IC,简称DDIC)模组。主板通过BTB和FPC与DDIC模组连接。其中,BTB主要为了连接DDIC模组和主板,通常BTB包括多个DSI-2的信号管脚;FPC中布满了DSI-2信号传输线,以与BTB配合完成FFIC模组和主板的连接。其中,DSI-2协议为MIPI制定的连接SoC与DDIC的协议接口。Fig. 18c is a schematic diagram of a board-level connection between a first device and a second device provided by other embodiments of the present application. As shown in Fig. 18c, taking the first device as a mobile phone and the second device as a display screen as an example, the mobile phone Including the main board, the main board includes the AP, and the display screen (not shown in the figure) includes the mobile phone display driver IC (Display Driver IC, DDIC for short) module. The main board is connected with the DDIC module through BTB and FPC. Among them, the BTB is mainly used to connect the DDIC module and the main board. Usually, the BTB includes multiple DSI-2 signal pins; the FPC is full of DSI-2 signal transmission lines to cooperate with the BTB to complete the connection between the FFIC module and the main board. Among them, the DSI-2 protocol is a protocol interface developed by MIPI to connect the SoC and the DDIC.
基于上述数据传输系统,本申请实施例提供了一种数据传输方法,该方法包括:Based on the above data transmission system, an embodiment of the present application provides a data transmission method, the method comprising:
若传输通道的环境参数符合第一算法开启条件,第一设备通过第一检纠错算法对获取的传输数据进行编码,生成第一编码数据,并将所述第一编码数据发送至第二设备。第二设备接收编码数据;若确定出符合第一算法开启条件,通过第一检纠错算法对编码数据进行校验,生成传输数据;若确定出符合第二算法开启条件,通过第二检纠错算法对编码数据进行校验,生成传输数据。If the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, the first device encodes the acquired transmission data through the first error detection and correction algorithm, generates first encoded data, and sends the first encoded data to the second device . The second device receives the encoded data; if it is determined that the conditions for enabling the first algorithm are met, the encoded data is verified by the first error detection and correction algorithm to generate transmission data; The error algorithm verifies the encoded data and generates the transmission data.
其中,所述第二检纠错算法与所述第一检纠错算法不同。Wherein, the second error detection and correction algorithm is different from the first error detection and correction algorithm.
作为一种可选方案,图18d是本申请实施例提供的一种数据传输方法的流程图,如图18d所示,该方法包括:As an optional solution, FIG. 18d is a flowchart of a data transmission method provided by an embodiment of the present application. As shown in FIG. 18d , the method includes:
步骤100a、第一设备判断传输通道的环境参数符合第一算法开启条件或符合第二算法开启条件,若符合第一算法开启条件,则执行步骤100b;若符合第二算法开启条件,则执行步骤100c。In step 100a, the first device determines that the environmental parameter of the transmission channel meets the first algorithm opening condition or meets the second algorithm opening condition. If the first algorithm opening condition is met, step 100b is executed; if the second algorithm opening condition is met, step 100b is executed. 100c.
本申请实施例中,判断传输通道的环境参数符合第一算法开启条件或符合第二算法开启条件可以由第一设备或者第二设备执行。作为一种可选方案,步骤100a由第一设备执行。In this embodiment of the present application, judging that the environment parameter of the transmission channel complies with the enabling condition of the first algorithm or the enabling condition of the second algorithm may be performed by the first device or the second device. As an optional solution, step 100a is performed by the first device.
若步骤100a由第二设备执行时,若第二设备判断出传输通道的环境参数符合第一算法开启条件,则向第一设备返回第一环境参数状态,第一环境参数状态例如为第一误码率状态或者第一丢包率状态,第一环境参数状态用于表示所述环境参数符合所述第一算法开启条件;若第二设备判断出传输通道的环境参数符合第二算法开启条件,则向第一设备返回第二环境参数状态,第二环境参数状态例如为第二误码率状态或者第二丢包率状态,第二环境参数状态用于于表示所述环境参数符合所述第二算法开启条件。If step 100a is performed by the second device, if the second device determines that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, it returns the first environmental parameter state to the first device. The first environmental parameter state is, for example, the first error. The code rate state or the first packet loss rate state, and the first environment parameter state is used to indicate that the environment parameter complies with the opening condition of the first algorithm; if the second device determines that the environment parameter of the transmission channel meets the opening condition of the second algorithm, Then, the second environment parameter state is returned to the first device. The second environment parameter state is, for example, the second bit error rate state or the second packet loss rate state. The second environment parameter state is used to indicate that the environment parameter conforms to the first Second algorithm enable condition.
步骤100b、第一设备通过第一检纠错算法对获取的传输数据进行编码,生成第一编码数据,并将所述第一编码数据发送至第二设备,并继续执行步骤100d。 Step 100b: The first device encodes the acquired transmission data through a first error detection and correction algorithm, generates first encoded data, sends the first encoded data to the second device, and proceeds to step 100d.
步骤100c、第一设备通过第二检纠错算法对获取的传输数据进行编码,生成第二编码数据,并将所述第二编码数据发送至第二设备。 Step 100c: The first device encodes the acquired transmission data through a second error detection and correction algorithm, generates second encoded data, and sends the second encoded data to the second device.
步骤100d、第二设备接收编码数据。 Step 100d, the second device receives the encoded data.
步骤100e、第二设备若确定出符合第一算法开启条件,通过第一检纠错算法对所述编码数据进行校验,生成传输数据;若确定出符合第二算法开启条件,通过第二检纠错算法对所述编码数据进行校验,生成传输数据。In step 100e, if the second device determines that the first algorithm enabling condition is met, the encoded data is verified by the first error detection and correction algorithm to generate transmission data; An error correction algorithm verifies the encoded data to generate transmission data.
本申请实施例中,可由第一设备获取传输通道的环境参数,并判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件。In this embodiment of the present application, the first device may acquire the environmental parameters of the transmission channel, and determine that the environmental parameters of the transmission channel meet the first algorithm enabling condition or the second algorithm enabling condition.
作为一种可选方案,若传输通道的环境参数包括误码率时,第一设备获取传输通道的环境参数可包括:第一设备向所述第二设备依次发送第一序列和第二序列,以供所述第二设备统计接收到的正确的第二序列的比特数,所述第一序列用于实现状态机均衡训练;接收所述第二设备发送的正确的第二序列的比特数;根据所述第二设备发送的正确的第二序列的比特数和发送的第二序列的总比特数计算出误码率。而第一设备判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件包括:第一设备判断误码率是否大于或等于第一阈值,若判断出误码率大于或等于第一阈值,表明传输通道的环境参数符合第一算法开启条件;若判断出误码率小于第一阈值,表明传输通道的环境参数符合第二算法开启条件。As an optional solution, if the environmental parameters of the transmission channel include the bit error rate, the first device acquiring the environmental parameters of the transmission channel may include: the first device sends the first sequence and the second sequence to the second device in sequence, for the second device to count the number of bits of the correct second sequence received, and the first sequence is used to implement state machine equalization training; receive the number of bits of the correct second sequence sent by the second device; The bit error rate is calculated according to the correct number of bits of the second sequence sent by the second device and the total number of bits of the second sequence sent by the second device. The first device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the first device judging whether the bit error rate is greater than or equal to the first threshold; A threshold value indicates that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the bit error rate is less than the first threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm.
作为另一种可选方案,若传输通道的环境参数包括系统传输速率时,第一设备获取传输通道的环境参数包括:第一设备从切速状态寄存器读取所述系统传输速率。而第一设备判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件包括:第一设备判断系统传输速率是否大于或等于第二阈值,若判断出系统传输速率大于或等于第二阈值,表明传输通道的环境参数符合第一算法开启条件;若判断出系统传输速率小于第二阈值,表明传输通道的环境参数符合第二算法开启条件。例如:此种情况可参见图23中步 骤506和步骤508。As another optional solution, if the environment parameter of the transmission channel includes the system transmission rate, the first device acquiring the environment parameter of the transmission channel includes: the first device reading the system transmission rate from the speed cut state register. The first device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the first device judging whether the system transmission rate is greater than or equal to the second threshold; Two thresholds, indicating that the environmental parameters of the transmission channel meet the opening conditions of the first algorithm; if it is determined that the system transmission rate is less than the second threshold, it indicates that the environmental parameters of the transmission channel meet the opening conditions of the second algorithm. For example, for this case, see step 506 and step 508 in Fig. 23 .
作为另一种可选方案,若传输通道的环境参数包括丢包率时,第一设备获取传输通道的环境参数包括:第一设备向第二设备发送测试数据包,并记录发送的所述测试数据包的个数;接收第二设备返回的统计出的接收到的正确的测试数据包的个数;根据正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率。而第一设备判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件包括:第一设备判断丢包率是否大于或等于第三阈值,若判断出丢包率大于或等于第三阈值,表明传输通道的环境参数符合第一算法开启条件;若判断出丢包率小于第三阈值,表明传输通道的环境参数符合第二算法开启条件。例如:此种情况可参见图25中步骤606和步骤612。As another optional solution, if the environmental parameter of the transmission channel includes the packet loss rate, the first device acquiring the environmental parameter of the transmission channel includes: the first device sends a test data packet to the second device, and records the sent test data packet The number of data packets; the number of correct test data packets received according to the statistics returned by the second device; the packet loss is calculated according to the number of correct test data packets and the number of sent test data packets Rate. The first device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the first device judging whether the packet loss rate is greater than or equal to the third threshold; The three thresholds indicate that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the packet loss rate is less than the third threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm. For example, for this situation, please refer to step 606 and step 612 in FIG. 25 .
本申请实施例中,还可由第二设备获取传输通道的环境参数,并判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件。In this embodiment of the present application, the second device may also acquire environmental parameters of the transmission channel, and determine that the environmental parameters of the transmission channel meet the first algorithm enabling condition or the second algorithm enabling condition.
作为一种可选方案,若传输通道的环境参数包括误码率时,第二设备接收第一设备依次发送的第一序列和第二序列,所述第一序列用于实现状态机均衡训练;根据接收到的正确的第二序列的比特数和发送的第二序列的总比特数计算出误码率;若所述误码率符合第一算法开启条件时,向所述第一设备发送第一误码率状态,所述第一误码率状态用于表示所述误码率符合所述第一算法开启条件;若所述误码率符合第二算法开启条件时,向所述第一设备发送第二误码率状态,所述第二误码率状态用于表示所述误码率符合所述第二算法开启条件。而第二设备判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件包括:第二设备判断误码率是否大于或等于第一阈值,若判断出误码率大于或等于第一阈值,表明传输通道的环境参数符合第一算法开启条件;若判断出误码率小于第一阈值,表明传输通道的环境参数符合第二算法开启条件。其中,第一设备可根据第一误码率状态获知误码率符合第一算法开启条件,即可采用第一检纠错算法进行编码;第一设备可根据第二误码率状态获知误码率符合第二算法开启条件,即可采用第二检纠错算法进行编码。例如:此种情况可参见图20中步骤406至步骤416以及步骤446。As an optional solution, if the environmental parameter of the transmission channel includes the bit error rate, the second device receives the first sequence and the second sequence sent in sequence by the first device, and the first sequence is used to implement state machine equalization training; Calculate the bit error rate according to the received correct number of bits of the second sequence and the total number of bits of the second sequence sent; if the bit error rate meets the first algorithm enabling condition, send the first device to the first device. A bit error rate status, the first bit error rate status is used to indicate that the bit error rate meets the enabling condition of the first algorithm; if the bit error rate meets the enabling condition of the second algorithm, the first bit error rate status is sent to the first The device sends a second bit error rate status, where the second bit error rate status is used to indicate that the bit error rate complies with the condition for enabling the second algorithm. The second device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the second device judging whether the bit error rate is greater than or equal to the first threshold; A threshold value indicates that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the bit error rate is less than the first threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm. Wherein, the first device can know that the bit error rate meets the enabling condition of the first algorithm according to the first bit error rate state, and can use the first error detection and correction algorithm to perform encoding; the first device can know the bit error according to the second bit error rate state If the rate meets the enabling condition of the second algorithm, the second error detection and correction algorithm can be used for encoding. For example, for this situation, please refer to steps 406 to 416 and step 446 in FIG. 20 .
作为另一种可选方案,若传输通道的环境参数包括丢包率时,第二设备接收第一设备发送的测试数据包;根据接收到的正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率;若所述丢包率符合第一算法开启条件时,向所述第一设备发送第一丢包率状态,所述第一丢包率状态用于表示所述丢包率符合所述第一算法开启条件;若所述丢包率符合第二算法开启条件时,向所述第一设备发送第二丢包率状态,所述第一丢包率状态用于表示所述丢包率符合所述第二算法开启条件。而第二设备判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件包括:第二设备判断丢包率是否大于或等于第三阈值,若判断出丢包率大于或等于第三阈值,表明传输通道的环境参数符合第一算法开启条件;若判断出丢包率小于第三阈值,表明传输通道的环境参数符合第二算法开启条件。其中,第一设备可根据第一丢包率状态获知丢包率符合第一算法开启条件,即可采用第一检纠错算法进行编码;第一设备可根据第二丢包率状态获知丢包率符合第二算法开启条件,即可采用第二检纠错算法进行编码。As another optional solution, if the environmental parameter of the transmission channel includes the packet loss rate, the second device receives the test data packet sent by the first device; according to the number of received correct test data packets and the sent test data The number of packets, and the packet loss rate is calculated; if the packet loss rate meets the conditions for enabling the first algorithm, the first packet loss rate status is sent to the first device, and the first packet loss rate status is used to indicate The packet loss rate complies with the enabling condition of the first algorithm; if the packet loss rate meets the enabling condition of the second algorithm, a second packet loss rate status is sent to the first device, the first packet loss rate status It is used to indicate that the packet loss rate complies with the condition for enabling the second algorithm. The second device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the second device judging whether the packet loss rate is greater than or equal to the third threshold; The three thresholds indicate that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the packet loss rate is less than the third threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm. Wherein, the first device can learn that the packet loss rate conforms to the enabling condition of the first algorithm according to the first packet loss rate state, and can use the first error detection and correction algorithm for encoding; the first device can learn the packet loss rate according to the second packet loss rate state If the rate meets the enabling condition of the second algorithm, the second error detection and correction algorithm can be used for encoding.
本实施例中,该方法还包括:第一设备采集原始数据;对所述原始数据进行编码格式转换,生成所述传输数据。原始数据包括但不限于:图像数据流、视频数据流、指令数据、存储数据或者网络数据,其中,网络数据例如为:2G/3G/4G/5G数据或者WLAN数据等。例 如,第一设备对原始数据进行编码格式转换生成所述传输数据,包括:对原始数据进行二进制编码格式转换生成所述传输数据。In this embodiment, the method further includes: collecting raw data by the first device; converting the encoding format of the raw data to generate the transmission data. The original data includes but is not limited to: image data stream, video data stream, instruction data, storage data or network data, wherein the network data is, for example, 2G/3G/4G/5G data or WLAN data. For example, the first device performing encoding format conversion on the original data to generate the transmission data includes: performing binary encoding format conversion on the original data to generate the transmission data.
作为一种可选方案,在第一设备判断出传输通道的环境参数符合第一算法开启条件之后,第一设备执行采集原始数据的步骤;或者在第一设备判断出传输通道的环境参数符合第一算法开启条件之后,第一设备执行采集原始数据的步骤。例如:此种情况可参见图23中步骤510以及步骤538。又例如:此种情况可参见图23中步骤510以及步骤538。As an optional solution, after the first device determines that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, the first device executes the step of collecting raw data; or after the first device determines that the environmental parameters of the transmission channel meet the first algorithm enabling conditions; After an algorithm is turned on, the first device performs the step of collecting raw data. For example, in this case, refer to step 510 and step 538 in FIG. 23 . For another example, in this case, refer to step 510 and step 538 in FIG. 23 .
作为另一种可选方案,在第二设备判断出传输通道的环境参数符合第一算法开启条件,并向第一设备返回第一误码率状态之后,第一设备执行采集原始数据的步骤;或者在第二设备判断出传输通道的环境参数符合第一算法开启条件,并向第一设备返回第一误码率状态之后,第一设备执行采集原始数据的步骤。例如:此种情况可参见图20中步骤418以及步骤448。As another optional solution, after the second device determines that the environmental parameter of the transmission channel meets the first algorithm enabling condition, and returns the first bit error rate state to the first device, the first device performs the step of collecting the original data; Or after the second device determines that the environmental parameter of the transmission channel meets the first algorithm enabling condition, and returns the first bit error rate state to the first device, the first device performs the step of collecting the original data. For example, for this situation, please refer to step 418 and step 448 in FIG. 20 .
作为另一种可选方案,在第一设备通过第一检纠错算法对获取的传输数据进行编码之前以及所述通过第二检纠错算法对获取的传输数据进行编码之前,执行采集原始数据的步骤。此种情况中,第一设备无需等待传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件的判断结果,可实时进行原始数据的采集。例如:此种情况可参见图25中步骤614以及步骤650。As another optional solution, before the first device encodes the acquired transmission data by using the first error detection and correction algorithm and before encoding the acquired transmission data by using the second error detection and correction algorithm, the acquisition of the original data is performed. A step of. In this case, the first device does not need to wait for the environmental parameters of the transmission channel to meet the first algorithm enabling condition or the judgment result that meets the second algorithm enabling condition, and can collect raw data in real time. For example, in this case, refer to step 614 and step 650 in FIG. 25 .
本申请实施例中,判断环境通道参数符合第一算法开启条件还可以包括:所述误码率大于或等于第一阈值、所述系统传输速率大于或等于第二阈值以及所述丢包率大于或等于第三阈值的任意组合。In this embodiment of the present application, judging that the environmental channel parameters meet the conditions for enabling the first algorithm may further include: the bit error rate is greater than or equal to a first threshold, the system transmission rate is greater than or equal to a second threshold, and the packet loss rate is greater than or equal to or any combination equal to the third threshold.
本申请实施例中,判断传输通道环境参数符合第二算法开启条件还可以包括:所述误码率小于第一阈值、所述系统传输速率小于第二阈值以及所述丢包率小于第三阈值的任意组合。In this embodiment of the present application, judging that the transmission channel environment parameters meet the conditions for enabling the second algorithm may further include: the bit error rate is less than a first threshold, the system transmission rate is less than a second threshold, and the packet loss rate is less than a third threshold any combination of .
在一种可选的实施例中,所述第一检纠错算法包括至少二个检纠错算法,第二检纠错算法包括至少一个检纠错算法,所述第一检纠错算法中的检纠错算法的数量大于所述第二检纠错算法中的检纠错算法的数量。In an optional embodiment, the first error detection and correction algorithm includes at least two error detection and correction algorithms, the second error detection and correction algorithm includes at least one error detection and correction algorithm, and the first error detection and correction algorithm includes The number of error detection and correction algorithms is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
作为一种可选方案,所述第一检纠错算法包括FEC算法、CRC算法和ECC算法(例如为图20中的步骤420至步骤444,以及图23中的步骤512至步骤524);或者,所述第一检纠错算法包括FEC算法和CRC算法;或者,所述第一检纠错算法包括FEC算法和ECC算法。例如:在图20中的步骤420至步骤444中,以及在图23中的步骤512至步骤524中,传输数据包括第一数据块,第一编码数据包括第四数据块。需要说明的是:FEC算法包括但不限于里德-所罗门码(Reed-solomon codes,简称RS码)算法。As an optional solution, the first error detection and correction algorithm includes an FEC algorithm, a CRC algorithm and an ECC algorithm (for example, steps 420 to 444 in FIG. 20 and steps 512 to 524 in FIG. 23 ); or , the first error detection and correction algorithm includes an FEC algorithm and a CRC algorithm; or, the first error detection and correction algorithm includes an FEC algorithm and an ECC algorithm. For example, in steps 420 to 444 in FIG. 20 and steps 512 to 524 in FIG. 23 , the transmission data includes the first data block, and the first encoded data includes the fourth data block. It should be noted that the FEC algorithm includes but is not limited to the Reed-Solomon codes (Reed-solomon codes, RS code for short) algorithm.
作为另一种可选方案,所述第二检纠错算法包括FEC算法(例如为:图25中的步骤654至步骤666);或者,所述第二检纠错算法包括CRC算法;或者,所述第二检纠错算法包括ECC算法;或者,所述第二检纠错算法包括CRC算法和ECC算法(例如为:图20中的步骤450至步骤468,以及图23中的步骤540至步骤558)。例如:图25中的步骤654至步骤666,传输数据包括第一数据块,第一编码数据包括第三数据块。又例如:图20中的步骤450至步骤468中,以及图23中的步骤540至步骤558中,传输数据包括第一数据块,第一编码数据包括第五数据块。As another optional solution, the second error detection and correction algorithm includes an FEC algorithm (for example, steps 654 to 666 in FIG. 25 ); or, the second error detection and correction algorithm includes a CRC algorithm; or, The second error detection and correction algorithm includes an ECC algorithm; or, the second error detection and correction algorithm includes a CRC algorithm and an ECC algorithm (for example, steps 450 to 468 in FIG. 20 and steps 540 to 540 in FIG. 23 ) step 558). For example, in steps 654 to 666 in FIG. 25 , the transmission data includes the first data block, and the first encoded data includes the third data block. For another example, in steps 450 to 468 in FIG. 20 and steps 540 to 558 in FIG. 23 , the transmission data includes the first data block, and the first encoded data includes the fifth data block.
本申请实施例中,所述第一编码数据包括指示字段,所述第一编码数据的指示字段用 于指示所述环境参数符合所述第一算法开启条件;和/或,所述第二编码数据包括指示字段,所述第二编码数据的指示字段用于指示所述环境参数符合所述第二算法开启条件。In this embodiment of the present application, the first encoded data includes an indication field, and the indication field of the first encoded data is used to indicate that the environment parameter complies with the condition for enabling the first algorithm; and/or the second encoded data The data includes an indication field, and the indication field of the second encoded data is used to indicate that the environmental parameter complies with the condition for enabling the second algorithm.
若仅第一编码数据中包括指示字段,则该指示字段例如为1。此种情况下,第二设备确定出符合第一算法开启条件具体包括:第二设备确定出编码数据中包括指示字段;第二设备确定出符合第二算法开启条件具体包括:确定出编码数据中未包括指示字段。If only the first encoded data includes an indication field, the indication field is, for example, 1. In this case, determining by the second device that the conditions for enabling the first algorithm are met specifically includes: determining that the encoded data includes an indication field; determining that the enabling conditions for the second algorithm are met by the second device specifically includes: determining that the encoded data contains an indication field; Indication field is not included.
若仅第二编码数据中包括指示字段,则该指示字段例如为1。此种情况下,第二设备确定出符合第一算法开启条件具体包括:第二设备确定出编码数据中未包括指示字段;第二设备确定出符合第二算法开启条件具体包括:第二设备确定出编码数据中包括指示字段。If only the second encoded data includes an indication field, the indication field is, for example, 1. In this case, determining by the second device that the conditions for enabling the first algorithm are met specifically includes: determining by the second device that the encoded data does not include an indication field; determining by the second device that the enabling conditions for the second algorithm are met specifically includes: determining that the second device meets the enabling conditions for the second algorithm. The out-coded data includes an indication field.
若第一编码数据和第二编码数据中均包括指示字段时,可将第一编码数据中的指示字段和第二编码数据中的指示字段设置为不同的取值。第一编码数据中的指示字段为第一取值,第一取值例如为1,第二编码字段中的指示字段为第二取值,第二取值例如为0。此种情况下,第二设备确定出符合第一算法开启条件具体包括:第二设备确定出编码数据中的指示字段为1;第二设备确定出符合第二算法开启条件具体可包括:第二设备确定出编码数据中的指示字段为0。其中,第一取值用于指示所述环境参数符合所述第一算法开启条件,第二取值用于所述环境参数符合所述第二算法开启条件。If both the first encoded data and the second encoded data include an indication field, the indication field in the first encoded data and the indication field in the second encoded data may be set to different values. The indication field in the first encoded data is a first value, for example, the first value is 1, and the indication field in the second encoded field is a second value, and the second value is, for example, 0. In this case, determining by the second device that the conditions for enabling the first algorithm are met specifically includes: the second device determining that the indication field in the encoded data is 1; and determining by the second device that the conditions for enabling the second algorithm are met may specifically include: the second The device determines that the indication field in the encoded data is 0. Wherein, the first value is used to indicate that the environmental parameter complies with the enabling condition of the first algorithm, and the second value is used to indicate that the environmental parameter complies with the enabling condition of the second algorithm.
所述指示字段包括保留字段或新增字段。当指示字段包括新增字段时,该指示字段例如为:误码率确认字段(如图20中的步骤428)、传输速率确认字段(如图23中的步骤520)或者丢包率确认字段(如图25中的步骤622)。The indication fields include reserved fields or newly added fields. When the indication field includes a newly added field, the indication field is, for example, a bit error rate confirmation field (as shown in step 428 in FIG. 20 ), a transmission rate confirmation field (as shown in step 520 in FIG. 23 ), or a packet loss rate confirmation field ( Step 622 in Figure 25).
本申请实施例中,所述通过第一检纠错算法对编码数据进行校验,包括:若确定出所述编码数据包括指示字段,对编码数据进行FEC校验,所述指示字段用于指示所述环境参数符合所述第一算法开启条件;对FEC校验后的编码数据进行CRC校验和/或ECC校验。例如:此种情况可参见图20中步骤436和步骤438,以及图23中的528和步骤530。In the embodiment of the present application, the checking of the encoded data by using the first error detection and correction algorithm includes: if it is determined that the encoded data includes an indication field, performing FEC check on the encoded data, and the indication field is used to indicate The environment parameter conforms to the condition for enabling the first algorithm; CRC check and/or ECC check is performed on the encoded data after the FEC check. For example, for this situation, please refer to step 436 and step 438 in FIG. 20 , and step 528 and step 530 in FIG. 23 .
本申请实施例中,所述通过第一检纠错算法对编码数据进行校验,包括:对编码数据进行FEC校验;若确定出编码数据包括指示字段,对FEC校验后的编码数据进行CRC校验和/或ECC校验,所述指示字段用于指示所述环境参数符合所述第一算法开启条件。例如:此种情况可参见图25中的步骤636至步骤640。In the embodiment of the present application, the checking of the encoded data by the first error detection and correction algorithm includes: performing FEC checking on the encoded data; if it is determined that the encoded data includes an indication field, performing FEC checking on the encoded data. CRC check and/or ECC check, the indication field is used to indicate that the environment parameter complies with the enabling condition of the first algorithm. For example, in this case, please refer to step 636 to step 640 in FIG. 25 .
本申请实施例提供的数据传输方法的技术方案中,第一设备根据传输通道的环境参数符合第一算法开启条件选择第一检纠错算法对传输数据进行编码生成第一编码数据,或者第一设备根据传输通道的环境参数符合第二算法开启条件选择第二检纠错算法对传输数据进行编码生成第二编码数据,第二设备接收编码数据,若确定出符合第一算法开启条件时通过第一检纠错算法对编码数据进行校验生成传输数据,若确定出符合第二算法开启条件时通过第二检纠错算法对编码数据进行校验生成传输数据,实现了通过选择出的检纠错算法对数据传输过程中的传输数据进行检纠错处理,从而在保证数据传输可靠性的基础上提高了数据传输效率。In the technical solution of the data transmission method provided by the embodiment of the present application, the first device selects a first error detection and correction algorithm to encode the transmission data according to the environmental parameters of the transmission channel meeting the conditions for enabling the first algorithm to generate the first encoded data, or the first The device selects the second error detection and correction algorithm to encode the transmission data to generate the second encoded data according to the environmental parameters of the transmission channel that meet the conditions for enabling the second algorithm, and the second device receives the encoded data. The first error detection and correction algorithm verifies the encoded data to generate transmission data. If it is determined that the conditions for enabling the second algorithm are met, the second error detection and correction algorithm is used to verify the encoded data to generate transmission data. The error detection algorithm performs error detection and correction processing on the transmission data in the data transmission process, thereby improving the data transmission efficiency on the basis of ensuring the reliability of the data transmission.
图19是本申请一些实施例提供的一种数据传输系统的结构示意图,如图19所示,该数据传输系统例如为MIPI CSI-2 D-PHY数据传输系统,该数据传输系统采用CSI-2协议架构。如图19所示,该系统包括第一设备和第二设备,第一设备包括图像处理单元和发送装置,第二设备包括主处理器单元和接收装置。其中,第一设备为摄像头模组,则图像处理单元为摄像头传感器(Sensor),发送模块为接口电路;第二设备为主板,则主处理 器单元为AP,接收模块为接口电路。发送装置包括第一格式转换模块、协议发送单元和PHY层发送模块。协议发送单元包括ECC编码模块、CRC编码模块和FEC编码模块。接收装置包括第二格式转换模块、协议接收单元和PHY层接收模块,协议接收单元包括包头ECC解码模块、净核CRC解码模块和FEC解码模块,其中,PHY层发送模块和PHY层接收模块之间通过传输通道通信连接,图19中以一条传输通道为例进行描述。其中,协议发送单元包括CSI-2发送单元,协议接收单元包括CSI-2接收单元,PHY层发送模块包括D-PHY发送模块,PHY层接收模块包括D-PHY接收模块。FIG. 19 is a schematic structural diagram of a data transmission system provided by some embodiments of the present application. As shown in FIG. 19 , the data transmission system is, for example, a MIPI CSI-2 D-PHY data transmission system, and the data transmission system adopts CSI-2 Protocol Architecture. As shown in FIG. 19 , the system includes a first device and a second device, the first device includes an image processing unit and a sending device, and the second device includes a main processor unit and a receiving device. Wherein, the first device is a camera module, the image processing unit is a camera sensor (Sensor), and the sending module is an interface circuit; the second device is a motherboard, then the main processor unit is an AP, and the receiving module is an interface circuit. The sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module. The protocol sending unit includes an ECC encoding module, a CRC encoding module and an FEC encoding module. The receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module. The protocol receiving unit includes a packet header ECC decoding module, a clean core CRC decoding module and an FEC decoding module, wherein the PHY layer transmitting module and the PHY layer receiving module are between the The communication connection is made through a transmission channel, and a transmission channel is used as an example for description in FIG. 19 . The protocol sending unit includes a CSI-2 sending unit, the protocol receiving unit includes a CSI-2 receiving unit, the PHY layer sending module includes a D-PHY sending module, and the PHY layer receiving module includes a D-PHY receiving module.
图20是本申请一些实施例提供的数据传输方法的流程图,如图20所示,该方法包括:FIG. 20 is a flowchart of a data transmission method provided by some embodiments of the present application. As shown in FIG. 20 , the method includes:
步骤402、第二设备对第一设备进行工作参数配置。Step 402: The second device configures the working parameters of the first device.
如图19所示,第二设备的主处理器单元对图像处理单元进行工作参数配置。As shown in FIG. 19 , the main processor unit of the second device configures the working parameters of the image processing unit.
具体地,在所有实际使用的场景下,主板可对摄像头模组进行工作参数配置,使得摄像头模组能够按照工作参数的要求工作。其中,工作参数可包括分辨率、帧率和接口速率等。Specifically, in all actual use scenarios, the main board can configure the working parameters of the camera module, so that the camera module can work according to the requirements of the working parameters. The working parameters may include resolution, frame rate, interface rate, and the like.
用户点击第二设备的相机APP的图标,打开相机APP,以触发第二设备对第一设备进行工作参数配置。The user clicks the icon of the camera APP of the second device to open the camera APP, so as to trigger the second device to configure the working parameters of the first device.
步骤404、第一设备向第二设备发送第一序列。Step 404: The first device sends the first sequence to the second device.
图21是本申请一些实施例中训练码流的数据格式示意图,如图21所示,在链路处于高速(High Speed,简称HS)传输状态时,第一设备通过传输通道向第二设备发送一段训练码流,以完成系统的训练过程。协议发送单元(如图19所示)通过传输通道向协议接收单元发送训练码流。具体地,协议发送单元向PHY层发送模块发送训练码流,PHY层发送模块通过传输通道向PHY层接收模块发送训练码流,而后,PHY层接收模块将训练码流发送至协议接收单元,以实现CSI-2状态机均衡训练过程。FIG. 21 is a schematic diagram of the data format of the training code stream in some embodiments of the present application. As shown in FIG. 21 , when the link is in a high speed (High Speed, HS for short) transmission state, the first device sends the data to the second device through the transmission channel A training stream to complete the training process of the system. The protocol sending unit (as shown in Figure 19) sends the training code stream to the protocol receiving unit through the transmission channel. Specifically, the protocol sending unit sends the training code stream to the PHY layer sending module, the PHY layer sending module sends the training code stream to the PHY layer receiving module through the transmission channel, and then the PHY layer receiving module sends the training code stream to the protocol receiving unit to Implement the CSI-2 state machine equalization training process.
如图21所示,训练码流包括数据类型序列、均衡序列、第一序列、第二序列和第三序列。第一设备在发送训练码流的过程中,首先,第一设备向第二设备发送数据类型序列,该数据类型序列包括“Control Word”,“Control Word”可表示该训练码流为控制包,例如,该Control Word”可以为0101。而后,第一设备向第二设备发送均衡(Equalization)序列。接着,第一设备向第二设备发送第一序列,该第一序列可包括伪随机二进制数列(Pseudo-Random Binary Sequence,简称PRBS)15序列,例如,第一设备可向第二设备发送100万个PRBS15序列,以实现状态机均衡训练过程。As shown in Figure 21, the training code stream includes a data type sequence, an equalization sequence, a first sequence, a second sequence and a third sequence. In the process of sending the training code stream by the first device, first, the first device sends a data type sequence to the second device, and the data type sequence includes "Control Word", and "Control Word" can indicate that the training code stream is a control packet, For example, the Control Word" may be 0101. Then, the first device sends an equalization (Equalization) sequence to the second device. Next, the first device sends a first sequence to the second device, and the first sequence may include a pseudo-random binary number sequence (Pseudo-Random Binary Sequence, PRBS for short) 15 sequence, for example, the first device can send 1 million PRBS15 sequences to the second device to implement the state machine equalization training process.
步骤406、第一设备向第二设备发送第二序列。Step 406: The first device sends the second sequence to the second device.
如图21所示,第一设备在发送训练码流的过程中,第一设备向第二设备发送第二序列,该第二序列可包括PRBS31序列,例如,第一设备可向第二设备发送100万个PRBS31序列。As shown in FIG. 21 , during the process of sending the training code stream by the first device, the first device sends a second sequence to the second device, and the second sequence may include a PRBS31 sequence. For example, the first device may send a second sequence to the second device. 1 million PRBS31 sequences.
步骤408、第一设备向第二设备发送第三序列。Step 408: The first device sends the third sequence to the second device.
如图21所示,第一设备在发送训练码流的过程中,第一设备向第二设备发送第三序列,该第三序列可包括空闲(IDLE)序列。第二设备可直接丢弃该IDLE序列,忽略该IDLE序列,并一直保持链路恢复时钟锁定。As shown in FIG. 21 , during the process of sending the training code stream by the first device, the first device sends a third sequence to the second device, and the third sequence may include an idle (IDLE) sequence. The second device can directly discard the IDLE sequence, ignore the IDLE sequence, and keep the link recovery clock locked all the time.
步骤410、第二设备统计接收到的正确的第二序列的比特数。Step 410: The second device counts the received bits of the correct second sequence.
在第一设备发送IDLE序列的时间段内,第二设备统计出正确的第二序列的比特数。 协议接收单元(如图19所示)统计接收到的正确的第二序列的比特数。During the time period when the first device sends the IDLE sequence, the second device counts the correct number of bits of the second sequence. The protocol receiving unit (as shown in FIG. 19 ) counts the received bits of the correct second sequence.
步骤412、第二设备根据正确的第二序列的比特数和第一设备发送的第二序列的总比特数,计算出误码率。Step 412: The second device calculates the bit error rate according to the correct number of bits of the second sequence and the total number of bits of the second sequence sent by the first device.
在第一设备发送IDLE序列的时间段内,第二设备计算出误码率。具体地,第二设备通过公式1-n/N计算出误码率,其中,n为正确的第二序列的比特数,N为第二序列的总比特数。协议接收单元(如图19所示)计算出误码率。During the time period when the first device sends the IDLE sequence, the second device calculates the bit error rate. Specifically, the second device calculates the bit error rate by using the formula 1-n/N, where n is the correct number of bits of the second sequence, and N is the total number of bits of the second sequence. The protocol receiving unit (as shown in Figure 19) calculates the bit error rate.
步骤414、第二设备判断误码率是否大于或等于第一阈值,若是,则执行步骤416;若否,则执行步骤446。Step 414: The second device determines whether the bit error rate is greater than or equal to the first threshold, and if so, executes step 416; if not, executes step 446.
在第一设备发送IDLE序列的时间段内,第二设备判断误码率是否大于或等于第一阈值。第一阈值例如为:1e-12、1e-15或者1e-10。协议接收单元(如图19所示)判断误码率是否大于或等于第一阈值。During the time period when the first device sends the IDLE sequence, the second device determines whether the bit error rate is greater than or equal to the first threshold. The first threshold is for example: 1e-12, 1e-15 or 1e-10. The protocol receiving unit (as shown in FIG. 19 ) judges whether the bit error rate is greater than or equal to the first threshold.
作为一种可选方案,步骤406至步骤416和步骤446可以替换为:第一设备向所述第二设备依次发送第一序列和第二序列,以供所述第二设备统计接收到的正确的第二序列的比特数,所述第一序列用于实现状态机均衡训练;接收所述第二设备发送的正确的第二序列的比特数;根据所述第二设备发送的正确的第二序列的比特数和发送的第二序列的总比特数计算出误码率。第一设备判断判断误码率是否大于或等于第一阈值。As an optional solution, steps 406 to 416 and step 446 can be replaced by: the first device sends the first sequence and the second sequence to the second device in sequence, so that the second device can count the received correct The number of bits of the second sequence of The bit error rate is calculated from the number of bits of the sequence and the total number of bits of the second sequence sent. The first device determines whether the bit error rate is greater than or equal to the first threshold.
步骤416、第二设备向第一设备返回第一误码率状态。Step 416: The second device returns the first bit error rate status to the first device.
第二设备若判断出误码率大于或等于第一阈值,表明误码率较大,此时第二设备生成误码率大于或等于第一阈值这一判断结果对应的第一误码率状态(Bit Error Ratem State,简称BER State),例如,第一误码率状态可以为1。If the second device determines that the bit error rate is greater than or equal to the first threshold, it indicates that the bit error rate is relatively large. At this time, the second device generates the first bit error rate state corresponding to the judgment result that the bit error rate is greater than or equal to the first threshold. (Bit Error Rate State, referred to as BER State), for example, the first bit error rate state may be 1.
而后,在第一设备发送IDLE序列的时间段结束之前,第二设备的协议接收单元将第一误码率状态通过辅助通道(AUX)返回至第一设备的协议发送单元。Then, before the time period during which the first device sends the IDLE sequence ends, the protocol receiving unit of the second device returns the first bit error rate status to the protocol sending unit of the first device through the auxiliary channel (AUX).
发送第三序列的时间段可用于进行误码率的计算和判断步骤,从而使得误码率的计算和判断步骤能够在发送训练码流的过程中完成。The time period for sending the third sequence can be used for calculating and judging the bit error rate, so that the steps of calculating and judging the bit error rate can be completed in the process of sending the training code stream.
步骤418、第一设备采集图像数据流,并对图像数据流进行编码格式转换生成第一数据块。Step 418: The first device collects the image data stream, and converts the encoding format of the image data stream to generate a first data block.
图像处理单元(如图19所示)采集图像数据流,并将采集的图像数据流发送至第一格式转换模块(如图19所示),第一格式转换模块对图像数据流进行编码格式转换。The image processing unit (as shown in Figure 19) collects the image data stream, and sends the collected image data stream to the first format conversion module (as shown in Figure 19), and the first format conversion module performs encoding format conversion on the image data stream .
步骤420、第一设备为第一数据块添加数据包头。Step 420: The first device adds a data packet header to the first data block.
图22是本申请一些实施例中基于D-PHY进行传输的数据块的格式示意图,如图22所示,第一格式转换模块(如图19所示)对图像数据流进行二进制编码格式转换,以形成“Payload”。数据包头可包括Data ID、16-bit WC和VCX。第一格式转换模块将添加了数据包头的第一数据块发送至协议发送单元(如图19所示)。FIG. 22 is a schematic diagram of the format of a data block transmitted based on D-PHY in some embodiments of the present application. As shown in FIG. 22 , the first format conversion module (as shown in FIG. 19 ) performs binary encoding format conversion on the image data stream, to form the "Payload". The packet header can include Data ID, 16-bit WC and VCX. The first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit (as shown in FIG. 19 ).
步骤422、第一设备对数据包头进行ECC编码生成第一ECC字段,以及对第一数据块进行CRC编码生成CRC字段。Step 422: The first device performs ECC encoding on the data packet header to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
如图22所示,协议发送单元通过包头ECC编码模块(如图19所示)对数据包头进行ECC编码,生成第一ECC字段。包头ECC编码模块通过6-bit的扩展汉明码对Data ID、WC和VCX进行ECC编码,生成第一ECC字段,其中,ECC字段为6-bit字段。需要说明的是:图22中所示的ECC字段包括第一ECC字段。As shown in FIG. 22 , the protocol sending unit performs ECC encoding on the data packet header through the packet header ECC encoding module (as shown in FIG. 19 ) to generate the first ECC field. The packet header ECC encoding module performs ECC encoding on the Data ID, WC, and VCX through a 6-bit extended Hamming code to generate a first ECC field, where the ECC field is a 6-bit field. It should be noted that the ECC field shown in FIG. 22 includes the first ECC field.
如图22所示,协议发送单元通过净核CRC编码模块(如图19所示)对第一数据块进行CRC编码,生成CRC字段。净核CRC编码模块通过多项式对“Payload”进行CRC编码生成CRC字段。其中,多项式例如为:X 16+X 12+X 5+X 0,CRC字段为16-bit字段。 As shown in Figure 22, the protocol sending unit performs CRC coding on the first data block through the clean core CRC coding module (as shown in Figure 19) to generate a CRC field. The net core CRC encoding module performs CRC encoding on "Payload" through a polynomial to generate a CRC field. The polynomial is, for example, X 16 +X 12 +X 5 +X 0 , and the CRC field is a 16-bit field.
步骤424、第一设备将第一ECC字段和CRC字段插入到第一数据块的包头和包尾,生成第二数据块。Step 424: The first device inserts the first ECC field and the CRC field into the packet header and the packet trailer of the first data block to generate a second data block.
如图22所示,协议发送单元(如图19所示)将第一ECC字段和CRC字段分别放置于“Payload”的包头和包尾,此时Data ID、WC和VCX分别位于第二数据块的指定位置。需要说明的是:图22中所示的ECC字段为第一ECC字段。As shown in Figure 22, the protocol sending unit (as shown in Figure 19) places the first ECC field and the CRC field at the header and end of the "Payload" packet, respectively. At this time, Data ID, WC, and VCX are located in the second data block, respectively. the specified location. It should be noted that: the ECC field shown in FIG. 22 is the first ECC field.
步骤426、第一设备对第二数据块的不同数据段进行FEC编码,生成每个数据段对应的FEC校验码,并将每个FEC校验码放置于对应的数据段的尾部。Step 426: The first device performs FEC encoding on different data segments of the second data block, generates an FEC check code corresponding to each data segment, and places each FEC check code at the end of the corresponding data segment.
如图22所示,协议发送单元(如图19所示)若判断出第一误码率状态为1时,通过FEC编码模块将第二数据块分为多个数据段,例如,多个数据段可包括第二数据块Part 0至Part N-1。FEC编码模块对第二数据块的不同数据段进行FEC编码,生成每个数据段对应的FEC校验码(FEC Parity),并将每个FEC校验码放置于对应的数据段的尾部。As shown in FIG. 22 , if the protocol sending unit (as shown in FIG. 19 ) determines that the first bit error rate status is 1, the FEC encoding module divides the second data block into multiple data segments, for example, multiple data segments The segment may include second data blocks Part 0 to Part N-1. The FEC encoding module performs FEC encoding on different data segments of the second data block, generates an FEC parity (FEC Parity) corresponding to each data segment, and places each FEC parity at the end of the corresponding data segment.
步骤428、第一设备在第二数据块之前添加指示字段,以生成第三数据块。Step 428: The first device adds an indication field before the second data block to generate a third data block.
本实施例中,作为一种可选方案,指示字段为新增字段,指示字段例如为:误码率确认(Bit Error Rate Ensure,简称BER EN)字段。该误码率确认字段用于指示误码率大于或等于第一阈值。如图22所示,协议发送单元通过FEC编码模块(如图19所示)在第二数据块之前添加BER EN字段。误码率确认字段的取值例如为1。In this embodiment, as an optional solution, the indication field is a newly added field, and the indication field is, for example, a bit error rate confirmation (Bit Error Rate Ensure, BER EN for short) field. The bit error rate confirmation field is used to indicate that the bit error rate is greater than or equal to the first threshold. As shown in Figure 22, the protocol sending unit adds a BER EN field before the second data block through the FEC encoding module (as shown in Figure 19). The value of the bit error rate confirmation field is, for example, 1.
作为另一种可选方案,指示字段为保留字段,此种情况下,步骤428可以包括:第一设备设置保留字段的取值,以使保留字段用于指示误码率大于或等于第一阈值。保留字段的取值例如为1。As another optional solution, the indication field is a reserved field. In this case, step 428 may include: the first device sets the value of the reserved field, so that the reserved field is used to indicate that the bit error rate is greater than or equal to the first threshold. . The value of the reserved field is, for example, 1.
步骤430、第一设备在第三数据块的开始位置设置SoT标识以及在第三数据块的结束位置设置EoT标识,以形成第四数据块。Step 430: The first device sets the SoT flag at the start position of the third data block and the EoT flag at the end position of the third data block to form a fourth data block.
如图22所示,协议发送单元(如图19所示)在第三数据块的开始位置设置SoT标识以及在第三数据块的结束位置设置EoT以形成第四数据块。As shown in FIG. 22 , the protocol sending unit (as shown in FIG. 19 ) sets the SoT flag at the start position of the third data block and the EoT at the end position of the third data block to form the fourth data block.
步骤432、第一设备将第四数据块发送至第二设备。Step 432: The first device sends the fourth data block to the second device.
如图22所示,协议发送单元(如图19所示)将第四数据块发送至PHY层发送模块(如图19所示),PHY层发送模块通过传输通道将第四数据块发送至PHY层接收模块(如图19所示),PHY层接收模块将第四数据块发送至协议接收单元(如图19所示)。As shown in Figure 22, the protocol sending unit (shown in Figure 19) sends the fourth data block to the PHY layer sending module (shown in Figure 19), and the PHY layer sending module sends the fourth data block to the PHY through the transmission channel Layer receiving module (as shown in Figure 19), the PHY layer receiving module sends the fourth data block to the protocol receiving unit (as shown in Figure 19).
步骤434、第二设备去除第四数据块的SoT和EoT,以生成第三数据块。Step 434: The second device removes the SoT and EoT of the fourth data block to generate a third data block.
如图22所示,协议接收单元(如图19所示)去除第四数据块的SoT和EoT,以生成第三数据块。As shown in FIG. 22, the protocol reception unit (as shown in FIG. 19) removes the SoT and EoT of the fourth data block to generate the third data block.
步骤436、第二设备对第三数据块进行解析。Step 436: The second device parses the third data block.
协议接收单元(如图19所示)对第三数据块进行解析。The protocol receiving unit (as shown in FIG. 19 ) parses the third data block.
步骤438、第二设备若解析出指示字段,对第三数据块进行FEC检纠错校验,生成第二数据块。Step 438: If the second device parses the indication field, it performs FEC detection and error correction check on the third data block to generate a second data block.
协议接收单元(如图19所示)若解析出指示字段,通过指示字段可获取误码率大于或等于第一阈值的判断结果,进而确定出采用第一检纠错算法,激活FEC解码模块(如 图19所示),由FEC解码模块通过RS码解码算法对第三数据块进行FEC校验,生成FEC校验结果。FEC校验结果包括校验成功、可纠正的错误结果或者不可纠正的错误结果。If the protocol receiving unit (as shown in Figure 19) parses the indication field, the judgment result that the bit error rate is greater than or equal to the first threshold can be obtained through the indication field, and then it is determined that the first error detection and correction algorithm is adopted, and the FEC decoding module ( As shown in FIG. 19 ), the FEC decoding module performs FEC verification on the third data block through the RS code decoding algorithm to generate an FEC verification result. FEC verification results include verification success, correctable error results or uncorrectable error results.
协议接收单元若识别出FEC校验结果包括可纠正的错误结果时,对第三数据块的错误数据进行纠正处理,并将第三数据块进行解包生成第二数据块。If the protocol receiving unit recognizes that the FEC check result includes a correctable error result, it corrects the erroneous data of the third data block, and unpacks the third data block to generate the second data block.
协议接收单元若识别出FEC校验结果包括校验成功,表明第三数据块中不存在错误数据,可直接将第三数据块进行解包生成第二数据块。If the protocol receiving unit recognizes that the FEC verification result includes verification success, indicating that there is no erroneous data in the third data block, it can directly unpack the third data block to generate the second data block.
协议接收单元若识别出FEC校验结果包括不可纠正的错误结果,将第三数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对第三数据块的处理方式。If the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result, the third data block will be discarded, skipped directly or retransmitted. In this case, the developer can determine the processing of the third data block. Way.
步骤440、第二设备对第二数据块中的CRC字段进行CRC校验,生成CRC校验结果。Step 440: The second device performs CRC check on the CRC field in the second data block to generate a CRC check result.
协议接收单元(如图19所示)通过净核CRC解码模块将第二数据块中的CRC字段与多项式进行模2除计算,得到余数,余数即为CRC校验结果。若CRC校验结果为0,则表明接收到的“Payload”是正确的数据;若CRC校验结果不为0,则表明接收到的“Payload”是错误的数据。其中,多项式可包括X 16+X 12+X 5+X 0The protocol receiving unit (as shown in FIG. 19 ) divides the CRC field in the second data block and the polynomial by modulo 2 through the clean core CRC decoding module to obtain the remainder, which is the CRC check result. If the CRC check result is 0, it indicates that the received "Payload" is correct data; if the CRC check result is not 0, it indicates that the received "Payload" is wrong data. Wherein, the polynomial may include X 16 +X 12 +X 5 +X 0 .
步骤442、第二设备对第二数据块中的数据包头进行ECC校验,生成ECC校验结果。Step 442: The second device performs ECC verification on the data packet header in the second data block, and generates an ECC verification result.
如图22所示,协议接收单元通过包头ECC解码模块(如图19所示)对数据包头中的Data ID、WC和VCX进行ECC编码生成第二ECC字段,将第一ECC字段与第二ECC字段进行异或计算得出ECC校验结果。若ECC校验结果为0,表明数据包头正确;若ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则表明需要对数据包头的错误位进行纠正;若ECC校验结果不为0且ECC校验结果指示出有2-bit以上的错误,则表明数据包头发生了不可纠正的错误。As shown in Figure 22, the protocol receiving unit performs ECC encoding on the Data ID, WC and VCX in the packet header through the packet header ECC decoding module (as shown in Figure 19) to generate the second ECC field, and the first ECC field and the second ECC The field is XORed to obtain the ECC check result. If the ECC check result is 0, it indicates that the data packet header is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of the data packet header needs to be corrected; if If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it indicates that an uncorrectable error has occurred in the data packet header.
其中,包头ECC解码模块可采用与包头ECC编码模块相同的编码规则对数据包头中的Data ID、WC和VCX进行ECC编码,即包头ECC解码模块可通过6-bit的扩展汉明码对Data ID、WC和VCX进行ECC编码生成第二ECC字段。Among them, the packet header ECC decoding module can use the same coding rules as the packet header ECC encoding module to perform ECC encoding on the Data ID, WC and VCX in the data packet header, that is, the packet header ECC decoding module can pass 6-bit extended Hamming code to Data ID, WC and VCX. WC and VCX perform ECC encoding to generate the second ECC field.
步骤444、第二设备若识别出校验结果为0且验证结果为0时,对第二数据块进行解包处理生成第一数据块,对第一数据块进行编码格式转换生成图像数据流,流程结束。 Step 444, if the second device recognizes that the verification result is 0 and the verification result is 0, it performs unpacking processing on the second data block to generate the first data block, and performs encoding format conversion on the first data block to generate the image data stream, Process ends.
协议接收单元(如图19所示)若识别出校验结果为0且验证结果为0时,去除第二数据块的数据包头,得到第一数据块。If the protocol receiving unit (as shown in FIG. 19 ) recognizes that the verification result is 0 and the verification result is 0, the packet header of the second data block is removed to obtain the first data block.
第二格式转换模块(如图19所示)对第一数据块进行编码格式转换生成图像数据流,并将图像数据流上传至主处理器单元,并将图像数据流上传至主处理器单元。具体地,第二格式转换模块将第一数据块进行像素图像编码格式转换生成图像数据流,并将图像数据流上传至主处理器单元。The second format conversion module (as shown in FIG. 19 ) converts the encoding format of the first data block to generate an image data stream, uploads the image data stream to the main processor unit, and uploads the image data stream to the main processor unit. Specifically, the second format conversion module performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the main processor unit.
步骤446、第二设备向第一设备返回第二误码率状态。Step 446: The second device returns the second bit error rate status to the first device.
第二设备若判断出误码率小于第一阈值,表明误码率较小,此时第二设备生成误码率小于第一阈值这一判断结果对应的第二误码率状态(Bit Error Ratem State,简称BER State),例如,第二误码率状态可以为0。If the second device determines that the bit error rate is less than the first threshold, it indicates that the bit error rate is small. At this time, the second device generates a second bit error rate state (Bit Error Rate corresponding to the judgment result that the bit error rate is less than the first threshold). State, referred to as BER State), for example, the second bit error rate state may be 0.
而后,在第一设备发送IDLE序列的时间段结束之前,第二设备的协议接收单元将第二误码率状态通过辅助通道(AUX)返回至第一设备的协议发送单元。Then, before the time period during which the first device sends the IDLE sequence ends, the protocol receiving unit of the second device returns the second bit error rate status to the protocol sending unit of the first device through the auxiliary channel (AUX).
步骤448、第一设备采集图像数据流,并对图像数据流进行编码格式转换生成第一数据块。Step 448: The first device collects the image data stream, and converts the encoding format of the image data stream to generate a first data block.
图像处理单元(如图19所示)采集图像数据流,并将采集的图像数据流发送至第一格式转换模块(如图19所示),第一格式转换模块对图像数据流进行编码格式转换,生成第一数据块。The image processing unit (as shown in Figure 19) collects the image data stream, and sends the collected image data stream to the first format conversion module (as shown in Figure 19), and the first format conversion module performs encoding format conversion on the image data stream , generate the first data block.
步骤450、第一设备为第一数据块添加数据包头。Step 450: The first device adds a data packet header to the first data block.
如图22所示,第一格式转换模块(如图19所示)对图像数据流进行二进制编码格式转换,以形成“Payload”。数据包头可包括Data ID、16-bit WC和VCX。第一格式转换模块将添加了数据包头的第一数据块发送至协议发送单元(如图19所示)。As shown in FIG. 22 , the first format conversion module (as shown in FIG. 19 ) performs binary encoding format conversion on the image data stream to form “Payload”. The packet header can include Data ID, 16-bit WC and VCX. The first format conversion module sends the first data block to which the data packet header is added to the protocol sending unit (as shown in FIG. 19 ).
步骤452、第一设备对数据包头进行ECC编码生成第一ECC字段,以及对第一数据块进行CRC编码生成CRC字段。Step 452: The first device performs ECC encoding on the data packet header to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
如图22所示,协议发送单元通过包头ECC编码模块(如图19所示)对数据包头进行编码,生成第一ECC字段。包头ECC编码模块通过6-bit的扩展汉明码对Data ID、WC和VCX进行ECC编码,生成第一ECC字段,其中,ECC字段为6-bit字段。需要说明的是:图22中所示的ECC字段包括第一ECC字段。As shown in FIG. 22 , the protocol sending unit encodes the data packet header through the packet header ECC encoding module (as shown in FIG. 19 ) to generate the first ECC field. The packet header ECC encoding module performs ECC encoding on the Data ID, WC, and VCX through a 6-bit extended Hamming code to generate a first ECC field, where the ECC field is a 6-bit field. It should be noted that the ECC field shown in FIG. 22 includes the first ECC field.
如图22所示,协议发送单元通过净核CRC编码模块(如图19所示)对第一数据块进行CRC编码,生成CRC字段。净核CRC编码模块通过多项式对“Payload”进行CRC编码生成CRC字段。其中,多项式例如为:X 16+X 12+X 5+X 0,CRC字段为16-bit字段。 As shown in Figure 22, the protocol sending unit performs CRC coding on the first data block through the clean core CRC coding module (as shown in Figure 19) to generate a CRC field. The net core CRC encoding module performs CRC encoding on "Payload" through a polynomial to generate a CRC field. The polynomial is, for example, X 16 +X 12 +X 5 +X 0 , and the CRC field is a 16-bit field.
步骤454、第一设备将第一ECC字段和CRC字段插入到第一数据块的包头和包尾,生成第二数据块。Step 454: The first device inserts the first ECC field and the CRC field into the packet header and the packet trailer of the first data block to generate a second data block.
如图22所示,协议发送单元(如图19所示)将第一ECC字段和CRC字段分别放置于“Payload”的包头和包尾,此时Data ID、WC和VCX分别位于第二数据块的指定位置。As shown in Figure 22, the protocol sending unit (as shown in Figure 19) places the first ECC field and the CRC field at the header and end of the "Payload" packet, respectively. At this time, Data ID, WC, and VCX are located in the second data block, respectively. the specified location.
步骤456、第一设备在第二数据块的开始位置设置SoT标识以及在第二数据块的结束位置设置EoT标识,以形成第五数据块。Step 456: The first device sets the SoT flag at the start position of the second data block and the EoT flag at the end position of the second data block to form a fifth data block.
如图22所示,协议发送单元(如图19所示)在第二数据块的开始位置设置SoT标识以及在第二数据块的结束位置设置EoT标识以形成第五数据块。As shown in FIG. 22 , the protocol sending unit (as shown in FIG. 19 ) sets the SoT flag at the beginning of the second data block and the EoT flag at the end of the second data block to form a fifth data block.
步骤458、第一设备将第五数据块发送至第二设备。Step 458: The first device sends the fifth data block to the second device.
如图22所示,协议发送单元(如图19所示)将第五数据块发送至PHY层发送模块(如图19所示),PHY层发送模块通过传输通道将第五数据块发送至PHY层接收模块(如图19所示),PHY层接收模块将第五数据块发送至协议接收单元(如图19所示)。As shown in Figure 22, the protocol sending unit (shown in Figure 19) sends the fifth data block to the PHY layer sending module (shown in Figure 19), and the PHY layer sending module sends the fifth data block to the PHY through the transmission channel Layer receiving module (as shown in Figure 19), the PHY layer receiving module sends the fifth data block to the protocol receiving unit (as shown in Figure 19).
步骤460、第二设备去除第五数据块的SoT和EoT,以生成第二数据块。Step 460: The second device removes the SoT and EoT of the fifth data block to generate a second data block.
如图22所示,协议接收单元(如图19所示)去除第五数据块的SoT和EoT,以生成第二数据块。As shown in FIG. 22, the protocol reception unit (as shown in FIG. 19) removes the SoT and EoT of the fifth data block to generate the second data block.
步骤462、第二设备对第二数据块进行解析。Step 462: The second device parses the second data block.
协议接收模块通过FEC解码模块对第二数据块进行解析。The protocol receiving module parses the second data block through the FEC decoding module.
步骤464、第二设备若未解析出指示字段,对第二数据块中的CRC字段进行CRC校验,生成CRC校验结果。Step 464: If the second device does not parse out the indication field, it performs CRC check on the CRC field in the second data block to generate a CRC check result.
协议接收单元(如图19所示)若未解析出指示字段,获取到误码率小于第一阈值的 判断结果,进而确定出采用第二检纠错算法,激活净核CRC解码模块(如图19所示),由净核CRC解码模块进行CRC校验和ECC校验。需要说明的是:本实施例中,第二设备若未解析出指示字段时,还可先执行步骤466,而后再执行步骤464中的对第二数据块中的CRC字段进行CRC校验,生成CRC校验结果的步骤。If the protocol receiving unit (as shown in Figure 19) does not parse the indication field, it obtains the judgment result that the bit error rate is less than the first threshold, and then determines that the second error detection and correction algorithm is used, and activates the clean core CRC decoding module (as shown in the figure). 19), CRC check and ECC check are performed by the clean core CRC decoding module. It should be noted that: in this embodiment, if the second device does not parse out the indication field, it can also perform step 466 first, and then perform the CRC check on the CRC field in the second data block in step 464 to generate CRC check result steps.
协议接收单元(如图19所示)通过净核CRC解码模块将第二数据块中的CRC字段与多项式进行模2除计算,得到余数,余数即为CRC校验结果。若CRC校验结果为0,则表明接收到的“Payload”是正确的数据;若CRC校验结果不为0,则表明接收到的“Payload”是错误的数据。其中,多项式例如为:X 16+X 12+X 5+X 0The protocol receiving unit (as shown in FIG. 19 ) divides the CRC field in the second data block and the polynomial by modulo 2 through the clean core CRC decoding module to obtain the remainder, which is the CRC check result. If the CRC check result is 0, it indicates that the received "Payload" is correct data; if the CRC check result is not 0, it indicates that the received "Payload" is wrong data. The polynomial is, for example: X 16 +X 12 +X 5 +X 0 .
步骤466、第二设备对第二数据块中的数据包头进行ECC校验,生成ECC校验结果。Step 466: The second device performs ECC verification on the data packet header in the second data block, and generates an ECC verification result.
如图22所示,协议接收单元通过包头ECC解码模块(如图19所示)对数据包头中的Data ID、WC和VCX进行ECC编码生成第二ECC字段,将第一ECC字段与第二ECC字段进行异或计算得出ECC校验结果。若ECC校验结果为0,表明数据包头正确;若ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则表明需要对数据包头的错误位进行纠正;若ECC校验结果不为0且ECC校验结果指示出有2-bit以上的错误,则表明数据包头发生了不可纠正的错误。As shown in Figure 22, the protocol receiving unit performs ECC encoding on the Data ID, WC and VCX in the packet header through the packet header ECC decoding module (as shown in Figure 19) to generate the second ECC field, and the first ECC field and the second ECC The field is XORed to obtain the ECC check result. If the ECC check result is 0, it indicates that the data packet header is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of the data packet header needs to be corrected; if If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it indicates that an uncorrectable error has occurred in the data packet header.
其中,包头ECC解码模块可采用与包头ECC编码模块相同的编码规则对数据包头中的Data ID、WC和VCX进行ECC编码,即包头ECC解码模块可通过6-bit的扩展汉明码对Data ID、WC和VCX进行ECC编码生成第二ECC字段。Among them, the packet header ECC decoding module can use the same coding rules as the packet header ECC encoding module to perform ECC encoding on the Data ID, WC and VCX in the data packet header, that is, the packet header ECC decoding module can pass 6-bit extended Hamming code to Data ID, WC and VCX. WC and VCX perform ECC encoding to generate the second ECC field.
步骤468、第二设备若识别出校验结果为0且验证结果为0时,对第二数据块进行解包处理生成第一数据块,对第一数据块进行编码格式转换生成图像数据流。Step 468: If the second device recognizes that the verification result is 0 and the verification result is 0, it unpacks the second data block to generate a first data block, and performs encoding format conversion on the first data block to generate an image data stream.
如图22所示,协议接收单元(如图19所示)若识别出校验结果为0且验证结果为0时,去除第二数据块的数据包头,得到第一数据块。As shown in FIG. 22 , if the protocol receiving unit (as shown in FIG. 19 ) recognizes that the verification result is 0 and the verification result is 0, the packet header of the second data block is removed to obtain the first data block.
第二格式转换模块对第一数据块进行编码格式转换生成图像数据流,并将图像数据流上传至主处理器单元,并将图像数据流上传至主处理器单元。具体地,第二格式转换模块将第一数据块进行像素图像编码格式转换生成图像数据流,并将图像数据流上传至主处理器单元。The second format conversion module converts the encoding format of the first data block to generate an image data stream, uploads the image data stream to the main processor unit, and uploads the image data stream to the main processor unit. Specifically, the second format conversion module performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the main processor unit.
需要说明的是:图20中的步骤420至步骤444可以替换为:通过FEC算法和CRC算法进行编码的方案;或者,通过FEC算法和ECC算法进行编码的方案。图20中的步骤450至步骤468可以替换为:通过FEC算法进行校验的方案;或者,通过CRC算法进行校验的方案;或者,通过ECC算法进行校验的方案。It should be noted that: Steps 420 to 444 in FIG. 20 can be replaced with: the encoding scheme using the FEC algorithm and the CRC algorithm; or the encoding scheme using the FEC algorithm and the ECC algorithm. Steps 450 to 468 in FIG. 20 can be replaced with: a scheme of performing verification through an FEC algorithm; or a scheme of performing verification through a CRC algorithm; or a scheme of performing verification through an ECC algorithm.
本申请实施例的技术方案中,通过检测传输通道环境而获取到误码率,当误码率较大时选择FEC算法、CRC算法和ECC算法的组合对数据传输过程中的传输数据进行检纠错处理,实现了多bits错误数据的检纠错,从而提高了数据传输的可靠性;当误码率较小时选择CRC算法和ECC算法的组合对数据传输过程中的传输数据进行检纠错处理,避免了检纠错处理时数据冗余较大的情况,从而提高了数据传输效率。采用本实施例的数据传输方法在保证数据传输可靠性的基础上提高了数据传输效率。本申请实施例中,在保证传输效率最大化、功耗最低的情境下,特别是可以在误码率较大时,实现多bits纠错,使数据传输的可靠性提高。In the technical solutions of the embodiments of the present application, the bit error rate is obtained by detecting the transmission channel environment, and when the bit error rate is large, a combination of the FEC algorithm, the CRC algorithm and the ECC algorithm is selected to detect and correct the transmission data in the data transmission process. Error processing realizes error detection and correction of multi-bit error data, thereby improving the reliability of data transmission; when the bit error rate is small, the combination of CRC algorithm and ECC algorithm is selected to detect and correct the transmission data during the data transmission process. , which avoids the situation of large data redundancy during error detection and correction processing, thereby improving the data transmission efficiency. Using the data transmission method of this embodiment improves data transmission efficiency on the basis of ensuring data transmission reliability. In the embodiment of the present application, in the case of ensuring maximum transmission efficiency and minimum power consumption, especially when the bit error rate is relatively large, multi-bit error correction can be implemented, thereby improving the reliability of data transmission.
图23是本申请另一些实施例提供的数据传输方法的流程图,如图23所示,图23与 图20所示的数据传输方法的区别在于:图23是通过系统传输速率确定采用第一检纠错算法或者第二检纠错算法,区别步骤可如下所示:FIG. 23 is a flowchart of a data transmission method provided by other embodiments of the present application. As shown in FIG. 23 , the difference between FIG. 23 and the data transmission method shown in FIG. 20 is: Error detection and correction algorithm or second error detection and correction algorithm, the difference steps can be as follows:
步骤504、第一设备向第二设备发送第一序列。Step 504: The first device sends the first sequence to the second device.
首先,第一设备向第二设备发送数据类型序列,该数据类型序列包括“Control Word”,“Control Word”可表示该训练码流为控制包,例如,该“Control Word”可以为0101。而后,第一设备向第二设备发送均衡(Equalization)序列。接着,第一设备向第二设备发送第一序列,该第一序列可包括PRBS15序列,例如,第一设备可向第二设备发送100万个PRBS15序列,以实现状态机均衡训练过程。由于本实施例后续无需计算误码率,因此后续无需再发送第二序列和第三序列,从而提高了训练效率。First, the first device sends a data type sequence to the second device, where the data type sequence includes "Control Word", and "Control Word" may indicate that the training code stream is a control packet, for example, the "Control Word" may be 0101. Then, the first device sends an equalization (Equalization) sequence to the second device. Next, the first device sends a first sequence to the second device, the first sequence may include a PRBS15 sequence, for example, the first device may send 1 million PRBS15 sequences to the second device to implement a state machine equalization training process. Since this embodiment does not need to calculate the bit error rate in the future, it is unnecessary to send the second sequence and the third sequence in the future, thereby improving the training efficiency.
协议发送单元(如图19所示)通过传输通道向协议接收单元发送第一序列。The protocol sending unit (as shown in FIG. 19 ) sends the first sequence to the protocol receiving unit through the transmission channel.
步骤506、第一设备从切速状态寄存器读取系统传输速率。Step 506: The first device reads the system transmission rate from the speed cut state register.
协议发送单元(如图19所示)从切速状态寄存器读取系统传输速率。The protocol sending unit (shown in Figure 19) reads the system transfer rate from the speed cut status register.
步骤508、第一设备判断系统传输速率是否大于或等于第二阈值,若是,执行步骤510;若否,则执行步骤538。Step 508: The first device determines whether the system transmission rate is greater than or equal to the second threshold, and if so, executes step 510; if not, executes step 538.
如图19所示,协议发送单元判断系统传输速率是否大于或等于第二阈值。第二阈值例如为:16Gbps、32Gbp、8Gbps、28Gbps、56Gbps、10Gbps或40Gbps。As shown in FIG. 19 , the protocol sending unit determines whether the system transmission rate is greater than or equal to the second threshold. The second threshold is for example: 16Gbps, 32Gbps, 8Gbps, 28Gbps, 56Gbps, 10Gbps or 40Gbps.
本实施例中,步骤502可参见步骤402中的描述。In this embodiment, reference may be made to the description in step 402 for step 502 .
本实施例中,步骤510至步骤536可参见步骤418至步骤444。其中,区别在于:本实施例中,指示字段包括传输速率确认(Transport Rate Ensure,简称TR EN)字段,该传输速率确认字段用于指示系统传输速率大于或等于第二阈值,传输速率确认字段的取值例如为1。或者,指示字段为保留字段,此种情况下,步骤520可以包括:第一设备设置保留字段的取值,以使保留字段用于指示系统传输速率大于或等于第二阈值,保留字段的取值例如为1。。In this embodiment, steps 510 to 536 may refer to steps 418 to 444 . The difference is: in this embodiment, the indication field includes a transmission rate confirmation (Transport Rate Ensure, referred to as TR EN) field, and the transmission rate confirmation field is used to indicate that the system transmission rate is greater than or equal to the second threshold, and the transmission rate confirmation field The value is 1, for example. Or, the indication field is a reserved field. In this case, step 520 may include: the first device sets the value of the reserved field, so that the reserved field is used to indicate that the system transmission rate is greater than or equal to the second threshold, and the value of the reserved field is For example, 1. .
本实施例中,步骤538至步骤558可参见步骤448至步骤448。In this embodiment, steps 538 to 558 may refer to steps 448 to 448 .
本实施例的技术方案中,第一设备直接从切速状态寄存器读取系统传输速率,并根据传输速率选择出适合的检纠错算法,无需通过发送第二序列而获取误码率,减少了第一设备和第二设备之间频繁的交互过程,从而提高了系统的训练效率。In the technical solution of this embodiment, the first device directly reads the system transmission rate from the speed-cut state register, and selects a suitable error detection and correction algorithm according to the transmission rate, without obtaining the bit error rate by sending the second sequence, reducing the need for The frequent interaction process between the first device and the second device improves the training efficiency of the system.
图24是另一些实施例提供的数据传输系统的结构示意图,如图24所示,该数据传输系统例如为HDMI数据传输系统,该数据传输系统可包括第一设备和第二设备,第一设备包括视频数据处理单元和发送装置,第二设备包括负载(sink)单元和接收装置,发送装置和接收装置通过传输通道通信连接,视频数据处理单元与发送装置通信连接,负载单元与接收装置通信连接。其中,第一设备为主板,则视频数据处理单元为AP,发送模块为接口电路;第二设备为显示屏,则负载单元为显示模组,接收装置为接口电路。其中,发送装置包括第一格式转换模块、协议发送单元和PHY层发送模块。协议发送单元包括TMDS CEC编码模块、FEC编码模块和信道编码模块。接收装置包第二格式转换模块、协议接收单元和PHY层接收模块,协议接收单元包括TMDS CEC解码模块、FEC解码模块和信道解码模块,其中,PHY层发送模块和PHY层接收模块之间通过传输通道通信连接。FIG. 24 is a schematic structural diagram of a data transmission system provided by other embodiments. As shown in FIG. 24 , the data transmission system is, for example, an HDMI data transmission system. The data transmission system may include a first device and a second device. The first device Including a video data processing unit and a sending device, the second device includes a load (sink) unit and a receiving device, the sending device and the receiving device are communicatively connected through a transmission channel, the video data processing unit is communicatively connected with the sending device, and the load unit is communicatively connected with the receiving device. . Wherein, if the first device is a motherboard, the video data processing unit is an AP, and the sending module is an interface circuit; the second device is a display screen, the load unit is a display module, and the receiving device is an interface circuit. Wherein, the sending device includes a first format conversion module, a protocol sending unit and a PHY layer sending module. The protocol sending unit includes a TMDS CEC encoding module, an FEC encoding module and a channel encoding module. The receiving device includes a second format conversion module, a protocol receiving unit and a PHY layer receiving module. The protocol receiving unit includes a TMDS CEC decoding module, an FEC decoding module and a channel decoding module, wherein the PHY layer sending module and the PHY layer receiving module are transmitted through the transmission module. Channel communication connection.
图25是另一些实施例提供的数据传输方法的流程图,如图25所示,该方法包括:FIG. 25 is a flowchart of a data transmission method provided by other embodiments. As shown in FIG. 25 , the method includes:
步骤602、第一设备对第二设备进行工作参数配置。Step 602: The first device configures working parameters for the second device.
如图24所示,第一设备的视频数据处理单元对第二设备的负载单元进行工作参数配置。As shown in FIG. 24 , the video data processing unit of the first device configures working parameters for the load unit of the second device.
具体地,在所有实际使用的场景下,主板可对显示模组进行工作参数配置,使得显示模组能够按照工作参数的要求工作。其中,工作参数可包括分辨率、帧率和接口速率等。Specifically, in all actual use scenarios, the main board can configure the working parameters of the display module, so that the display module can work according to the requirements of the working parameters. The working parameters may include resolution, frame rate, interface rate, and the like.
步骤604、第一设备向第二设备发送第一序列。Step 604: The first device sends the first sequence to the second device.
首先,第一设备向第二设备发送数据类型序列,该数据类型序列包括“Control Word”,“Control Word”可表示该训练码流为控制包,例如,该“Control Word”可以为0101。而后,第一设备向第二设备发送均衡(Equalization)序列。接着,第一设备向第二设备发送第一序列,该第一序列可包括PRBS15序列,例如,第一设备可向第二设备发送100万个PRBS15序列,以实现状态机均衡训练过程。由于本实施例后续无需计算误码率,因此后续无需再发送第二序列和第三序列,从而提高了训练效率。First, the first device sends a data type sequence to the second device, where the data type sequence includes "Control Word", and "Control Word" may indicate that the training code stream is a control packet, for example, the "Control Word" may be 0101. Then, the first device sends an equalization (Equalization) sequence to the second device. Next, the first device sends a first sequence to the second device, the first sequence may include a PRBS15 sequence, for example, the first device may send 1 million PRBS15 sequences to the second device to implement a state machine equalization training process. Since this embodiment does not need to calculate the bit error rate in the future, it is unnecessary to send the second sequence and the third sequence in the future, thereby improving the training efficiency.
协议发送单元(如图24所示)通过传输通道向协议接收单元发送第一序列。The protocol sending unit (as shown in Figure 24) sends the first sequence to the protocol receiving unit through the transmission channel.
步骤606、第一设备向第二设备发送测试数据包,并记录发送的测试数据包的个数。Step 606: The first device sends a test data packet to the second device, and records the number of the sent test data packets.
作为一种可选方案,测试数据包可包括应用层数据包或控制数据包。第一设备的协议发送单元(如图24所示)通过寄存器记录发送的测试数据包的个数。As an optional solution, the test data packets may include application layer data packets or control data packets. The protocol sending unit of the first device (as shown in FIG. 24 ) records the number of sent test data packets through the register.
步骤608、第二设备统计接收到的正确的测试数据包的个数,并将统计出的正确的测试数据包的个数返回至第一设备。Step 608: The second device counts the number of correct test data packets received, and returns the counted number of correct test data packets to the first device.
第二设备的协议接收单元(如图24所示)统计接收到的正确的测试数据包的个数,并通过辅助通道将正确的测试数据包的个数返回至第一设备的协议发送单元。The protocol receiving unit of the second device (as shown in FIG. 24 ) counts the number of correct test packets received, and returns the correct number of test packets to the protocol sending unit of the first device through the auxiliary channel.
步骤610、第一设备根据正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率。Step 610: The first device calculates the packet loss rate according to the number of correct test data packets and the number of sent test data packets.
具体地,第一设备通过公式1-m/M计算出误码率,其中,m为正确的测试数据包的个数,N为发送的测试数据包的个数。协议发送单元(如图24所示)计算出丢包率。Specifically, the first device calculates the bit error rate by using the formula 1-m/M, where m is the number of correct test data packets, and N is the number of sent test data packets. The protocol sending unit (as shown in Figure 24) calculates the packet loss rate.
步骤612、第一设备判断丢包率是否大于或等于第三阈值,若是,则执行步骤616;若否,则执行步骤652。Step 612: The first device determines whether the packet loss rate is greater than or equal to the third threshold, and if so, executes step 616; if not, executes step 652.
协议发送单元(如图24所示)判断丢包率是否大于或等于第三阈值。The protocol sending unit (as shown in Figure 24) determines whether the packet loss rate is greater than or equal to the third threshold.
丢包率例如为:0.1%至1%。The packet loss rate is, for example: 0.1% to 1%.
作为一种可选方案,本实施例中的步骤606至步骤612可以替换为:第二设备接收第一设备发送的测试数据包;根据接收到的正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率;若所述丢包率符合第一算法开启条件时,向所述第一设备发送第一丢包率状态,所述第一丢包率状态用于表示所述丢包率符合所述第一算法开启条件;若所述丢包率符合第二算法开启条件时,向所述第一设备发送第二丢包率状态,所述第一丢包率状态用于表示所述丢包率符合所述第二算法开启条件。而第二设备判断传输通道的环境参数符合第一算法开启条件或者符合第二算法开启条件包括:第二设备判断丢包率是否大于或等于第三阈值,若判断出丢包率大于或等于第三阈值,表明传输通道的环境参数符合第一算法开启条件;若判断出丢包率小于第三阈值,表明传输通道的环境参数符合第二算法开启条件。As an optional solution, steps 606 to 612 in this embodiment may be replaced with: the second device receives the test data packet sent by the first device; The number of data packets, and the packet loss rate is calculated; if the packet loss rate meets the conditions for enabling the first algorithm, the first packet loss rate status is sent to the first device, and the first packet loss rate status is used for Indicates that the packet loss rate complies with the enabling condition of the first algorithm; if the packet loss rate meets the enabling condition of the second algorithm, a second packet loss rate status is sent to the first device, and the first packet loss rate The status is used to indicate that the packet loss rate complies with the condition for enabling the second algorithm. The second device judging that the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm or the enabling conditions for the second algorithm includes: the second device judging whether the packet loss rate is greater than or equal to the third threshold; The three thresholds indicate that the environmental parameters of the transmission channel meet the enabling conditions of the first algorithm; if it is determined that the packet loss rate is less than the third threshold, it indicates that the environmental parameters of the transmission channel meet the enabling conditions of the second algorithm.
步骤614、第一设备采集图像或视频数据流,并对图像数据流进行编码格式转换生成 第一数据块。Step 614: The first device collects an image or video data stream, and performs encoding format conversion on the image data stream to generate a first data block.
视频数据处理单元(如图24所示)采集图像或视频数据流,并将采集的图像或视频数据流发送至第一格式转换模块(如图24所示)。The video data processing unit (as shown in FIG. 24 ) collects the image or video data stream, and sends the collected image or video data stream to the first format conversion module (as shown in FIG. 24 ).
作为一种可选方案,步骤614可以在步骤604之后执行。As an alternative, step 614 may be performed after step 604 .
步骤616、第一设备为第一数据块添加数据包头。Step 616: The first device adds a data packet header to the first data block.
第一格式转换模块(如图24所示)对图像或视频数据流进行二进制编码格式转换,以形成“Payload”。The first format conversion module (as shown in FIG. 24 ) performs binary encoding format conversion on the image or video data stream to form “Payload”.
图26是本申请实施例中基于HDMI进行传输的数据块的格式示意图,如图26所示,数据包头包括前导码(Premble)、数据同步信息(Sync)、控制/数据信息(C/D)和保留字段(Rsvd)。协议发送单元将前导码(Premble)、数据同步信息(Sync)、控制/数据信息(C/D)和Rsvd添加到数据块(Payload)的头部。其中,前导码(Premble)用于表明“Payload”是各种类型的包信息(Data Island)或是视频像素数据(Video Data),其中,包信息的内容包括音频数据包或图像信息包等。FIG. 26 is a schematic diagram of the format of a data block transmitted based on HDMI in an embodiment of the present application. As shown in FIG. 26 , the data packet header includes a preamble (Premble), data synchronization information (Sync), and control/data information (C/D) and reserved fields (Rsvd). The protocol sending unit adds a preamble (Premble), data synchronization information (Sync), control/data information (C/D) and Rsvd to the header of the data block (Payload). Among them, the preamble (Premble) is used to indicate that "Payload" is various types of packet information (Data Island) or video pixel data (Video Data), wherein the content of the packet information includes audio data packets or image information packets.
步骤618、第一设备对第一数据块进行ECC编码生成第一ECC字段,以及对第一数据块进行CRC编码生成CRC字段。Step 618: The first device performs ECC encoding on the first data block to generate a first ECC field, and performs CRC encoding on the first data block to generate a CRC field.
具体地,协议发送单元通过TMDS CED编码模块采用6-bit的扩展汉明码对“Payload”进行ECC编码生成第一ECC字段和校验位(Parity)字段;TMDS CED编码模块采用16-bit CRC对“Payload”进行CRC编码生成CRC(16-bit CRC)字段和校验位(Parity)字段。需要说明的是:图26中所示的ECC字段为第一ECC字段。Specifically, the protocol sending unit uses the 6-bit extended Hamming code to perform ECC encoding on "Payload" through the TMDS CED encoding module to generate the first ECC field and the parity (Parity) field; the TMDS CED encoding module uses a 16-bit CRC pair "Payload" performs CRC encoding to generate a CRC (16-bit CRC) field and a parity (Parity) field. It should be noted that: the ECC field shown in FIG. 26 is the first ECC field.
步骤620、第一设备将第一ECC字段和CRC字段添加至第一数据块的尾部。Step 620: The first device adds the first ECC field and the CRC field to the end of the first data block.
如图26所示,协议发送单元(如图24所示)将第一ECC字段和CRC字段添加至“Payload”的尾部。As shown in Fig. 26, the protocol transmission unit (as shown in Fig. 24) adds the first ECC field and the CRC field to the end of "Payload".
步骤622、第一设备将指示字段添加至第一数据块的头部,以生成第二数据块。Step 622: The first device adds an indication field to the header of the first data block to generate a second data block.
本实施例中,作为一种可选方案,指示字段为新增字段,指示字段例如为:丢包率确认字段(Packet Loss Rate Ensure,简称PLR EN)。该丢包率确认字段用于指示丢包率大于或等于第三阈值。In this embodiment, as an optional solution, the indication field is a newly added field, and the indication field is, for example, a packet loss rate confirmation field (Packet Loss Rate Ensure, PLR EN for short). The packet loss rate confirmation field is used to indicate that the packet loss rate is greater than or equal to the third threshold.
生成的第二数据块的具体格式可参见图26所示。丢包率确认字段的取值例如为1。如图26所示,第二数据块中第一ECC字段和CRC字段之后还可设置校验位(Parity)字段。The specific format of the generated second data block can be referred to as shown in FIG. 26 . The value of the packet loss rate confirmation field is, for example, 1. As shown in FIG. 26 , a parity (Parity) field may also be set after the first ECC field and the CRC field in the second data block.
作为另一种可选方案,指示字段为保留字段,此种情况下,步骤622可以包括:第一设备设置保留字段的取值,以使保留字段用于指示丢包率大于或等于第一阈值。保留字段的取值例如为1。As another optional solution, the indication field is a reserved field. In this case, step 622 may include: the first device sets a value of the reserved field, so that the reserved field is used to indicate that the packet loss rate is greater than or equal to the first threshold. . The value of the reserved field is, for example, 1.
步骤624、第一设备对第二数据块进行信道编码,生成编码后的第二数据块。Step 624: The first device performs channel coding on the second data block to generate an encoded second data block.
协议发送单元通过信道编码模块对第二数据块进行信道编码,生成编码后的第二数据块。The protocol sending unit performs channel coding on the second data block through the channel coding module to generate the coded second data block.
步骤626、第一设备将第二数据块分成多个FEC数据块。Step 626: The first device divides the second data block into multiple FEC data blocks.
如图13所示,FEC数据块包括Symbol数据块(Super Block Payload)。协议发送单元通过FEC编码模块(如图24所示)将第二数据块分成多个FEC数据块。As shown in Figure 13, the FEC data block includes a Symbol data block (Super Block Payload). The protocol sending unit divides the second data block into multiple FEC data blocks through the FEC encoding module (as shown in FIG. 24 ).
步骤628、第一设备对每个FEC数据块进行FEC编码,生成FEC校验码。Step 628: The first device performs FEC encoding on each FEC data block to generate an FEC check code.
如图13所示,协议发送单元通过FEC编码模块采用RS码编码算法对每个FEC数 据块进行FEC编码生成FEC校验码(RS Block/Parity)。As shown in Figure 13, the protocol sending unit uses the RS code encoding algorithm to perform FEC encoding on each FEC data block through the FEC encoding module to generate an FEC check code (RS Block/Parity).
步骤630、第一设备将FEC校验码添加至FEC数据块的尾部,以生成第三数据块。Step 630: The first device adds the FEC check code to the end of the FEC data block to generate a third data block.
形成的第三数据块的具体格式可参见图13所示,第三数据块还包括开始位(Start Super Block)字段和字节数(RS Block Symbol/Byte)字段。The specific format of the third data block formed can be referred to as shown in FIG. 13 , and the third data block also includes a start bit (Start Super Block) field and a number of bytes (RS Block Symbol/Byte) field.
步骤632、第一设备将第三数据块发送至第二设备。Step 632: The first device sends the third data block to the second device.
协议发送单元(如图24所示)将第三数据块发送至PHY层发送模块(如图24所示),PHY层发送模块通过传输通道将第三数据块发送至PHY层接收模块(如图24所示),PHY层接收模块将第三数据块发送至协议接收单元。The protocol sending unit (as shown in Figure 24) sends the third data block to the PHY layer sending module (as shown in Figure 24), and the PHY layer sending module sends the third data block to the PHY layer receiving module through the transmission channel (as shown in Figure 24). 24), the PHY layer receiving module sends the third data block to the protocol receiving unit.
步骤634、第二设备对第三数据块进行FEC检纠错校验,生成第二数据块。Step 634: The second device performs FEC detection and error correction check on the third data block to generate a second data block.
协议接收单元通过FEC解码模块(如图24所示)采用RS码解码算法对第三数据块进行FEC校验,生成FEC校验结果。FEC校验结果包括校验成功、可纠正的错误结果或者不可纠正的错误结果。The protocol receiving unit uses the RS code decoding algorithm to perform FEC check on the third data block through the FEC decoding module (as shown in Figure 24), and generates an FEC check result. FEC verification results include verification success, correctable error results or uncorrectable error results.
协议接收单元若识别出FEC校验结果包括可纠正的错误结果时,对第三数据块的错误数据进行纠正处理,并将第三数据块进行解包生成第二数据块。If the protocol receiving unit recognizes that the FEC check result includes a correctable error result, it corrects the erroneous data of the third data block, and unpacks the third data block to generate the second data block.
若识别出FEC校验结果包括校验成功,表明第三数据块中不存在错误数据,可直接将第三数据块进行解包生成第二数据块。If it is identified that the FEC verification result includes verification success, indicating that there is no erroneous data in the third data block, the third data block can be directly unpacked to generate the second data block.
协议接收单元若识别出FEC校验结果包括不可纠正的错误结果,将第三数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对第三数据块的处理方式。If the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result, the third data block will be discarded, skipped directly or retransmitted. In this case, the developer can determine the processing of the third data block. Way.
步骤636、第二设备对第二数据块进行解析。Step 636: The second device parses the second data block.
协议接收单元(如图24所示)对第二数据块进行解析。The protocol receiving unit (as shown in Figure 24) parses the second data block.
步骤638、第二设备若解析出指示字段,对第二数据块中的CRC字段进行CRC校验,生成CRC校验结果。Step 638: If the second device parses the indication field, it performs CRC check on the CRC field in the second data block to generate a CRC check result.
协议接收单元(如图24所示)若解析出指示字段,获取到丢包率大于或等于第三阈值的判断结果,进而确定出采用第一检纠错算法,激活TMDS CEC解码模块(如图24所示)通过TMDS CEC解码模块将第二数据块中的CRC字段与多项式进行模2除计算,得到余数,余数即为CRC校验结果。CRC校验结果可以为0或者不为0。其中,多项式可包括X 16+X 12+X 5+X 0If the protocol receiving unit (as shown in Figure 24) parses the indication field, obtains the judgment result that the packet loss rate is greater than or equal to the third threshold, and then determines that the first error detection and correction algorithm is used, and activates the TMDS CEC decoding module (as shown in the figure). 24) by the TMDS CEC decoding module, the CRC field in the second data block and the polynomial are divided by modulo 2 to obtain the remainder, and the remainder is the CRC check result. The CRC check result can be 0 or not. Wherein, the polynomial may include X 16 +X 12 +X 5 +X 0 .
步骤640、第二设备若解析出指示字段,对第二数据块中的第一ECC字段进行ECC校验,生成ECC校验结果。Step 640: If the second device parses out the indication field, it performs ECC check on the first ECC field in the second data block to generate an ECC check result.
TMDS CEC解码模块(如图24所示)对第二数据块中的“Payload”进行ECC编码生成第二ECC字段,将第一ECC字段与第二ECC字段进行异或计算得出ECC校验结果。若ECC校验结果为0,表明“Payload”正确;若ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则表明需要对“Payload”的错误位进行纠正;若ECC校验结果不为0且ECC校验结果指示出有2-bit以上的错误,则表明“Payload”发生了不可纠正的错误。其中,TMDS CEC解码模块可采用与TMDS CEC编码模块相同的编码规则对“Payload”进行ECC编码,即TMDS CEC解码模块可通过6-bit的扩展汉明码对“Payload”进行ECC编码生成第二ECC字段。The TMDS CEC decoding module (as shown in Figure 24) performs ECC encoding on "Payload" in the second data block to generate a second ECC field, and performs XOR calculation on the first ECC field and the second ECC field to obtain the ECC check result . If the ECC check result is 0, it indicates that the "Payload" is correct; if the ECC check result is not 0 and the ECC check result indicates a 1-bit error and an error bit, it indicates that the error bit of "Payload" needs to be corrected ; If the ECC check result is not 0 and the ECC check result indicates that there are more than 2-bit errors, it means that an uncorrectable error has occurred in the "Payload". Among them, the TMDS CEC decoding module can use the same encoding rules as the TMDS CEC encoding module to perform ECC encoding on "Payload", that is, the TMDS CEC decoding module can perform ECC encoding on "Payload" through 6-bit extended Hamming code to generate a second ECC field.
需要说明的是:本实施例中,第二设备若解析出指示字段时,还可先执行步骤640,而后再执行步骤638。It should be noted that: in this embodiment, if the second device parses the indication field, step 640 may be performed first, and then step 638 may be performed.
步骤642、第二设备判断CRC校验结果和ECC校验结果是否均为0,若是,则执行步骤644;若判断出重传,则执行步骤626。Step 642: The second device determines whether the CRC check result and the ECC check result are both 0, and if so, executes step 644; if it determines retransmission, executes step 626.
协议接收单元(如图24所示)判断CRC校验结果和ECC校验结果是否均为0。The protocol receiving unit (as shown in Figure 24) judges whether the CRC check result and the ECC check result are both 0.
步骤644、第二设备对第二数据块进行解包处理生成第一数据块。Step 644: The second device unpacks the second data block to generate the first data block.
协议接收单元(如图24所示)对第二数据块进行解包处理生成第一数据块。The protocol receiving unit (as shown in FIG. 24 ) unpacks the second data block to generate the first data block.
具体地,协议协议接收单元去除第二数据块中的前导码(Premble)、数据同步信息(Sync)、控制/数据信息(C/D)、保留字段(Rsvd)、丢包率确认字段(PLR EN))、第一ECC字段、CRC字段和校验位(Parity)字段,以实现对第二数据块进行解包处理得到第一数据块。Specifically, the protocol protocol receiving unit removes the preamble (Premble), data synchronization information (Sync), control/data information (C/D), reserved field (Rsvd), and packet loss rate confirmation field (PLR) in the second data block EN)), the first ECC field, the CRC field, and the parity (Parity) field, so as to realize the first data block by depacketizing the second data block.
步骤646、第二设备对第一数据块进行信道解码,生成解码后的第一数据块。Step 646: The second device performs channel decoding on the first data block to generate the decoded first data block.
协议接收单元通过信道解码模块(如图24所示)对第一数据块进行信道解码,生成解码后的第一数据块。The protocol receiving unit performs channel decoding on the first data block through the channel decoding module (as shown in FIG. 24 ) to generate the decoded first data block.
步骤648、第二设备对第一数据块进行编码格式转换,生成图像或视频数据流,流程结束。Step 648: The second device converts the encoding format of the first data block to generate an image or video data stream, and the process ends.
第二格式转换模块(如图24所示)对第一数据块进行编码格式转换,生成图像或视频数据流,并将图像或视频数据流上传至负载单元(如图24所示)。具体地,第二格式转换模块将第一数据块进行像素图像编码格式转换生成图像数据流,并将图像数据流上传至负载单元。The second format conversion module (as shown in FIG. 24 ) performs coding format conversion on the first data block, generates an image or video data stream, and uploads the image or video data stream to the load unit (as shown in FIG. 24 ). Specifically, the second format conversion module performs pixel image coding format conversion on the first data block to generate an image data stream, and uploads the image data stream to the load unit.
作为一种可选方案,第二设备若识别出ECC校验结果不为0且ECC校验结果指示出有1-bit错误以及错误位,则对第二数据块的错误位进行纠正,对第二数据块进行解包处理生成第一数据块,而后对第一数据块进行信道解码生成解码后的第一数据块,对第一数据块进行像素图像编码格式转换生成图像或视频数据流。As an optional solution, if the second device recognizes that the ECC check result is not 0 and the ECC check result indicates that there are 1-bit errors and erroneous bits, it corrects the erroneous bits of the second data block, and corrects the error bits of the second data block. Two data blocks are unpacked to generate a first data block, then channel decoding is performed on the first data block to generate a decoded first data block, and pixel image coding format conversion is performed on the first data block to generate an image or video data stream.
作为另一种可选方案,第二设备若识别出ECC校验结果不为0和/或识别出则ECC校验结果不为0且验证结果指示出有2-bit以上的错误,则将第二数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对数据包的处理方式。其中若判断出对第二数据块进行重传时,可继续执行步骤626。As another optional solution, if the second device recognizes that the ECC verification result is not 0 and/or that the ECC verification result is not 0 and the verification result indicates that there are more than 2-bit errors, it will The second data block is discarded, skipped directly or retransmitted. In this case, the developer can determine the processing method of the data packet. If it is determined that the second data block is to be retransmitted, step 626 may be continued.
步骤650、第一设备采集图像或视频数据流,并对图像或视频数据流进行编码格式转换生成第一数据块。Step 650: The first device collects an image or video data stream, and performs encoding format conversion on the image or video data stream to generate a first data block.
作为一种可选方案,步骤650可以在步骤604之后执行。As an alternative, step 650 may be performed after step 604 .
第一格式转换模块(如图24所示)对图像或视频数据流进行二进制编码格式转换,以形成“Payload”。The first format conversion module (as shown in FIG. 24 ) performs binary encoding format conversion on the image or video data stream to form “Payload”.
步骤652、第一设备对第一数据块进行信道编码,生成编码后的第一数据块。Step 652: The first device performs channel coding on the first data block to generate an encoded first data block.
协议发送单元(如图24所示)通过信道编码模块对第一数据块进行信道编码,生成编码后的第一数据块。The protocol sending unit (as shown in FIG. 24 ) performs channel coding on the first data block through the channel coding module to generate the coded first data block.
步骤654、第一设备将第一数据块分成多个FEC数据块。Step 654: The first device divides the first data block into multiple FEC data blocks.
步骤656、第一设备对每个FEC数据块进行FEC编码,生成FEC校验码。Step 656: The first device performs FEC encoding on each FEC data block to generate an FEC check code.
步骤658、第一设备将FEC校验码添加至FEC数据块的尾部,以生成第四数据块。Step 658: The first device adds the FEC check code to the end of the FEC data block to generate a fourth data block.
步骤660、第一设备将第四数据块发送至第二设备。Step 660: The first device sends the fourth data block to the second device.
步骤662、第二设备对第四数据块进行解析。Step 662: The second device parses the fourth data block.
步骤664、第二设备若未解析出指示字段,对第四数据块进行FEC检纠错校验,生成第一数据块。Step 664: If the second device fails to parse out the indication field, it performs FEC detection and error correction check on the fourth data block to generate the first data block.
协议接收单元若(如图24所示)未解析出指示字段,获取到丢包率小于第三阈值的判断结果,进而确定出采用第二检纠错算法,通过FEC解码模块采用RS码解码算法对第四数据块进行FEC校验,生成FEC校验结果。FEC校验结果包括校验成功、可纠正的错误结果或者不可纠正的错误结果。If the protocol receiving unit (as shown in Figure 24) does not parse the indication field, obtain the judgment result that the packet loss rate is less than the third threshold, and then determine to use the second error detection and correction algorithm, and use the RS code decoding algorithm through the FEC decoding module. FEC verification is performed on the fourth data block to generate an FEC verification result. FEC verification results include verification success, correctable error results or uncorrectable error results.
协议接收单元若识别出FEC校验结果包括可纠正的错误结果时,对第四数据块的错误数据进行纠正处理,并将第四数据块进行解包生成第一数据块。If the protocol receiving unit identifies that the FEC check result includes a correctable error result, it corrects the erroneous data of the fourth data block, and unpacks the fourth data block to generate the first data block.
协议接收单元若识别出FEC校验结果包括校验成功,表明第四数据块中不存在错误数据,可直接将第三数据块进行解包生成第一数据块。If the protocol receiving unit recognizes that the FEC verification result includes verification success, indicating that there is no erroneous data in the fourth data block, it can directly unpack the third data block to generate the first data block.
协议接收单元若识别出FEC校验结果包括不可纠正的错误结果,将第四数据块进行丢弃、直接跳过或重传等处理,此种情况下,可由开发人员确定对第四数据块的处理方式。If the protocol receiving unit recognizes that the FEC check result includes an uncorrectable error result, the fourth data block will be discarded, skipped directly or retransmitted. In this case, the developer can determine the processing of the fourth data block. Way.
步骤666、第二设备对第四数据块进行解包处理生成第一数据块。Step 666: The second device unpacks the fourth data block to generate the first data block.
步骤668、第二设备对第一数据块进行信道解码,生成解码后的第一数据块。Step 668: The second device performs channel decoding on the first data block to generate a decoded first data block.
步骤670、第二设备对第一数据块进行编码格式转换,生成图像或视频数据流。Step 670: The second device converts the encoding format of the first data block to generate an image or video data stream.
协议接收单元(如图24所示)对第一数据块进行编码格式转换,生成图像或视频数据流,并将图像或视频数据流上传至负载单元(如图24所示)。The protocol receiving unit (as shown in FIG. 24 ) converts the encoding format of the first data block, generates an image or video data stream, and uploads the image or video data stream to the load unit (as shown in FIG. 24 ).
需要说明的是:图25中的步骤616至步骤646可以替换为:通过FEC算法和CRC算法进行编码的方案;或者,通过FEC算法和ECC算法进行编码的方案。图25中的步骤654至步骤666可以替换为:通过CRC算法和ECC算法进行校验的方案;或者,通过CRC算法进行校验的方案;或者,通过ECC算法进行校验的方案。It should be noted that: Steps 616 to 646 in FIG. 25 can be replaced with: the encoding scheme using the FEC algorithm and the CRC algorithm; or the encoding scheme using the FEC algorithm and the ECC algorithm. Steps 654 to 666 in FIG. 25 can be replaced with: a scheme of performing verification by CRC algorithm and ECC algorithm; or, a scheme of performing verification by CRC algorithm; or, a scheme of performing verification by ECC algorithm.
本申请实施例的技术方案中,通过检测传输通道环境而获取到丢包率,当丢包率较大时选择FEC算法、CRC算法和ECC算法的组合对数据传输过程中的传输数据进行检纠错处理,实现了多bits错误数据的检纠错,从而提高了数据传输的可靠性;当丢包率较小时选择FEC算法对数据传输过程中的传输数据进行检纠错处理,避免了检纠错处理时数据冗余较大的情况,从而提高了数据传输效率。采用本实施例的数据传输方法在保证数据传输可靠性的基础上提高了数据传输效率。In the technical solutions of the embodiments of the present application, the packet loss rate is obtained by detecting the transmission channel environment, and when the packet loss rate is relatively large, a combination of the FEC algorithm, the CRC algorithm and the ECC algorithm is selected to detect and correct the transmission data in the data transmission process. Error processing realizes error detection and correction of multi-bit error data, thereby improving the reliability of data transmission; when the packet loss rate is small, the FEC algorithm is selected to perform error detection and correction processing on the transmission data during data transmission, avoiding detection and correction. The data redundancy is relatively large during error processing, thereby improving the data transmission efficiency. Using the data transmission method of this embodiment improves data transmission efficiency on the basis of ensuring data transmission reliability.
本申请实施例还提供一种第一设备,该第一设备可以是终端设备也可以是内置于所述终端设备的电路设备。该设备可以用于执行上述方法实施例中的功能/步骤。第一设备为主机,主机可以采用如下图27所示的电子设备。An embodiment of the present application further provides a first device, where the first device may be a terminal device or a circuit device built in the terminal device. The device may be used to perform the functions/steps in the above method embodiments. The first device is a host, and the host can use an electronic device as shown in Figure 27 below.
本申请实施例还提供一种第二设备,该第二设备可以是终端设备也可以是内置于所述终端设备的电路设备。该设备可以用于执行上述方法实施例中的功能/步骤。第二设备为主机,主机可以采用如下图27所示的电子设备。The embodiment of the present application further provides a second device, where the second device may be a terminal device or a circuit device built in the terminal device. The device may be used to perform the functions/steps in the above method embodiments. The second device is a host, and the host can use an electronic device as shown in Figure 27 below.
图27是本申请一实施例提供的一种电子设备的结构示意图,如图27所示,电子设备900包括处理器910和收发器920。可选地,该电子设备900还可以包括存储器930。其中,处理器910、收发器920和存储器930之间可以通过内部连接通路互相通信,传递控制和/或数据信号,该存储器930用于存储计算机程序,该处理器910用于从该存储器930中调用并运行该计算机程序。FIG. 27 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in FIG. 27 , the electronic device 900 includes a processor 910 and a transceiver 920 . Optionally, the electronic device 900 may further include a memory 930 . Among them, the processor 910, the transceiver 920 and the memory 930 can communicate with each other through an internal connection path to transmit control and/or data signals. Invoke and run the computer program.
可选地,电子设备900还可以包括天线940,用于将收发器920输出的无线信号发送 出去。Optionally, the electronic device 900 may further include an antenna 940 for transmitting the wireless signal output by the transceiver 920.
上述处理器910可以和存储器930可以合成一个处理装置,更常见的是彼此独立的部件,处理器910用于执行存储器930中存储的程序代码来实现上述功能。具体实现时,该存储器930也可以集成在处理器910中,或者,独立于处理器910。The above-mentioned processor 910 and the memory 930 can be combined into a processing device, and more commonly, they are independent components, and the processor 910 is used to execute the program codes stored in the memory 930 to realize the above-mentioned functions. During specific implementation, the memory 930 may also be integrated in the processor 910 , or be independent of the processor 910 .
除此之外,为了使得电子设备900的功能更加完善,该电子设备900还可以包括输入单元960、显示单元970、音频电路980、摄像头990和传感器901等中的一个或多个,所述音频电路还可以包括扬声器982、麦克风984等。其中,显示单元970可以包括显示屏In addition, in order to make the functions of the electronic device 900 more complete, the electronic device 900 may further include one or more of an input unit 960, a display unit 970, an audio circuit 980, a camera 990, a sensor 901, etc., the audio The circuit may also include a speaker 982, a microphone 984, and the like. Wherein, the display unit 970 may include a display screen
可选地,上述电子设备900还可以包括电源950,用于给终端设备中的各种器件或电路提供电源。Optionally, the above electronic device 900 may further include a power supply 950 for providing power to various devices or circuits in the terminal device.
应理解,图27所示的电子设备900能够实现图20、图23或图25所示方法实施例的各个过程。电子设备900中的各个单元的操作和/或功能,分别为了实现上述方法实施例中的相应流程。具体可参见上述方法实施例中的描述,为避免重复,此处适当省略详细描述。It should be understood that the electronic device 900 shown in FIG. 27 can implement each process of the method embodiment shown in FIG. 20 , FIG. 23 or FIG. 25 . The operations and/or functions of each unit in the electronic device 900 are respectively to implement the corresponding processes in the foregoing method embodiments. For details, reference may be made to the descriptions in the foregoing method embodiments, and to avoid repetition, the detailed descriptions are appropriately omitted here.
应理解,图27所示的电子设备900中的处理器910可以是片上系统(system on a chip,SOC),该处理器910中可以包括中央处理器(central processing unit,CPU),还可以进一步包括其他类型的处理器,所述CPU可以叫主CPU。各部分处理器配合工作实现之前的方法流程,并且每部分处理器可以选择性执行一部分软件驱动程序。It should be understood that the processor 910 in the electronic device 900 shown in FIG. 27 may be a system on a chip (SOC), and the processor 910 may include a central processing unit (CPU), and may further Including other types of processors, the CPU may be referred to as the main CPU. Each part of the processor cooperates to implement the previous method flow, and each part of the processor can selectively execute a part of the software driver.
总之,处理器910内部的各部分处理器或处理单元可以共同配合实现之前的方法流程,且各部分处理器或处理单元相应的软件程序可存储在存储器930中。In a word, each part of the processors or processing units inside the processor 910 can cooperate to implement the previous method process, and the corresponding software programs of each part of the processors or processing units can be stored in the memory 930 .
本申请还提供了一种计算机可读存储介质,该计算机可读存储介质中存储有指令,当该指令在计算机上运行时,使得计算机执行如上述图20、图23或图25所示的数据传输方法中的各个步骤。The present application also provides a computer-readable storage medium, where instructions are stored in the computer-readable storage medium, and when the instructions are executed on a computer, the computer executes the data shown in FIG. 20 , FIG. 23 or FIG. 25 The various steps in the transfer method.
本申请还提供了一种包含指令的计算机程序产品,当该计算机程序产品在计算机或任一至少一种处理器上运行时,使得计算机执行如图20、图23或图25所示的数据传输方法中的各个步骤。The present application also provides a computer program product containing instructions, when the computer program product is run on a computer or any one of at least one processor, causing the computer to perform data transmission as shown in FIG. 20 , FIG. 23 or FIG. 25 steps in the method.
本申请还提供一种芯片,包括处理器。该处理器用于读取并运行存储器中存储的计算机程序,以执行本申请提供的数据传输方法执行的相应操作和/或流程。The present application also provides a chip including a processor. The processor is used to read and run the computer program stored in the memory, so as to execute the corresponding operations and/or processes performed by the data transmission method provided in this application.
可选地,该芯片还包括存储器,该存储器与该处理器通过电路或电线与存储器连接,处理器用于读取并执行该存储器中的计算机程序。进一步可选地,该芯片还包括通信接口,处理器与该通信接口连接。通信接口用于接收需要处理的数据和/或信息,处理器从该通信接口获取该数据和/或信息,并对该数据和/或信息进行处理。该通信接口可以是输入输出接口。Optionally, the chip further includes a memory, the memory and the processor are connected to the memory through a circuit or a wire, and the processor is used for reading and executing the computer program in the memory. Further optionally, the chip further includes a communication interface, and the processor is connected to the communication interface. The communication interface is used to receive data and/or information to be processed, and the processor acquires the data and/or information from the communication interface and processes the data and/or information. The communication interface may be an input-output interface.
以上各实施例中,涉及的处理器910可以例如包括中央处理器(central processing unit,CPU)、微处理器、微控制器或数字信号处理器,还可包括GPU、NPU和ISP,该处理器还可包括必要的硬件加速器或逻辑处理硬件电路,如特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本申请技术方案程序执行的集成电路等。此外,处理器可以具有操作一个或多个软件程序的功能,软件程序可以存储在存储器中。In the above embodiments, the involved processor 910 may include, for example, a central processing unit (CPU), a microprocessor, a microcontroller or a digital signal processor, and may also include a GPU, an NPU, and an ISP. Necessary hardware accelerators or logic processing hardware circuits may also be included, such as application-specific integrated circuits (ASICs), or one or more integrated circuits used to control the execution of the programs of the technical solution of the present application. In addition, the processor may have the functionality to operate one or more software programs, which may be stored in the memory.
存储器可以是只读存储器(read-only memory,ROM)、可存储静态信息和指令的其 它类型的静态存储设备、随机存取存储器(random access memory,RAM)或可存储信息和指令的其它类型的动态存储设备,也可以是电可擦可编程只读存储器(electrically erasable programmable read-only memory,EEPROM)、只读光盘(compact disc read-only memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其它磁存储设备,或者还可以是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其它介质等。The memory can be read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types of storage devices that can store information and instructions The dynamic storage device can also be electrically erasable programmable read-only memory (electrically erasable programmable read-only memory, EEPROM), compact disc read-only memory (CD-ROM) or other optical disk storage, optical disk storage ( including compact discs, laser discs, compact discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or may also be capable of carrying or storing desired program code in the form of instructions or data structures and capable of Any other medium accessed by a computer, etc.
本申请实施例中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示单独存在A、同时存在A和B、单独存在B的情况。其中A,B可以是单数或者复数。字符“/”一般表示前后关联对象是一种“或”的关系。“以下至少一项”及其类似表达,是指的这些项中的任意组合,包括单项或复数项的任意组合。例如,a,b和c中的至少一项可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In the embodiments of the present application, "at least one" refers to one or more, and "multiple" refers to two or more. "And/or", which describes the association relationship of the associated objects, means that there can be three kinds of relationships, for example, A and/or B, which can indicate the existence of A alone, the existence of A and B at the same time, and the existence of B alone. where A and B can be singular or plural. The character "/" generally indicates that the associated objects are an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple.
本领域普通技术人员可以意识到,本文中公开的实施例中描述的各单元及算法步骤,能够以电子硬件、计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps described in the embodiments disclosed herein can be implemented by a combination of electronic hardware, computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described systems, devices and units may refer to the corresponding processes in the foregoing method embodiments, which will not be repeated here.
在本申请所提供的几个实施例中,任一功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。In the several embodiments provided in this application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes .
以上所述,仅为本申请的具体实施方式,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application. The protection scope of the present application shall be subject to the protection scope of the claims.

Claims (23)

  1. 一种数据传输方法,其特征在于,应用于第一设备,所述方法包括:A data transmission method, characterized in that, applied to a first device, the method comprising:
    若传输通道的环境参数符合第一算法开启条件,通过第一检纠错算法对获取的传输数据进行编码,生成第一编码数据,并将所述第一编码数据发送至第二设备;If the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, encode the acquired transmission data through the first error detection and correction algorithm, generate first encoded data, and send the first encoded data to the second device;
    若传输通道的环境参数符合第二算法开启条件,通过第二检纠错算法对获取的传输数据进行编码,生成第二编码数据,并将所述第二编码数据发送至第二设备,所述第二检纠错算法与所述第一检纠错算法不同。If the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, the acquired transmission data is encoded by the second error detection and correction algorithm, second encoded data is generated, and the second encoded data is sent to the second device. The second error detection and correction algorithm is different from the first error detection and correction algorithm.
  2. 根据权利要求1所述的方法,其特征在于,还包括:The method of claim 1, further comprising:
    获取传输通道的环境参数。Get the environment parameters of the transport channel.
  3. 根据权利要求2所述的方法,其特征在于,所述传输通道的环境参数包括误码率;所述获取传输通道的环境参数包括:向所述第二设备依次发送第一序列和第二序列,以供所述第二设备统计接收到的正确的第二序列的比特数,所述第一序列用于实现状态机均衡训练;接收所述第二设备发送的正确的第二序列的比特数;根据所述第二设备发送的正确的第二序列的比特数和发送的第二序列的总比特数计算出误码率;或者,The method according to claim 2, wherein the environmental parameter of the transmission channel comprises a bit error rate; the acquiring the environmental parameter of the transmission channel comprises: sequentially sending the first sequence and the second sequence to the second device , for the second device to count the number of bits of the correct second sequence received, and the first sequence is used to implement state machine equalization training; to receive the number of bits of the correct second sequence sent by the second device ; Calculate the bit error rate according to the number of bits of the correct second sequence sent by the second device and the total number of bits of the second sequence sent; or,
    所述传输通道环境参数包括系统传输速率;所述获取传输通道环境参数包括:从切速状态寄存器读取所述系统传输速率。The transmission channel environment parameter includes a system transmission rate; the acquiring the transmission channel environment parameter includes: reading the system transmission rate from a speed cut state register.
  4. 根据权利要求1或3所述的方法,其特征在于,若所述传输通道的环境参数符合第一算法开启条件,所述方法还包括:采集原始数据;对所述原始数据进行编码格式转换,生成所述传输数据;或者,The method according to claim 1 or 3, characterized in that, if the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, the method further comprises: collecting raw data; converting the raw data into an encoding format, generating said transmission data; or,
    若所述传输通道的环境参数符合第二算法开启条件,所述方法还包括:采集原始数据;对所述原始数据进行编码格式转换,生成所述传输数据。If the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, the method further includes: collecting original data; converting the encoding format of the original data to generate the transmission data.
  5. 根据权利要求2所述的方法,其特征在于,所述传输通道的环境参数包括丢包率;所述获取传输通道的环境参数包括:The method according to claim 2, wherein the environmental parameter of the transmission channel comprises a packet loss rate; the obtaining the environmental parameter of the transmission channel comprises:
    向第二设备发送测试数据包,并记录发送的所述测试数据包的个数;Send a test data packet to the second device, and record the number of the sent test data packet;
    接收第二设备返回的统计出的接收到的正确的测试数据包的个数;Receive the number of correct test data packets received according to statistics returned by the second device;
    根据正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率。Calculate the packet loss rate according to the number of correct test packets and the number of sent test packets.
  6. 根据权利要求1或5所述的方法,其特征在于,所述通过第一检纠错算法对获取的传输数据进行编码之前,还包括:采集原始数据;对所述原始数据进行编码格式转换,生成所述传输数据;或者,所述通过第二检纠错算法对获取的传输数据进行编码之前,还包括:采集原始数据;对所述原始数据进行编码格式转换,生成所述传输数据。The method according to claim 1 or 5, wherein before encoding the acquired transmission data by the first error detection and correction algorithm, the method further comprises: collecting original data; converting the encoding format of the original data, generating the transmission data; or, before encoding the acquired transmission data by using the second error detection and correction algorithm, the method further includes: collecting original data; converting the encoding format of the original data to generate the transmission data.
  7. 根据权利要求1-6任一所述的方法,其特征在于,所述传输通道环境参数包括误码率、系统传输速率和所述丢包率中之一或其任意组合;The method according to any one of claims 1-6, wherein the transmission channel environment parameter comprises one of a bit error rate, a system transmission rate and the packet loss rate or any combination thereof;
    所述传输通道环境参数符合第一算法开启条件包括:所述误码率大于或等于第一阈值、所述系统传输速率大于或等于第二阈值以及所述丢包率大于或等于第三阈值中之一或其任意组合;The transmission channel environment parameter meeting the first algorithm enabling condition includes: the bit error rate is greater than or equal to a first threshold, the system transmission rate is greater than or equal to a second threshold, and the packet loss rate is greater than or equal to a third threshold one or any combination thereof;
    所述传输通道环境参数符合第二算法开启条件包括:所述误码率小于第一阈值、所述系统传输速率小于第二阈值以及所述丢包率小于第三阈值中之一或其任意组合。The transmission channel environment parameter meeting the condition for enabling the second algorithm includes: the bit error rate is less than the first threshold, the system transmission rate is less than the second threshold, and the packet loss rate is less than one of the third threshold or any combination thereof .
  8. 根据权利要求1-7任一所述的方法,其特征在于,所述第一检纠错算法包括至少二个检纠错算法,所述第二检纠错算法包括至少一个检纠错算法;或者,The method according to any one of claims 1-7, wherein the first error detection and correction algorithm includes at least two error detection and correction algorithms, and the second error detection and correction algorithm includes at least one error detection and correction algorithm; or,
    所述第一检纠错算法中的检纠错算法的数量大于所述第二检纠错算法中的检纠错算法的数量。The number of error detection and correction algorithms in the first error detection and correction algorithm is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
  9. 根据权利要求1或8所述的方法,其特征在于,所述第一检纠错算法包括前向纠错FEC算法、净核循环冗余校验CRC算法和包头错误纠正码ECC算法;或者所述第一检纠错算法包括FEC算法和CRC算法;或者所述第一检纠错算法包括FEC算法和ECC算法;或者,The method according to claim 1 or 8, wherein the first error detection and correction algorithm comprises a forward error correction (FEC) algorithm, a clean core cyclic redundancy check (CRC) algorithm, and a packet header error correction code (ECC) algorithm; or The first error detection and correction algorithm includes the FEC algorithm and the CRC algorithm; or the first error detection and correction algorithm includes the FEC algorithm and the ECC algorithm; or,
    所述第二检纠错算法包括FEC算法;或者所述第二检纠错算法包括CRC算法;或者所述第二检纠错算法包括ECC算法;或者所述第二检纠错算法包括CRC算法和ECC算法。The second error detection and correction algorithm includes an FEC algorithm; or the second error detection and correction algorithm includes a CRC algorithm; or the second error detection and correction algorithm includes an ECC algorithm; or the second error detection and correction algorithm includes a CRC algorithm and ECC algorithm.
  10. 根据权利要求1-9任一所述的方法,其特征在于,所述第一编码数据包括指示字段,所述第一编码数据的指示字段用于指示所述环境参数符合所述第一算法开启条件;和/或,The method according to any one of claims 1-9, wherein the first encoded data includes an indication field, and the indication field of the first encoded data is used to indicate that the environment parameter is enabled in accordance with the first algorithm conditions; and/or,
    所述第二编码数据包括指示字段,所述第二编码数据的指示字段用于指示所述环境参数符合所述第二算法开启条件。The second encoded data includes an indication field, and the indication field of the second encoded data is used to indicate that the environment parameter complies with the condition for enabling the second algorithm.
  11. 根据权利要求1-10任一所述的方法,其特征在于,所述第一设备为摄像头模组,所述第二设备为主板;或者The method according to any one of claims 1-10, wherein the first device is a camera module, and the second device is a motherboard; or
    所述第一设备为摄像头模组,第二设备为主机;或者The first device is a camera module, and the second device is a host; or
    所述第一设备为主板,所述第二设备为显示屏;或者The first device is a motherboard, and the second device is a display screen; or
    所述第一设备为主机,所述第二设备为显示屏。The first device is a host, and the second device is a display screen.
  12. 一种数据传输方法,其特征在于,应用于第二设备,所述方法包括:A data transmission method, characterized in that, applied to a second device, the method comprising:
    接收到编码数据;received encoded data;
    若确定出符合第一算法开启条件,通过第一检纠错算法对所述编码数据进行校验,生成传输数据;If it is determined that the conditions for enabling the first algorithm are met, the encoded data is checked by the first error detection and correction algorithm to generate transmission data;
    若确定出符合第二算法开启条件,通过第二检纠错算法对所述编码数据进行校验,生成传输数据。If it is determined that the conditions for enabling the second algorithm are met, the encoded data is verified by the second error detection and correction algorithm to generate transmission data.
  13. 根据权利要求12所述的方法,其特征在于,所述方法还包括:The method of claim 12, wherein the method further comprises:
    接收第一设备依次发送的第一序列和第二序列,所述第一序列用于实现状态机均衡训练;receiving a first sequence and a second sequence sequentially sent by the first device, where the first sequence is used to implement state machine equalization training;
    根据接收到的正确的第二序列的比特数和发送的第二序列的总比特数计算出误码率;Calculate the bit error rate according to the number of bits of the correct second sequence received and the total number of bits of the second sequence sent;
    若所述误码率符合第一算法开启条件时,向所述第一设备发送第一误码率状态,所述第一误码率状态用于表示所述误码率符合所述第一算法开启条件;If the bit error rate complies with the enabling condition of the first algorithm, a first bit error rate status is sent to the first device, where the first bit error rate status is used to indicate that the bit error rate conforms to the first algorithm open condition;
    若所述误码率符合第二算法开启条件时,向所述第一设备发送第二误码率状态,所述第二误码率状态用于表示所述误码率符合所述第二算法开启条件。If the bit error rate complies with the enabling condition of the second algorithm, send a second bit error rate status to the first device, where the second bit error rate status is used to indicate that the bit error rate conforms to the second algorithm Turn on condition.
  14. 根据权利要求14所述的方法,其特征在于,所述方法还包括:The method of claim 14, wherein the method further comprises:
    接收第一设备发送的测试数据包;receiving a test data packet sent by the first device;
    根据接收到的正确的测试数据包的个数和发送的测试数据包的个数,计算出丢包率;Calculate the packet loss rate according to the number of correct test packets received and the number of test packets sent;
    若所述丢包率符合第一算法开启条件时,向所述第一设备发送第一丢包率状态,所述第一丢包率状态用于表示所述丢包率符合所述第一算法开启条件;If the packet loss rate complies with the enabling condition of the first algorithm, a first packet loss rate status is sent to the first device, where the first packet loss rate status is used to indicate that the packet loss rate complies with the first algorithm open condition;
    若所述丢包率符合第二算法开启条件时,向所述第一设备发送第二丢包率状态,所述 第一丢包率状态用于表示所述丢包率符合所述第二算法开启条件。If the packet loss rate complies with the enabling condition of the second algorithm, a second packet loss rate status is sent to the first device, where the first packet loss rate status is used to indicate that the packet loss rate complies with the second algorithm Turn on condition.
  15. 根据权利要求14所述的方法,其特征在于,所述第一检纠错算法包括至少二个检纠错算法,第二检纠错算法包括至少一个检纠错算法,所述第一检纠错算法中的检纠错算法的数量大于所述第二检纠错算法中的检纠错算法的数量。The method according to claim 14, wherein the first error detection and correction algorithm includes at least two error detection and correction algorithms, the second error detection and correction algorithm includes at least one error detection and correction algorithm, and the first error detection and correction algorithm includes at least one error detection and correction algorithm. The number of error detection and correction algorithms in the error detection algorithm is greater than the number of error detection and correction algorithms in the second error detection and correction algorithm.
  16. 根据权利要求14或17所述的方法,其特征在于,所述第一检纠错算法包括FEC算法、CRC算法和ECC算法;或者The method according to claim 14 or 17, wherein the first error detection and correction algorithm comprises an FEC algorithm, a CRC algorithm and an ECC algorithm; or
    所述第一检纠错算法包括FEC算法和CRC算法;或者The first error detection and correction algorithm includes an FEC algorithm and a CRC algorithm; or
    所述第一检纠错算法包括FEC算法和ECC算法;或者The first error detection and correction algorithm includes an FEC algorithm and an ECC algorithm; or
    所述第二检纠错算法包括FEC算法;或者The second error detection and correction algorithm includes an FEC algorithm; or
    所述第二检纠错算法包括CRC算法;或者The second error detection and correction algorithm includes a CRC algorithm; or
    所述第二检纠错算法包括ECC算法;或者The second error detection and correction algorithm includes an ECC algorithm; or
    所述第二检纠错算法包括CRC算法和ECC算法。The second error detection and correction algorithm includes a CRC algorithm and an ECC algorithm.
  17. 根据权利要求14所述的方法,其特征在于,所述确定出符合第一算法开启条件,包括:确定出所述编码数据包括指示字段;所述确定出符合第二算法开启条件,包括:确定出所述编码数据未包括指示字段;或者,The method according to claim 14, wherein the determining that the condition for enabling the first algorithm is met comprises: determining that the encoded data includes an indication field; the determining that the condition for enabling the second algorithm is met comprises: determining out that the encoded data does not include an indication field; or,
    所述确定出符合第一算法开启条件,包括:确定出所述编码数据未包括指示字段;所述确定出符合第二算法开启条件,包括:确定出所述第二编码数据包括指示字段;或者,The determining that the condition for enabling the first algorithm is met includes: determining that the encoded data does not include an indication field; the determining that the condition for enabling the second algorithm is met includes: determining that the second encoding data includes an indication field; or ,
    所述确定出符合第一算法开启条件,包括:确定出所述第一编码数据中的指示字段为第一取值;所述确定出符合第二算法开启条件,包括:确定出所述第二编码数据中的指示字段为第二取值。The determining that the condition for enabling the first algorithm is met includes: determining that the indication field in the first encoded data is the first value; the determining that the condition for enabling the second algorithm is met includes: determining that the second The indication field in the encoded data is the second value.
  18. 一种第一设备,其特征在于,包括:A first device, characterized in that it includes:
    一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得所述设备执行权利要求1至11中任意一项所述的数据传输方法。one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs including instructions, when the instructions are When the device executes, the device is caused to execute the data transmission method described in any one of claims 1 to 11.
  19. 一种第二设备,其特征在于,包括:A second device, comprising:
    一个或多个处理器;存储器;以及一个或多个计算机程序,其中所述一个或多个计算机程序被存储在所述存储器中,所述一个或多个计算机程序包括指令,当所述指令被所述设备执行时,使得所述设备执行权利要求12至17中任意一项所述的数据传输方法。one or more processors; a memory; and one or more computer programs, wherein the one or more computer programs are stored in the memory, the one or more computer programs including instructions, when the instructions are When the device executes, the device is caused to execute the data transmission method described in any one of claims 12 to 17 .
  20. 一种数据传输系统,其特征在于,包括:第一设备和第二设备,所述第一设备和所述第二设备通过传输通道通信连接;A data transmission system, comprising: a first device and a second device, wherein the first device and the second device are communicatively connected through a transmission channel;
    所述第一设备,用于若传输通道的环境参数符合第一算法开启条件,通过第一检纠错算法对获取的传输数据进行编码,生成第一编码数据,并将所述第一编码数据发送至第二设备;若传输通道的环境参数符合第二算法开启条件,通过第二检纠错算法对获取的传输数据进行编码,生成第二编码数据,并将所述第二编码数据发送至第二设备,所述第二检纠错算法与所述第一检纠错算法不同;The first device is configured to encode the acquired transmission data through a first error detection and correction algorithm if the environmental parameters of the transmission channel meet the conditions for enabling the first algorithm, generate first encoded data, and convert the first encoded data to the first device. Send to the second device; if the environmental parameters of the transmission channel meet the conditions for enabling the second algorithm, encode the acquired transmission data through the second error detection and correction algorithm, generate second encoded data, and send the second encoded data to a second device, wherein the second error detection and correction algorithm is different from the first error detection and correction algorithm;
    所述第二设备,用于若接收到第一设备发送的第一编码数据,通过第一检纠错算法对所述第一编码数据进行校验,生成传输数据;若接收到第一设备发送的第二编码数据,通过第二检纠错算法对所述第二编码数据进行校验,生成传输数据。The second device is configured to, if receiving the first encoded data sent by the first device, verify the first encoded data through a first error detection and correction algorithm, and generate transmission data; if receiving the first encoded data sent by the first device The second encoded data is checked by a second error detection and correction algorithm to generate transmission data.
  21. 根据权利要求20所述的系统,其特征在于,所述第一设备为摄像头模组,所述 第二设备为主板;或者The system of claim 20, wherein the first device is a camera module, and the second device is a motherboard; or
    所述第一设备为摄像头模组,第二设备为主机;或者The first device is a camera module, and the second device is a host; or
    所述第一设备为主板,所述第二设备为显示屏;或者The first device is a motherboard, and the second device is a display screen; or
    所述第一设备为主机,所述第二设备为显示屏。The first device is a host, and the second device is a display screen.
  22. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质包括存储的程序,其中,在所述程序运行时控制所述计算机可读存储介质所在设备执行权利要求1至11中任意一项所述的数据传输方法,或者,在所述程序运行时控制所述计算机可读存储介质所在设备执行权利要求12至17中任意一项所述的数据传输方法。A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein when the program is run, a device where the computer-readable storage medium is located is controlled to execute any one of claims 1 to 11 One of the data transmission methods, or, when the program is running, the device where the computer-readable storage medium is located is controlled to execute the data transmission method according to any one of claims 12 to 17.
  23. 一种包含指令的计算机程序产品,其特征在于,当所述计算机程序产品在计算机或任一至少一种处理器上运行时,使得所述计算机执行如权利要求1至11中任一项所述的数据传输方法;或者,使得所述计算机执行如权利要求12至17中任一项所述的数据传输方法。A computer program product comprising instructions, characterized in that, when the computer program product is run on a computer or any one of at least one processor, the computer is made to perform the execution of any one of claims 1 to 11. or, causing the computer to execute the data transmission method according to any one of claims 12 to 17.
PCT/CN2021/123743 2020-10-15 2021-10-14 Data transmission method and system, and computer-readable storage medium WO2022078426A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011106012.4A CN114374470B (en) 2020-10-15 2020-10-15 Data transmission method, system and computer readable storage medium
CN202011106012.4 2020-10-15

Publications (1)

Publication Number Publication Date
WO2022078426A1 true WO2022078426A1 (en) 2022-04-21

Family

ID=81138568

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/123743 WO2022078426A1 (en) 2020-10-15 2021-10-14 Data transmission method and system, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN114374470B (en)
WO (1) WO2022078426A1 (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884624A (en) * 2022-07-08 2022-08-09 广州思德医疗科技有限公司 Data processing method and device
CN115129509A (en) * 2022-06-30 2022-09-30 苏州浪潮智能科技有限公司 Data transmission method, device and medium
CN115484084A (en) * 2022-09-05 2022-12-16 北京天元特通科技有限公司 Unidirectional data transmission method and related equipment
WO2024098841A1 (en) * 2022-11-07 2024-05-16 中国第一汽车股份有限公司 Control method and apparatus, device, and storage medium
WO2024193265A1 (en) * 2023-03-17 2024-09-26 华为技术有限公司 Data transmission method and related apparatus

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115297341A (en) * 2022-07-18 2022-11-04 西安电子科技大学芜湖研究院 Video data transmission method and device, electronic equipment and readable storage medium
CN116321286B (en) * 2023-03-13 2023-09-22 湖北华中电力科技开发有限责任公司 Data deviation identification system applying intelligent algorithm

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790666A (en) * 2011-05-17 2012-11-21 华为终端有限公司 Error control method, receiving end, transmitting end and system
US20150135041A1 (en) * 2013-11-13 2015-05-14 Microsemi Frequency And Time Corporation Ethernet point to point link incorporating forward error correction
CN107086898A (en) * 2017-04-19 2017-08-22 江苏卓胜微电子有限公司 Joint error correction method and device
CN107947902A (en) * 2017-12-04 2018-04-20 郑州云海信息技术有限公司 The data error processing system and method for a kind of high-speed interface chip
CN109412753A (en) * 2018-10-25 2019-03-01 网易(杭州)网络有限公司 Data transmission method and device, electronic equipment and storage medium
CN111128203A (en) * 2020-02-27 2020-05-08 北京达佳互联信息技术有限公司 Audio data encoding method, audio data decoding method, audio data encoding device, audio data decoding device, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6182264B1 (en) * 1998-05-22 2001-01-30 Vlsi Technology, Inc. Smart dynamic selection of error correction methods for DECT based data services
CN102098130A (en) * 2009-12-15 2011-06-15 意法半导体研发(深圳)有限公司 Efficient dynamic transmission with high speed and high reliability
CN102158308B (en) * 2011-02-12 2014-09-10 中兴通讯股份有限公司 Method and system for configuring uplink forward error correction flow
CN104639919B (en) * 2013-11-14 2017-11-03 杭州海康威视数字技术股份有限公司 Data transmission method and its system for digital video fiber optic transmitter system
CN109218083B (en) * 2018-08-27 2021-08-13 广州猎游信息科技有限公司 Voice data transmission method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102790666A (en) * 2011-05-17 2012-11-21 华为终端有限公司 Error control method, receiving end, transmitting end and system
US20150135041A1 (en) * 2013-11-13 2015-05-14 Microsemi Frequency And Time Corporation Ethernet point to point link incorporating forward error correction
CN107086898A (en) * 2017-04-19 2017-08-22 江苏卓胜微电子有限公司 Joint error correction method and device
CN107947902A (en) * 2017-12-04 2018-04-20 郑州云海信息技术有限公司 The data error processing system and method for a kind of high-speed interface chip
CN109412753A (en) * 2018-10-25 2019-03-01 网易(杭州)网络有限公司 Data transmission method and device, electronic equipment and storage medium
CN111128203A (en) * 2020-02-27 2020-05-08 北京达佳互联信息技术有限公司 Audio data encoding method, audio data decoding method, audio data encoding device, audio data decoding device, electronic equipment and storage medium

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115129509A (en) * 2022-06-30 2022-09-30 苏州浪潮智能科技有限公司 Data transmission method, device and medium
CN114884624A (en) * 2022-07-08 2022-08-09 广州思德医疗科技有限公司 Data processing method and device
CN115484084A (en) * 2022-09-05 2022-12-16 北京天元特通科技有限公司 Unidirectional data transmission method and related equipment
WO2024098841A1 (en) * 2022-11-07 2024-05-16 中国第一汽车股份有限公司 Control method and apparatus, device, and storage medium
WO2024193265A1 (en) * 2023-03-17 2024-09-26 华为技术有限公司 Data transmission method and related apparatus

Also Published As

Publication number Publication date
CN114374470A (en) 2022-04-19
CN114374470B (en) 2024-10-18

Similar Documents

Publication Publication Date Title
WO2022078426A1 (en) Data transmission method and system, and computer-readable storage medium
JP5233165B2 (en) Data transmission device
EP2127265B1 (en) Method and system for transmission of uncompressed video over wireless communication channels
KR101367015B1 (en) Error detection in physical interfaces for point-to-point communications between integrated circuits
US20160261375A1 (en) Packet format and coding method for serial data transmission
US9661350B2 (en) Methods and apparatus for error rate estimation
US8103942B2 (en) Data transmission apparatus, data transmission device, data reception device and data transmission system
US20060168496A1 (en) Systems and methods for implementing cyclic redundancy checks
US7665011B2 (en) Method and circuit for reducing SATA transmission data errors by adjusting the period of sending align primitives
EP2317688A2 (en) System and methods for implementing cyclic redundancy checks
CN202663412U (en) Sending equipment, receiving equipment and transmission system
JPWO2008053858A1 (en) Interface device and electronic device
JP4844629B2 (en) Apparatus and method for error correction in mobile wireless applications incorporating erasure table data
EP3029842B1 (en) Memory-efficient methods of transporting error correction codes in a symbol encoded transmission stream
CN107733568B (en) Method and device for realizing CRC parallel computation based on FPGA
US9337959B2 (en) Defect propagation of multiple signals of various rates when mapped into a combined signal
US10862830B2 (en) Real-time on-chip data transfer system
US8990645B2 (en) Methods and apparatus for error rate estimation
CN108347292A (en) A kind of the data decoding method and device of Physical Coding Sublayer
WO2022193098A1 (en) Data transmission method, communication device, and system
US20130013975A1 (en) System and device
EP2811483A2 (en) Methods and apparatus for error rate estimation
US20190115935A1 (en) Forward Error Correction and Asymmetric Encoding for Video Data Transmission Over Multimedia Link
TWI400889B (en) Systems and methods for implementing cyclic redundancy checks
JP5532030B2 (en) Data communication method and data communication apparatus

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21879469

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21879469

Country of ref document: EP

Kind code of ref document: A1