CN114826276B - Manchester decoding method and device and readable storage medium - Google Patents

Manchester decoding method and device and readable storage medium Download PDF

Info

Publication number
CN114826276B
CN114826276B CN202210744335.9A CN202210744335A CN114826276B CN 114826276 B CN114826276 B CN 114826276B CN 202210744335 A CN202210744335 A CN 202210744335A CN 114826276 B CN114826276 B CN 114826276B
Authority
CN
China
Prior art keywords
value
similarity
decoding result
adc
decoding
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.)
Active
Application number
CN202210744335.9A
Other languages
Chinese (zh)
Other versions
CN114826276A (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.)
Qingdao Topscomm Communication Co Ltd
Original Assignee
Qingdao Topscomm Communication 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 Qingdao Topscomm Communication Co Ltd filed Critical Qingdao Topscomm Communication Co Ltd
Priority to CN202210744335.9A priority Critical patent/CN114826276B/en
Publication of CN114826276A publication Critical patent/CN114826276A/en
Application granted granted Critical
Publication of CN114826276B publication Critical patent/CN114826276B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M5/00Conversion of the form of the representation of individual digits
    • H03M5/02Conversion to or from representation by pulses
    • H03M5/04Conversion to or from representation by pulses the pulses having two levels
    • H03M5/06Code representation, e.g. transition, for a given bit cell depending only on the information in that bit cell
    • H03M5/12Biphase level code, e.g. split phase code, Manchester code; Biphase space or mark code, e.g. double frequency code
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0045Arrangements at the receiver end
    • H04L1/0054Maximum-likelihood or sequential decoding, e.g. Viterbi, Fano, ZJ algorithms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L1/00Arrangements for detecting or preventing errors in the information received
    • H04L1/004Arrangements for detecting or preventing errors in the information received by using forward error control
    • H04L1/0056Systems characterized by the type of code used
    • H04L1/0061Error detection codes

Abstract

The application discloses a Manchester decoding method, a Manchester decoding device and a readable storage medium, and relates to the field of electronic information. The Manchester decoding method provided by the application comprises the steps of presetting a preset standard value, receiving metering data fed back by a metering chip, obtaining an ADC (analog to digital converter) value of each carrier cycle according to the metering data, calculating the similarity between the ADC value of each carrier cycle and the preset standard value, and selecting the decoding result of the preset standard value with the highest similarity as the decoding result of the ADC value.

Description

