Data transmission method and device

By adopting pulse coding and decoding technologies in single bus technology, the problem of strict clock deviation and timing control requirements of master and slave devices is solved, the stability and speed of data transmission are improved, and the limitations caused by insufficient processing capabilities are reduced.

CN119621613APending Publication Date: 2025-03-14BEIJING CEC HUADA ELECTRONIC DESIGN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411675340.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-21
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

In single bus technology, the master and slave devices have extremely strict requirements on clock deviation and timing control. Any microsecond-level time deviation may lead to data transmission errors, and insufficient processing capabilities of the master and slave devices lead to low communication efficiency.

Method used

Pulse encoding and decoding technology is adopted to obtain the target transmission data and the encoding and decoding mode, and pulse data is pulsed between the master and the slave device, so that the slave device decodes the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

Benefits of technology

It avoids strict requirements for clock deviation and timing control, improves the stability and speed of data transmission, and reduces the limitations caused by the lack of processing capabilities of master and slave devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119621613A_ABST
    Figure CN119621613A_ABST
Patent Text Reader

Abstract

The invention discloses a data transmission method and device. And obtaining target transmission data and a target coding and decoding mode. Then, according to the target coding and decoding mode, pulse coding is carried out on the target transmission data, and pulse data corresponding to the target transmission data is generated; and finally, sending the pulse data to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target coding and decoding mode to obtain target transmission data. Therefore, strict requirements on clock skew and time sequence control in a single bus technology are avoided, the stability and the speed of data transmission are improved, and the limitation caused by insufficient processing capability of the master equipment and the slave equipment is also reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for data transmission. Background Art

[0002] 1-wire Bus technology uses a single data line, which can supply power and transmit data, and the data transmission is bidirectional. It has many advantages such as saving I / O port lines, simple resource structure, low cost, easy bus expansion and maintenance, etc.

[0003] Currently, the master and slave devices have extremely strict requirements on the clock deviation and timing control of the single bus. Any time deviation at the microsecond level may cause the sending and receiving of bits between the communicating parties to be out of sync, which in turn leads to errors in data transmission. Summary of the invention

[0004] The present specification provides a data transmission method, device, storage medium and electronic device to improve the stability and rate of data transmission and reduce the limitations caused by insufficient processing capabilities of a master device and a slave device.

[0005] This manual adopts the following technical solutions:

[0006] This specification provides a method for data transmission, the method is applied to a master device in a communication system, the communication system includes: a master device and a slave device, the method includes:

[0007] Obtain target transmission data and target encoding and decoding mode;

[0008] According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data;

[0009] The pulse data is sent to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

[0010] Optionally, the communication system stores at least one encoding and decoding mode;

[0011] Before acquiring the target transmission data and the target encoding and decoding mode, the method further includes:

[0012] Acquire device information of the master device and device information of the slave device;

[0013] A target codec mode is selected from the at least one codec mode based on the device information of the master device and the device information of the slave device.

[0014] Optionally, the target encoding and decoding mode includes: a first encoding and decoding mode;

[0015] According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including:

[0016] If it is determined that the target encoding and decoding mode is the first encoding and decoding mode, pulse encoding is performed on the value of the single-byte data in the target transmission data to obtain the number of pulses corresponding to the value of the single-byte data; wherein the single-byte data consists of eight bits;

[0017] Based on the number of pulses corresponding to the value of the single-byte data, pulse data corresponding to the target transmission data is generated.

[0018] Optionally, the target encoding and decoding mode includes: a second encoding and decoding mode;

[0019] According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including:

[0020] If it is determined that the target encoding and decoding mode is the second encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain two first sub-byte data; wherein the first sub-byte data consists of four bits;

[0021] Performing pulse encoding on the value of the first sub-byte data to obtain the number of pulses corresponding to the value of the first sub-byte data;

[0022] Based on the number of pulses corresponding to the value of the first sub-byte data, pulse data corresponding to the target transmission data is generated.

[0023] Optionally, the target encoding and decoding mode includes: a third encoding and decoding mode;

[0024] According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including:

[0025] If it is determined that the target encoding and decoding mode is the third encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain four second sub-byte data; wherein the second sub-byte data consists of two bits;

[0026] Performing pulse encoding on the value of the second sub-byte data to obtain the number of pulses corresponding to the value of the second sub-byte data;

[0027] Based on the number of pulses corresponding to the value of the second sub-byte data, pulse data corresponding to the target transmission data is generated.

[0028] Optionally, the target coding mode includes: a fourth coding mode;

[0029] According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including:

[0030] If it is determined that the target encoding and decoding mode is the fourth encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain eight third sub-byte data; wherein the third sub-byte data consists of one bit;

[0031] Performing pulse encoding on the value of the third sub-byte data to obtain the number of pulses corresponding to the value of the third sub-byte data;

[0032] Based on the number of pulses corresponding to the value of the third subbyte data, pulse data corresponding to the target transmission data is generated.

[0033] Optionally, at least one data line is used to establish a communication connection between the master device and the slave device;

[0034] Sending the pulse data to the slave device comprises:

[0035] Determining a target transmission mode based on the number of the data lines and the target encoding and decoding mode;

[0036] Based on the target transmission mode, the pulse data is sent to the slave device.

[0037] This specification provides a method for data transmission, the method is applied to a slave device in a communication system, the communication system includes: a master device and a slave device, the method includes:

[0038] Get the target codec mode;

[0039] Receiving pulse data sent by the master device;

[0040] According to the target encoding and decoding mode, the pulse data is pulse-decoded to obtain target transmission data.

[0041] Optionally, the communication system stores at least one encoding and decoding mode, and the master device and the slave device establish a communication connection using at least one data line;

[0042] Before acquiring the target encoding and decoding mode, the method further includes:

[0043] Acquire device information of the master device and device information of the slave device;

[0044] A target codec mode is selected from the at least one codec mode based on the device information of the master device and the device information of the slave device.

