Data decoding method and apparatus, electronic device, and storage medium

By sampling and decoding Manchester-encoded data streams on the rising and falling edges of a single clock, the problem of clock resource utilization during Manchester-encoded data decoding in high-speed serial communication is solved, thereby improving decoding efficiency and saving clock resources.

WO2025108397A1PCT designated stage expired Publication Date: 2025-05-30CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1

Patent Information

Application Number
PCT/CN2024/133645
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-11-23
Filing Date
2024-11-21
Publication Date
2025-05-30

AI Technical Summary

Technical Problem

In high-speed serial communication, when using Manchester-encoded data decoding, multiple clocks need to be used, resulting in large clock resources and low decoding efficiency.

Method used

By obtaining the clock rate of a single clock, the Manchester-encoded data stream is sampled on the rising and falling edges of the single clock, multiple sampled data are obtained and decoded to realize the decoding of the data stream.

Benefits of technology

At any clock rate, no multiple clocks are required, the decoding efficiency is doubled, and the clock offset jitter requirements are low, which reduces the difficulty of development and reduces the use of clock resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024133645_30052025_PF_FP_ABST
    Figure CN2024133645_30052025_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a data decoding method and apparatus, an electronic device, and a storage medium. The method comprises: acquiring the clock rate of a single-channel clock; on the basis of the clock rate of the single-channel clock, sampling, at rising edges and falling edges of the single-channel clock, a data stream formed using Manchester encoding, and obtaining a plurality of pieces of sampling data; and decoding each piece of sampling data, and obtaining decoded data of the data stream. According to the data decoding method provided by embodiments of the present application, clock resources required to be occupied when the Manchester-encoded data is decoded can be reduced while improving the decoding efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Data decoding method, device, electronic device and storage medium

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims priority to Chinese patent application 202311577729.0, filed on November 23, 2023, entitled “Data decoding method, device, electronic device and storage medium,” and the entire contents of that application are incorporated herein by reference. Technical Field

[0003] The present application relates to the field of data processing technology, and in particular to a data decoding method, device, electronic device and storage medium. Background Art

[0004] Compared to parallel communication, serial communication offers advantages such as strong anti-interference capabilities, fewer pins required, and longer transmission distances. However, because serial communication uses only a single data line, high-speed serial communication data recovery is difficult without an accompanying clock. Therefore, Manchester encoding can be used to encode serial communication data. This encoding method offers excellent anti-interference and self-synchronization capabilities, facilitating data recovery.

[0005] Manchester-encoded data has a transmission rate of only half the modulation rate. Therefore, to improve decoding efficiency, related technologies use phase shifters to output multiple, homogeneous clocks with equal phase differences. This allows for high-speed sampling of Manchester-encoded data, enabling reliable decoding and increasing the decoding rate. However, this decoding method requires the use of multiple phase shifters to output clocks, which consumes a large amount of clock resources. Summary of the Invention

[0006] In view of the above problems, the present application provides a data decoding method, device, electronic device and storage medium, which can improve decoding efficiency while reducing the clock resources required for decoding data using Manchester encoding.

[0007] In a first aspect, the present application provides a data decoding method, comprising: obtaining the clock rate of a single-channel clock; sampling a data stream formed by Manchester encoding at the rising and falling edges of the single-channel clock according to the clock rate of the single-channel clock to obtain multiple sampling data; decoding each of the sampling data to obtain decoded data of the data stream.

[0008] In the technical solution of the embodiment of the present application, after obtaining the clock rate of a single-channel clock, the data stream formed by Manchester encoding is sampled at the rising edge and falling edge of the single-channel clock according to the clock rate of the single-channel clock to obtain multiple sampling data, so as to decode each sampling data to obtain decoded data of the data stream. Therefore, in the process of decoding the data using Manchester encoding, data is collected for decoding through dual-edge sampling, so that at any clock rate, there is no need to output multiple clocks, and the decoding efficiency can be doubled. In addition, the single clock has low requirements for clock offset jitter, which reduces the development difficulty. Therefore, while improving the decoding efficiency, the clock resources required for decoding the data using Manchester encoding are reduced.

[0009] In some embodiments, obtaining the clock rate of a single clock includes obtaining the clock rate of the single clock based on a modulation rate of a data stream formed using Manchester encoding. Obtaining the clock rate of the single clock based on the modulation rate of the data stream formed using Manchester encoding allows the clock rate to be adapted to the modulation rate of the data stream, thereby enabling decoding of Manchester codes of different modulation rates and improving data decoding accuracy.