Manchester decoding method and device and readable storage medium
Technical Field
The present application relates to the field of electronic information, and in particular, to a manchester decoding method, apparatus, and readable storage medium.
Background
In recent years, with the increase of the application of electric energy meters, the corresponding electric energy meters need to directly or indirectly interact with an alternating current power grid when metering and communicating devices. In order to ensure the safety of operators and equipment, the industry generally supplies power to the metering and communication module and the main control module independently, and the metering and communication module and the main control module are isolated in various ways at the front stage and the rear stage, so that the normal communication of the front stage and the rear stage is not influenced, and the current is prevented from flowing between the two modules. The isolation methods commonly used at present include optical isolation, magnetic isolation and capacitive isolation.
The existing magnetic isolation data detection usually adopts a Manchester decoding mode, and the current Manchester decoding method usually acquires corresponding ADC data after detecting the rising edge of a carrier, acquires an ADC value of a code element position in a time delay mode, and then acquires a decoding result by evaluating the ADC value.
In view of the above-mentioned technologies, a manchester decoding method with high stability is an urgent problem to be solved by those skilled in the art.
Disclosure of Invention
The application aims to provide a Manchester decoding method, so as to solve the problems that the current Manchester decoding is easily interfered by a magnetic field and the stability is not strong due to low sampling rate.
In order to solve the above technical problem, the present application provides a manchester decoding method applied to a magnetic isolation system, including:
sending an initialization command to a metering chip;
receiving the metering data fed back by the metering chip, and acquiring an ADC (analog to digital converter) value of each carrier period according to the metering data;
respectively carrying out similarity calculation on each ADC value in each carrier period and a preset standard value;
and taking the decoding result corresponding to the preset standard value with the highest similarity of the ADC values as the decoding result of each ADC value.
Preferably, after the step of taking the decoding result corresponding to the preset standard value with the highest similarity of the ADC values as the decoding result of the ADC values, the method further includes:
and completing framing according to the decoding result, and performing frame check to obtain data of each frame, wherein framing is to combine the decoding result by taking the frame as a unit to obtain data of bit bits so as to facilitate data transmission.
Preferably, the calculation of the similarity between each ADC value in each carrier period and a preset standard value is calculated by the following formula:
Figure 838879DEST_PATH_IMAGE001
wherein, a is a value of the similarity, Xrei is reference data corresponding to the preset standard value, and Li is the ith data to be measured (i =1, 2, 3, 4 … … n).
Preferably, the method further comprises the following steps:
and updating the reference data at intervals of a first preset time according to a decoding result and the accuracy.
Preferably, after the step of taking the decoding result corresponding to the preset standard value with the highest similarity of the ADC values as the decoding result of the ADC values, the method further includes:
checking whether the decoding result is correct every second preset time;
and if not, updating the reference data according to a correct decoding result.
Preferably, the calculating the similarity between each ADC value in each carrier period and a preset standard value includes:
respectively carrying out similarity calculation on each ADC value in each carrier period and a standard 01 code to obtain a first similarity value, and carrying out similarity calculation on each ADC value in each carrier period and a standard 10 code to obtain a second similarity value:
the taking the decoding result corresponding to the preset standard value with the highest similarity of the ADC values as the decoding result of the ADC values includes:
confirming the magnitude relation between the first similarity value and the second similarity value;
if the first similarity value is greater than the second similarity value, confirming that the code element in the carrier period is 10 and the decoding result is bit 0;
if the first similarity value is smaller than the second similarity value, the code element in the carrier period is 01, and the decoding result is bit 1.
Preferably, after receiving the metering data fed back by the metering chip, the method further includes:
and if the decoding result is not obtained within the third preset time, controlling an alarm device to alarm.
In order to solve the above problem, the present application also provides a manchester decoding apparatus, including:
the sending module is used for sending an initialization command to the metering chip;
the receiving module is used for receiving the metering data fed back by the metering chip and acquiring an ADC (analog to digital converter) value of each carrier period according to the metering data;
the calculation module is used for calculating the similarity of each ADC value in each carrier period to a preset standard value;
and the decoding module is used for taking a decoding result corresponding to the preset standard value with the highest similarity of the ADC values as a decoding result of each ADC value.
Preferably, the apparatus further comprises:
and the framing module is used for completing framing according to the decoding result, carrying out frame check and obtaining the data of each frame, and framing is to combine the decoding result by taking the frame as a unit to obtain the data of bit so as to facilitate data transmission.
Preferably, the apparatus further comprises:
and the first updating module is used for updating the reference data at intervals of a first preset time according to the decoding result and the accuracy.
Preferably, the apparatus further comprises:
the checking module is used for checking whether the decoding result is correct or not every second preset time, and if not, the second updating module is started;
and the second updating module is used for updating the reference data according to a correct decoding result.
Preferably, the apparatus further comprises:
and the alarm module is used for controlling an alarm device to alarm if the decoding result is not obtained within the third preset time.
In order to solve the above problem, the present application further provides a manchester decoding apparatus, comprising a memory for storing a computer program;
a processor for implementing the steps of the manchester decoding method as described above when executing the computer program.
To solve the above problem, the present application further provides a computer-readable storage medium having stored thereon a computer program, which when executed by a processor implements the steps of the manchester decoding method as described above.
Compared with the prior mode of decoding directly through the ADC value at the rising edge, the method adopts the carrier period as the sampling data of the ADC value, so that more sampling points and higher fault-tolerant rate are obtained, and because the instant bit is interfered, although the sampling data can not be decoded normally, the decoding result of the closest standard value can be obtained according to the similarity, thereby avoiding the problem of decoding error caused by the interference of the bit, the efficiency and stability of decoding are improved.
The manchester decoding device and the computer readable storage medium provided by the application correspond to the manchester decoding method, so that the advantages are the same as the above.
Drawings
In order to more clearly illustrate the embodiments of the present application, the drawings required for the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained by those skilled in the art without inventive effort.
FIG. 1 is a flow chart of a Manchester decoding method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a manchester decoding apparatus according to an embodiment of the present disclosure;
fig. 3 is a structural diagram of a manchester decoding device according to another embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without any creative effort belong to the protection scope of the present application.
The core of the application is to provide a Manchester decoding method so as to solve the problems that the current Manchester decoding is easily interfered by a magnetic field and the stability is not strong due to low sampling rate.
In order that those skilled in the art will better understand the disclosure, the following detailed description is given with reference to the accompanying drawings.
Fig. 1 is a flowchart of a manchester decoding method according to an embodiment of the present disclosure, which is applied to a magnetic isolation system, and as shown in fig. 1, the method includes:
s10: sending an initialization command to a metering chip;
the magnetic isolation system in this embodiment generally refers to a magnetic coupling isolator at a grid connection and a connection thereof, the magnetic coupling isolator is a magnetic coupler based on a chip-size transformer, and unlike a Light Emitting Diode (LED) and a photodiode which are used in a conventional optical coupler, the magnetic isolation technology directly manufactures a transformer on a chip by using a wafer-level process. In magnetic isolation communication, in order to achieve bandwidth and interference resistance, manchester encoding is generally adopted when data are transmitted back from a slave to a host, and the encoding has the following differential characteristics: second-order spread spectrum: bit 1 extends to 0b01 and bit 0 extends to 0b 10. Due to the existence of the exciting current and leakage inductance of the magnetic isolation transformer, the waveform modulated by the slave end can be distorted after being transmitted back to the master end.
In the manchester encoding mode, binary data 0 and 1 are represented by edges of a signal, for example, an upper edge of the signal represents 1, a lower edge of the signal represents 0, and such a transition generally occurs in the middle of a bit frame, in this embodiment, the type of the magnetic isolation system itself is not limited, and data of specific code bits in manchester decoding is not limited, and a general binary period may be 11, 10, 01, 00, and the like.
It should be noted that, in this embodiment, a specific type of the metering chip is not limited, and it is understood that the metering chip is an acquisition device for acquiring and acquiring a carrier frequency in this application, since an execution main body in this embodiment is a single chip, an initialization command is generally sent from the single chip to the metering chip, and then since one cycle of a general decoded carrier includes a rising edge and a falling edge at the same time, it is preferable to adopt 01 and 10 as basic codes, the metering chip will first return 16 01 and 16 10, and the reference value is obtained by averaging after the single chip receives the result.
S11: receiving metering data fed back by the metering chip, and acquiring an ADC (analog to digital converter) value of each carrier cycle according to the metering data;
it should be noted that, in this embodiment, how to obtain the metering data and the specific type of the metering data are not limited, and an Analog-to-Digital Converter (ADC) value, that is, a Digital-to-Analog value counted for the carrier fed back by the metering chip, may be simply understood as periodic transformation data of the carrier frequency.
S12: respectively carrying out similarity calculation on each ADC value in each carrier period and a preset standard value;
it should be noted that, in this embodiment, a specific calculation method of the similarity is not limited, for example, a mean value may be calculated according to ADC values in each carrier period, or a corresponding carrier waveform may be plotted to perform the similarity calculation, a preset standard value in this embodiment, that is, a decoding result corresponding to a standard ADC value obtained by the single chip according to data fed back by the metering chip, and in this embodiment, an acquisition method of the preset standard value, a specific numerical value, and the like are not limited.
It is understood that the preset standard value may be obtained by decoding the periodic data of the standard 01, 10, etc. by using manchester decoding after receiving the feedback data of the metering chip, and therefore, the similarity value is obtained by comparing the periodic data of the different standard 01, 10, etc. based on the similarity calculation.
S13: and taking the decoding result corresponding to the preset standard value with the highest similarity of the ADC values as the decoding result of each ADC value.
It can be understood that, since neither the preset standard value nor the ADC value is defined in this embodiment, the obtained decoding result with the highest similarity is the standard value with the closest ADC value, so that the standard value is used as the final decoding result, and the obtained decoding result in this embodiment is the decoding result of one period, and the manner of obtaining the decoding result of each frame bit by subsequent obtaining is not specifically defined, and it is conceivable that the decoding result of each frame bit can be decomposed by using the decoding result of the period.
Compared with the prior mode of decoding by directly using the ADC value at the rising edge, because the carrier period is used as the sampling data of the ADC value, the sampling points are more, the fault-tolerant rate is higher, and because the instant bit is interfered, although the sampling data can not be normally decoded, the decoding result of the closest standard value can be obtained according to the similarity, the problem of decoding error caused by the fact that the bit is interfered is avoided, the efficiency and stability of decoding are improved.
Considering that a decoding result of each frame bit needs to be obtained in the data judgment, a preferred scheme is provided herein, and after taking a decoding result corresponding to a preset standard value with the highest similarity of each ADC value as a decoding result of each ADC value, the method further includes:
and finishing framing according to the decoding result, performing frame verification, and acquiring data of each frame, wherein frame blocking is to combine the decoding result by taking the frame as a unit.
Framing, i.e. combining related information data together into data which can be transmitted over the network, then passing through a link layer to a physical layer, and finally sending out the data in a bit mode, wherein the Frame data on the network is transmitted in a small unit called a Frame (Frame), the Frame is composed of a plurality of parts, and different parts execute different functions. The frame is shaped by a specific software called a network driver, sent to the network cable through the network card, and arrives at the destination machine through the network cable, and the reverse process is performed at one end of the destination machine. The ethernet card of the receiving end machine captures these frames and tells the operating system that the frame has arrived and then stores it. It can be understood that the execution subject in this embodiment is a single chip, the target machine is a terminal of the whole grid-connected system, the specific manner of framing is not limited in this embodiment, and it can be understood that
Frame checking is one of the most commonly used error checking methods in the field of data communications. A frame of data is treated as a long binary number (for example, a piece of 128-byte information is treated as a 1024-bit binary number), then the data is processed by a specified method, a plurality of specific numbers are obtained as a processing result, finally the specific numbers are attached to an information code as a check code and then transmitted (or stored) together as a frame, the same processing is carried out when receiving (or reading) is carried out, and whether the specific numbers and the check code obtained by the check processing are the same or not can be found whether an error occurs in the transmission (or storage) process. The most used method for frame checking is accumulation and check and cyclic redundancy check. The specific manner adopted for frame verification in this embodiment is not limited.
In the embodiment, a frame check and framing manner is adopted for subsequent data processing, so that the processed periodic data is changed from a period unit to a frame unit, and the accuracy of frame data is guaranteed through the frame check under the condition of guaranteeing the integrity of the data.
Preferably, the similarity calculation of each ADC value in each carrier period and the preset standard value is calculated by the following formula:
Figure 184410DEST_PATH_IMAGE002
wherein, a is a value of the similarity, Xrei is reference data corresponding to a preset standard value, and Li is ith data to be measured (i =1, 2, 3, 4 … … n).
It should be noted that, in this embodiment, a specific numerical value of i, that is, the number of set reference data and the specific number of acquired data to be detected are not limited, and it can be understood that a specific method for calculating similarity is provided in this embodiment, so that stability of obtaining a standard calculation code with the highest similarity to each carrier cycle is stronger, and an obtained decoding result is more accurate.
Considering dynamic changes due to grid connection and dynamic changes of a magnetic isolation system, a preferable scheme is provided, and the method further comprises the following steps:
and updating the reference data at intervals of a first preset time according to the decoding result and the accuracy.
It should be noted that, in this embodiment, a specific duration of the first preset time is not limited, and it may be understood that after the decoding result is obtained, the decoding result obtained through calculation may be manually compared with the decoding result obtained through calculation of the obtained data, so as to obtain the accuracy of decoding, therefore, dynamic updating of the reference data is guaranteed at intervals of the first preset time, and the updated standard generally uses the previous decoding data and the corresponding decoding result as a reference, so as to ensure the accuracy of the decoding result.
In the foregoing embodiment, it is proposed that the reference value is dynamically updated at intervals with respect to the accuracy of the decoding result, and considering whether the decoding result is accurate or not in real time, a preferable scheme is proposed herein, and after taking the decoding result corresponding to the preset reference value with the highest similarity of each ADC as the decoding result of each ADC, the method further includes:
checking whether the decoding result is correct every second preset time;
if not, updating the reference data according to the correct decoding result.
That is, when it is detected that the decoding result is incorrect, the decoding result is corrected, and the reference data is updated according to the correct decoding result, so that the accuracy of the obtained decoding result is ensured.
The above embodiment does not limit the specific calculation method of the similarity, and a preferable scheme is proposed herein, in which calculating the similarity between each ADC value in each carrier period and a preset standard value includes:
respectively carrying out similarity calculation on each ADC value in each carrier period and a standard 01 code to obtain a first similarity value, and carrying out similarity calculation on each ADC value in each carrier period and a standard 10 code to obtain a second similarity value:
the step of taking the decoding result corresponding to the preset standard value with the highest similarity of each ADC value as the decoding result of each ADC value comprises the following steps:
confirming the magnitude relation between the first similarity value and the second similarity value;
if the first similarity value is larger than the second similarity value, confirming that the code element in the carrier period is 10 and the decoding result is bit 0;
if the first similarity value is smaller than the second similarity value, the symbol in the carrier period is 01, and the decoding result is bit 1.
It can be understood that, since a rising edge and a falling edge exist in one period of a normal carrier at the same time, and generally one rising edge and one falling edge are one period, a general symbol is two bits and no consideration is needed for the case of 11 or 10, specific data corresponding to bit 0 and bit 1 are related to a carrier in the carrier period, that is, the obtained specific bit 0 indicates that the rising edge is followed by the falling edge, and bit 1 is opposite, by using the above case, a carrier decoding result of a base standard can be obtained more simply, thereby ensuring the accuracy and the calculation efficiency of the obtained decoding result.
In view of the problem that processing is not timely or the metering data is not processed due to the possible fault of the single chip microcomputer, the preferable scheme is provided, and after the metering data fed back by the metering chip is received, the method further comprises the following steps:
and if the decoding result is not obtained within the third preset time, controlling an alarm device to alarm.
It should be noted that, in this embodiment, the specific time length of the third preset time is not limited, and the specific type of the alarm device is not limited, and may be a buzzer, a warning light, and the like.
In the above embodiments, the manchester decoding method is described in detail, and the present application also provides embodiments corresponding to the manchester decoding apparatus. It should be noted that the present application describes the embodiments of the apparatus portion from two perspectives, one from the perspective of the function module and the other from the perspective of the hardware.
Fig. 2 is a schematic diagram of a manchester decoding apparatus according to an embodiment of the present disclosure, the apparatus including:
a sending module 10, configured to send an initialization command to a metering chip;
the receiving module 11 is configured to receive metering data fed back by the metering chip, and obtain an ADC value of each carrier period according to the metering data;
the calculating module 12 is configured to perform similarity calculation on each ADC value in each carrier period respectively according to a preset standard value;
the decoding module 13 is configured to use a decoding result corresponding to the preset standard value with the highest similarity of each ADC as a decoding result of each ADC.
Preferably, the apparatus further comprises:
and the framing module is used for completing framing according to the decoding result, carrying out frame check and obtaining the data of each frame, and framing is to combine the decoding result by taking the frame as a unit to obtain the data of bit so as to facilitate data transmission.
Preferably, the apparatus further comprises:
and the first updating module is used for updating the reference data according to the decoding result and the accuracy rate at intervals of a first preset time.
Preferably, the apparatus further comprises:
the checking module is used for checking whether the decoding result is correct or not every second preset time, and if not, the second updating module is started;
and the second updating module is used for updating the reference data according to the correct decoding result.
Preferably, the apparatus further comprises:
and the alarm module is used for controlling the alarm device to alarm if the decoding result is not obtained within the third preset time.
Since the embodiment of the apparatus portion and the embodiment of the method portion correspond to each other, please refer to the description of the embodiment of the method portion for the embodiment of the apparatus portion and the corresponding beneficial effects, which is not repeated herein.
Fig. 3 is a structural diagram of a manchester decoding apparatus according to another embodiment of the present application, and as shown in fig. 3, the manchester decoding apparatus includes: a memory 20 for storing a computer program;
a processor 21 for implementing the steps of the manchester decoding method as mentioned in the above embodiments when executing the computer program.
The manchester decoding device provided by the embodiment may include, but is not limited to, a smart phone, a tablet computer, a notebook computer, a desktop computer, or the like.
The processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and the like. The Processor 21 may be implemented in at least one hardware form of Digital Signal Processor (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 21 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 21 may be integrated with a Graphics Processing Unit (GPU), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 21 may further include an Artificial Intelligence (AI) processor for processing computing operations related to machine learning.
The memory 20 may include one or more computer-readable storage media, which may be non-transitory. Memory 20 may also include high speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used for storing the following computer program 201, wherein after being loaded and executed by the processor 21, the computer program can implement the relevant steps of the manchester decoding method disclosed in any one of the foregoing embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202, data 203, and the like, and the storage manner may be a transient storage manner or a permanent storage manner. Operating system 202 may include, among others, Windows, Unix, Linux, and the like. Data 203 may include, but is not limited to, data involved in manchester decoding methods, and the like.
In some embodiments, the Manchester decoding apparatus may further include a display 22, an input/output interface 23, a communication interface 24, a power supply 25, and a communication bus 26.
Those skilled in the art will appreciate that the structure shown in fig. 3 does not constitute a limitation of the manchester decoding apparatus and may include more or fewer components than those shown.
The manchester decoding device provided by the embodiment of the application comprises a memory and a processor, wherein when the processor executes a program stored in the memory, the following method can be realized: the manchester decoding method according to the above embodiment.
Since the embodiment of the apparatus portion and the embodiment of the method portion correspond to each other, reference is made to the description of the embodiment of the method portion for the embodiment of the apparatus portion and the corresponding advantageous effects, which are not repeated herein.
Finally, the application also provides a corresponding embodiment of the computer readable storage medium. The computer-readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps as set forth in the above-mentioned method embodiments.
It is to be understood that if the method in the above embodiments is implemented in the form of software functional units and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium and executes all or part of the steps of the methods described in the embodiments of the present application, or all or part of the technical solutions. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, an optical disk, or other various media capable of storing program codes.
Since the embodiment of the readable storage medium portion corresponds to the embodiment of the method portion, reference is made to the description of the embodiment of the method portion for the embodiment of the apparatus portion and the corresponding advantageous effects thereof, which are not repeated herein.
The manchester decoding method, the manchester decoding device and the readable storage medium provided by the application are described in detail above. The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, without departing from the principle of the present application, the present application can also make several improvements and modifications, and those improvements and modifications also fall into the protection scope of the claims of the present application.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (9)

1. A Manchester decoding method is applied to a magnetic isolation system and comprises the following steps:
sending an initialization command to a metering chip;
receiving the metering data fed back by the metering chip, and acquiring an ADC (analog to digital converter) value of each carrier period according to the metering data;
respectively carrying out similarity calculation on each ADC value in each carrier period and a preset standard value;
taking the decoding result corresponding to the preset standard value with the highest similarity of the ADC values as the decoding result of each ADC value; the preset standard value is a decoding result corresponding to a standard ADC value obtained by the singlechip according to the metering data fed back by the metering chip;
the calculating the similarity between each ADC value in each carrier period and a preset standard value includes:
respectively carrying out similarity calculation on each ADC value in each carrier period and a standard 01 code to obtain a first similarity value, and carrying out similarity calculation on each ADC value in each carrier period and a standard 10 code to obtain a second similarity value:
the taking the decoding result corresponding to the preset standard value with the highest similarity of the ADC values as the decoding result of the ADC values includes:
confirming the magnitude relation of the first similarity value and the second similarity value;
if the first similarity value is greater than the second similarity value, confirming that the code element in the carrier period is 10 and the decoding result is bit 0;
if the first similarity value is smaller than the second similarity value, the code element in the carrier period is 01, and the decoding result is bit 1.
2. The manchester decoding method according to claim 1, wherein after the decoding result corresponding to the preset standard value with the highest similarity of the ADC values is taken as the decoding result of each ADC value, the method further comprises:
and completing framing according to the decoding result, and performing frame check to obtain data of each frame, wherein framing is to combine the decoding result by taking the frame as a unit to obtain data of bit bits so as to facilitate data transmission.
3. The manchester decoding method according to claim 2, wherein the calculating the similarity between each ADC value in each carrier period and a preset standard value is calculated by the following formula:
A=∑|X rei -L i |
wherein A is a value of similarity, X rei Is the reference data corresponding to the preset standard value L i The ith data to be measured (i ═ 1, 2, 3, 4 … … n).
4. The manchester decoding method according to claim 3, further comprising:
and updating the reference data at intervals of a first preset time according to a decoding result and the accuracy.
5. The manchester decoding method according to claim 3, wherein after the decoding result corresponding to the preset standard value with the highest similarity of the respective ADC values is taken as the decoding result of the respective ADC values, the method further comprises:
checking whether the decoding result is correct every second preset time;
and if not, updating the reference data according to a correct decoding result.
6. The Manchester decoding method according to any one of claims 1 to 5, further comprising, after receiving the metrology data fed back by the metrology chip:
and if the decoding result is not obtained within the third preset time, controlling an alarm device to alarm.
7. A manchester decoding apparatus, comprising:
the sending module is used for sending an initialization command to the metering chip;
the receiving module is used for receiving the metering data fed back by the metering chip and acquiring the ADC value of each carrier cycle according to the metering data;
the calculation module is used for calculating the similarity of each ADC value in each carrier period to a preset standard value; the preset standard value is a decoding result corresponding to a standard ADC value obtained by the singlechip according to the metering data fed back by the metering chip;
the decoding module is used for taking a decoding result corresponding to the preset standard value with the highest similarity of the ADC values as a decoding result of each ADC value;
the calculation module is specifically configured to perform similarity calculation on each ADC value in each carrier cycle and a standard 01 code to obtain a first similarity value, and perform similarity calculation on each ADC value in each carrier cycle and a standard 10 code to obtain a second similarity value:
the decoding module is specifically configured to confirm a magnitude relationship between the first similarity value and the second similarity value; if the first similarity value is greater than the second similarity value, confirming that the code element in the carrier period is 10 and the decoding result is bit 0; if the first similarity value is smaller than the second similarity value, the code element in the carrier cycle is 01, and the decoding result is bit 1.
8. A manchester decoding apparatus comprising a memory for storing a computer program;
a processor for implementing the steps of the manchester decoding method as claimed in claim 1 when executing the computer program.
9. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the manchester decoding method as claimed in claim 1.
CN202210744335.9A 2022-06-29 2022-06-29 Manchester decoding method and device and readable storage medium Active CN114826276B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210744335.9A CN114826276B (en) 2022-06-29 2022-06-29 Manchester decoding method and device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210744335.9A CN114826276B (en) 2022-06-29 2022-06-29 Manchester decoding method and device and readable storage medium

Publications (2)

Publication Number Publication Date
CN114826276A CN114826276A (en) 2022-07-29
CN114826276B true CN114826276B (en) 2022-09-30

Family

ID=82522710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210744335.9A Active CN114826276B (en) 2022-06-29 2022-06-29 Manchester decoding method and device and readable storage medium

Country Status (1)

Country Link
CN (1) CN114826276B (en)

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0768803A1 (en) * 1995-10-11 1997-04-16 Philips Electronique Grand Public Scanning protocol for control signals in a cordless telephone
CN104424450B (en) * 2013-08-19 2017-05-17 福建升腾资讯有限公司 Magnetic-card decoding method based on ADC pin sampling
KR102031598B1 (en) * 2016-08-05 2019-11-08 선전 구딕스 테크놀로지 컴퍼니, 리미티드 Signal transmission method and apparatus
CN108667757A (en) * 2017-03-27 2018-10-16 航天信息股份有限公司 Manchester code sampling processing method, module and decoder

Also Published As

Publication number Publication date
CN114826276A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN109981617A (en) A kind of internet of things equipment monitoring method, system and electronic equipment and storage medium
CN105204968B (en) A kind of failure memory detection method and device
CN109376758B (en) Pattern-based component identification method, system, device and storage medium
CN109611815B (en) Energy consumption alarm management method and device for gas steam boiler
CN107147553A (en) Method of adjustment, adjusting apparatus and the adjusting device of slave station baud rate and frame format
CN104330990A (en) Parity check cable model identification method and device thereof
CN115794578A (en) Data management method, device, equipment and medium for power system
CN114826276B (en) Manchester decoding method and device and readable storage medium
CN109426598A (en) A kind of hard disk state indicator lamp control method and device
CN111475186A (en) Firmware upgrading method, device, equipment and medium based on BMC
CN106815772A (en) Electric power data report method and device
CN109901551A (en) Information acquisition method, information acquisition device and the terminal device of industrial control equipment
CN113590287B (en) Task processing method, device, equipment, storage medium and scheduling system
CN114090119A (en) Control flow checking method, device, equipment and storage medium
CN112732842A (en) Data processing method and system based on environment big data, electronic device and medium
CN113240076A (en) Clock error abnormal data detection method based on clustering and neural network algorithm
CN108269004B (en) Product life analysis method and terminal equipment
CN110297794A (en) Data communication system and method
CN113517989B (en) Resource charging method and device for IaaS cloud platform
CN104333479A (en) Server power connection relation detecting method and detecting system
CN111934910B (en) Fault processing method, equipment and storage medium
CN117591983B (en) Multi-index anomaly detection method and device, electronic equipment and storage medium
CN111143776B (en) Electric quantity load prediction method and device
CN115758076A (en) Electricity stealing suspected user label generation method and device, electronic equipment and storage medium
CN117609801A (en) Data comparison method, device, equipment and medium

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