[0045] This specification provides a data transmission device, the device is applied to a master device in a communication system, the communication system includes: a master device and a slave device; the device includes:

[0046] An acquisition module is used to acquire target transmission data and target encoding and decoding mode;

[0047] An encoding module, used for pulse encoding the target transmission data according to the target encoding and decoding mode, and generating pulse data corresponding to the target transmission data;

[0048] The sending module is used to send the pulse data to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

[0049] This specification provides a data transmission device, which is applied to a slave device in a communication system, wherein the communication system includes: a master device and a slave device; the device includes:

[0050] An acquisition module is used to obtain the target encoding and decoding mode;

[0051] A receiving module, used for receiving pulse data sent by the master device;

[0052] The decoding module is used to perform pulse decoding on the pulse data according to the target encoding and decoding mode to obtain target transmission data.

[0053] This specification provides an electronic device, including a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus;

[0054] The memory stores machine-readable instructions, and the processor executes the above-mentioned data transmission method by calling the machine-readable instructions.

[0055] The present specification provides a machine-readable storage medium, wherein the machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, a method for transmitting data is implemented.

[0056] At least one of the above technical solutions adopted in this specification can achieve the following beneficial effects:

[0057] In this specification, target transmission data and target encoding and decoding mode are obtained. Then, pulse encoding is performed on the target transmission data according to the target encoding and decoding mode to generate pulse data corresponding to the target transmission data. Finally, the pulse data is sent to the slave device so that the slave device pulse decodes the pulse data according to the target encoding and decoding mode to obtain the target transmission data. Thus, the strict requirements on clock deviation and timing control in the single bus technology are avoided, the stability and rate of data transmission are improved, and the limitations caused by the lack of processing power of the master device and the slave device are reduced. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The drawings described herein are used to provide a further understanding of this specification and constitute a part of this specification. The illustrative embodiments and descriptions of this specification are used to explain this specification and do not constitute an improper limitation on this specification. In the drawings:

[0059] Figure 1 is a flow chart of a data transmission method shown in an exemplary embodiment;

[0060] Figure 2 is a schematic diagram of a single bus communication system shown in an exemplary embodiment;

[0061] Figure 3 is a schematic diagram of a communication system with multiple data lines shown in an exemplary embodiment;

[0062] Figure 4 is a schematic diagram of a first encoding and decoding mode shown in an exemplary embodiment;

[0063] Figure 5 is a schematic diagram of a second encoding and decoding mode shown in an exemplary embodiment;

[0064] Figure 6 is a schematic diagram of a third encoding and decoding mode shown in an exemplary embodiment;

[0065] Figure 7 is a schematic diagram of a fourth encoding and decoding mode shown in an exemplary embodiment;

[0066] Figure 8 is a schematic diagram of a data transmission method based on two data lines shown in an exemplary embodiment;

[0067] Fig. 9 is a schematic diagram of another data transmission method based on two data lines according to an exemplary embodiment;

[0068] Fig.10 is a schematic diagram of another data transmission method based on two data lines according to an exemplary embodiment;

[0069] Fig.11 is a schematic diagram of another data transmission method based on two data lines according to an exemplary embodiment;

[0070] Fig.12 is a flow chart of another data transmission method shown in an exemplary embodiment;

[0071] Fig.13 It is a structural diagram of an electronic device where a data transmission device is located, shown in an exemplary embodiment;

[0072] Fig.14 is a structural diagram of a data transmission device shown in an exemplary embodiment;

[0073] Fig.15 It is a structural diagram of another data transmission device shown in an exemplary embodiment. DETAILED DESCRIPTION

[0074] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below in conjunction with the drawings in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of this specification.

[0075] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0076] Currently, the master and slave devices have extremely strict requirements on the clock deviation and timing control of the single bus. Any time deviation at the microsecond level may cause the sending and receiving of bits between the communicating parties to be out of sync, which in turn leads to errors in data transmission.

[0077] Furthermore, for master and slave devices without an operating system, when the processor performance is high, microsecond-level timing control can be barely achieved. However, for master and slave devices with an operating system, even if the processor performance is very high, the multi-tasking and multi-process management characteristics of the operating system make it extremely difficult to achieve microsecond-level timing control. Even if it can be achieved, this process requires a huge cost, which violates the original design intention of using a single bus for communication, which is simple, easy to use, and low-cost.

[0078] Based on this, this specification proposes a technical solution for pulse encoding the target transmission data according to the target encoding and decoding mode, generating pulse data, and transmitting the pulse data between the master device and the slave device. Thus, the strict requirements on clock deviation and timing control in the single bus technology are avoided, the stability and rate of data transmission are improved, and the limitations caused by the insufficient processing capabilities of the master device and the slave device are reduced.

[0079] The technical solutions provided by the embodiments of this specification are described in detail below in conjunction with the accompanying drawings.

[0080] Figure 1 This is a flow chart of a data transmission method shown in an exemplary embodiment, and the method specifically includes the following steps:

[0081] S100: Obtain target transmission data and target encoding and decoding mode.

[0082] S102: Perform pulse coding on the target transmission data according to the target coding and decoding mode to generate pulse data corresponding to the target transmission data.

[0083] S104: Send the pulse data to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

[0084] In the embodiments of this specification, the data transmission method can be applied to a master device in a communication system, and the communication system includes: a master device and a slave device. Figure 2 shown.

[0085] Figure 2 It is a schematic diagram of a single bus communication system shown in an exemplary embodiment.

[0086] exist Figure 2 In the master device and the slave device, there are pulse generators, pulse counters, general purpose input / output (GPIO), etc. GPIO is a digital signal interface. A data line is used to establish a communication connection between the master device and the slave device.