[0010] In some embodiments, decoding each sampled data to obtain decoded data of the data stream includes: comparing adjacent sampled data according to the sampling order of each sampled data to determine each transition edge position; and obtaining decoded data of the data stream from each sampled data based on each transition edge position. By comparing adjacent sampled data according to the sampling order of the sampled data to determine each transition edge position, and obtaining decoded data of the data stream from each sampled data based on each transition edge position, the characteristic of Manchester-encoded data signals being located at transition edges is utilized to quickly determine transition edge positions for data decoding by comparing adjacent sampled data, thereby improving decoding accuracy of the Manchester-encoded data stream.

[0011] In some embodiments, according to the sampling order of each sampling data, adjacent sampling data are compared to determine the position of each transition edge, including: according to the sampling order of each sampling data, the last sampling data collected in the previous clock cycle is spliced ​​with each sampling data collected in the next clock cycle to obtain spliced ​​data; the adjacent sampling data in the spliced ​​data are compared to determine the transition edge position, so that the data signal of the data stream can be accurately extracted from each clock cycle.

[0012] In some embodiments, adjacent sampled data are compared based on the sampling order of each sampled data to determine the transition edge positions, including: splicing each sampled data collected in the previous clock cycle with the first sampled data collected in the next clock cycle based on the sampling order of each sampled data to obtain spliced ​​data; and comparing adjacent sampled data in the spliced ​​data to determine the transition edge positions. This allows the data signal of the data stream to be accurately extracted from each clock cycle.

[0013] In some embodiments, obtaining decoded data of the data stream from each sampled data according to each transition edge position includes: obtaining candidate data corresponding to each transition edge position from each sampled data according to each transition edge position; filtering each candidate data according to the modulation rate to obtain target data; and obtaining decoded data according to each target data. A risk threshold for the area that was impacted is determined based on historical impact information of the area, and a battery risk assessment result is obtained based on a comparison of the impact force in the impact information with the risk threshold. After obtaining candidate data corresponding to each transition edge position from each sampled data according to each transition edge position, filtering each candidate data according to the modulation rate to obtain target data, and obtaining decoded data based on each target data, sampled data determined by transition edges that do not match the data stream are filtered out from the decoded data, thereby improving the accuracy of the obtained decoded data.

[0014] In some embodiments, each of the alternative data is screened according to the modulation rate to obtain each target data, including: determining the time period of adjacent bits of the decoded data according to the modulation rate; screening each of the alternative data in turn according to the time period to obtain each target data, so that the alternative data that matches the modulation rate can be quickly screened out from the alternative data as the target data, so that the target data can be arranged in the order of acquisition to obtain the decoded data, thereby improving the efficiency of obtaining the decoded data.

[0015] In the second aspect, the present application provides a data decoding device, including: a rate acquisition module for obtaining the clock rate of a single clock; a data sampling module for sampling a data stream formed by Manchester encoding at the rising edge and falling edge of the single clock according to the clock rate of the single clock to obtain multiple sampling data; a data decoding module for decoding each of the sampling data to obtain decoded data of the data stream.

[0016] In the technical solution of the embodiment of the present application, after obtaining the clock rate of a single-channel clock, the data stream formed by Manchester encoding is sampled at the rising edge and falling edge of the single-channel clock according to the clock rate of the single-channel clock to obtain multiple sampling data, so as to decode each sampling data to obtain decoded data of the data stream. Therefore, in the process of decoding the data using Manchester encoding, data is collected for decoding through dual-edge sampling, so that at any clock rate, there is no need to output multiple clocks, and the decoding efficiency can be doubled. In addition, the single clock has low requirements for clock offset jitter, which reduces the development difficulty. Therefore, while improving the decoding efficiency, the clock resources required for decoding the data using Manchester encoding are reduced.

[0017] In a third aspect, the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the method in the implementation of the first aspect when executing the computer program.

[0018] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, performs the method in the embodiment of the first aspect.

[0019] In a fifth aspect, the present application provides a computer program product, which, when running on a computer, enables the computer to execute the method in the first aspect, any optional implementation method in the first aspect, or the third aspect, any optional implementation method in the third aspect.

[0020] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] Various other advantages and benefits will become apparent to those skilled in the art upon reading the detailed description of the preferred embodiment below. The accompanying drawings are for illustration purposes only and are not to be considered as limiting the present application. The same reference numerals are used throughout the drawings to represent the same components. In the drawings:

[0022] FIG1 is a flow chart of a data decoding method according to some embodiments of the present application;

[0023] FIG2 is a schematic diagram of a sampling circuit structure in some embodiments of the present application;

[0024] FIG3 is a schematic diagram of dual clock edge sampling in some embodiments of the present application;

[0025] FIG4 is a schematic structural diagram of a data decoding device according to some embodiments of the present application;

[0026] FIG5 is a schematic structural diagram of an electronic device according to some embodiments of the present application.

[0027] Some of the accompanying drawings in the specific implementation manner are as follows:

[0028] 200 - rate acquisition module; 201 - data sampling module; 202 - data decoding module; 300 - electronic device; 301 - processor; 302 - memory; 303 - communication bus. DETAILED DESCRIPTION

[0029] The following embodiments of the technical solution of the present application will be described in detail with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application and are therefore only examples and are not intended to limit the scope of protection of the present application.

[0030] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" and any variations thereof in the specification and claims of this application and the above-mentioned figure descriptions are intended to cover non-exclusive inclusions.

[0031] In the description of the embodiments of this application, the technical terms "first" and "second" are used only to distinguish different objects and should not be understood to indicate or imply relative importance or implicitly specify the quantity, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, the meaning of "plurality" is more than two, unless otherwise clearly and specifically defined.

[0032] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0033] In the description of the embodiments of this application, the term "and / or" is simply a description of the association relationship between associated objects, indicating that three relationships can exist. For example, A and / or B can represent the following three situations: A exists alone, A and B exist simultaneously, and B exists alone. In addition, the character " / " in this document generally indicates that the associated objects are in an "or" relationship.

[0034] In the description of the embodiments of the present application, the term "multiple" refers to more than two (including two). Similarly, "multiple groups" refers to more than two groups (including two groups), and "multiple pieces" refers to more than two pieces (including two pieces).

[0035] Compared to parallel communication, serial communication has advantages such as strong anti-interference ability, fewer pins required, and long transmission distance. However, since serial communication only has one data line, data recovery in high-speed serial communication is more difficult in the absence of an accompanying clock. Therefore, serial communication data can be encoded by adopting Manchester encoding. Manchester encoding, also known as phase encoding, is a synchronous clock encoding technology used by the physical layer to encode the clock and data of a synchronous bit stream. It can modulate each code element into two levels, using the level transition edge to represent high and low levels. The data stream formed by Manchester encoding is accompanied by clock transmission, which makes this encoding method have good anti-interference and self-synchronization capabilities, which is conducive to data recovery.

[0036] However, the transmission rate of Manchester-encoded data is only half of the modulation rate. Therefore, common decoding methods for Manchester-encoded data require a high-frequency clock that is much higher than the symbol rate for encoding and decoding. However, this will cause the clock required for encoding and decoding to become very high, and the decoding efficiency is still low. Therefore, in the related art, by using a phase shifter to output multiple homologous clocks with equal phase differences, the Manchester-encoded data is sampled at high speed, thereby achieving reliable decoding of the data without using a high-frequency clock that is much higher than the symbol rate, thereby improving the data decoding rate. However, this decoding method requires the use of a phase shifter to output multiple clocks, which occupies a large amount of clock resources.

[0037] In response to the above technical problems, an embodiment of the present application provides a data decoding method. After obtaining the clock rate of a single-channel clock, the method samples a data stream formed by Manchester encoding at the rising edge and falling edge of the single-channel clock according to the clock rate of the single-channel clock to obtain multiple sampling data, so as to decode each sampling data to obtain decoded data of the data stream. In the process of decoding the data using Manchester encoding, data is collected and decoded through dual-edge sampling, so that at any clock rate, there is no need to output multiple clocks, and the decoding efficiency can be doubled. In addition, the single clock has low requirements on clock offset jitter, which reduces the development difficulty. While improving the decoding efficiency, the clock resources required for decoding the data using Manchester encoding are reduced.

[0038] The data decoding method, apparatus, electronic device, and storage medium disclosed in the embodiments of the present application can be applied to a decoding device for decoding Manchester-encoded data. The decoding device may include a decoder for decoding the data, and the decoder may include a sampling circuit for sampling the data.

[0039] According to some embodiments of the present application, an embodiment of the present application provides a data decoding method, which can be applied to the aforementioned decoding device for decoding data using Manchester encoding. As shown in Figure 1, the data decoding method includes:

[0040] S101, obtaining the clock rate of a single clock;

