CN116506097A - Data processing method, electronic device and storage medium - Google Patents

Data processing method, electronic device and storage medium Download PDF

Info

Publication number
CN116506097A
CN116506097A CN202310754511.1A CN202310754511A CN116506097A CN 116506097 A CN116506097 A CN 116506097A CN 202310754511 A CN202310754511 A CN 202310754511A CN 116506097 A CN116506097 A CN 116506097A
Authority
CN
China
Prior art keywords
decoding
data
preset
encoding
rate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310754511.1A
Other languages
Chinese (zh)
Other versions
CN116506097B (en
Inventor
张月
叶媲舟
韩静
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Ruimeng Semiconductor Co ltd
Original Assignee
Shenzhen Ruimeng Semiconductor Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Ruimeng Semiconductor Co ltd filed Critical Shenzhen Ruimeng Semiconductor Co ltd
Priority to CN202310754511.1A priority Critical patent/CN116506097B/en
Publication of CN116506097A publication Critical patent/CN116506097A/en
Application granted granted Critical
Publication of CN116506097B publication Critical patent/CN116506097B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L7/00Arrangements for synchronising receiver with transmitter
    • H04L7/0054Detection of the synchronisation error by features other than the received signal transition
    • H04L7/0066Detection of the synchronisation error by features other than the received signal transition detection of error based on transmission code rule

Abstract

The application is applicable to the technical field of computers, and provides a data processing method, electronic equipment and a storage medium, wherein the method comprises the following steps: receiving opposite end coded data sent by a communication opposite end; and determining a decoding rate according to the preset code rate, and controlling a preset decoding circuit to decode the opposite-end encoded data according to the decoding rate and a preset encoding and decoding clock to obtain decoded data. In the method, the decoding rate is determined through the preset code rate, and the preset decoding circuit is controlled to decode the opposite-end coded data sent by the opposite communication end according to the determined decoding rate and the preset coding and decoding clock generated by the crystal oscillator, so that decoded data are obtained. When decoding the opposite-end coded data, the received opposite-end coded data is decoded based on a stable and accurate preset coding and decoding clock generated by the crystal oscillator, and a decoding clock in the opposite-end coded data is not needed to be decoded, so that the accuracy of the decoded data and the decoding efficiency are improved.

Description

Data processing method, electronic device and storage medium
Technical Field
The application belongs to the technical field of communication, and particularly relates to a data processing method, electronic equipment and a storage medium.
Background
Manchester encoding is a synchronous clock encoding technique. In the data stream using manchester encoding, a transition is provided in the middle of each bit encoding, and this transition is used as both a clock signal and a data signal, so that the transmitting end can transmit the synchronous clock signal to the receiving end together while transmitting the data information.
In the related art, when data transmission is performed by using manchester encoding, a receiving end generally needs to decode a synchronous clock signal first, and then decode the manchester encoding based on the obtained synchronous clock signal to obtain decoded data. The accuracy of the decoded data depends on the accuracy of the synchronous clock signal obtained by decoding, and if the synchronous clock signal obtained by decoding is wrong, the accuracy of the decoded data obtained by decoding based on the synchronous clock signal is lower.
Disclosure of Invention
The embodiment of the application provides a data processing method, electronic equipment and a storage medium, which can solve the problem that in the related technology, the accuracy of data information depends on the accuracy of a synchronous clock signal obtained by decoding, and if the synchronous clock signal obtained by decoding is wrong, the accuracy of the data information obtained by decoding based on the synchronous clock signal is lower.
A first aspect of an embodiment of the present application provides a data processing method, including:
receiving opposite end coded data sent by a communication opposite end, wherein the opposite end coded data is Manchester coded data;
determining a decoding rate according to a preset code rate, and controlling a preset decoding circuit to decode the opposite-end coded data according to the decoding rate and a preset coding and decoding clock to obtain decoded data, wherein the decoding rate is used for indicating the number of pulses required for decoding one-bit data, and the preset coding and decoding clock is a clock generated by a crystal oscillator.
A second aspect of an embodiment of the present application provides a data processing apparatus, including:
the data receiving unit is used for receiving opposite-end coded data sent by a communication opposite end, wherein the opposite-end coded data are Manchester coded data;
the data decoding unit is used for determining a decoding rate according to a preset code rate, controlling a preset decoding circuit to decode the opposite-end encoded data according to the decoding rate and a preset encoding and decoding clock to obtain decoded data, wherein the decoding rate is used for indicating the number of pulses required for decoding one-bit data, and the preset encoding and decoding clock is a clock generated by a crystal oscillator.
A third aspect of the embodiments of the present application provides an electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the data processing method provided in the first aspect when the computer program is executed.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the data processing method provided in the first aspect.
The implementation of the data processing method, the electronic device and the storage medium provided by the embodiment of the application has the following beneficial effects: and determining a decoding rate through a preset code rate, and controlling a preset decoding circuit to decode opposite-end encoded data sent by a communication opposite end according to the determined decoding rate and a preset encoding and decoding clock generated by a crystal oscillator to obtain decoded data. When decoding the opposite-end coded data, the received opposite-end coded data is decoded based on a stable and accurate preset coding and decoding clock generated by the crystal oscillator, and a decoding clock in the opposite-end coded data is not needed to be decoded, so that the accuracy of the decoded data and the decoding efficiency are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the related technical descriptions, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person of ordinary skill in the art.
FIG. 1 is a flow chart of an implementation of a data processing method according to an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating connection of a preset decoding circuit according to an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating connection of a preset encoding circuit according to an embodiment of the present disclosure;
FIG. 4 is a flow chart of an implementation of decoding peer-encoded data according to an embodiment of the present application;
FIG. 5 is a flow chart of an implementation of encoding data to be encoded according to an embodiment of the present application;
FIG. 6 is a block diagram of a data processing apparatus according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless expressly specified otherwise.
In order to explain the technical aspects of the present application, the following examples are presented.
Referring to fig. 1, fig. 1 is a flowchart of an implementation of a data processing method according to an embodiment of the present application, where the flowchart may include the following steps 101 to 102.
Step 101, receiving opposite end coded data sent by a communication opposite end.
In the present embodiment, the execution subject of the above-described data processing method is generally a communication device.
The communication partner is usually another device that communicates with the communication device that is the subject of execution.
Wherein, the opposite end coded data is usually Manchester coded data. The manchester encoded data is typically based on a preset encoding rule, with a high-low transition of the level in the middle of each bit of encoded data representing a data "0" or "1".
The preset encoding rule is usually a preset encoding rule. In practice, the communication device may pre-define a preset encoding rule with the communication peer to ensure accuracy of the decoded data. The preset encoding rule may be that a transition from a low level to a high level in the middle of encoding data indicates data "0", and a transition from a high level to a low level indicates data "1". The preset encoding rule may also be that the level in the middle of encoding data transitions from a high level to a low level indicating data "0" and from a low level to a high level indicating data "1".
In practice, the communication peer may send the peer-encoded data to the execution body through a network, so that the execution body may receive the peer-encoded data sent by the communication peer through the network.
Step 102, determining a decoding rate according to a preset code rate, and controlling a preset decoding circuit to decode the opposite-end encoded data according to the decoding rate and a preset encoding and decoding clock to obtain decoded data.
The preset code rate is usually a preset number of levels required for representing one-bit manchester encoded data.
Wherein the decoding rate is used to indicate the number of pulses needed to decode a bit of data.
The preset decoding circuit is usually a preset decoding circuit.
The preset codec clock is usually a preset encoded and decoded clock, and in practice, the preset codec clock is usually a clock generated by a crystal oscillator.
In practice, the executing body may determine the decoding rate in various manners, and as an example, the executing body may determine the ratio of the main frequency clock rate to the preset code rate as the decoding rate, for example, if the preset code rate is 2 and the main frequency clock rate is 6MHz, the decoding rate may be determined to be 3MHz, where 3 mhz=6 MHz/2. As another example, the execution body may use a preset code rate, and find a decoding rate corresponding to the preset code rate from a pre-established code rate-decoding rate correspondence table. The code rate-decoding rate correspondence table may be a correspondence table pre-established by the execution body and storing correspondence relations between a plurality of code rates and decoding rates.
In practice, the execution body may use a clock generated by the crystal oscillator as a decoding clock, and after determining the decoding rate, the execution body may transmit the decoding rate and the decoding clock to a decoding circuit, and the decoding circuit decodes the opposite-end encoded data to obtain decoded data.
In some embodiments, the peer-encoded data may include synchronization header data and communication data, wherein the synchronization header data is a preset synchronization header, and the preset synchronization header is typically a preset synchronization header. In practice, the pulse width required to preset the synchronization header is typically different from the pulse width required to communicate data per bit. As an example, the preset sync header may occupy a pulse width required to indicate 3-bit data, wherein a pulse width required for the first 1.5-bit data may be used to indicate 0 and a pulse width required for the last 1.5-bit data may be used to indicate 1. For example, if the pulse width required for indicating 1 bit of data is 2, 0 is indicated by low level-high level, and 1 is indicated by high level-low level, the pulse width required for the predetermined synchronization header is 6, the level corresponding to the first 1.5 bits of data of the predetermined synchronization header is changed to low level-high level, and the level corresponding to the last 1.5 bits of data is changed to high level-low level. If the pulse width required for indicating 1 bit of data is 2, the low level-high level is used for indicating 1, the high level-low level is used for indicating 0, the pulse width required for the preset synchronous head is 6, the level corresponding to the first 1.5 bits of data of the preset synchronous head is changed to be high level-low level, and the level corresponding to the last 1.5 bits of data is changed to be low level-high level.
In practice, when decoding the encoded data of the opposite terminal, the execution body may control the preset decoding circuit to detect the synchronization header of the encoded data of the opposite terminal according to the decoding rate and the preset encoding and decoding clock, and when the detected synchronization header is the same as the preset synchronization header, control the preset decoding circuit to decode the encoded data of the opposite terminal according to the decoding rate and the preset encoding and decoding clock, so as to obtain the decoded data.
According to the data processing method provided by the embodiment, the decoding rate is determined through the preset code rate, and the preset decoding circuit is controlled to decode the opposite-end coded data sent by the opposite communication end according to the determined decoding rate and the preset coding and decoding clock generated by the crystal oscillator, so that decoded data are obtained. When decoding the opposite-end coded data, the received opposite-end coded data is decoded based on a stable and accurate preset coding and decoding clock generated by the crystal oscillator, and a decoding clock in the opposite-end coded data is not needed to be decoded, so that the accuracy of the decoded data and the decoding efficiency are improved.
In some embodiments, the data processing method may further include the following steps one to two.
Step one, obtaining data to be encoded.
The data to be encoded is usually data to be encoded and then transmitted.
In practice, the execution body may latch the data to be transmitted, and when the predetermined transmission condition is satisfied, acquire the latched data to be encoded. Wherein the preset outward spring is usually a preset outward condition, and the outward condition may include at least one of the following: the data quantity of the latched data to be encoded reaches a preset data quantity threshold value, a data sending message is received, and the latching duration of the data to be encoded reaches a preset latching duration.
And secondly, determining the coding rate according to the preset code rate, and controlling a preset coding circuit to code the data to be coded according to the coding rate and a preset coding and decoding clock to obtain the local coded data.
Wherein the encoding rate is used to indicate the number of pulses required to encode a bit of data.
The preset encoding circuit is usually a preset encoding circuit.
In practice, the executing body may determine the encoding rate in various ways, and as an example, the executing body may determine a ratio of the main frequency clock rate to the preset code rate as the encoding rate. As another example, the executing body may use a preset code rate, and find a code rate corresponding to the preset code rate from a pre-established code rate-code rate correspondence table. The code rate-code rate correspondence table may be a correspondence table pre-established by the execution body and storing correspondence relations between a plurality of code rates and code rates.
In practice, the executing body may use a clock generated by the crystal oscillator as an encoding clock, and after determining the decoding rate, the executing body may transmit the encoding rate and the encoding clock to the encoding circuit, and the encoding circuit encodes the data to be encoded to obtain the local encoded data.
According to the data processing method provided by the embodiment, the coding rate is determined through the preset code rate, and the preset coding circuit is controlled to code data to be coded according to the determined coding rate and the preset coding and decoding clock generated by the crystal oscillator, so that the coded data are obtained. When the data to be encoded is encoded, the data to be encoded is encoded based on a stable and accurate preset encoding and decoding clock generated by the crystal oscillator, so that the accuracy of the encoded data is improved.
In some embodiments, the preset decoding circuit may include a Manchester decoder, a decode shift register, and a decode latch.
Referring to fig. 2, fig. 2 is a schematic diagram illustrating connection of a preset decoding circuit 200 according to an embodiment of the disclosure. As shown in fig. 2, the output of manchester decoder 201 is connected to the input of decode shift register 202, and the output of decode shift register 202 is connected to the input of decode latch 203.
The manchester decoder 201 is configured to decode the opposite-end encoded data according to a decoding rate and a preset codec clock, to obtain decoded data.
Wherein the decode shift register 202 is used to convert the data format of the decoded data into a parallel data format.
Wherein the decoding latch 203 is used to latch decoded data in parallel data format.
In practice, the manchester decoder 201 may detect the synchronization header of the manchester encoded data according to the input decoding rate, the preset encoding and decoding clock and the preset encoding rule, and decode the manchester encoded data according to the input decoding rate, the preset encoding and decoding clock and the preset encoding rule when the detected synchronization header matches with the preset synchronization header, so as to obtain decoded data in a serial data format, and then transmit the decoded data in the serial data format to the decoding shift register 202. The decode shift register 202 may convert the data format of the received decoded data from a serial data format to a parallel data format for subsequent data transmission and transmit the decoded data in the parallel data format to the decode latch 203. The decode latch 203 may latch the decoded data in parallel data format in preparation for a subsequent data application.
According to the data processing method, the opposite end coded data is decoded through the Manchester decoder, so that the decoding efficiency is improved; the data format of the decoded data is converted into the parallel data format through the decoding shift register, and the parallel data format can be adopted for transmission when the decoded data is transmitted, so that the transmission efficiency of the decoded data is improved; the decoded data is latched by the decoding latch, which provides for the application of the decoded data.
In some embodiments, the preset encoding circuit includes an encoding latch, an encoding shift register, and a Manchester encoder.
Referring to fig. 3, fig. 3 is a schematic diagram illustrating connection of a preset encoding circuit 300 according to an embodiment of the present application. As shown in fig. 3, the output of the encoding latch 301 is connected to the input of the encoding shift register 302, and the output of the encoding shift register 302 is connected to the input of the manchester encoder 303.
Wherein the encoding latch 301 is used for latching data to be encoded.
Wherein the code shift register 302 is used to convert the data format of the latched data to be coded into a serial data format.
The manchester encoder 303 is configured to encode data to be encoded in a serial data format according to an encoding rate and a preset encoding/decoding clock, so as to obtain local encoded data.
In practice, the encoding latch 301 may latch the preset synchronization header and the data to be encoded in the parallel data format that needs to be sent out, and then transmit the latched synchronization header and the data to be encoded in the parallel data format to the shift register 302. The shift register 302 may convert the received data to be encoded from a parallel data format into a serial data format, and then transmit the data to be encoded in the serial data format to the manchester encoder 303. The manchester encoder 303 encodes the preset synchronization header according to the encoding rate, the preset encoding and decoding clock and the preset encoding rule, and then encodes the data to be encoded in the serial data format according to the encoding rate, the preset encoding and decoding clock and the preset encoding rule to obtain the local encoded data.
According to the data processing method, the data to be encoded is latched through the encoding latch, the latched data format of the data to be encoded is converted into the serial data format through the encoding shift register, preparation is made for Manchester encoding of the data to be encoded, the data to be encoded is decoded through the Manchester encoder, and encoding efficiency is improved.
Referring to fig. 4, fig. 4 is a flowchart of an implementation of decoding peer-encoded data according to an embodiment of the present application, where the flowchart may include the following steps 401 to 403.
Step 401, switching the decoding state of the communication device from the initial decoding state to the synchronization header decoding state.
The decoding states of the communication device include an initial decoding state, a synchronization header decoding state, and a data decoding state.
In practice, when the communication device is in an initial decoding state, the communication device can receive the opposite-end coded data of the opposite-end communication, and when the opposite-end coded data is received, the communication device can switch the decoding state from the initial decoding state to a synchronous head decoding state, and synchronous head detection is carried out on the opposite-end coded data.
Step 402, when the communication device is in a synchronous header decoding state, synchronous header detection is performed on the opposite end encoded data according to the decoding rate and the preset encoding and decoding clock, and if the detected synchronous header is matched with the preset synchronous header, the decoding state of the communication device is switched to a data decoding state.
In practice, the communication device may compare the detected synchronization header with a preset synchronization header, and when the detected synchronization header and the preset synchronization header are the same, switch the decoding state of the communication device to the data decoding state, and decode the opposite-end encoded data. As an example, the preset sync header may occupy a pulse width required to indicate 3-bit data, wherein a pulse width required for the first 1.5-bit data indicates 0, a pulse width required for the second 1.5-bit data indicates 1, the opposite-end encoded data is decoded according to the decoding rate and the preset codec clock, the detected sync header is the pulse width required for the first 1.5-bit data indicates 0, the pulse width required for the second 1.5-bit data indicates 1, the detected sync header is the same as the preset sync header, and the decoding state of the communication device may be switched to the data decoding state.
In practice, when the detected synchronization header is different from the preset synchronization header, the decoding state of the communication device can be switched from the synchronization header decoding state to the initial decoding state, and the opposite end coded data of the opposite end of the communication can be continuously received.
Step 403, when the communication device is in the data decoding state, decoding the opposite end encoded data according to the decoding rate and the preset encoding and decoding clock to obtain decoded data, and switching the communication device from the data decoding state to the initial decoding state.
In practice, when the communication device is in a data decoding state, the communication device can decode the opposite-end encoded data according to the decoding rate, the preset encoding and decoding clock and the preset encoding rule to obtain decoded data. After the data decoding is completed, the communication device may switch the decoding state to the initial decoding state, and continue to receive the peer-to-peer encoded data of the communication peer.
In this embodiment, when decoding the peer data, the communication device executes the corresponding decoding steps through different decoding states, so that the decoding steps executed by the communication device can be obtained quickly through the decoding states, and when a fault occurs in the decoding process, the position of the decoding step with the fault can be located quickly, so that debugging of the communication device based on the decoding step with the fault is facilitated.
Referring to fig. 5, fig. 5 is a flowchart of an implementation of encoding data to be encoded according to an embodiment of the present application, where the flowchart may include the following steps 501 to 503.
Step 501, the encoding state of the communication device is switched from the initial encoding state to the synchronization header encoding state.
The encoding states of the communication device include an initial encoding state, a synchronization header encoding state, and a data encoding state.
In practice, when the communication device is in an initial encoding state, the communication device can acquire the data to be encoded, and when the data to be encoded is acquired, the communication device can switch the encoding state into a synchronous head encoding state, and encode a preset synchronous head before the data to be encoded.
Step 502, when the communication device is in the synchronous head coding state, determining a coding rate according to a preset code rate, coding the preset synchronous head, and switching the coding state of the communication device to a data coding state.
In practice, the communication device usually needs to encode the preset synchronization header before encoding the data to be encoded. When the communication equipment is in a synchronous head coding state, the communication equipment can determine the ratio of the main frequency clock rate to the preset code rate as the coding rate, then code the preset synchronous head according to the coding rate, the preset coding and decoding clock and the preset coding rule, and then switch the coding state of the communication equipment into a data coding state to realize the coding of the data to be coded.
Step 503, when the communication device is in the data encoding state, determining the encoding rate according to the preset code rate, encoding the data to be encoded to obtain the local end encoded data, and switching the encoding state of the communication device to the initial encoding state.
In practice, when the communication device is in a data coding state, the communication device can code the data to be coded according to the coding rate, the preset coding and decoding clock and the preset coding rule to obtain the local end coded data, and then the coding state of the communication device is switched from the data coding state to the initial coding state.
In this embodiment, when encoding data to be encoded, the communication device executes corresponding encoding steps through different encoding states, so that the encoding steps executed by the communication device can be obtained quickly through the encoding states, and when a fault occurs in the encoding process, the position of the encoding step with the fault can be located quickly, so that debugging of the communication device based on the encoding step with the fault is facilitated.
In some embodiments, the above data processing method may further include the following first step to second step before receiving the encoded data sent by the communication peer.
First, when the communication equipment is a communication slave equipment, a preset code rate sent by a communication master equipment matched with the communication equipment is received and stored.
In practice, the preset code rate is usually agreed by the communication master device and the communication slave device which are matched for use, and before the opposite-end coded data is transmitted, the communication master device usually needs to send the preset code rate to the communication slave device, so that the communication master device encodes based on the preset code rate, and the communication slave device decodes based on the preset code rate, thereby ensuring the accuracy of data encoding and decoding.
In practice, when the communication device is a communication slave device, the communication device may receive a preset code rate sent by the communication master device, and store the received preset code rate, so as to decode the peer data based on the preset code rate.
And secondly, when the communication equipment is a communication master equipment, determining the target code rate as a preset code rate, and transmitting the preset code rate to a communication slave equipment matched with the communication equipment.
In practice, when the communication device is a communication master device, the communication device may determine the target code rate as a preset code rate, and send the determined preset code rate to a communication slave device that is used in cooperation with the communication device.
In some embodiments, the target code rate may be determined by at least one of:
and determining the default code rate as the target code rate.
Wherein the default code rate is generally a default code rate of the communication device.
In practice, the communication device may determine the default code rate as the target code rate. As an example, the default code rate is 6, which may be regarded as the target code rate, i.e., the target code rate is determined to be 6.
And receiving code rate configuration information input by a user, and determining the code rate configured by the code rate setting information as a target code rate.
The code rate configuration information is information for configuring the code rate. In practice, the implementation form of the code rate configuration information may include a voice form, a text form, a picture form, and the like.
In practice, the execution body may receive the code rate configuration information input by the user, and then determine the code rate configured by the code rate configuration information as the target code rate. As one example, upon receiving code rate configuration information "set code rate to 4" in text form input by a user, the communication device may determine the code rate configured by the code rate configuration information as a target code rate, and determine the target code rate as 4.
In this embodiment, the target code rate may be a default code rate, or a code rate configured by code rate setting information input by a user, so as to determine the target code rate according to actual use requirements.
Referring to fig. 6, fig. 6 is a block diagram of a data processing apparatus 600 according to an embodiment of the present application, including:
a data receiving unit 601, configured to receive peer-to-peer encoded data sent by a communication peer, where the peer-to-peer encoded data is manchester encoded data;
the data decoding unit 602 is configured to determine a decoding rate according to a preset code rate, control a preset decoding circuit to decode the opposite end encoded data according to the decoding rate and a preset encoding and decoding clock, and obtain decoded data, where the decoding rate is used to indicate the number of pulses required for decoding one bit of data, and the preset encoding and decoding clock is a clock generated by a crystal oscillator.
In some embodiments, the apparatus further comprises a data acquisition unit and a data encoding unit (not shown in the figures).
The data acquisition unit is used for acquiring data to be coded;
the data coding unit is used for determining a coding rate according to a preset code rate, controlling a preset coding circuit to code data to be coded according to the coding rate and a preset coding and decoding clock, and obtaining local end coded data, wherein the coding rate is used for indicating the number of pulses required for coding one bit of data.
In some embodiments, the preset decoding circuit in the data decoding unit 602 may include a manchester decoder, a decoding shift register, and a decoding latch, wherein an output terminal of the manchester decoder is connected to an input terminal of the decoding shift register, and an output terminal of the decoding shift register is connected to an input terminal of the decoding latch;
the Manchester decoder is used for decoding the opposite-end coded data according to the decoding rate and a preset coding and decoding clock to obtain decoded data;
the decoding shift register is used for converting the data format of the decoding data into a parallel data format;
the decoding latch is used for latching decoding data in parallel data format.
In some embodiments, the preset encoding circuit in the data encoding unit may include an encoding latch, an encoding shift register, and a manchester encoder, wherein an output terminal of the encoding latch is connected to an input terminal of the encoding shift register, and an output terminal of the encoding shift register is connected to an input terminal of the manchester encoder;
the coding latch is used for latching data to be coded;
the code shift register is used for converting the data format of the latched data to be coded into a serial data format;
The Manchester encoder is used for encoding the data to be encoded in the serial data format according to the encoding rate and a preset encoding and decoding clock to obtain the local end encoded data.
In some embodiments, the decoding statuses of the communication device comprise an initial decoding status, a synchronization header decoding status, and a data decoding status, and the data decoding unit 602 may comprise a first decoding switching module, a second decoding switching module, and a third decoding switching module (not shown in the figure).
The control of the preset decoding circuit to decode the opposite end encoded data according to the decoding rate and the preset encoding and decoding clock to obtain decoded data may include:
a first decoding switching module, configured to switch a decoding state of the communication device from an initial decoding state to a synchronous header decoding state;
the second decoding switching module is used for detecting the synchronous head of the opposite-end coded data according to the decoding rate and a preset encoding and decoding clock when the communication equipment is in the synchronous head decoding state, and switching the decoding state of the communication equipment into a data decoding state if the detected synchronous head is matched with the preset synchronous head;
and the third decoding switching module is used for decoding the opposite-end encoded data according to the decoding rate and a preset encoding and decoding clock when the communication equipment is in a data decoding state to obtain decoded data, and switching the communication equipment from the data decoding state to an initial decoding state.
In some embodiments, the encoding states of the communication device include an initial encoding state, a synchronization header encoding state, and a data encoding state, and the data encoding unit includes a first encoding switching module, a second encoding switching module, and a third encoding switching module (not shown in the figure).
The first coding switching module is used for switching the coding state of the communication equipment from an initial coding state to a synchronous head coding state;
the second code switching module is used for determining the code rate according to the preset code rate when the communication equipment is in the synchronous head coding state, coding the preset synchronous head and switching the coding state of the communication equipment into the data coding state;
and the third code switching module is used for determining the code rate according to the preset code rate when the communication equipment is in the data coding state, coding the data to be coded to obtain the local end coded data, and switching the coding state of the communication equipment to the initial coding state.
In some embodiments, the apparatus further comprises a code rate receiving unit and a code rate transmitting unit (not shown in the figure).
The code rate receiving unit is used for receiving and storing a preset code rate sent by the communication main equipment matched with the communication equipment when the communication equipment is the communication slave equipment;
And the code rate sending unit is used for determining the target code rate as a preset code rate when the communication equipment is a communication master equipment and sending the preset code rate to a communication slave equipment matched with the communication equipment.
In some embodiments, the target code rate in the code rate transmission unit is determined by at least one of:
determining a default code rate as a target code rate;
and receiving code rate configuration information input by a user, and determining the code rate configured by the code rate setting information as a target code rate.
The number supply device provided by the embodiment determines the decoding rate through the preset code rate, and controls the preset decoding circuit to decode the opposite-end coded data sent by the opposite-end communication according to the determined decoding rate and the preset coding and decoding clock generated by the crystal oscillator, so as to obtain decoded data. When decoding the opposite-end coded data, the received opposite-end coded data is decoded based on a stable and accurate preset coding and decoding clock generated by the crystal oscillator, and a decoding clock in the opposite-end coded data is not needed to be decoded, so that the accuracy of the decoded data and the decoding efficiency are improved.
It should be noted that, because the content of information interaction and execution process between the above devices/units is based on the same conception as the embodiment of the data processing method in the present application, specific functions and technical effects thereof may be found in the embodiment of the data processing method, and will not be described herein again.
Referring to fig. 7, fig. 7 is a block diagram of an electronic device 700 according to an embodiment of the present application, where the electronic device 700 includes: at least one processor 701 (only one processor is shown in fig. 7), a memory 702, and a computer program 703, such as a data processing program, stored in the memory 702 and executable on the at least one processor 701. The processor 701, when executing the computer program 703, implements the steps of the embodiments of the respective data processing methods described above. The processor 701 executes the functions of the modules/units in the above-described embodiments of the apparatus, for example, the functions of the data receiving unit 601 to the data decoding unit 602 shown in fig. 6, when executing the computer program 703.
By way of example, the computer program 703 may be partitioned into one or more units, one or more units being stored in the memory 702 and executed by the processor 701 to complete the present application. One or more of the elements may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments describe the execution of the computer program 703 in the electronic device 700. For example, the computer program 703 may be divided into a data receiving unit, a data decoding unit, and specific functions of each unit are described in the above embodiments, which are not described here again.
The electronic device 700 may be a computing device such as an electronic device, a desktop computer, a tablet computer, a cloud electronic device, and a mobile terminal. The electronic device 700 may include, but is not limited to, a processor 701, a memory 702. It will be appreciated by those skilled in the art that fig. 7 is merely an example of an electronic device 700 and is not intended to limit the electronic device 700, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., an electronic device may further include an input-output device, a network access device, a bus, etc.
The processor 701 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital data processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), off-the-shelf programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 702 may be an internal storage unit of the electronic device 700, such as a hard disk or a memory of the electronic device 700. The memory 702 may also be an external storage device of the electronic device 700, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card) or the like, which are provided on the electronic device 700. Alternatively, the memory 702 may include both internal and external storage units of the electronic device 700. The memory 702 is used to store computer programs and other programs and data required by the electronic device 700. The memory 702 may also be used to temporarily store data that has been output or is to be output.
In addition, each functional unit in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated modules, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the flow of the method of the above embodiments, and a computer program that may be implemented by a computer program to instruct related hardware may be stored in a computer readable storage medium, where the computer program when executed by a processor may implement the steps of each of the method embodiments described above. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth. It should be noted that the content of the computer readable medium can be appropriately increased or decreased according to the requirements of the jurisdiction's jurisdiction and the patent practice, for example, in some jurisdictions, the computer readable medium does not include electrical carrier signals and telecommunication signals according to the jurisdiction and the patent practice.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A data processing method applied to a communication device, the method comprising:
receiving opposite end coded data sent by a communication opposite end, wherein the opposite end coded data is Manchester coded data;
determining a decoding rate according to a preset code rate, and controlling a preset decoding circuit to decode the opposite-end encoded data according to the decoding rate and a preset encoding and decoding clock to obtain decoded data, wherein the decoding rate is used for indicating the number of pulses required for decoding one-bit data, and the preset encoding and decoding clock is a clock generated by a crystal oscillator.
2. The data processing method of claim 1, wherein the method further comprises:
acquiring data to be encoded;
and determining a coding rate according to the preset code rate, and controlling a preset coding circuit to code the data to be coded according to the coding rate and the preset coding and decoding clock to obtain local end coded data, wherein the coding rate is used for indicating the number of pulses required for coding one bit of data.
3. The data processing method according to claim 1, wherein the preset decoding circuit includes a manchester decoder, a decoding shift register, and a decoding latch, wherein an output terminal of the manchester decoder is connected to an input terminal of the decoding shift register, and an output terminal of the decoding shift register is connected to an input terminal of the decoding latch;
the Manchester decoder is used for decoding the opposite-end encoded data according to the decoding rate and the preset encoding and decoding clock to obtain decoded data;
the decoding shift register is used for converting the data format of the decoding data into a parallel data format;
the decoding latch is used for latching the decoding data in the parallel data format.
4. The data processing method according to claim 2, wherein the preset encoding circuit includes an encoding latch, an encoding shift register, and a manchester encoder, wherein an output terminal of the encoding latch is connected to an input terminal of the encoding shift register, and an output terminal of the encoding shift register is connected to an input terminal of the manchester encoder;
the coding latch is used for latching the data to be coded;
the code shift register is used for converting the latched data format of the data to be coded into a serial data format;
the Manchester encoder is used for encoding the data to be encoded in the serial data format according to the encoding rate and the preset encoding and decoding clock to obtain the local end encoded data.
5. The data processing method according to claim 1, wherein the decoding states of the communication device include an initial decoding state, a synchronization header decoding state, and a data decoding state, and the controlling the preset decoding circuit decodes the peer-to-peer encoded data according to the decoding rate and a preset codec clock to obtain decoded data, comprising:
Switching the decoding state of the communication device from the initial decoding state to the synchronization header decoding state;
when the communication equipment is in a synchronous head decoding state, synchronous head detection is carried out on the opposite-end coded data according to the decoding rate and the preset encoding and decoding clock, and if the detected synchronous head is matched with the preset synchronous head, the decoding state of the communication equipment is switched to the data decoding state;
when the communication equipment is in the data decoding state, decoding the opposite-end coded data according to the decoding rate and the preset coding and decoding clock to obtain the decoded data, and switching the communication equipment from the data decoding state to the initial decoding state.
6. The method according to claim 2, wherein the encoding states of the communication device include an initial encoding state, a synchronization header encoding state, and a data encoding state, and the controlling the preset encoding circuit encodes the data to be encoded according to the encoding rate and the preset encoding/decoding clock to obtain the local encoded data, includes:
switching the encoding state of the communication device from the initial encoding state to the synchronous head encoding state;
When the communication equipment is in a synchronous head coding state, determining a coding rate according to the preset code rate, coding a preset synchronous head, and switching the coding state of the communication equipment into a data coding state;
when the communication equipment is in a data coding state, determining a coding rate according to the preset code rate, coding the data to be coded to obtain the local end coding data, and switching the coding state of the communication equipment to the initial coding state.
7. The data processing method according to any one of claims 1 to 6, characterized in that before the receiving the encoded data transmitted by the communication partner, the method further comprises:
when the communication equipment is a communication slave equipment, receiving and storing the preset code rate sent by a communication master equipment matched with the communication equipment;
and when the communication equipment is a communication master equipment, determining a target code rate as the preset code rate, and sending the preset code rate to a communication slave equipment matched with the communication equipment.
8. The data processing method of claim 7, wherein the target code rate is determined by at least one of:
Determining a default code rate as the target code rate;
and receiving code rate configuration information input by a user, and determining the code rate configured by the code rate setting information as the target code rate.
9. An electronic device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the data processing method according to any of claims 1-8 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the data processing method according to any one of claims 1-8.
CN202310754511.1A 2023-06-26 2023-06-26 Data processing method, electronic device and storage medium Active CN116506097B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310754511.1A CN116506097B (en) 2023-06-26 2023-06-26 Data processing method, electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310754511.1A CN116506097B (en) 2023-06-26 2023-06-26 Data processing method, electronic device and storage medium