[0087] Among them, the way to generate pulse data includes: edge-triggered level flipping of digital circuits (for example, from low level to high level or from high level to low level), pulse generator generating pulse data, etc. Pulse generators include: self-oscillation circuits, PWM signal generators, etc. Ways to count pulse data include: software counting, hardware counting. Software counting can refer to phase detection of pulses or I / O high and low levels, edge-triggered interrupts, etc. Hardware counting can refer to the use of special counter chips or circuits to achieve.

[0088] Furthermore, the pulse may be in the form of a square wave, a triangle wave, a sine wave, a sawtooth wave, or the like.

[0089] It should be noted that multiple data lines can be used to establish a communication connection between the master device and the slave device. Figure 3 shown.

[0090] Figure 3 FIG. 1 is a schematic diagram of a communication system with multiple data lines shown in an exemplary embodiment.

[0091] exist Figure 3 In the master device and the slave device, there are pulse generators, pulse counters, general input and output, etc. Multiple data lines can be used to establish a communication connection between the master device and the slave device.

[0092] In the embodiment of this specification, target transmission data and target encoding and decoding mode are obtained.

[0093] Then, according to the target coding and decoding mode, pulse coding is performed on the target transmission data to generate pulse data corresponding to the target transmission data.

[0094] Next, the pulse data is sent to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

[0095] In actual applications, it takes a while for the master device to pulse encode the target transmission data and for the slave device to pulse decode the pulse data. The length of the processing time is affected by the processing capabilities of the master and slave devices. Therefore, even when transmitting single-byte data, the fewer the number of pulses, the higher the communication performance. In fact, the communication performance is affected by many factors, including the number of pulse groups required to transmit single-byte data, the number of pulses in each group of pulses, the frequency of the pulses, and the processing capabilities of the master and slave devices. These factors together determine the efficiency and reliability of communication.

[0096] In the embodiment of this specification, the communication system stores at least one encoding and decoding mode.

[0097] Before obtaining the target transmission data and the target encoding and decoding mode, the device information of the master device and the device information of the slave device are obtained. The device information mentioned here may include: processor information, memory information, software configuration information, etc.

[0098] Then, based on the device information of the master device and the device information of the slave device, a target codec mode is selected from at least one codec mode.

[0099] It can be seen from the above embodiments that the communication system can select the encoding and decoding mode that best suits the current hardware configuration and communication requirements, thereby ensuring communication efficiency and data transmission reliability.

[0100] In the embodiment of this specification, the target coding mode includes: a first coding mode.

[0101] If the target coding mode is determined to be the first coding mode, pulse coding is performed on the value of the single-byte data in the target transmission data to obtain the number of pulses corresponding to the value of the single-byte data, wherein the single-byte data consists of eight bits.

[0102] Then, based on the number of pulses corresponding to the numerical value of the one-byte data, pulse data corresponding to the target transmission data is generated.

[0103] In the first encoding and decoding mode, only one set of pulses is needed to transmit a single-byte data. Since the value range of a single-byte data is 0 to 255, 1 to 255 pulses can be used to represent the values ​​1 to 255. Among them, the value 0 requires 256 pulses to be transmitted.

[0104] For example, when the value of the single-byte data is "0x01", the number of pulses is 1, and 1 pulse is transmitted. For another example, when the value of the single-byte data is "0x02", the number of pulses is 2, and 2 pulses are transmitted. Similarly, when the value of the single-byte data is "N", the number of pulses is N, and N pulses are transmitted.

[0105] It should be noted that when the value of the single-byte data is "0x00", the number of pulses is 256, and 256 pulses are transmitted.

[0106] Figure 4 It is a schematic diagram of a first encoding and decoding mode shown in an exemplary embodiment.

[0107] exist Figure 4In the example, the target transmission data is "0x01", "0x02", "0x03", "0x04", and "0x05". For example, a data line is used to establish a communication connection between the master device and the slave device. When the value of the single-byte data is "0x01", 1 pulse is transmitted. When the value of the single-byte data is "0x02", 2 pulses are transmitted. When the value of the single-byte data is "0x03", 3 pulses are transmitted. When the value of the single-byte data is "0x04", 4 pulses are transmitted. When the value of the single-byte data is "0x05", 5 pulses are transmitted.

[0108] In the embodiment of this specification, the target coding mode includes: a second coding mode.

[0109] If it is determined that the target encoding and decoding mode is the second encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain two first sub-byte data, wherein the first sub-byte data consists of four bits.

[0110] Then, pulse encoding is performed on the value of the first sub-byte data to obtain the number of pulses corresponding to the value of the first sub-byte data.

[0111] Next, pulse data corresponding to the target transmission data is generated based on the number of pulses corresponding to the value of the first sub-byte data.

[0112] In the second encoding and decoding mode, the single-byte data is divided into two first sub-byte data, that is, two groups of pulses are required to transmit the single-byte data. Since the value range of the first sub-byte data is 0 to 15, 1 to 15 pulses can be used to represent the values ​​1 to 15 respectively. Among them, the value 0 requires 16 pulses to be transmitted.

[0113] For example, when the value of the single-byte data is "0x12", the first first sub-byte data is "1", the number of pulses of the first group of pulses is 1, and 1 pulse is transmitted. The second first sub-byte data is "2", the number of pulses of the second group of pulses is 2, and 2 pulses are transmitted. For another example, when the value of the single-byte data is "0x23", the first first sub-byte data is "2", the number of pulses of the first group of pulses is 2, and 2 pulses are transmitted. The second first sub-byte data is "3", the number of pulses of the second group of pulses is 3, and 3 pulses are transmitted. Similarly, when the value of the single-byte data is "0xNN", the first first sub-byte data is "N", the number of pulses of the first group of pulses is N, and N pulses are transmitted. The second first sub-byte data is "N", the number of pulses of the second group of pulses is N, and N pulses are transmitted.

[0114] It should be noted that when the value of the single-byte data is "0x00", the first sub-byte data is "0", the number of pulses in the first group of pulses is 16, and 16 pulses are transmitted. The second first sub-byte data is "0", the number of pulses in the second group of pulses is 16, and 16 pulses are transmitted.

[0115] Figure 5 It is a schematic diagram of a second encoding and decoding mode shown in an exemplary embodiment.

[0116] exist Figure 5 In the example, the target transmission data is "0x22", "0x33", and "0x44", and a data line is used to establish a communication connection between the master device and the slave device. When the value of the single-byte data is "0x22", the first first sub-byte data is "2", the number of pulses in the first group of pulses is 2, and 2 pulses are transmitted. The second first sub-byte data is "2", the number of pulses in the second group of pulses is 2, and 2 pulses are transmitted. When the value of the single-byte data is "0x33", the first first sub-byte data is "3", the number of pulses in the first group of pulses is 3, and 3 pulses are transmitted. The second first sub-byte data is "3", the number of pulses in the second group of pulses is 3, and 3 pulses are transmitted. When the value of the single-byte data is "0x44", the first first sub-byte data is "4", the number of pulses in the first group of pulses is 4, and 4 pulses are transmitted. The second first sub-byte data is "4", the number of pulses in the second group of pulses is 4, and 4 pulses are transmitted.

[0117] In the embodiment of this specification, the target coding mode includes: a third coding mode.

[0118] If it is determined that the target encoding and decoding mode is the third encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain four second sub-byte data, wherein the second sub-byte data consists of two bits.

[0119] Then, pulse encoding is performed on the value of the second sub-byte data to obtain the number of pulses corresponding to the value of the second sub-byte data.

[0120] Next, pulse data corresponding to the target transmission data is generated based on the number of pulses corresponding to the value of the second subbyte data.

[0121] In the third encoding and decoding mode, the single-byte data is divided into four second sub-byte data, that is, four groups of pulses are required to transmit the single-byte data. Since the value range of the second sub-byte data is 0 to 3, 1 to 3 pulses can be used to represent the values ​​1 to 3 respectively. Among them, the value 0 requires 4 pulses to be transmitted.

[0122] Figure 6It is a schematic diagram of a third encoding and decoding mode shown in an exemplary embodiment.

[0123] exist Figure 6 In the example, the target transmission data is "0x5A" and "0xFF", and a data line is used to establish a communication connection between the master device and the slave device. When the value of the single-byte data is "0x5A", the binary is "01011010", the first second sub-byte data is "01", the number of pulses in the first group of pulses is 1, and 1 pulse is transmitted. The second second sub-byte data is "01", the number of pulses in the second group of pulses is 1, and 1 pulse is transmitted. The third second sub-byte data is "10", the number of pulses in the third group of pulses is 2, and 2 pulses are transmitted. The fourth second sub-byte data is "10", the number of pulses in the fourth group of pulses is 2, and 2 pulses are transmitted. When the value of the single-byte data is "0xFF", the binary is "11111111", the first second sub-byte data is "11", the number of pulses in the first group of pulses is 3, and 3 pulses are transmitted. The second second sub-byte data is "11", the number of pulses in the second group of pulses is 3, and 3 pulses are transmitted. The third second subbyte data is "11", the number of pulses in the third group of pulses is 3, and 3 pulses are transmitted. The fourth second subbyte data is "11", the number of pulses in the fourth group of pulses is 3, and 3 pulses are transmitted.

[0124] It should be noted that when the value of the single-byte data is "0x00", the binary is "00000000", the first second sub-byte data is "00", the number of pulses of the first group of pulses is 4, and 4 pulses are transmitted. The second second sub-byte data is "00", the number of pulses of the second group of pulses is 4, and 4 pulses are transmitted. The third second sub-byte data is "00", the number of pulses of the third group of pulses is 4, and 4 pulses are transmitted. The fourth second sub-byte data is "00", the number of pulses of the fourth group of pulses is 4, and 4 pulses are transmitted.

[0125] In the embodiment of this specification, the target coding mode includes: a fourth coding mode.

[0126] If the target encoding and decoding mode is determined to be the fourth encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain eight third sub-byte data, wherein the third sub-byte data consists of one bit.

[0127] Then, pulse encoding is performed on the value of the third sub-byte data to obtain the number of pulses corresponding to the value of the third sub-byte data.

[0128] Next, based on the number of pulses corresponding to the value of the third subbyte data, pulse data corresponding to the target transmission data is generated.

[0129] In the fourth encoding and decoding mode, the single-byte data is divided into eight third sub-byte data, that is, eight groups of pulses are required to transmit the single-byte data. Since the value range of the third sub-byte data is 0 to 1, one pulse can be used to represent the value 1, and two pulses can be used to represent the value 0.

[0130] Figure 7 It is a schematic diagram of a fourth encoding and decoding mode shown in an exemplary embodiment.

[0131] exist Figure 7 In the example, a communication connection is established between a master device and a slave device using a data line. When the value of a single-byte data is "0xCC", the binary is "11001100", the first third sub-byte data is "1", the number of pulses in the first group of pulses is 1, and 1 pulse is transmitted. The second third sub-byte data is "1", the number of pulses in the second group of pulses is 1, and 1 pulse is transmitted. The third third sub-byte data is "0", the number of pulses in the third group of pulses is 2, and 2 pulses are transmitted. The fourth third sub-byte data is "0", the number of pulses in the fourth group of pulses is 2, and 2 pulses are transmitted. The fifth third sub-byte data is "1", the number of pulses in the fifth group of pulses is 1, and 1 pulse is transmitted. The sixth third sub-byte data is "1", the number of pulses in the sixth group of pulses is 1, and 1 pulse is transmitted. The seventh third sub-byte data is "0", the number of pulses in the seventh group of pulses is 2, and 2 pulses are transmitted. The eighth third sub-byte data is "0", the number of pulses in the eighth group of pulses is 2, and 2 pulses are transmitted.

[0132] It should be noted that when the value of the single-byte data is "0x00", the binary is "00000000", the first third sub-byte data is "0", the number of pulses of the first group of pulses is 2, and 2 pulses are transmitted. The second third sub-byte data is "0", the number of pulses of the second group of pulses is 2, and 2 pulses are transmitted. The third third sub-byte data is "0", the number of pulses of the third group of pulses is 2, and 2 pulses are transmitted. The fourth third sub-byte data is "0", the number of pulses of the fourth group of pulses is 2, and 2 pulses are transmitted. The fifth third sub-byte data is "0", the number of pulses of the fifth group of pulses is 2, and 2 pulses are transmitted. The sixth third sub-byte data is "0", the number of pulses of the sixth group of pulses is 2, and 2 pulses are transmitted. The seventh third sub-byte data is "0", the number of pulses of the seventh group of pulses is 2, and 2 pulses are transmitted. The eighth third sub-byte data is "0", the number of pulses of the eighth group of pulses is 2, and 2 pulses are transmitted.

[0133] It can be seen from the above embodiments that, by using the target encoding and decoding mode among multiple encoding and decoding modes, the target transmission data is pulse-encoded, thereby avoiding the strict requirements on clock deviation and timing control in the single bus technology, improving the stability and rate of communication, and reducing the limitations caused by the insufficient processing capabilities of the master device and the slave device.

[0134] In the embodiments of this specification, a plurality of data lines may be used to establish a communication connection between the master device and the slave device, wherein different numbers of data lines correspond to different data transmission modes.

[0135] Then, based on the number of data lines and the target encoding and decoding mode, the target data transmission mode is determined.

[0136] Next, based on the target data transmission mode, the pulse data is sent to the slave device.

[0137] In the embodiment of the present specification, if the target coding mode is the first coding mode, and two data lines are used to establish a communication connection between the master device and the slave device, the pulse data corresponding to the first single-byte data is transmitted through the first data line, and the pulse data corresponding to the second single-byte data is transmitted through the second data line, and so on, the pulse data is sent to the slave device.

[0138] Figure 8 It is a schematic diagram showing a data transmission method based on two data lines according to an exemplary embodiment.

[0139] exist Figure 8 In the example, the target transmission data is "0x01", "0x02", "0x03", "0x04", and "0x05". When the value of the single-byte data is "0x01", the number of pulses is 1, and 1 pulse is transmitted through the first data line. When the value of the single-byte data is "0x02", the number of pulses is 2, and 2 pulses are transmitted through the second data line. When the value of the single-byte data is "0x03", the number of pulses is 3, and 3 pulses are transmitted through the first data line. When the value of the single-byte data is "0x04", the number of pulses is 4, and 4 pulses are transmitted through the second data line. When the value of the single-byte data is "0x05", the number of pulses is 5, and 5 pulses are transmitted through the first data line.

[0140] In an embodiment of the present specification, if the target encoding and decoding mode is the second encoding and decoding mode, and two data lines are used to establish a communication connection between the master device and the slave device, the pulse data corresponding to the first first sub-byte data is transmitted through the first data line, and the pulse data corresponding to the second first sub-byte data is transmitted through the second data line.

[0141] Fig. 9 It is a schematic diagram showing another data transmission method based on two data lines according to an exemplary embodiment.

[0142] exist Fig. 9 In the example, the target transmission data is "0x11", "0x22", "0x33", "0x44", and "0x55". When the value of the single-byte data is "0x11", the first first sub-byte data is "1", the number of pulses of the first group of pulses is 1, and 1 pulse is transmitted through the first data line. The second first sub-byte data is "1", the number of pulses of the second group of pulses is 1, and 1 pulse is transmitted through the second data line. When the value of the single-byte data is "0x22", the first first sub-byte data is "2", the number of pulses of the first group of pulses is 2, and 2 pulses are transmitted through the first data line. The second first sub-byte data is "2", the number of pulses of the second group of pulses is 2, and 2 pulses are transmitted through the second data line. When the value of the single-byte data is "0x33", the first first sub-byte data is "3", the number of pulses of the first group of pulses is 3, and 3 pulses are transmitted through the first data line. The second first sub-byte data is "3", the number of pulses of the second group of pulses is 3, and 3 pulses are transmitted through the second data line. When the value of the single-byte data is "0x44", the first first sub-byte data is "4", the number of pulses of the first group of pulses is 4, and 4 pulses are transmitted through the first data line. The second first sub-byte data is "4", the number of pulses of the second group of pulses is 4, and 4 pulses are transmitted through the second data line. When the value of the single-byte data is "0x55", the first first sub-byte data is "5", the number of pulses of the first group of pulses is 5, and 5 pulses are transmitted through the first data line. The second first sub-byte data is "5", the number of pulses of the second group of pulses is 5, and 5 pulses are transmitted through the second data line.

[0143] It should be noted that when the value of the single-byte data is "0x00", the first sub-byte data is "0", the number of pulses in the first group of pulses is 16, and 16 pulses are transmitted through the first data line. The second first sub-byte data is "0", the number of pulses in the second group of pulses is 16, and 16 pulses are transmitted through the second data line.

[0144] In an embodiment of the present specification, if the target encoding and decoding mode is the third encoding and decoding mode, and two data lines are used to establish a communication connection between the master device and the slave device, the first pulse data corresponding to the second sub-byte data and the second pulse data corresponding to the second sub-byte data are transmitted through the first data line, and the third pulse data corresponding to the second sub-byte data and the fourth pulse data corresponding to the second sub-byte data are transmitted through the second data line.

[0145] Fig.10 It is a schematic diagram showing another data transmission method based on two data lines according to an exemplary embodiment.

[0146] exist Fig.10 In the example, the target transmission data is "0xAA", "0xFF", "0x00". When the value of the single-byte data is "0xAA", the binary is "10101010", the first second sub-byte data is "10", the number of pulses of the first group of pulses is 2, and 2 pulses are transmitted through the first data line. The second second sub-byte data is "10", the number of pulses of the second group of pulses is 2, and 2 pulses are transmitted through the first data line. The third second sub-byte data is "10", the number of pulses of the third group of pulses is 2, and 2 pulses are transmitted through the second data line. The fourth second sub-byte data is "10", the number of pulses of the fourth group of pulses is 2, and 2 pulses are transmitted through the second data line.

[0147] When the value of the single-byte data is "0xFF", the binary is "11111111", the first second sub-byte data is "11", the number of pulses of the first group of pulses is 3, and 3 pulses are transmitted through the first data line. The second second sub-byte data is "11", the number of pulses of the second group of pulses is 3, and 3 pulses are transmitted through the first data line. The third second sub-byte data is "11", the number of pulses of the third group of pulses is 3, and 3 pulses are transmitted through the second data line. The fourth second sub-byte data is "11", the number of pulses of the fourth group of pulses is 3, and 3 pulses are transmitted through the second data line.

[0148] When the value of the single-byte data is "0x00", the binary value is "00000000", the first second sub-byte data is "00", the number of pulses of the first group of pulses is 4, and 4 pulses are transmitted through the first data line. The second second sub-byte data is "00", the number of pulses of the second group of pulses is 4, and 4 pulses are transmitted through the first data line. The third second sub-byte data is "00", the number of pulses of the third group of pulses is 4, and 4 pulses are transmitted through the second data line. The fourth second sub-byte data is "00", the number of pulses of the fourth group of pulses is 4, and 4 pulses are transmitted through the second data line.

[0149] In an embodiment of the present specification, if the target codec mode is the fourth codec mode, and two data lines are used to establish a communication connection between the master device and the slave device, the first pulse data corresponding to the third sub-byte data, the second pulse data corresponding to the third sub-byte data, the third pulse data corresponding to the third sub-byte data, and the fourth pulse data corresponding to the third sub-byte data are transmitted through the first data line, and the fifth pulse data corresponding to the third sub-byte data, the sixth pulse data corresponding to the third sub-byte data, the seventh pulse data corresponding to the third sub-byte data, and the eighth pulse data corresponding to the third sub-byte data are transmitted through the second data line.

[0150] Fig.11 It is a schematic diagram showing another data transmission method based on two data lines according to an exemplary embodiment.

[0151] exist Fig.11 In the example, the target transmission data is "0xCC" and "0xFF". When the value of the single-byte data is "0xCC", the binary is "11001100", the first third sub-byte data is "1", the number of pulses of the first group of pulses is 1, and 1 pulse is transmitted through the first data line. The second third sub-byte data is "1", the number of pulses of the second group of pulses is 1, and 1 pulse is transmitted through the first data line. The third third sub-byte data is "0", the number of pulses of the third group of pulses is 2, and 2 pulses are transmitted through the first data line. The fourth third sub-byte data is "0", the number of pulses of the fourth group of pulses is 2, and 2 pulses are transmitted through the first data line. The fifth third sub-byte data is "1", the number of pulses of the fifth group of pulses is 1, and 1 pulse is transmitted through the second data line. The sixth third sub-byte data is "1", the number of pulses of the sixth group of pulses is 1, and 1 pulse is transmitted through the second data line. The seventh third sub-byte data is "0", the number of pulses of the seventh group of pulses is 2, and 2 pulses are transmitted through the second data line. The eighth third sub-byte data is "0", the number of pulses in the eighth group of pulses is 2, and 2 pulses are transmitted through the second data line.

[0152] When the value of the single-byte data is "0xFF", the binary value is "11111111", the first third sub-byte data is "1", the number of pulses of the first group of pulses is 1, and 1 pulse is transmitted through the first data line. The second third sub-byte data is "1", the number of pulses of the second group of pulses is 1, and 1 pulse is transmitted through the first data line. The third third sub-byte data is "1", the number of pulses of the third group of pulses is 1, and 1 pulse is transmitted through the first data line. The fourth third sub-byte data is "1", the number of pulses of the fourth group of pulses is 1, and 1 pulse is transmitted through the first data line. The fifth third sub-byte data is "1", the number of pulses of the fifth group of pulses is 1, and 1 pulse is transmitted through the second data line. The sixth third sub-byte data is "1", the number of pulses of the sixth group of pulses is 1, and 1 pulse is transmitted through the second data line. The seventh third sub-byte data is "1", the number of pulses of the seventh group of pulses is 1, and 1 pulse is transmitted through the second data line. The eighth third sub-byte data is "1", the number of pulses in the eighth group of pulses is 1, and 1 pulse is transmitted through the second data line.

[0153] It should be noted that there are other data transmission methods in this specification. For example, the target encoding and decoding mode is the third encoding and decoding mode, and four data lines are used to establish a communication connection between the master device and the slave device. The first pulse data corresponding to the second sub-byte data is transmitted through the first data line. The second pulse data corresponding to the second sub-byte data is transmitted through the second data line. The third pulse data corresponding to the second sub-byte data is transmitted through the third data line. The fourth pulse data corresponding to the second sub-byte data is transmitted through the fourth data line.

[0154] For another example, the target encoding and decoding mode is the fourth encoding and decoding mode, and eight data lines are used to establish a communication connection between the master device and the slave device. Through the first data line, the pulse data corresponding to the first and third sub-byte data is transmitted. Through the second data line, the pulse data corresponding to the second and third sub-byte data is transmitted, and through the third data line. The third pulse data corresponding to the third sub-byte data is transmitted. Through the fourth data line, the pulse data corresponding to the fourth and third sub-byte data is transmitted. Through the fifth data line, the pulse data corresponding to the fifth and third sub-byte data is transmitted. Through the sixth data line, the pulse data corresponding to the sixth and third sub-byte data is transmitted. Through the seventh data line, the pulse data corresponding to the seventh and third sub-byte data is transmitted. Through the eighth data line, the eighth pulse data corresponding to the third sub-byte data is transmitted. This manual will not go into details one by one. This manual does not limit the data transmission method.

[0155] Fig.12FIG. 1 is a flow chart of another data transmission method shown in an exemplary embodiment, wherein the method specifically comprises the following steps:

[0156] S1200: Obtain a target encoding and decoding mode.

[0157] S1202: Receive pulse data sent by the master device.

[0158] S1204: Perform pulse decoding on the pulse data according to the target encoding and decoding mode to obtain target transmission data.

[0159] In the embodiments of the present specification, the data transmission method can be applied to a master device in a communication system, and the communication system includes: a master device and a slave device. A target encoding and decoding mode is obtained.

[0160] Then, receive the pulse data sent by the master device.

[0161] Next, the pulse data is pulse-decoded according to the target encoding and decoding mode to obtain the target transmission data.

[0162] Furthermore, the communication system stores at least one coding mode. Before acquiring the target coding mode, device information of the master device and device information of the slave device are acquired.

[0163] Then, based on the device information of the master device and the device information of the slave device, a target codec mode is selected from at least one codec mode.

[0164] It can be seen from the above method that the target transmission data and the target encoding and decoding mode are obtained. Then, the target transmission data is pulse-encoded according to the target encoding and decoding mode to generate pulse data corresponding to the target transmission data. Finally, the pulse data is sent to the slave device so that the slave device pulse-decodes the pulse data according to the target encoding and decoding mode to obtain the target transmission data. Thus, the strict requirements for clock deviation and timing control in the single bus technology are avoided, the stability and rate of data transmission are improved, and the limitations caused by the lack of processing power of the master device and the slave device are reduced.

[0165] Furthermore, based on the number of data lines and the target encoding and decoding mode, the target data transmission mode is determined, thereby improving the efficiency of data transmission.

[0166] Corresponding to the above-mentioned embodiment of the method based on data transmission, this specification also provides an embodiment of a data transmission device.

[0167] See also Fig.13 , Fig.13It is a structural diagram of an electronic device in which a data transmission device is located, which is shown in an exemplary embodiment. At the hardware level, the device includes a processor 1302, an internal bus 1304, a network interface 1306, a memory 1308, and a non-volatile memory 1310, and of course may also include other required hardware. One or more embodiments of this specification can be implemented based on software, such as the processor 1302 reading the corresponding computer program from the non-volatile memory 1310 into the memory 1308 and then running it. Of course, in addition to the software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0168] See also Fig.14 , Fig.14 FIG. 1 is a structural diagram of a data transmission device according to an exemplary embodiment. The data transmission device can be applied to Fig.13 In the electronic device shown in the figure, the technical solution of this specification is implemented. The device may include:

[0169] The acquisition module 1400 is used to acquire target transmission data and target encoding and decoding mode;

[0170] The encoding module 1402 is used to perform pulse encoding on the target transmission data according to the target encoding and decoding mode to generate pulse data corresponding to the target transmission data;

[0171] The sending module 1404 is used to send the pulse data to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

[0172] Optionally, the communication system stores at least one codec mode; the acquisition module 1400 is further specifically used to obtain device information of the master device and device information of the slave device; based on the device information of the master device and the device information of the slave device, select a target codec mode from the at least one codec mode.

[0173] Optionally, the target coding mode includes: a first coding mode; the encoding module 1402 is specifically used to, if it is determined that the target coding mode is the first coding mode, perform pulse encoding on the numerical value of the single-byte data in the target transmission data to obtain a pulse number corresponding to the numerical value of the single-byte data; wherein the single-byte data consists of eight bits; based on the pulse number corresponding to the numerical value of the single-byte data, generate pulse data corresponding to the target transmission data.

[0174] Optionally, the target encoding and decoding mode includes: a second encoding and decoding mode; the encoding module 1402 is specifically used to divide the single-byte data in the target transmission data to obtain two first sub-byte data if it is determined that the target encoding and decoding mode is the second encoding and decoding mode; wherein the first sub-byte data consists of four bits; pulse encoding the value of the first sub-byte data to obtain the number of pulses corresponding to the value of the first sub-byte data; and generating pulse data corresponding to the target transmission data based on the number of pulses corresponding to the value of the first sub-byte data.

[0175] Optionally, the target coding mode includes: a third coding mode; the encoding module 1402 is specifically used to divide the single-byte data in the target transmission data to obtain four second sub-byte data if it is determined that the target coding mode is the third coding mode; wherein the second sub-byte data consists of two bits; pulse encode the value of the second sub-byte data to obtain the number of pulses corresponding to the value of the second sub-byte data; and generate pulse data corresponding to the target transmission data based on the number of pulses corresponding to the value of the second sub-byte data.

[0176] Optionally, the target coding mode includes: a fourth coding mode; the encoding module 1402 is specifically used to, if it is determined that the target coding mode is the fourth coding mode, divide the single-byte data in the target transmission data to obtain eight third sub-byte data; wherein the third sub-byte data consists of one bit; pulse encode the value of the third sub-byte data to obtain the number of pulses corresponding to the value of the third sub-byte data; based on the number of pulses corresponding to the value of the third sub-byte data, generate pulse data corresponding to the target transmission data.

[0177] Optionally, at least one data line is used to establish a communication connection between the master device and the slave device; the sending module 1404 is specifically used to determine the target data transmission mode based on the number of the data lines and the target encoding and decoding mode; based on the target data transmission mode, the pulse data is sent to the slave device.

[0178] See also Fig.15 , Fig.15 FIG. 1 is a structural diagram of another data transmission device according to an exemplary embodiment. The data transmission device can be applied to Fig.13 In the electronic device shown in the figure, the technical solution of this specification is implemented. The device may include:

[0179] An acquisition module 1500 is used to acquire a target encoding and decoding mode;

[0180] The receiving module 1502 is used to receive the pulse data sent by the master device;

[0181] The decoding module 1504 is used to perform pulse decoding on the pulse data according to the target encoding and decoding mode to obtain target transmission data.

[0182] Optionally, the communication system stores at least one codec mode; the acquisition module 1500 is specifically used to obtain device information of the master device and device information of the slave device; based on the device information of the master device and the device information of the slave device, select a target codec mode from the at least one codec mode.

[0183] The implementation process of the functions and effects of each unit in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, and will not be repeated here.

[0184] Based on the same concept as the above method, this specification also provides an electronic device, including: a processor; a memory for storing processor executable instructions; wherein the processor implements the steps of the method described in any of the above embodiments by running the executable instructions.

[0185] Based on the same concept as the above method, this specification also provides a computer-readable storage medium on which computer instructions are stored. When the instructions are executed by a processor, the steps of the method described in any of the above embodiments are implemented.

[0186] Based on the same concept as the above method, this specification also provides a computer program product, including a computer program / instruction, which implements the steps of the method described in any of the above embodiments when executed by a processor.

[0187] It should be understood that although the terms first, second, third, etc. may be used to describe various information in one or more embodiments of this specification, these information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0188] The above description is merely a preferred embodiment of one or more embodiments of the present specification and is not intended to limit one or more embodiments of the present specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of the present specification shall be included in the scope of protection of one or more embodiments of the present specification.

Claims

1. A method for data transmission, characterized in that: The method is applied to a master device in a communication system, the communication system comprising: a master device and a slave device, and the method comprises: Obtain target transmission data and target encoding and decoding mode; According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data; The pulse data is sent to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

2. The method according to claim 1, characterized in that The communication system stores at least one encoding and decoding mode; Before acquiring the target transmission data and the target encoding and decoding mode, the method further includes: Acquire device information of the master device and device information of the slave device; A target codec mode is selected from the at least one codec mode based on the device information of the master device and the device information of the slave device.

3. The method according to claim 1, characterized in that The target encoding and decoding mode includes: a first encoding and decoding mode; According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including: If it is determined that the target encoding and decoding mode is the first encoding and decoding mode, pulse encoding is performed on the value of the single-byte data in the target transmission data to obtain the number of pulses corresponding to the value of the single-byte data; wherein the single-byte data consists of eight bits; Based on the number of pulses corresponding to the value of the single-byte data, pulse data corresponding to the target transmission data is generated.

4. The method according to claim 1, characterized in that The target encoding and decoding mode includes: a second encoding and decoding mode; According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including: If it is determined that the target encoding and decoding mode is the second encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain two first sub-byte data; wherein the first sub-byte data consists of four bits; Performing pulse encoding on the value of the first sub-byte data to obtain the number of pulses corresponding to the value of the first sub-byte data; Based on the number of pulses corresponding to the value of the first sub-byte data, pulse data corresponding to the target transmission data is generated.

5. The method according to claim 1, characterized in that The target encoding and decoding mode includes: a third encoding and decoding mode; According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including: If it is determined that the target encoding and decoding mode is the third encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain four second sub-byte data; wherein the second sub-byte data consists of two bits; Performing pulse encoding on the value of the second sub-byte data to obtain the number of pulses corresponding to the value of the second sub-byte data; Based on the number of pulses corresponding to the value of the second sub-byte data, pulse data corresponding to the target transmission data is generated.

6. The method according to claim 1, characterized in that The target encoding and decoding mode includes: a fourth encoding and decoding mode; According to the target encoding and decoding mode, pulse encoding is performed on the target transmission data to generate pulse data corresponding to the target transmission data, including: If it is determined that the target encoding and decoding mode is the fourth encoding and decoding mode, the single-byte data in the target transmission data is divided to obtain eight third sub-byte data; wherein the third sub-byte data consists of one bit; Performing pulse encoding on the value of the third sub-byte data to obtain the number of pulses corresponding to the value of the third sub-byte data; Based on the number of pulses corresponding to the value of the third subbyte data, pulse data corresponding to the target transmission data is generated.

7. The method according to claim 1, characterized in that At least one data line is used to establish a communication connection between the master device and the slave device; Sending the pulse data to the slave device comprises: Determining a target data transmission mode based on the number of the data lines and the target encoding and decoding mode; Based on the target data transmission mode, the pulse data is sent to the slave device.

8. A method for data transmission, characterized in that: The method is applied to a slave device in a communication system, the communication system comprising: a master device and a slave device, and the method comprises: Get the target codec mode; Receiving pulse data sent by the master device; According to the target encoding and decoding mode, the pulse data is pulse-decoded to obtain target transmission data.

9. The method according to claim 8, characterized in that The communication system stores at least one encoding and decoding mode; Before acquiring the target encoding and decoding mode, the method further includes: Acquire device information of the master device and device information of the slave device; A target codec mode is selected from the at least one codec mode based on the device information of the master device and the device information of the slave device.

10. A data transmission device, characterized in that: The device is applied to a master device in a communication system, the communication system comprising: a master device and a slave device; the device comprises: An acquisition module is used to acquire target transmission data and target encoding and decoding mode; An encoding module, used for pulse encoding the target transmission data according to the target encoding and decoding mode, and generating pulse data corresponding to the target transmission data; The sending module is used to send the pulse data to the slave device, so that the slave device performs pulse decoding on the pulse data according to the target encoding and decoding mode to obtain the target transmission data.

11. A data transmission device, characterized in that: The device is applied to a slave device in a communication system, the communication system comprising: a master device and a slave device; the device comprises: An acquisition module is used to obtain the target encoding and decoding mode; A receiving module, used for receiving pulse data sent by the master device; The decoding module is used to perform pulse decoding on the pulse data according to the target encoding and decoding mode to obtain target transmission data.

12. An electronic device, characterized in that: It includes a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are interconnected via the bus; The memory stores machine-readable instructions, and the processor executes the method according to any one of claims 1 to 9 by calling the machine-readable instructions.

13. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-readable instructions, and when the machine-readable instructions are called and executed by a processor, the method according to any one of claims 1 to 9 is implemented.