[0041] S102, sampling a data stream formed by using Manchester encoding at a rising edge and a falling edge of the single-channel clock according to a clock rate of the single-channel clock to obtain a plurality of sampled data;

[0042] S103: Decode each sample data to obtain decoded data of the data stream.

[0043] In some embodiments, the clock rate of a single clock can be set based on actual decoding requirements. The clock rate refers to the number of pulses per second generated by the oscillator that sets the decoder's sampling speed. To avoid decoding failures, the clock rate must be less than or equal to a preset rate, which is determined based on the computing resources currently available for data sampling. For example, the preset rate can be calculated based on the computing resources currently available for data sampling in the decoding device, and the specific value of the clock rate can be set based on the preset rate. The computing resources can be the hard-core resources of the FPGA in the sampling circuit of the decoding device to reduce development difficulty.

[0044] After determining the clock rate of a single clock, this clock rate and data stream can be input into the decoder's FPGA for data sampling. The FPGA can include an IDDR module, a register for data input that synchronizes externally input data with the clock signal for subsequent data processing and analysis. For example, the sampling circuit can be shown in Figure 2, where port D is the data input port, port CE is the enable control port, port C is the clock input port, port S / R is the reset position port, Q1 samples data on the rising edge of the clock, and Q2 samples data on the falling edge of the clock. After determining the clock rate of a single clock, this clock rate can be input into the sampling circuit via port C, and the data stream can be input into the sampling circuit via port D. The sampling circuit then samples the data stream on both the rising and falling edges of the single clock according to the clock rate. Sampled data collected on the rising edge of the clock is output from port Q1, and sampled data collected on the falling edge of the clock is output from port Q2. For example, a clock rate equal to twice the modulation rate of the data stream is used. Since the clock rate input to the sampling circuit is twice the modulation rate and dual-edge sampling is employed, there are four clock edges per clock cycle. This allows four sampling points, or four data points, to be sampled within a single clock cycle, achieving quadruple sampling. As shown in Figure 3, clk0, clk90, clk180, and clk270 represent the four sampling points of the data stream. The sampled data extracted from the data stream in each clock cycle are "0000," "1111," "0000," and "1111," respectively. While a single clock source would normally require a clock rate of four times the modulation rate to obtain four data samples within a single clock cycle, this approach only requires a clock rate of twice the modulation rate. This reduces the clock resources required for a single clock source by half, while maintaining the same decoding speed, resulting in higher decoding efficiency.

[0045] After obtaining a plurality of sampled data, the sampled data may be combined in the order of acquisition, and then decoded according to the encoding rule of Manchester encoding adopted by the data stream to obtain decoded data of the data stream.

[0046] After obtaining the clock rate of a single-channel clock, the data stream formed by Manchester encoding is sampled at the rising edge and falling edge of the single-channel clock according to the clock rate of the single-channel clock to obtain multiple sampling data, so as to decode each sampling data to obtain decoded data of the data stream. Therefore, in the process of decoding the data using Manchester encoding, data is collected for decoding through dual-edge sampling, so that at any clock rate, there is no need to output multiple clocks, and the decoding efficiency can be doubled. In addition, the single clock has low requirements for clock offset jitter, which reduces the development difficulty. Therefore, while improving the decoding efficiency, the clock resources required for decoding the data using Manchester encoding are reduced.

[0047] To improve the accuracy of data decoding, in some embodiments, obtaining the clock rate of the single-channel clock includes obtaining the clock rate of the single-channel clock according to the modulation rate of the data stream formed by Manchester encoding.

[0048] In some embodiments, when a decoding device receives a data stream generated using Manchester encoding, it may parse the data stream to obtain the modulation rate of the data stream. Alternatively, the modulation rate of the data stream may be obtained from the encoder that encodes the data stream. The data stream may be a serial data stream. The modulation rate refers to the change in the signal per unit time after modulation, that is, the number of times the carrier parameter changes per unit time. It is also called the symbol rate, code element rate, or baud rate.

[0049] After obtaining the modulation rate of the data stream, the clock rate of the single-channel clock that is N times the modulation rate can be determined based on the modulation rate. The clock rate refers to the number of pulses per second generated by the oscillator that sets the sampling speed of the decoder. N ≥ 1, and the specific value can be determined according to the actual situation. For example, N can be inversely proportional to the modulation rate. If the modulation rate is high, the value of N is low to avoid excessive clock rate requirements and increase the cost and design difficulty of the decoding device; if the modulation rate is low, the value of N is high to further improve the decoding efficiency. For example, 2 times the modulation rate can be used as the clock rate of the single-channel clock.

[0050] In order to avoid the situation where decoding cannot occur, the preset rate can be calculated based on the computing resources that the decoding device can currently allocate to data sampling, and then the quotient obtained by dividing the preset rate by the modulation rate is used as the value N. Therefore, based on the value N and the modulation rate, the clock rate = N × modulation rate can be determined.

[0051] By adopting the modulation rate of the data stream formed by Manchester coding, the clock rate of the single clock is obtained, so that the clock rate is adapted to the modulation rate of the data stream, thereby being able to decode Manchester codes of different modulation rates and improve the accuracy of data decoding.

[0052] When decoding the sampled data, in order to improve the accuracy of the decoded data obtained, in some embodiments, each sampled data is decoded to obtain decoded data of the data stream, including: comparing adjacent sampled data according to the sampling order of each sampled data to determine the position of each transition edge; and obtaining decoded data of the data stream from each sampled data according to the position of each transition edge.

[0053] In some embodiments, since Manchester encoding includes a transition between each bit, the transition between bits represents a data signal. That is, in a data stream formed using Manchester encoding, the data signal is located at the transition edge of the data stream. Therefore, after obtaining each sampled data, the sampled data can be arranged in sampling order. Then, for each sampled data, it can be XOR-ed with the adjacent sampled data. If the phases of two adjacent sampled data are the same, such as if both adjacent sampled data are "1" or "0," it indicates that no transition occurred between the two sampled data, and it can be determined that no transition edge exists between the two sampled data. If the phases of the two ringing sampled data are different, such as if the first sampled data is "1" and the second sampled data is "0," it indicates that no transition occurred between the two sampled data, and it can be determined that a transition edge exists between the two sampled data. In this way, by comparing all adjacent sampled data, the transition edge position in each sampled data can be identified.

[0054] After determining the transition edge position, the sampling data on the left and right sides of the transition edge position can be compared to determine whether the transition edge at the transition edge position is a rising edge or a falling edge. If the sampling data on the left side of the transition edge position is "1" and the sampling data on the right side is "0", then it can be determined that the transition edge at the transition edge position is a falling edge. After determining the type of transition edge at each transition edge position, the data signal corresponding to each transition edge can be extracted according to the encoding rules defined by Manchester encoding, so that all data signals can be arranged in the order of acquisition to obtain the decoded data of the data stream. If the encoding rules defined by Manchester encoding are that the rising edge represents "0" and the falling edge represents "1", then if the transition edge at a certain transition edge position is a rising edge, it can be determined that the data signal carried by the transition edge is "0".

[0055] By comparing adjacent sampled data according to the sampling order of the sampled data, the position of each transition edge is determined, and based on the position of each transition edge, the decoded data of the data stream is obtained from each sampled data. In this way, the characteristic that the data signal using Manchester encoding is located at the transition edge is utilized to quickly determine the transition edge position for data decoding by comparing adjacent sampled data, thereby improving the decoding accuracy of the data stream using Manchester encoding.

[0056] In order to more accurately identify the transition edge position, in some embodiments, adjacent sampling data are compared according to the sampling order of each sampling data to determine the transition edge position, including: according to the sampling order of each sampling data, the last sampling data collected in the previous clock cycle is spliced ​​with each sampling data collected in the next clock cycle to obtain spliced ​​data; and adjacent sampling data in the spliced ​​data are compared to determine the transition edge position.

[0057] In some embodiments, considering that data signals in a data stream are transmitted according to clock cycles, the last bit of sampled data collected in the previous clock cycle can be concatenated with each bit of sampled data collected in the next clock cycle, based on the sampling order of each sampled data, to generate concatenated data. For example, assuming dual-edge sampling using a clock rate twice the modulation rate, four sampled data can be collected within a clock cycle. Assuming the four sampled data collected in the previous clock cycle are "0000" and the four sampled data collected in the next clock cycle are "1111," the last bit of the sampled data in "0000" can be concatenated with "1111" to generate the concatenated data "01111." After obtaining the concatenated data, the sampled data of adjacent bits in the concatenated data can be XORed to determine the transition edge position, which can then be used to extract the data signal of the data stream from the concatenated data. In this way, the data signal of the data stream can be accurately extracted from each clock cycle.

[0058] Similarly, in some embodiments, the sampling data collected in the previous clock cycle can be spliced ​​with the first sampling data collected in the next clock cycle according to the sampling order of each sampling data to obtain spliced ​​data; the adjacent sampling data in the spliced ​​data are compared to determine the jump edge position.

[0059] For example, assuming dual-edge sampling is performed at a clock rate twice the modulation rate, four samples can be collected within one clock cycle. Assuming the four samples collected in the previous clock cycle are "0000" and the four samples collected in the next clock cycle are "1111," the first sample in "1111" can be concatenated with "0000" to obtain the concatenated data "00001." Once the concatenated data is obtained, the sample data of adjacent bits in the concatenated data can be XORed to determine the transition edge position, which can then be used to extract the data signal of the data stream from the concatenated data.

[0060] After extracting the data signal of the data stream through the transition edge position, the individual data signals can be spliced ​​in the sampling order to obtain the decoded data of the data stream.

[0061] However, when using Manchester encoding to form a data stream, since Manchester encoding requires transition edges to represent data signals, if two adjacent data signals in the data stream are identical, Manchester encoding will first perform a transition between the two data signals. For example, if the data signal in the data stream is "11," Manchester encoding uses a falling edge to represent "1" and a rising edge to represent "0," meaning the data stream requires two falling edges. Therefore, after the first falling edge appears to represent the first data signal "1," the waveform must first rise once from the first data signal "1" to the second data signal "1" before a second falling edge appears to represent the second data signal "1." During the sampling process of this data stream, three transition edges are identified in the sampled data. If decoding is performed directly based on the transition positions of these three edges, the resulting decoded data will be "101," inconsistent with the original data stream, resulting in a decoding error. Therefore, in order to improve the accuracy of decoding the data stream, in some embodiments, decoded data of the data stream is obtained from each sampled data, including: according to each transition edge position, obtaining each alternative data corresponding to each transition edge position from each sampled data; according to the modulation rate, screening each alternative data to obtain each target data; and obtaining decoded data based on each target data.

[0062] In some embodiments, after determining the transition edge position, the sampling data on the left and right sides of the transition edge position can be compared to determine whether the transition edge of the transition edge position is a rising edge or a falling edge. After determining the type of the transition edge of the transition edge position, one of the sampling data on the left and right sides of the transition edge position can be selected as the alternative data according to the encoding rules defined by Manchester encoding. For example, assuming that the sampling data on the left and right sides of the transition edge position are "0" and "1" respectively, it can be determined that the transition edge position is a rising edge. If the encoding rule defined by Manchester encoding is that the data signal represented by the rising edge is "0", then the sampling data "0" on the left side of the transition edge position can be determined as the alternative data; if the encoding rule defined by Manchester encoding is that the data signal represented by the rising edge is "1", then the sampling data "1" on the right side of the transition edge position can be determined as the alternative data. In this way, each alternative data corresponding to each transition edge position can be obtained from each sampling data.

[0063] After obtaining each candidate data set, the candidate data can be arranged in sampling order. Then, starting from the second candidate data set, the interval between each candidate data set and the first candidate data set is determined according to the order in which the candidate data sets are arranged. Next, for each candidate data set and the first candidate data set, a determination is made as to whether the interval between the two adjacent data signals, as determined by the modulation rate, matches the modulation duration between the two adjacent data signals. For example, whether the interval is an integer multiple of the modulation duration. If so, the candidate data set is retained; otherwise, it is deleted. In this way, the candidate data set that matches the modulation rate can be selected from all candidate data sets as the target data, and the target data sets can be arranged in the order in which they were acquired, thereby obtaining decoded data.

[0064] After obtaining each candidate data corresponding to each transition edge position from each sampled data through each transition edge position, each candidate data is screened according to the modulation rate to obtain each target data, so as to obtain decoded data based on each target data, thereby filtering out the sampled data determined by the transition edge that does not match the data stream from the decoded data, thereby improving the accuracy of the obtained decoded data.

[0065] In order to further improve the efficiency of screening the alternative data, in some embodiments, each alternative data is screened according to the modulation rate to obtain each target data, including: determining the time period of adjacent bits of the decoded data according to the modulation rate; and screening each alternative data in turn according to the time period to obtain each target data.

[0066] In some embodiments, the duration between any two adjacent data signals in the data stream can be determined based on the modulation rate, and this duration can be used as the time period between adjacent bits of the decoded data. For example, if the modulation rate is such that encoding is completed every 50 ns, the time period between adjacent bits of the decoded data can be determined to be 50 ns.

[0067] After all candidate data are obtained from each sampled data according to each transition edge position, each candidate data is arranged according to the acquisition order of each candidate data, and then the first candidate data is added to the target data set as the current data, and the next candidate data whose acquisition time interval with the current data meets the time period is extracted from each candidate data, and the current data is iteratively added to the target data set until the next candidate data of the current data cannot be extracted from each candidate data according to the time period, and all candidate data in the target data set are used as target data, so that the candidate data that matches the modulation rate can be quickly screened out from each candidate data as the target data, so that each target data can be arranged in the acquisition order to obtain decoded data.

[0068] FIG4 shows a schematic structural diagram of a data decoding device provided by the present application. It should be understood that the device corresponds to the method embodiment executed in FIG1 and can execute the steps involved in the aforementioned method. The specific functions of the device can be found in the description above. To avoid repetition, a detailed description is appropriately omitted here. The device includes at least one software function module that can be stored in a memory in the form of software or firmware or solidified in the operating system (OS) of the device. Specifically, the device is used to perform collision detection on a battery with a sensor provided on the surface. The device includes: a rate acquisition module 200 for acquiring the clock rate of a single clock; a data sampling module 201 for sampling a data stream formed by Manchester encoding at the rising and falling edges of the single clock according to the clock rate of the single clock to obtain a plurality of sampled data; a data decoding module 202 for decoding each sampled data to obtain decoded data of the data stream.

[0069] In the technical solution of the embodiment of the present application, after obtaining the clock rate of a single-channel clock, the data stream formed by Manchester encoding is sampled at the rising edge and falling edge of the single-channel clock according to the clock rate of the single-channel clock to obtain multiple sampling data, so as to decode each sampling data to obtain decoded data of the data stream. Therefore, in the process of decoding the data using Manchester encoding, data is collected for decoding through dual-edge sampling, so that at any clock rate, there is no need to output multiple clocks, and the decoding efficiency can be doubled. In addition, the single clock has low requirements for clock offset jitter, which reduces the development difficulty. Therefore, while improving the decoding efficiency, the clock resources required for decoding the data using Manchester encoding are reduced.

[0070] According to some embodiments of the present application, the rate acquisition module 201 is specifically configured to acquire the clock rate of a single-channel clock according to the modulation rate of a data stream formed by using Manchester encoding.

[0071] According to some embodiments of the present application, the data decoding module 202 is specifically used to: compare adjacent sampled data according to the sampling order of each sampled data to determine each transition edge position; and obtain decoded data of the data stream from each sampled data according to each transition edge position.

[0072] According to some embodiments of the present application, the data decoding module 202 is specifically used to: splice the last sampling data collected in the previous clock cycle with each sampling data collected in the next clock cycle according to the sampling order of each sampling data to obtain spliced ​​data; compare adjacent sampling data in the spliced ​​data to determine the jump edge position.

[0073] According to some embodiments of the present application, the data decoding module 202 is specifically used to: splice each sampling data collected in the previous clock cycle with the first sampling data collected in the next clock cycle according to the sampling order of each sampling data to obtain spliced ​​data; compare adjacent sampling data in the spliced ​​data to determine the jump edge position.

[0074] According to some embodiments of the present application, the data decoding module 202 is specifically used to: obtain each alternative data corresponding to each transition edge position from each sampled data according to each transition edge position; filter each alternative data according to the modulation rate to obtain each target data; and obtain decoded data according to each target data.

[0075] According to some embodiments of the present application, the data decoding module 202 is specifically used to: determine the time period of adjacent bits of the decoded data according to the modulation rate; and screen each candidate data in turn according to the time period to obtain each target data.

[0076] According to some embodiments of the present application, the clock rate is less than or equal to a preset rate, and the preset rate is determined according to computing resources currently available for data sampling.

[0077] According to some embodiments of the present application, as shown in Figure 5, the present application provides an electronic device 300, including: a processor 301 and a memory 302, the processor 301 and the memory 302 are interconnected and communicate with each other through a communication bus 303 and / or other forms of connection mechanisms (not marked), and the memory 302 stores a computer program executable by the processor 301. When the computing device is running, the processor 301 executes the computer program to execute the method executed by the external terminal in any optional implementation method, for example: obtaining the clock rate of a single clock; according to the clock rate of the single clock, sampling a data stream formed by Manchester encoding at the rising edge and falling edge of the single clock to obtain multiple sampled data; decoding each sampled data to obtain decoded data of the data stream.

[0078] The present application provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the method in any of the aforementioned optional implementations is executed.

[0079] Among them, the storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0080] The present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the method in any optional implementation manner.

[0081] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some or all of the technical features therein. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.

Claims

1. A data decoding method, comprising: Get the clock rate of a single clock; According to the clock rate of the single-channel clock, sampling the data stream formed by using Manchester encoding at the rising edge and the falling edge of the single-channel clock to obtain a plurality of sampled data; Each of the sampled data is decoded to obtain decoded data of the data stream.

2. The method according to claim 1, wherein: Get the clock rate of a single clock, including: The clock rate of the single-channel clock is obtained according to the modulation rate of the data stream formed by using Manchester encoding.

3. The method according to claim 1 or 2, wherein: Decoding each of the sampled data to obtain decoded data of the data stream includes: Comparing adjacent sampling data according to the sampling order of each sampling data to determine the position of each transition edge; According to each of the transition edge positions, decoded data of the data stream is obtained from each of the sampled data.

4. The method according to claim 3, wherein: According to the sampling order of each of the sampled data, adjacent sampled data are compared to determine each transition edge position, including: According to the sampling order of each of the sampled data, the last sampled data collected in the previous clock cycle is spliced ​​with each sampled data collected in the next clock cycle to obtain spliced ​​data; Adjacent sampling data in the spliced ​​data are compared to determine the transition edge position.

5. The method according to claim 3, wherein: According to the sampling order of each of the sampled data, adjacent sampled data are compared to determine each transition edge position, including: According to the sampling order of each of the sampled data, each sampled data collected in the previous clock cycle is spliced ​​with the first sampled data collected in the next clock cycle to obtain spliced ​​data; Adjacent sampling data in the spliced ​​data are compared to determine the transition edge position.

6. The method according to any one of claims 3 to 5, wherein: According to each of the transition edge positions, the decoded data of the data stream is obtained from each of the sampled data, including: According to each of the transition edge positions, acquiring each of the candidate data corresponding to each of the transition edge positions from each of the sampled data; According to the modulation rate, the candidate data are screened to obtain target data; The decoded data is obtained according to each of the target data.

7. The method according to claim 6, wherein: According to the modulation rate, the candidate data are screened to obtain target data, including: Determining a time period of adjacent bits of the decoded data according to the modulation rate; According to the time period, each candidate data is screened in turn to obtain each target data.

8. A data decoding method, comprising: Obtaining the clock rate of the single-channel clock according to the modulation rate of the data stream formed by Manchester encoding; According to the clock rate of the single-channel clock, sampling the data stream formed by using Manchester encoding at the rising edge and the falling edge of the single-channel clock to obtain a plurality of sampled data; According to the sampling order of each of the sampling data, the last sampling data collected in the previous clock cycle is spliced ​​with each sampling data collected in the next clock cycle to obtain spliced ​​data, or, according to the sampling order of each of the sampling data, each sampling data collected in the previous clock cycle is spliced ​​with the first sampling data collected in the next clock cycle to obtain spliced ​​data; Comparing the adjacent sampling data in the spliced ​​data to determine the transition edge position; According to each of the transition edge positions, acquiring each of the candidate data corresponding to each of the transition edge positions from each of the sampled data; Determining a time period of adjacent bits of the decoded data according to the modulation rate; According to the time period, the candidate data are screened in sequence to obtain target data; The decoded data is obtained according to each of the target data.

9. A data decoding device, comprising: A rate acquisition module, used to obtain the clock rate of a single-channel clock; A data sampling module, used for sampling a data stream formed by Manchester coding at a rising edge and a falling edge of the single-channel clock according to a clock rate of the single-channel clock to obtain a plurality of sampled data; The data decoding module is used to decode each of the sampled data to obtain decoded data of the data stream.

10. An electronic device comprising a processor and a memory storing a computer program, wherein the processor implements the method according to any one of claims 1 to 8 when executing the computer program.

11. A computer-readable storage medium having a computer program stored thereon, wherein the computer program implements the method according to any one of claims 1 to 8 when executed by a processor.

Citation Information

Patent Citations

  • Manchester decoding device capable of carrying out error correction and method thereof

    CN105281776A

  • A decoding method and device for high-speed Manchester encoding

    CN109861692A

  • Signal processing method and device, electronic equipment and storage medium

    CN114205054A

  • Double-edge sampling circuit and data sampling method, device and system used for double-edge sampling circuit

    CN115512738A

  • Clock and data recovery using dual manchester encoded data streams

    US20150023458A1

Cited By

  • Decoding method, device and module and computer readable storage medium

    CN121098449A

  • Decoding method, apparatus, module and computer readable storage medium

    CN121098449B