Publications (2)

Publication Number Publication Date
CN116506097A true CN116506097A (en) 2023-07-28
CN116506097B CN116506097B (en) 2023-09-19

Family

ID=87318708

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310754511.1A Active CN116506097B (en) 2023-06-26 2023-06-26 Data processing method, electronic device and storage medium

Country Status (1)

Country Link
CN (1) CN116506097B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5168511A (en) * 1990-10-22 1992-12-01 Berkeley Varitronics Systems, Inc. Manchester data recorder with synchronously adjustable clock
US5687193A (en) * 1995-06-22 1997-11-11 France Telecom Manchester coder/decoder
CN112235218A (en) * 2020-12-15 2021-01-15 广州智慧城市发展研究院 Manchester signal decoding method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5168511A (en) * 1990-10-22 1992-12-01 Berkeley Varitronics Systems, Inc. Manchester data recorder with synchronously adjustable clock
US5687193A (en) * 1995-06-22 1997-11-11 France Telecom Manchester coder/decoder
CN112235218A (en) * 2020-12-15 2021-01-15 广州智慧城市发展研究院 Manchester signal decoding method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
白敏: "面向无线传感平台的无源芯片基带设计与实现", 《中国优秀硕士论文全文数据库(信息科技辑)》 *

Also Published As

