Single-wire communication method, communication system, readable storage medium, and program product
By employing a single-wire communication method and phase inversion processing technology in the communication system, the effective carrier level duration in the carrier clock signal is identified, solving the data distortion problem caused by signal attenuation and waveform distortion in traditional communication systems. This enables reliable and accurate data transmission in multi-level cascaded scenarios and improves the system's scalability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HANGZHOU SHIXIN TECH CO LTD
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-14
AI Technical Summary
In traditional master-slave communication systems, signal attenuation and waveform distortion lead to distortion of encoded information in long-link or multi-level cascaded scenarios, affecting the reliability and accuracy of data communication.
By introducing a single-wire communication method into the communication system, the slave device inverts the carrier clock signal and decodes the communication data by identifying the duration of the effective carrier level, ensuring that the signal maintains accuracy and reliability during cascaded transmission.
It effectively avoids duty cycle distortion and signal attenuation problems in long-distance transmission, ensures reliable and accurate transmission of target communication data in multi-level cascade scenarios, and improves the scalability of the communication system.
Smart Images

Figure CN121864544A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a single-wire communication method, communication system, readable storage medium, and program product. Background Technology
[0002] Traditional master-slave communication systems typically require multiple communication lines to transmit clock and data signals separately, resulting in complex wiring and high port resource consumption. To simplify connections, related technologies encode data into the pulse width or duty cycle of the clock signal, enabling single-wire transmission. However, in long-link or multi-level cascaded scenarios, the signal attenuates cumulatively as the number of slave devices increases, causing waveform distortion and duty cycle shifts. This leads to distortion of the encoded information, ultimately resulting in data that cannot be correctly decoded, severely impacting communication reliability.
[0003] There is currently no effective solution to the problem of signal attenuation caused by the increase in the number of cascade stages in related technologies, which in turn affects the correct transmission of data. Summary of the Invention
[0004] Therefore, it is necessary to provide a single-wire communication method, communication system, readable storage medium, and program product to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a single-wire communication method applied to a slave device in a communication system; the communication system includes a master device and N cascaded slave devices; a single-channel serial communication channel is provided between the master device and the N slave devices; the method includes:
[0006] For the nth slave device, a target carrier clock signal transmitted via the serial communication channel is received; the target carrier clock signal is the original carrier clock signal sent by the master device carrying the target communication data, which is obtained after being inverted by some or all of the slave devices in the first n-1 slave devices, where 1≤n≤N;
[0007] The target communication data is decoded from the target carrier clock signal by identifying the duration of the effective carrier level in the target carrier clock signal.
[0008] In one embodiment, decoding the target communication data from the target carrier clock signal by identifying the duration of the effective carrier level in the target carrier clock signal includes:
[0009] The effective carrier level is determined by identifying the signal polarity of the target carrier clock signal;
[0010] The target communication data is decoded from the target carrier clock signal by identifying the duration of the effective carrier level.
[0011] In one embodiment, the target carrier clock signal comprises a series of rectangular wave signals; determining the effective carrier level by identifying the signal polarity of the target carrier clock signal includes:
[0012] If at least one of the rectangular wave signals is identified as having a valid polarity level whose duration exceeds a preset polarity identification threshold, then the valid carrier level is determined based on the level type of the valid polarity level.
[0013] Wherein, the effective carrier level and the effective polarity level are opposite to each other.
[0014] In one embodiment, determining the effective carrier level based on the level type of the effective polarity level includes:
[0015] If the effective polarity level is the first level, then the second level in the target carrier clock signal is determined as the effective carrier level;
[0016] If the effective polarity level is the second level, then the first level in the target carrier clock signal is determined as the effective carrier level;
[0017] The first voltage level and the second voltage level are opposite to each other.
[0018] In one embodiment, the target carrier clock signal includes a series of rectangular wave signals; the step of decoding the target communication data from the target carrier clock signal by identifying the duration of the effective carrier level includes:
[0019] For each of the rectangular wave signals, identify the duration of the effective carrier level in the rectangular wave signal;
[0020] Based on the comparison result between the carrier level duration and the preset encoding duration threshold, the target code is decoded from the rectangular wave signal;
[0021] According to the signal transmission timing of the multiple rectangular wave signals, the multiple target codes are reconstructed to obtain target communication data.
[0022] In one embodiment, decoding the target code from the rectangular wave signal based on the comparison result of the carrier level duration and a preset coding duration threshold includes:
[0023] If the duration of the carrier level is longer than the preset encoding duration threshold, then the target encoding is determined to be the first encoding;
[0024] If the duration of the carrier level is less than or equal to the preset encoding duration threshold, then the target encoding is determined to be the second encoding;
[0025] The first code and the second code are inverses of each other.
[0026] In one embodiment, the method further includes:
[0027] The target carrier clock signal is inverted by the slave device to obtain an inverted carrier clock signal, and the inverted carrier clock signal is transmitted to the next slave device via the serial communication channel.
[0028] Alternatively, the target carrier clock signal may be transmitted via the serial communication channel to the next slave device after the slave device.
[0029] Secondly, this application provides a single-wire communication method applied to a master device in a communication system; the communication system further includes N cascaded slave devices; a single-channel serial communication channel is provided between the master device and the N slave devices; the method includes:
[0030] For the target communication data to be transmitted, the target communication data is decomposed bit by bit into multiple target codes;
[0031] According to the preset mapping relationship between encoding and level duration, multiple target codes are mapped to multiple carrier level durations;
[0032] Determine the effective carrier level, and based on the effective carrier level and the duration of multiple carrier levels, generate an original carrier clock signal containing multiple rectangular wave signals;
[0033] The original carrier clock signal is sent to the slave device through the serial communication channel so that the slave device performs the single-wire communication method as described above.
[0034] In one embodiment, mapping multiple target codes to multiple carrier level durations according to a preset mapping relationship between codes and level durations includes:
[0035] Obtain the preset encoding duration threshold;
[0036] If the target code is identified as the first code, the duration of the effective carrier level is set to the first duration; the first duration is greater than the preset code duration threshold.
[0037] If the target code is identified as the second code, the duration of the effective carrier level is set to the second duration; the second duration is less than or equal to the preset code duration threshold.
[0038] The first code and the second code are inverses of each other.
[0039] In one embodiment, generating an original carrier clock signal containing multiple rectangular wave signals based on the effective carrier level and the duration of multiple carrier levels includes:
[0040] Determine the inverted level that is the opposite of the effective carrier level, and the duration of the inverted level;
[0041] For each target code, a rectangular wave signal carrying the target code is generated based on the effective carrier level, the duration of the carrier level, the inverted level, and the duration of the inverted level.
[0042] According to the encoding order of the multiple target codes, the multiple rectangular wave signals are sequentially loaded onto the original carrier clock signal.
[0043] In one embodiment, the inverted level of at least one of the rectangular wave signals is determined as the effective polarity level;
[0044] Set the duration of the effective polarity level to a third duration;
[0045] Wherein, the third duration is greater than the preset polarity identification threshold, and the preset polarity identification threshold is greater than the first duration.
[0046] Thirdly, this application provides a communication system, which includes a master device and N cascaded slave devices; a single-channel serial communication channel is provided between the master device and the N slave devices;
[0047] The slave device is used to perform the single-wire communication method described above;
[0048] The master device is used to execute the single-wire communication method described above.
[0049] In one embodiment, the slave device is a driving circuit; the communication system further includes an LED array; N driving circuits are connected to the LED array.
[0050] Fourthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described above.
[0051] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described above.
[0052] The aforementioned single-line communication method, communication system, readable storage medium, and program product, for the nth slave device, receive a target carrier clock signal transmitted via a serial communication channel. The target carrier clock signal is the original carrier clock signal sent by the master device, carrying the target communication data, obtained after phase inversion processing by some or all of the first n-1 slave devices, where 1 ≤ n ≤ N. The target communication data is decoded from the target carrier clock signal by identifying the duration of the effective carrier level. By selectively inverting the carrier clock signal during its transmission along the serial communication channel, the duty cycle distortion and signal attenuation problems caused by long-distance transmission can be effectively avoided. Furthermore, each slave device can accurately decode the target communication data by detecting the duration of the effective carrier level in the target carrier clock signal, thereby ensuring reliable and accurate transmission of the target communication data in multi-level cascaded scenarios. Thus, not only is the reliability and accuracy of single-line communication guaranteed, but the scalability of the communication system is also effectively improved. Attached Figure Description
[0053] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0054] Figure 1 This is a flowchart illustrating a single-line communication method in one embodiment;
[0055] Figure 2 This is a schematic diagram of a communication system in one embodiment;
[0056] Figure 3 This is a flowchart illustrating the target communication data decoding steps in one embodiment;
[0057] Figure 4 This is a flowchart illustrating the target communication data decoding step in another embodiment;
[0058] Figure 5 This is a flowchart illustrating a single-line communication method in another embodiment;
[0059] Figure 6This is a flowchart illustrating the steps for generating the original carrier clock signal in one embodiment;
[0060] Figure 7 This is a schematic diagram of a device in one embodiment. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0062] Traditional master-slave communication systems typically require multiple communication lines to transmit clock and data signals separately, resulting in complex wiring and high port resource consumption. To simplify connections, related technologies encode data into the pulse width or duty cycle of the clock signal, enabling single-wire transmission; for example, by modulating the duty cycle of the clock pulse or controlling the duration of its high / low level, logic "0" or "1" is encoded, thus carrying both clock and data on a single communication line. However, in long links or multi-level cascaded scenarios, the signal attenuates cumulatively as the number of slave devices increases, causing waveform distortion and duty cycle shifts, leading to distorted encoded information and ultimately preventing correct data decoding, severely impacting communication reliability.
[0063] To address the problems existing in the aforementioned traditional technologies, this application proposes a single-wire communication method, aiming to ensure the accuracy and reliability of single-wire communication and effectively improve the scalability of the system. The "single-wire communication" described in this application specifically refers to a communication method that simultaneously transmits clock signals and data signals through a single communication line (or a single serial communication channel); it should be understood that in practical applications, the communication system may also include other auxiliary function signal lines.
[0064] In one embodiment, such as Figure 1 As shown, Figure 1 This is a flowchart illustrating a single-wire communication method in one embodiment; the single-wire communication method is applied to a slave device in a communication system; see... Figure 2 The communication system includes a master device and N cascaded slave devices; a single serial communication channel is provided between the master device and the N slave devices; N is a positive integer; the single-wire communication method includes the following steps:
[0065] Step S101: For the nth slave device, receive the target carrier clock signal transmitted via the serial communication channel. Where 1≤n≤N, and n is a positive integer.
[0066] In this context, the master device refers to the control node in the communication system responsible for initiating communication, generating, and sending the original carrier clock signal loaded with the target communication data. The slave device refers to the controlled node in the communication system that receives and processes the carrier clock signal transmitted via the serial communication channel. Multiple slave devices are connected sequentially in a cascaded manner to form a serial communication link; the master device is connected to the first slave device in a chain of N cascaded slave devices.
[0067] In this configuration, a single-channel serial communication channel is provided between the master device and each of the N slave devices. This means that only one physical line is used to transmit the combined clock and data signals between the master device and each slave device. This serial communication channel can simultaneously carry the clock and data signals required for communication, eliminating the need for additional dedicated clock or data lines. In other words, all clock and data signals are transmitted serially through this single physical line, thus achieving single-line communication. It is understandable that there may be other signal lines with auxiliary functions between the master device and the N slave devices.
[0068] The target carrier clock signal is the original carrier clock signal sent by the master device, carrying the target communication data, and is obtained after being inverted by some or all of the first n-1 slave devices, where 1 ≤ n ≤ N. It can be understood that when n=1, the target carrier clock signal is the original carrier clock signal; when n>1, the target carrier clock signal may be the original carrier clock signal (e.g., the first n-1 slave devices of the nth slave device have not performed inversion processing), or it may be the result of the original carrier clock signal after one or more inversion processes.
[0069] It should be noted that due to limitations such as line loss during signal cascading transmission, the target carrier clock signal may still exhibit some attenuation in its actual waveform even without phase inversion of the original carrier signal. However, this attenuation is within the allowable range of the communication system and will not affect the accurate decoding of communication data. The allowable attenuation range of the communication system needs to be set according to actual communication requirements and is not specifically limited here.
[0070] It should be noted that during the transmission of the original carrier clock signal through the serial communication channel, the slave devices that can perform the reverse operation can be flexibly set according to actual communication needs, signal integrity requirements, etc., and no specific restrictions are made here.
[0071] The target communication data, represented in binary code, contains the actual content that the communication system needs to transmit, such as control commands, parameters, and address information. It is understood that the target communication data includes multiple target codes; these target codes are binary codes, and their values can be logic "0" or logic "1," depending on the actual communication content, but are not specifically limited here.
[0072] The original carrier clock signal consists of multiple consecutive rectangular wave signals. Each rectangular wave signal includes an effective carrier level and an inverse level that is the opposite of the effective carrier level. The effective carrier level refers to the specific logic level used to characterize the binary encoded information.
[0073] Understandably, the original carrier clock signal is generated by the master device. Before formal communication, the master device and each slave device will pre-negotiate a specific communication protocol to determine the effective carrier level, the carrier level duration corresponding to the effective carrier level, and the mapping relationship between the binary code. Then, based on the communication protocol negotiated by both parties and combined with the actual communication requirements, the master device dynamically configures the carrier level duration of the effective carrier level in each rectangular wave signal, as well as the duration of the inverse of the inverse of the effective carrier level, so that the carrier level duration of the effective carrier level corresponds to logic "0" or "1", thereby embedding the target communication data into the clock signal, realizing single-line communication, and ensuring the effective transmission of communication data.
[0074] It should be noted that the clock periods corresponding to each rectangular wave pulse in the original carrier clock signal can be the same or different, and can be set according to actual communication needs. No specific limitation is made here.
[0075] Understandably, the original carrier clock signal carries both timing information (for clock synchronization) and data content (i.e., target encoded data), which can reduce the communication system's dependence on independent clock lines and independent data lines, effectively alleviating the pressure on the communication system in terms of interface pin resource occupation and wiring complexity.
[0076] In one exemplary embodiment, the phase inversion process can be implemented in several ways: it can be a step-by-step phase inversion of the original carrier clock signal (i.e., phase inversion is performed once for each slave device); or it can be phase inverted once after the carrier clock signal passes through a preset number of slave devices. The preset number can be flexibly set according to actual communication parameters such as link length (i.e., number of slave devices), the attenuation range allowed by the communication system, and actual communication needs, and is not specifically limited here.
[0077] It is understood that the term "inversion" refers to the logic level reversal of the carrier clock signal, that is, converting high levels to low levels and low levels to high levels in the carrier clock signal. The inversion operation does not change the periodic characteristics of the signal, but only reverses the signal polarity. By inverting the carrier clock signal, the waveform of the carrier clock signal can be shaped during data transmission to suppress signal attenuation and duty cycle distortion caused by long-distance data transmission.
[0078] It should be noted that duty cycle distortion refers to the phenomenon that the ratio of the high-level duration to the low-level duration in the carrier clock signal deviates from its original set ratio. Since the target communication data is encoded through the duration of a specific level, duty cycle distortion can cause the slave device to misinterpret logic "0" or "1" during the decoding process, thereby affecting the reliability and accuracy of communication.
[0079] Step S102: By identifying the duration of the effective carrier level in the target carrier clock signal, the target communication data is decoded from the target carrier clock signal.
[0080] The effective carrier level refers to the specific logic level used to characterize binary encoded information; for example, the effective carrier level can be high or low. The duration of the effective carrier level corresponds to the binary encoding type. It should be noted that the type and duration of the effective carrier level need to be pre-agreed and negotiated between the master device and each slave device through the communication protocol before formal communication; specific limitations are not provided here.
[0081] In an exemplary embodiment, for a single communication process, the master device generates an original carrier clock signal carrying the target communication data and transmits it to the first slave device via a serial communication channel. The first slave device receives the original carrier clock signal and decodes the target communication data from it by identifying the duration of the effective carrier level. Simultaneously, it inverts the original carrier clock signal to obtain an inverted carrier clock signal, which is then transmitted to the second slave device via the serial communication channel. The target carrier clock signal received by the second slave device at this point is the carrier clock signal obtained after the original carrier clock signal has been inverted by the first slave device; that is, it is a signal that is the inverse of the original carrier clock signal.
[0082] Subsequently, assume that the second slave device directly transmits its received target carrier clock signal (i.e., the carrier clock signal obtained by inverting the original carrier clock signal after being processed by the first slave device) to the third slave device via the serial communication channel. At this point, the target carrier clock signal received by the third slave device is still the carrier clock signal obtained by inverting the original carrier clock signal after being processed by the first slave device; however, since this carrier clock signal (i.e., the carrier clock signal obtained by inverting the original carrier clock signal after being processed by the first slave device) has undergone two transmissions, the carrier clock signal may experience some attenuation (but still within the allowable attenuation range). To avoid further signal degradation in subsequent transmissions, the third slave device can invert its currently received target carrier clock signal and transmit the inverted carrier clock signal to the fourth slave device via the serial communication channel. At this point, the target carrier clock signal received by the fourth slave device is the carrier clock signal obtained by inverting the original carrier clock signal after being processed by both the first and third slave devices; in this case, the target carrier clock signal and the original carrier clock signal are in phase. This process is repeated to enable single-line communication between the master device and multiple slave devices, ensuring the accuracy and reliability of signals during long-distance transmission.
[0083] It should be noted that whether each slave device performs phase inversion processing can be flexibly set according to the actual signal attenuation, the attenuation range allowed by the communication system, and the signal transmission efficiency, etc., and no specific limitation is made here.
[0084] Understandably, in a single-wire communication system, when a signal with a 20% duty cycle passes through the first slave device, its duty cycle may drop to 18% due to signal attenuation during transmission; when the signal continues to be transmitted to the second slave device, the duty cycle may further attenuate to 16%. As the signal is transmitted step by step through cascaded slave devices, the duty cycle will continuously deviate from the original set value, causing distortion of the pulse width encoded data information, which may ultimately prevent the slave devices from accurately decoding the target communication data. In this application, each slave device can internally invert the received target carrier clock signal. For example, when the original carrier clock signal with a duty cycle of 20% attenuates to 18% after passing through the first slave device, the slave device immediately performs inversion processing on the received target carrier clock signal, that is, inverts the high and low levels, at which point the signal duty cycle changes from 18% to 82%. Subsequently, the inverted carrier clock signal is transmitted to the second slave device. After passing through the second slave device, the signal duty cycle may attenuate to 80%, so the second slave device performs inversion processing again, restoring the duty cycle to 20%, and so on. Even if there is still a certain degree of duty cycle attenuation in each transmission stage, by introducing inversion processing, duty cycle distortion can be effectively suppressed, preventing the signal duty cycle from continuously deteriorating in multi-stage cascading, thereby ensuring that each slave device can accurately decode the target communication data based on a stable and reliable target carrier clock signal.
[0085] In this embodiment, for the nth slave device, a target carrier clock signal transmitted via a serial communication channel is received. The target carrier clock signal is the original carrier clock signal carrying the target communication data sent by the master device, which is obtained after phase inversion processing by some or all of the first n-1 slave devices, where 1 ≤ n ≤ N. By identifying the duration of the effective carrier level in the target carrier clock signal, the target communication data is decoded from the target carrier clock signal. By selectively inverting the carrier clock signal by the slave devices on the communication link during its transmission along the serial communication channel, duty cycle distortion and signal attenuation problems caused by long-distance transmission can be effectively avoided. Furthermore, each slave device can accurately decode the target communication data by detecting the duration of the effective carrier level in the target carrier clock signal, thereby ensuring reliable and accurate transmission of the target communication data in multi-level cascaded scenarios. Thus, not only is the reliability and accuracy of single-line communication guaranteed, but the scalability of the communication system is also effectively improved.
[0086] In one embodiment, such as Figure 3 As shown, Figure 3 This is a flowchart illustrating the target communication data decoding steps in one embodiment; the target communication data is decoded from the target carrier clock signal by identifying the duration of the effective carrier level in the target carrier clock signal, including the following steps:
[0087] Step S301: Determine the effective carrier level by identifying the signal polarity of the target carrier clock signal.
[0088] Step S302: By identifying the duration of the effective carrier level, the target communication data is decoded from the target carrier clock signal.
[0089] Among them, signal polarity identification is used to identify the polarity relationship between the target carrier clock signal and the original carrier clock signal; the polarity relationship includes two states: in-phase (same polarity) or out-of-phase (opposite polarity).
[0090] The signal polarity of the target carrier clock signal refers to the signal polarity of the target carrier clock signal relative to the original carrier clock signal.
[0091] It should be noted that because phase inversion flips the high and low levels of the signal, the polarity of the target carrier clock signal received by each slave device (i.e., whether it is in phase or out of phase with the original carrier clock signal) is dynamic and uncertain. Furthermore, since the N slave devices cannot know their specific position or order in the cascaded link during communication, nor can they predict how many times the received target carrier clock signal has undergone phase inversion, directly assuming a fixed level as the effective carrier level for decoding will lead to data decoding failure if the actual signal polarity is reversed due to phase inversion. Therefore, it is necessary to identify the signal polarity of the target carrier clock signal before decoding to dynamically determine the current effective carrier level (high or low) used to represent the data, thereby ensuring that the decoding logic matches the actual signal polarity and guaranteeing communication accuracy.
[0092] In an exemplary embodiment, the master device and each slave device can negotiate and determine an effective polarity level for signal polarity identification in advance through a communication protocol before formal communication. During formal communication, each slave device determines the signal polarity (i.e., in-phase or out-of-phase) of the target carrier clock signal relative to the original carrier clock signal by identifying the actual level state of the effective polarity level in the target carrier clock signal, thereby accurately determining the level type of the effective carrier level currently used for decoding, and thus achieving correct decoding of the target communication data.
[0093] In this embodiment, the effective carrier level is determined by identifying the signal polarity of the target carrier clock signal, and the target communication data is further decoded based on the duration of the effective carrier level. This effectively avoids the decoding uncertainty caused by signal inversion and transmission attenuation in multi-level cascaded single-line communication systems. It enables each slave device to adaptively determine the signal polarity of the current signal without needing to know its position in the link or its inversion history, ensuring the reliability and accuracy of data decoding. Thus, the reliability and accuracy of single-line communication are guaranteed, while enhancing the scalability of the system.
[0094] In one embodiment, the target carrier clock signal comprises a series of consecutive rectangular wave signals; determining the effective carrier level by identifying the signal polarity of the target carrier clock signal includes the following steps:
[0095] If at least one rectangular wave signal is identified to have a valid polarity level whose duration exceeds a preset polarity identification threshold, the valid carrier level is determined based on the level type of the valid polarity level.
[0096] The effective carrier level and the effective polarity level are opposite to each other; for example, if the effective polarity level is low, the effective carrier level is high; conversely, if the effective polarity level is high, the effective carrier level is low.
[0097] Among them, the preset polarity identification threshold is greater than any carrier level duration used to characterize the target encoding in the target communication data.
[0098] It should be noted that the master device sets the effective carrier level and the effective polarity level to be out of phase, and sets the duration of the effective polarity level to be greater than the preset polarity identification threshold. The preset polarity identification threshold is set to be greater than the duration of any carrier level used to characterize the target encoding in the target communication data. This ensures that the slave device can reliably distinguish between the effective polarity level used for polarity identification and the effective carrier level used to characterize the data, thereby avoiding the problem of target communication data decoding failure due to confusion between the two.
[0099] During formal communication, the slave device only needs to detect whether there is a level in the target carrier clock signal whose duration exceeds the preset polarity identification threshold to uniquely determine the type of the effective polarity level (high level or low level). Then, based on its inverse relationship with the effective carrier level, it can accurately determine the effective carrier level used for decoding, thereby achieving accurate parsing of the target communication data.
[0100] In one exemplary embodiment, determining the effective carrier level based on the level type of the effective polarity level includes the following steps:
[0101] Step 1: If the effective polarity level is the first level, then the second level in the target carrier clock signal is determined as the effective carrier level.
[0102] Step 2: If the effective polarity level is the second level, then the first level in the target carrier clock signal is determined as the effective carrier level.
[0103] The first and second voltage levels are inverses of each other. For example, if the first voltage level is high, the second voltage level is low; conversely, if the first voltage level is low, the second voltage level is high.
[0104] It should be noted that there is a correspondence between the level type of the effective polarity level and the signal polarity.
[0105] In an exemplary embodiment, taking the original carrier clock signal generated by the master control terminal as an example, where the effective carrier level is high and the effective polarity level is low, if the device identifies at least one rectangular wave signal in the target carrier clock signal that contains an effective polarity level with a duration greater than a preset polarity identification threshold and the effective polarity level is low, then it can be determined that the target carrier clock signal and the original carrier clock signal are in phase. At this time, it can be determined that the effective carrier level used to characterize the data in the target carrier clock signal is high.
[0106] Similarly, if the device identifies at least one valid polarity level in the target carrier clock signal whose duration is greater than the preset polarity identification threshold and whose valid polarity level is high, then it can be determined that the target carrier clock signal is out of phase with the original carrier clock signal. In this case, the valid carrier level used to characterize the data in the target carrier clock signal is low.
[0107] In this embodiment, by introducing an effective polarity level that is inversely phase to the effective carrier level and whose duration is significantly longer than that of the effective carrier level, it is possible to ensure that the slave device accurately and reliably identifies the signal polarity of the target carrier clock signal. Based on the signal polarity identification result, the level type of the effective carrier level used to characterize the data in the current target carrier clock signal can be further accurately determined, thereby avoiding data decoding errors caused by the inversion process of the signal during cascaded transmission, which prevents the correct identification of the effective carrier level.
[0108] In one embodiment, such as Figure 4 As shown, Figure 4 This is a flowchart illustrating the target communication data decoding steps in another embodiment; by identifying the duration of the effective carrier level, the target communication data is decoded from the target carrier clock signal, including the following steps:
[0109] Step S401: For each rectangular wave signal, identify the duration of the effective carrier level in the rectangular wave signal.
[0110] The target carrier clock signal includes multiple consecutive rectangular wave signals; the rectangular wave signals include an effective carrier level and an inverse level that is the opposite of the effective carrier level.
[0111] The duration of the effective carrier level in each rectangular wave signal corresponds to the binary encoding type. It should be noted that the type and duration of the effective carrier level must be pre-agreed and negotiated between the master and slave devices through the communication protocol before formal communication; specific limitations are not provided here.
[0112] It should be noted that the duration of the inverted level in each rectangular wave signal can be set by the master device according to the actual communication requirements, and is not specifically limited here; however, it must be ensured that the duration of the inverted level of at least one rectangular wave signal is greater than the preset polarity identification threshold in order to realize signal polarity identification; the duration of the inverted level in the other rectangular wave signals can be any value, and is not specifically limited here.
[0113] Step S402: Based on the comparison result between the carrier level duration and the preset encoding duration threshold, the target code is decoded from the rectangular wave signal.
[0114] Among them, the preset encoding duration threshold is less than the preset polarity identification threshold, and the preset polarity identification threshold is greater than the duration of the carrier level in any rectangular wave signal.
[0115] In an exemplary embodiment, decoding the target code from the rectangular wave signal based on a comparison between the carrier level duration and a preset coding duration threshold includes the following steps:
[0116] Step 1: If the carrier level lasts for a duration longer than the preset coding duration threshold, then the target coding is determined to be the first coding.
[0117] Step 2: If the duration of the carrier level is less than or equal to the preset encoding duration threshold, then the target encoding is determined to be the second encoding.
[0118] Both the first and second codes are binary codes; the first and second codes are inverses of each other; for example, if the first code is "1", then the second code is "0"; conversely, if the first code is "0", then the second code is "1".
[0119] Understandably, the master device embeds the corresponding carrier level duration into the continuous rectangular wave signal in sequence according to the value of each target code in the target communication data; each target code is characterized by the carrier level duration of the effective carrier level, and ensures that there is a clear size relationship between the carrier level duration and the preset code duration threshold (for example, less than or equal to the preset code duration threshold represents "0", and greater than the preset code duration threshold represents "1").
[0120] Step S403: According to the signal transmission timing of multiple rectangular wave signals, data reconstruction is performed on multiple target codes to obtain target communication data.
[0121] The signal transmission timing refers to the physical order in which each rectangular wave signal is transmitted sequentially from the master device along the serial communication channel. The signal transmission timing corresponds one-to-one with the encoding order of each target code in the target communication data, ensuring that the slave device can correctly reconstruct the target communication data based on the order of the received rectangular wave signals.
[0122] The data reconstruction method can be, but is not limited to, data splicing, and is not specifically limited here; in an exemplary embodiment, multiple target codes are sequentially spliced according to the signal transmission timing of multiple rectangular wave signals to obtain target communication data.
[0123] For example, the duration of the carrier level in a rectangular wave signal is denoted as Tdata; the first code is set to "1", and the second code is set to "0"; a preset coding duration threshold is set to T1, and a preset polarity identification threshold is set to T2, where T1 < T2, and the preset polarity identification threshold T2 is greater than the duration of the carrier level in any rectangular wave signal, i.e., T2 > Tdata. For each rectangular wave signal, if the carrier level duration Tdata is identified as greater than the preset coding duration threshold T1, i.e., T1 < Tdata < T2, then the target code is determined to be the first code "1". If the carrier level duration Tdata is identified as less than or equal to the preset coding duration threshold T1, i.e., Tdata ≤ T1 < T2, then the target code is determined to be the second code "0". This process is repeated to decode the target code from each rectangular wave; then, according to the signal transmission timing of multiple rectangular wave signals, multiple target codes are sequentially concatenated to obtain the target communication data.
[0124] In this embodiment, by setting a preset encoding duration threshold, a clear discrimination benchmark can be provided for the slave device, enabling it to accurately distinguish between the first and second codes based on the relationship between the duration of the effective carrier level and the preset encoding duration threshold, thereby achieving reliable decoding of the target code. Simultaneously, by following the signal transmission timing sequence of multiple rectangular wave signals, it can be ensured that each target code strictly maintains its original arrangement order during data reconstruction, thus completely and accurately restoring the target communication data sent by the master device.
[0125] In one embodiment, the single-wire communication method applied to the slave device further includes the following steps:
[0126] The target carrier clock signal is inverted by the slave device to obtain the inverted carrier clock signal, and the inverted carrier clock signal is transmitted to the slave device after the slave device via the serial communication channel.
[0127] Alternatively, the target carrier clock signal can be transmitted from the slave device to the slave device's successor via a serial communication channel.
[0128] Inverting the phase refers to performing logic level flipping on the target carrier clock signal.
[0129] It should be noted that whether each slave device performs phase inversion processing can be flexibly set according to the actual signal attenuation, the attenuation range allowed by the communication system, and the signal transmission efficiency, and no specific limit is made here.
[0130] In this embodiment, each slave device can selectively invert the target carrier clock signal according to actual communication needs to achieve waveform shaping, effectively suppressing signal attenuation and duty cycle distortion caused by multi-level transmission, while taking into account both signal transmission efficiency and system resource overhead.
[0131] In one embodiment, such as Figure 5 As shown, Figure 5 This is a flowchart illustrating a single-wire communication method in another embodiment; the single-wire communication method is applied to the master device in the communication system; the communication system also includes N cascaded slave devices; a single-channel serial communication channel is provided between the master device and the N slave devices; the single-wire communication method includes the following steps:
[0132] Step S501: For the target communication data to be transmitted, the target communication data is decomposed into multiple target codes bit by bit.
[0133] The target communication data includes multiple target codes; each target code corresponds to one data bit.
[0134] In an exemplary embodiment, if the target communication data is "1110", the target communication data can be decomposed bit by bit into four target codes: "1", "1", "1", and "0".
[0135] Step S502: According to the preset mapping relationship between encoding and level duration, multiple target codes are mapped to multiple carrier level durations.
[0136] The mapping relationship between the preset encoding and the duration of the level is negotiated and determined in advance by the master device and each slave device through the communication protocol before formal communication, so as to ensure that both parties have a consistent understanding of the duration of the carrier level corresponding to the target encoding, thereby achieving accurate data transmission.
[0137] The preset mapping relationship between encoding and level duration includes a preset encoding duration threshold. The preset encoding duration threshold is used to distinguish the carrier level duration corresponding to different target encodings, thereby achieving an accurate mapping between each target encoding and the corresponding carrier level duration.
[0138] Step S503: Determine the effective carrier level, and based on the effective carrier level and the duration of multiple carrier levels, generate an original carrier clock signal containing multiple rectangular wave signals.
[0139] The effective carrier level type is determined in advance by the master device and each slave device through the communication protocol before formal communication, and is not specifically limited here.
[0140] Step S504: The original carrier clock signal is sent to the slave device through the serial communication channel so that the slave device executes the single-wire communication method described in any of the above embodiments.
[0141] For example, before formal communication, the master device and each slave device negotiate and determine the preset mapping relationship between the encoding and the level duration, as well as the level type of the effective carrier level, through the communication protocol. After formal communication, for the target communication data "1110" to be transmitted, the target communication data is decomposed into four target codes: "1", "1", "1", and "0" bit by bit. Then, according to the preset mapping relationship between the encoding and the level duration, the four target codes "1", "1", "1", and "0" are mapped to the corresponding four carrier level durations.
[0142] Furthermore, based on the effective carrier level and the duration of the four carrier levels, an original carrier clock signal containing four rectangular wave signals is generated. This original carrier clock signal is then transmitted to the first slave device via a serial communication channel, allowing the first slave device to receive the original carrier clock signal transmitted through the serial communication channel. By identifying the duration of the effective carrier level in the original carrier clock signal, the target communication data is decoded from the original carrier clock signal. The first slave device then inverts the original carrier clock signal to obtain an inverted carrier clock signal, which is then transmitted to the second slave device via the serial communication channel. Alternatively, the slave device can transmit the original carrier clock signal to the second slave device via the serial communication channel, and so on, achieving single-line communication between the master device and multiple slave devices, ensuring signal accuracy and reliability during long-distance transmission.
[0143] In this embodiment, the target communication data is decomposed bit-by-bit into multiple target codes. Based on a preset mapping relationship between the codes and their durations, each target code is converted into a corresponding carrier level duration. Then, an original carrier clock signal containing multiple rectangular wave signals is generated based on the effective carrier level and its duration. This original carrier clock signal is sent to the slave device via a serial communication channel, achieving multiplexed transmission of clock and data signals on a single serial communication channel. This eliminates the need for additional clock or data lines, simplifying the hardware interface and wiring complexity. Furthermore, since the preset mapping relationship between the codes and their durations is negotiated and agreed upon by the master device and each slave device before formal communication, each slave device, upon receiving the target carrier clock signal transmitted via the serial communication channel (the target carrier clock signal is the original carrier clock signal, or the original carrier clock signal obtained after one or more phase inversions), can accurately decode the complete target communication data by identifying the duration of the effective carrier level. This not only ensures the reliability and accuracy of single-line communication but also effectively improves the scalability of the communication system.
[0144] In one embodiment, multiple target codes are mapped to multiple carrier level durations according to a preset mapping relationship between encoding and level duration, including the following steps:
[0145] Step 1: Obtain the preset encoding duration threshold.
[0146] The preset encoding duration threshold can be set according to actual communication needs, and no specific limit is set here.
[0147] Step 2: If the target code is identified as the first code, then the duration of the effective carrier level is set to the first duration.
[0148] Among them, the first duration is greater than the preset encoding duration threshold.
[0149] Step 3: If the target code is identified as the second code, then the duration of the effective carrier level is set to the second duration.
[0150] Among them, the second duration is less than or equal to the preset encoding duration threshold.
[0151] Both the first and second codes are binary codes; the first and second codes are inverses of each other.
[0152] It should be noted that the settings for the first and second durations mentioned above need to reserve sufficient timing margin to ensure that even if the signal attenuates during cascaded transmission (within the attenuation range allowed by the communication system), the relationship between the carrier level duration and the preset encoding duration threshold remains clear and does not reverse, thereby ensuring that the slave device can still accurately decode the target communication data based on the relationship between the carrier level duration and the preset encoding duration threshold.
[0153] For example, let the first code be "1" and the second code be "0", and the preset encoding duration threshold be T1; for each target code, if the target code is identified as the first code "1", then the duration of the effective carrier level is set to the first duration Tdata1, T1 < Tdata1; if the target code is identified as the second code "0", then the duration of the effective carrier level is set to the second duration Tdata2, Tdata2 ≤ T1.
[0154] In this embodiment, by setting a preset encoding duration threshold, the carrier level duration corresponding to different target codes can be effectively distinguished, thereby achieving an accurate mapping between each target code and the corresponding carrier level duration, laying the foundation for improving the reliability and accuracy of single-line communication.
[0155] In one embodiment, such as Figure 6 As shown, Figure 6 This is a flowchart illustrating the steps for generating the original carrier clock signal in one embodiment. Based on the effective carrier level and the duration of multiple carrier levels, an original carrier clock signal containing multiple rectangular wave signals is generated, including the following steps:
[0156] Step S601: Determine the inverted level that is the opposite of the effective carrier level, and the duration of the inverted level.
[0157] It should be noted that the duration of the inverted level can be set according to actual communication needs, and no specific limitation is made here; for example, the duration of the inverted level in a specific rectangular wave signal used for signal polarity identification can be set to be greater than the preset polarity identification threshold, while the duration of the inverted level in other rectangular wave signals can be set to any value.
[0158] The preset polarity identification threshold is greater than the duration of any carrier level. It should be noted that setting the preset polarity identification threshold to be greater than the duration of any carrier level ensures that the slave device can reliably distinguish between the level used for polarity identification and the effective carrier level used to characterize the data, thereby avoiding the problem of target communication data decoding failure due to confusion between the two.
[0159] Step S602: For each target code, a rectangular wave signal carrying the target code is generated based on the effective carrier level, the duration of the carrier level, the inverted level, and the duration of the inverted level.
[0160] Among them, the duration of the carrier level carries the target encoded information.
[0161] In an exemplary embodiment, the method for generating a rectangular wave signal carrying a target code based on the effective carrier level, the duration of the carrier level, the inverted level, and the duration of the inverted level may be: constructing a waveform based on the effective carrier level, the duration of the carrier level, the inverted level, and the duration of the inverted level to generate a rectangular wave signal carrying a target code.
[0162] Step S603: According to the encoding order of multiple target codes, multiple rectangular wave signals are sequentially loaded onto the original carrier clock signal.
[0163] It is understandable that during signal transmission, the signal transmission timing of multiple rectangular wave signals corresponds one-to-one with the encoding order of multiple target codes.
[0164] For example, if the effective carrier level is high, then the inverted level that is the opposite of the effective carrier level is low. Then, for each target code, a waveform is constructed based on the effective carrier level (high level), the duration of the carrier level corresponding to the target code, the inverted level (low level), and the duration of the inverted level (which can be any duration or a duration greater than the preset polarity identification threshold) to generate a rectangular wave signal carrying the target code. According to the encoding order of multiple target codes, multiple rectangular wave signals are sequentially loaded onto the original carrier clock signal and sent to the slave device via a single serial communication channel.
[0165] In this embodiment, a corresponding rectangular wave signal is generated for each target code based on the effective carrier level, the duration of the carrier level, the inverted level, and the duration of the inverted level. Furthermore, multiple rectangular wave signals are sequentially loaded into the original carrier clock signal according to the encoding order of the target code, ensuring the timing consistency and resolvability of the data during transmission, thus laying the foundation for improving the reliability of single-line communication.
[0166] In one embodiment, the inverted level of at least one rectangular wave signal is determined as the effective polarity level; the duration of the effective polarity level is set as a third duration.
[0167] Among them, the third duration is greater than the preset polarity recognition threshold, and the preset polarity recognition threshold is greater than the first duration.
[0168] The effective polarity level refers to the inverted level whose duration exceeds the preset polarity identification threshold. The inverted level is the opposite of the effective carrier level.
[0169] In one exemplary embodiment, the inverted level in the rectangular wave signal corresponding to the target code that appears earlier in the encoding sequence can be designated as the effective polarity level, and its level duration can be set to a third duration greater than a preset polarity identification threshold. Therefore, after receiving the target carrier clock signal, the slave device can quickly complete signal polarity identification based on the preset polarity identification threshold, thereby determining the level type of the effective carrier level as early as possible, improving the efficiency of subsequent data decoding and overall communication performance.
[0170] It is understandable that for rectangular wave signals other than those used for signal polarity identification, the duration of their inverted level can be any value, and no specific limitation is made here.
[0171] In this embodiment, the inverted level of at least one rectangular wave signal is determined as the effective polarity level; and the duration of the effective polarity level is set to be greater than a preset polarity identification threshold. Based on this, a clear polarity discrimination basis can be provided for the slave device, thereby laying the foundation for signal polarity identification.
[0172] In one embodiment, such as Figure 2 As shown, a communication system is provided, which includes a master device and N cascaded slave devices; a single serial communication channel is provided between the master device and the N slave devices;
[0173] The device is used to perform the single-wire communication method described in any of the above embodiments;
[0174] The master device is used to execute the single-wire communication method described in any of the above embodiments.
[0175] It should be noted that the specific limitations of the single-wire communication method between the slave device and the master device can be found in the specific limitations of the single-wire communication method above, and will not be repeated here.
[0176] In one exemplary embodiment, see Figure 7 The slave device has two communication ports: an input port (IN) and an output port (OUT). The slave device includes a waveform shaping module, a polarity identification module, and a control module. In the communication system, slave devices at each level are cascaded sequentially via the input port IN and the output port OUT. The slave device receives the target carrier clock signal through the input port IN and transmits it to the waveform shaping module, the polarity identification module, and the control module, respectively.
[0177] The waveform shaping module is used to invert the target carrier clock signal to obtain an inverted carrier clock signal, and then transmit the inverted carrier clock signal to the next slave device via a serial communication channel; or, the waveform shaping module is used to transmit the target carrier clock signal to the next slave device via a serial communication channel. The polarity identification module is used to determine the effective carrier level by identifying the signal polarity of the target carrier clock signal. The control module is used to decode the target communication data from the target carrier clock signal by identifying the duration of the effective carrier level.
[0178] It should be noted that the specific limitations of each module mentioned above can be found in the limitations of the single-line communication method mentioned above, and will not be repeated here.
[0179] In an exemplary embodiment, taking an LED display scenario as an example, the slave device is a driving circuit; the communication system also includes an LED array; N driving circuits are connected to the LED array.
[0180] The LED array consists of multiple LEDs arranged in an array.
[0181] For example, in an LED display scenario, the target communication data can be the target display data; the master device can be the master control terminal, and the slave device can be the drive circuit; the display system includes the master control terminal and N drive circuits; a single-channel serial communication channel is provided between the master control terminal and the N drive circuits; after communication begins, the master control terminal generates an original carrier clock signal carrying the target display data and sends the original carrier clock signal to the drive circuit; for the nth drive circuit, the target carrier clock signal transmitted via the serial communication channel is received; the target carrier clock signal is the original carrier clock signal, which is obtained after inverting some or all of the drive circuits in the first n-1 drive circuits, where 1≤n≤N; the effective carrier level is determined by identifying the signal polarity of the target carrier clock signal; the target display data is decoded from the target carrier clock signal by identifying the duration of the effective carrier level, and then the LED array is driven to perform the corresponding display output based on the target display data.
[0182] In this embodiment, the communication system effectively avoids duty cycle distortion and signal attenuation problems caused by long-distance transmission by selectively inverting the carrier clock signal during its transmission along the serial communication channel using slave devices on the communication link. Furthermore, each slave device can accurately decode the target communication data by detecting the duration of the effective carrier level in the target carrier clock signal, thus ensuring reliable and accurate transmission of the target communication data in multi-level cascaded scenarios. Therefore, it not only guarantees the reliability and accuracy of single-line communication but also effectively improves the scalability of the communication system.
[0183] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0184] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0185] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0186] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0187] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0188] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0189] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A single-wire communication method, characterized in that, A slave device used in a communication system; the communication system includes a master device and N cascaded slave devices; The master device and the N slave devices are connected by a single-channel serial communication channel; the method includes: For the nth slave device, a target carrier clock signal transmitted via the serial communication channel is received; The target carrier clock signal is the original carrier clock signal carrying the target communication data sent by the master device, which is obtained after being inverted by some or all of the slave devices in the first n-1 slave devices, where 1≤n≤N; The target communication data is decoded from the target carrier clock signal by identifying the duration of the effective carrier level in the target carrier clock signal.
2. The method according to claim 1, characterized in that, The step of decoding the target communication data from the target carrier clock signal by identifying the duration of the effective carrier level in the target carrier clock signal includes: The effective carrier level is determined by identifying the signal polarity of the target carrier clock signal; The target communication data is decoded from the target carrier clock signal by identifying the duration of the effective carrier level.
3. The method according to claim 2, characterized in that, The target carrier clock signal includes multiple consecutive rectangular wave signals; The step of determining the effective carrier level by identifying the signal polarity of the target carrier clock signal includes: If at least one of the rectangular wave signals is identified as having a valid polarity level whose duration exceeds a preset polarity identification threshold, then the valid carrier level is determined based on the level type of the valid polarity level. Wherein, the effective carrier level and the effective polarity level are opposite to each other.
4. The method according to claim 3, characterized in that, Determining the effective carrier level based on the level type of the effective polarity level includes: If the effective polarity level is the first level, then the second level in the target carrier clock signal is determined as the effective carrier level; If the effective polarity level is the second level, then the first level in the target carrier clock signal is determined as the effective carrier level; The first voltage level and the second voltage level are opposite to each other.
5. The method according to claim 2, characterized in that, The target carrier clock signal includes multiple consecutive rectangular wave signals; the step of decoding the target communication data from the target carrier clock signal by identifying the duration of the effective carrier level includes: For each of the rectangular wave signals, identify the duration of the effective carrier level in the rectangular wave signal; Based on the comparison result between the carrier level duration and the preset encoding duration threshold, the target code is decoded from the rectangular wave signal; According to the signal transmission timing of the multiple rectangular wave signals, the multiple target codes are reconstructed to obtain target communication data.
6. The method according to claim 5, characterized in that, Decoding the target code from the rectangular wave signal based on the comparison result of the carrier level duration and the preset coding duration threshold includes: If the duration of the carrier level is longer than the preset encoding duration threshold, then the target encoding is determined to be the first encoding; If the duration of the carrier level is less than or equal to the preset encoding duration threshold, then the target encoding is determined to be the second encoding; The first code and the second code are inverses of each other.
7. The method according to claim 1, characterized in that, The method further includes: The target carrier clock signal is inverted by the slave device to obtain an inverted carrier clock signal, and the inverted carrier clock signal is transmitted to the next slave device via the serial communication channel. Alternatively, the target carrier clock signal may be transmitted via the serial communication channel to the next slave device after the slave device.
8. A single-wire communication method, characterized in that, A master device applied in a communication system; the communication system further includes N cascaded slave devices; a single-channel serial communication channel is provided between the master device and the N slave devices; the method includes: For the target communication data to be transmitted, the target communication data is decomposed bit by bit into multiple target codes; According to the preset mapping relationship between encoding and level duration, multiple target codes are mapped to multiple carrier level durations; Determine the effective carrier level, and based on the effective carrier level and the duration of multiple carrier levels, generate an original carrier clock signal containing multiple rectangular wave signals; The original carrier clock signal is sent to the slave device through the serial communication channel so that the slave device executes the single-wire communication method according to any one of claims 1 to 7.
9. The method according to claim 8, characterized in that, The step of mapping multiple target codes to multiple carrier level durations according to a preset mapping relationship between codes and level durations includes: Obtain the preset encoding duration threshold; If the target code is identified as the first code, the duration of the effective carrier level is set to the first duration; the first duration is greater than the preset code duration threshold. If the target code is identified as the second code, the duration of the effective carrier level is set to the second duration; the second duration is less than or equal to the preset code duration threshold. The first code and the second code are inverses of each other.
10. The method according to claim 9, characterized in that, The step of generating an original carrier clock signal containing multiple rectangular wave signals based on the effective carrier level and the duration of multiple carrier levels includes: Determine the inverted level that is the opposite of the effective carrier level, and the duration of the inverted level; For each target code, a rectangular wave signal carrying the target code is generated based on the effective carrier level, the duration of the carrier level, the inverted level, and the duration of the inverted level. According to the encoding order of the multiple target codes, the multiple rectangular wave signals are sequentially loaded onto the original carrier clock signal.
11. The method according to claim 10, characterized in that, The inverted level of at least one of the rectangular wave signals is determined as the effective polarity level; Set the duration of the effective polarity level to a third duration; Wherein, the third duration is greater than the preset polarity identification threshold, and the preset polarity identification threshold is greater than the first duration.
12. A communication system, characterized in that, The communication system includes a master device and N cascaded slave devices; a single serial communication channel is provided between the master device and the N slave devices; The slave device is configured to perform the single-wire communication method according to any one of claims 1 to 7; The main device is used to execute the single-line communication method according to any one of claims 8 to 11.
13. The communication system according to claim 12, characterized in that, The slave device is a driving circuit; the communication system also includes an LED array; N driving circuits are connected to the LED array.
14. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.
15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 11.