Publication number Publication date
CN116506097B (en) 2023-09-19

Similar Documents

Publication Publication Date Title
US9621385B2 (en) Methods and apparatus to reduce signaling power
CN101895549B (en) Conversion gateway and conversion method of vehicle communication network data
CN108777606B (en) Decoding method, apparatus and readable storage medium
US9722717B2 (en) Technologies for ethernet link robustness for deep sleep low power applications
CN116506097B (en) Data processing method, electronic device and storage medium
EP1955470A1 (en) Synchronized receiver
CN112953680A (en) Encoding method, decoding method, encoding device, and decoding device
CN109347605B (en) Encoding method, decoding method and device, and computer readable storage medium
CN110620635A (en) Decoding method, apparatus and readable storage medium
US20200387338A1 (en) Detection method and detection device for audio signal
CN110087080B (en) Decoding method, apparatus and readable storage medium
CN113193873A (en) Encoding method, decoding method, encoding device, and decoding device
CN115061968B (en) Interface processor and interface processing system
US11454943B2 (en) Serial isolation communication method, device and system
CN112118074A (en) Communication method and device
CN108667558B (en) Coding method suitable for transmitting short content
US20110255583A1 (en) Electrical pulse data transmission using a look-up table
CN114124309B (en) Data transmission method and equipment
CN113850098B (en) Data encoding device
CN114124163B (en) Decoding method, device, equipment and storage medium of electronic tag
CN110036596A (en) Phase-shift coding for signal transition minimized
CN112769173A (en) Double-decoding charging control system, control method and electronic equipment
US8175171B2 (en) Transmitter, receiver, transmitting method, receiving method, variable-length serial burst data transfer system, semiconductor device and hybrid semiconductor device
CN113238610A (en) Counter signal synchronization method, device, equipment and storage medium
CN114333857A (en) Data processing method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant