Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without creative efforts, shall fall within the protection scope of the present invention.
In existing serial data coding mode, most common mBnB encodes (m<N) it is to combine analog link physics special
Property on the basis of, m bit data encodings at n bit, coded data includes abundant timing information, is conducive to the same of receiving terminal
Step decoding.However, mBnB encoding and decoding principle and its realization are relative complex, and the physics of power electronic system fiber optic communication is unique
Property, coded pattern is required relatively low.Therefore, for power electronic system fiber optic communication application, mBnB is not optimum code pattern.
MB1C codes are less in communicating dedicated serial codec to make because its analog line adaptability is good not as good as mBnB codes
With.For pure fibre circuit, requirement of the physical link to line code reduces, and mB1C codes are retaining the same of good synchronizing characteristics
When, it realizes relatively easy.On this basis, the embodiment of the present invention proposes a kind of decoding method, for realizing reliable efficient
Data transmission, to adapt to the power electronic system period demand for control of high switching frequency, hard real-time.
Fig. 1 is a kind of flow diagram of coding method of the embodiment of the present invention, as shown in Figure 1, a kind of being used for transmitting terminal
Coding method, including:
101, original parallel data are split into the first code character of several predetermined bit length.
Specifically, original parallel data to be encoded are split into n the first code characters by transmitting terminal, and every 1 first code character includes
The information code of the original parallel data of predetermined bit.For example, original parallel data are the parallel data of 32bit, predetermined bit is long
Degree is 4bit, the parallel data of above-mentioned 32bit is split as 8 the first code characters, every 1 first code character includes 4bit source information codes.
102, mB1C coding principles are based on, the second code character of structure is corresponded to according to any first code character.
Specifically, mB1C coding principles are the addition 1bit complement codes after m bit original parallel data, form one group of coded number
According to.1bit complement codes can be derived from any one position in m bit data.In the embodiment of the present invention, by the first code character of every m bit
In presetting digit capacity numerical value as complement code, add after first code character, constitute the second code character of m+1bit.The present invention is implemented
In example, by the radix-minus-one complement of the end data of the first code character, as complement code addition after the first code character.It is carried out based on mB1C coding principles
Coding, data encoding efficiency are m/ (m+1).With the increase of m values, code efficiency approach 100%.
103, according to corresponding the second code character of whole of the original parallel data, obtain check code, and by the whole the
It is used as coded data packet after two code characters and check code splicing.
Specifically, the check code is parity check code.
Transmitting terminal splices the second code character of above-mentioned whole after obtaining check code, and by check code setting the last one the
Behind two code characters, a coded data packet being made of n the second code characters and a check bit is formed.
Fig. 2 is a kind of structural schematic diagram of coded data packet of the embodiment of the present invention, as shown in Fig. 2, the coded data
Packet is made of n the second code characters and a check code, wherein predetermined bit length is m bit, and every 1 second code character is m+
The preceding m bit of 1bit, every 1 second code character are corresponding first code character, and m+1bit is the corresponding radix-minus-one complement of m bit data.
It in the embodiment of the present invention, is encoded, is remained in optical fiber physical link good based on mB1C coding principles
While synchronizing characteristics, realization is relatively easy, and code efficiency is high, disclosure satisfy that the power electronics of high switching frequency, hard real-time
System requirements.
Based on any of the above-described embodiment, Fig. 3 is a kind of structural schematic diagram of coded system of the embodiment of the present invention, such as Fig. 3
It is shown, a kind of coded system, including:
Split cells 301, the first code character for original parallel data to be split into several predetermined bit length.
Coding unit 302, for being based on mB1C coding principles, by adding complement code structure after any first code character
Corresponding second code character;The complement code is the radix-minus-one complement of the last digit evidence of any first code character.
Generation unit 303, for according to corresponding the second code character of whole of the original parallel data, obtaining check code, and
By the coded data packet as the original parallel data after the second code character of the whole and check code splicing;The check code is
Parity check code.
It should be noted that above-mentioned split cells 301, coding unit 302 and the cooperation of generation unit 303 are to execute above-mentioned reality
A kind of coding method in example is applied, the concrete function of the system is referring to the embodiment of above-mentioned coding method, and details are not described herein again.
In the embodiment of the present invention, serial mode coding is carried out based on mB1C coding principles, is retained in optical fiber physical link
While good synchronizing characteristics, realize relatively easy, code efficiency is high, disclosure satisfy that high switching frequency, hard real-time
Power electronic system demand.
For above-mentioned coding method, the present invention also proposes a kind of coding/decoding method, is compiled by above-mentioned coding method for decoding
The coded data packet of code obtains data to be encoded.
Fig. 4 is a kind of flow diagram of coding/decoding method of the embodiment of the present invention, as shown in figure 4, a kind of being directed to receiving terminal
Coding/decoding method, including:
401, all the second code characters are extracted from coded data packet, and solution code check is obtained according to the second code character of above-mentioned whole
Code.
Specifically, receiving terminal is based on the check code algorithm in cataloged procedure, according to whole second codes in coded data packet
Group obtains corresponding decoding check code.In the embodiment of the present invention, the checking algorithm that transmitting terminal uses when encoding is even-odd check,
Then receiving terminal equally applies even-odd check to obtain decoding check code.
402, if the decoding check code is consistent with the check code extracted from the coded data packet, compiled based on mB1C
Code principle, is decoded every 1 second code character, obtains the first code character and decoding radix-minus-one complement of corresponding predetermined bit length.
Specifically, receiving terminal is calculated to the decoding check code obtained directly to extract most from coded data packet with receiving terminal
Latter bit check code is compared:If it is consistent with the check code extracted from coded data packet to decode check code, receiving terminal
Confirm that currently received coded data packet is correct, executes decoding operate;Otherwise, receiving terminal confirms currently received coded data packet
It is wrong.
Specific decoding operate is based on mB1C coding principles, and mB1C coding principles are added after m bit original parallel data
Add 1bit complement codes, forms one group of coded data.1bit complement codes can be derived from any one position in m bit data.The present invention is implemented
In example, 1bit complement codes are derived from last position in m bit data, and the last bit complement of every 1 second code character is removed, and obtain each
Corresponding first code character of second code character.Herein, the last bit complement of the every 1 second code character i.e. corresponding decoding radix-minus-one complement of second code character.
403, if the end data inversion of each the decoding radix-minus-one complement and corresponding first code character, splice all described the
One code character obtains original parallel data.
Specifically, under the premise of original parallel data being split as several first code characters in an encoding process, will pass through
Several first code characters that 402 steps obtain are spliced again, restore original parallel data.
In the embodiment of the present invention, coded data packet is decoded based on mB1C coding principles, in optical fiber physical link
While remaining good synchronizing characteristics, realization is relatively easy, and code efficiency is high, disclosure satisfy that high switching frequency, hard real time
The power electronic system demand of property.
Based on any of the above-described embodiment, Fig. 5 is a kind of structural schematic diagram of decoding system of the embodiment of the present invention, such as Fig. 5
It is shown, a kind of decoding system, including:
Second verification unit 501, for extracting all the second code characters from coded data packet, and according to above-mentioned whole second codes
Group obtains decoding check code;
Judging unit 502, if consistent with the check code extracted from the coded data packet for the decoding check code,
Then be based on mB1C coding principles, every 1 second code character is decoded, obtain corresponding predetermined bit length the first code character and
Decode radix-minus-one complement;
Decoding unit 503, if the end data inversion for each the decoding radix-minus-one complement and corresponding first code character, is spelled
All first code characters are connect, original parallel data are obtained.
It should be noted that above-mentioned second verification unit 501, judging unit 502 and decoding unit 503 coordinate on to execute
State a kind of coding/decoding method in embodiment, the concrete function of the system referring to above-mentioned coding/decoding method embodiment, herein no longer
It repeats.
In the embodiment of the present invention, coded data packet is decoded based on mB1C coding principles, in optical fiber physical link
While remaining good synchronizing characteristics, realization is relatively easy, and code efficiency is high, disclosure satisfy that high switching frequency, hard real time
The power electronic system demand of property.
For above-mentioned decoding method, the present invention also proposes a kind of communication means, is based on above-mentioned decoding method into line number
According to transmission.
Based on any of the above-described embodiment, Fig. 6 is a kind of communication means of the embodiment of the present invention, as shown in fig. 6, one kind is directed to
The communication means of transmitting terminal, including:601, information to be sent is divided into several data to be encoded, based on above-mentioned coding method
Each data to be encoded are encoded respectively, obtain the corresponding coded data packet of each data to be encoded;
602, all coded data packets are packaged into default frame and sent, so that receiving terminal can be based on above-mentioned
Coding/decoding method is decoded each coded data packet after the default frame decapsulation, obtains each coded data packet and correspond to
Data to be encoded, thus obtain the information to be sent.
It in the embodiment of the present invention, is communicated, is realized opposite by the coded data packet built based on mB1C coding principles
Simply, code efficiency is high, disclosure satisfy that the power electronic system demand of high switching frequency, hard real-time.In addition, self-defined frame lattice
The communication means of formula effectively reduces the complexity of optical fiber physical link communication, improves the reliability of data transmission.
Based on any of the above-described embodiment, Fig. 7 is a kind of structural schematic diagram of default frame of the embodiment of the present invention, such as Fig. 7 institutes
Show, a kind of communication means, the default frame includes synchronizing frame head, standard time clock, address coding data packet, information coding data packet
With end postamble;Wherein, the frequency of the standard time clock is the transmission frequency and code clock frequency of serialized encoded data;
The standard time clock is used to transmit decoding clock information to receiving terminal, so that receiving terminal can adaptively be carried from standard time clock
Clock information is taken, and synthesizes the decoding clock of same frequency according to clock information;Described information coded data packet is by all to be encoded
The corresponding coded data packet of data is constituted.
Specifically, optic communication links are low level " 0 " in Idle state, and synchronizing frame head is the high electricity of the first predetermined bit
Flat " 1 ", the starting as default frame.Standard time clock is the second predetermined bit pulse signal, for indicating to decode to receiving terminal
Clock information so that receiving terminal can from standard time clock extracted in self-adaptive clock information, identify the frequency of tranmitting data register, obtain
The traffic rate of present frame is obtained, and then in the decoding clock of locally generated same frequency.Address coding data packet is according to above-mentioned
The coded data packet for including source address and destination address of coding method coding in one embodiment.Information coding data packet is
According to the coding method of any of the above-described embodiment coding include information to be sent at least one coded data packet, wherein
Each coded data packet in information coding data packet corresponds to each data to be encoded in information to be sent.Herein, information is compiled
In code data packet, the quantity of coded data packet is related with the classification of information to be sent and quantity.It is the first default ratio to terminate postamble
Special low level " 0 ", the ending as default frame.It should be noted that synchronizing frame head and the bit number phase shared by end postamble
Together, and synchronizing frame head should be greater than the bit number shared by the second code character of coded data packet with the bit number shared by end postamble.
It should be noted that each coded data packet is to be encoded according to above-mentioned coding method in information coding data packet
Data packet, the complement code that every 1 second code character includes in each coded data packet can be used for when receiving terminal is to being based on standard
Being corrected for the decoding clock that clock obtains, is caused with the frequency difference or line-hit of eliminating the system clock of transmitting terminal and receiving terminal
Accumulated error, and then ensure the decoded correctness of serial data.
In the embodiment of the present invention, gives and coded data packet is applied to the concrete structure that data transmission presets frame, help
In the power electronic system demand for meeting high switching frequency, hard real-time.
Based on any of the above-described embodiment, Fig. 8 is that the data of the embodiment of the present invention preset frame and the structure of the default frame of order is shown
It is intended to, as shown in figure 8, a kind of communication means, the information to be sent is data information or command information;It pending delivers letters if described
Breath is data information, and the data information includes data amount check and corresponding data several parallel data words, then described information is compiled
Code data packet is made of first coding data packet and several second coded data packets of corresponding data;Wherein, first coding
Data packet is the corresponding coded data packet of the data amount check;Second coded data packet is any parallel data word pair
The coded data packet answered, second coded data packet correspond to a parallel data word;Believe if the information to be sent is order
Breath, then described information coded data packet is made of third coded data packet, and the third coded data packet is the command information
Corresponding coded data packet.
Specifically, if information to be sent is data information, the corresponding default frame generated is that data preset frame.With reference in figure 8
Data preset the structure of frame, it is known that, data preset the information coding data packet of frame by a first coding data packet and n second
Data packet is constituted, wherein n is the number for the data to be encoded that information to be sent is split, i.e. data amount check in data information.This
Place, first coding data packet and the second coded data packet are encoded by the coding method in above-described embodiment.Thus, data
The default corresponding information coding data packet of frame is made of n+1 coded data packet.
If information to be sent is command information, the corresponding default frame generated is that frame is preset in order.It is default with reference to being ordered in figure 8
The structure of frame, it is known that, order the information coding data packet, that is, third coded data packet for presetting frame, the corresponding order of each order
Default frame, it includes a third coded data packet that frame is preset in each order.
It should be noted that identifying that currently received default frame is that data preset frame or order is pre- for the ease of receiving terminal
If frame, presets frame with the corresponding data of adaptive decoding or frame is preset in order, data preset the first coding data packet and life of frame
Enable the third coded data packet bit wide having the same for presetting frame.
In the embodiment of the present invention, the format difference that data preset frame and frame is preset in order is given, is contributed to more efficiently
Efficiently communicated.
Based on any of the above-described embodiment, a kind of communication means, the first information and the third of the first coding data packet are compiled
Information, the control information are used to indicate the type of information to be sent to the first information of code data packet in order to control.
Specifically, identify that currently received default frame is that data preset frame or frame is preset in order for the ease of receiving terminal,
Frame is preset with the corresponding data of adaptive decoding or frame is preset in order, and transmitting terminal is when generating default frame, by the first coding
Information in order to control is arranged in the first information of data packet and third coded data packet so that the first place of the first coding data packet of generation
The first information reverse phase of information and third coded data packet, and default frame of reception is distinguished with this.Herein, the first coding
The control information of data packet can be " 0 " or " 1 ", and the control information of corresponding third coded data packet can be " 1 " or " 0 ".
For example, in the corresponding default frame of setting data information, the control information of first coding data packet is " 1 ", order letter
It ceases in corresponding default frame, the control information of third coded data packet is " 0 ".Receiving terminal is in decoding, the information coding of acquisition
It is " 1 " that the first information of data packet, which controls information, then it is assumed that the default frame received is that data preset frame, and the information of acquisition is compiled
It is " 0 " that the first information of code data packet, which controls information, then it is assumed that the default frame received is that information presets frame.
Based on any of the above-described embodiment, Fig. 9 is a kind of structural schematic diagram of communication system of the embodiment of the present invention, such as Fig. 9
It is shown, a kind of communication system, including:
First communication unit 901, for information to be sent to be divided into several data to be encoded, based on above-mentioned coding staff
Method respectively encodes each data to be encoded, obtains the corresponding coded data packet of each data to be encoded.
Second communication unit 902, for all coded data packets to be packaged into default frame and send, so that receiving
End can be decoded each coded data packet after the default frame decapsulation, obtained every based on above-mentioned coding/decoding method
Thus the corresponding data to be encoded of one coded data packet obtain the information to be sent.
It should be noted that the cooperation of 901 and second communication unit 902 of above-mentioned first communication unit is to execute above-described embodiment
In a kind of communication means, the concrete function of the system is referring to the embodiment of above-mentioned communication means, and details are not described herein again.
It in the embodiment of the present invention, is communicated, is realized opposite by the coded data packet built based on mB1C coding principles
Simply, code efficiency is high, disclosure satisfy that the power electronic system demand of high switching frequency, hard real-time.In addition, customized frame
The communication means of format effectively reduces the complexity of optical fiber physical link communication, improves the reliability of data transmission.
For above-mentioned decoding method, the present invention also proposes a kind of communication means, is based on above-mentioned decoding method into line number
According to transmission.
Based on any of the above-described embodiment, Figure 10 is a kind of flow diagram of communication means of the embodiment of the present invention, is such as schemed
Shown in 10, a kind of communication means for receiving terminal, including:1001, the default frame that transmitting terminal is sent is received, to the default frame
It is decapsulated, obtains several coded data packets;Wherein, the coded data packet is transmitting terminal based on above-mentioned coding method
Coding acquisition is carried out to data to be encoded, the data to be encoded are divided to obtain by information to be sent;
1002, each coded data packet is decoded based on above-mentioned coding/decoding method and obtains each coding
The corresponding data to be encoded of data packet, thus obtain information to be sent.
It in the embodiment of the present invention, is communicated, is realized opposite by the coded data packet built based on mB1C coding principles
Simply, code efficiency is high, disclosure satisfy that the power electronic system demand of high switching frequency, hard real-time.In addition, customized frame
The communication means of format effectively reduces the complexity of optical fiber physical link communication, improves the reliability of data transmission.
Based on any of the above-described embodiment, with reference to figure 7, a kind of communication means, when the default frame includes synchronizing frame head, standard
Clock, address coding data packet, information coding data packet and end postamble;Wherein, the standard time clock is used to indicate to receiving terminal
Decode clock information so that receiving terminal can from standard time clock extracted in self-adaptive clock information, and closed according to clock information
At the decoding clock of same frequency;Described information coded data packet is made of the corresponding coded data packet of whole data to be encoded.
Specifically, optic communication links are low level " 0 " in Idle state, and synchronizing frame head is the high electricity of the first predetermined bit
Flat " 1 ", the starting as default frame.Standard time clock is the second predetermined bit pulse signal, and receiving terminal can be from standard time clock
Middle extracted in self-adaptive clock information, identifies the frequency of tranmitting data register, obtains the traffic rate of present frame, and then locally generated same
The decoding clock of frequency.Address coding data packet is the packet for needing to be decoded according to the coding/decoding method in any of the above-described embodiment
Coded data packet containing source address and destination address.Information coding data packet is the decoding needed according to any of the above-described embodiment
What method was decoded includes at least one coded data packet of information to be sent, wherein every in information coding data packet
One coded data packet corresponds to each data to be encoded in information to be sent.Herein, in information coding data packet, coded data packet
Quantity it is related with the classification of information to be sent and quantity.End postamble is the first predetermined bit low level " 0 ", as default
The ending of frame.It should be noted that synchronizing frame head is identical with the bit number shared by end postamble, and synchronizing frame head and end postamble
Shared bit number should be greater than the bit number shared by the second code character of coded data packet.
It should be noted that each coded data packet is to be encoded according to above-mentioned coding method in information coding data packet
Data packet, the complement code that every 1 second code character includes in each coded data packet can be used for when receiving terminal is to being based on standard
Being corrected for the decoding clock that clock obtains, is caused with the frequency difference or line-hit of eliminating the system clock of transmitting terminal and receiving terminal
Accumulated error, and then ensure the decoded correctness of serial data.
In the embodiment of the present invention, gives and coded data packet is applied to the concrete structure that data transmission presets frame, help
In the power electronic system demand for meeting high switching frequency, hard real-time.
Based on any of the above-described embodiment, a kind of communication means, the information to be sent is data information or command information;If
The information to be sent is data information, and the data information includes data amount check and corresponding data several parallel data words,
Then described information coded data packet is made of first coding data packet and several second coded data packets of corresponding data;Wherein,
The first coding data packet is the corresponding coded data packet of the data amount check;Second coded data packet is any described
The corresponding coded data packet of parallel data word, second coded data packet correspond to a parallel data word;If described to be sent
Information is command information, then described information coded data packet is made of third coded data packet, and the third coded data packet is
The corresponding coded data packet of the command information.
Specifically, if information to be sent is data information, the corresponding default frame generated is that data preset frame.With reference in figure 8
Data preset the structure of frame, it is known that, data preset the information coding data packet of frame by a first coding data packet and n second
Coded data packet is constituted, wherein n is the number for the data to be encoded that information to be sent is split, i.e. data in data information
Number.Herein, first coding data packet and the second coded data packet are encoded by the coding method in above-described embodiment.Cause
And data are preset the corresponding information coding data packet of frame and are made of n+1 coded data packet.
If information to be sent is command information, the corresponding default frame generated is that frame is preset in order.It is default with reference to being ordered in figure 8
The structure of frame, it is known that, order the information coding data packet, that is, third coded data packet for presetting frame, the corresponding order of each order
Default frame, it includes a third coded data packet that frame is preset in each order.
It should be noted that identifying that currently received default frame is that data preset frame or order is pre- for the ease of receiving terminal
If frame, presets frame with the corresponding data of adaptive decoding or frame is preset in order, data preset the first coding data packet and life of frame
Enable the third coded data packet bit wide having the same for presetting frame.Herein, receiving terminal can be compiled according to the address for presetting frame is received
Coded data packet after code data packet, it is that data preset frame or frame is preset in order to judge that frame is preset in current reception.
In the embodiment of the present invention, the format difference that data preset frame and frame is preset in order is given, is contributed to more efficiently
Efficiently communicated.
Based on any of the above-described embodiment, a kind of communication means, the first information and the third of the first coding data packet are compiled
Information, the control information are used to indicate the type of information to be sent to the first information of code data packet in order to control.
Specifically, transmitting terminal identifies that currently received default frame is data when generating default frame for the ease of receiving terminal
Default frame still orders default frame, presets frame with the corresponding data of adaptive decoding or frame is preset in order, by first coding data
Information in order to control is arranged in the first information of packet and third coded data packet, passes through and different control information is arranged so that data are believed
Cease corresponding default frame default frame different from corresponding with command information.
Accordingly, after receiving terminal receives and presets frame, the first of information coding data packet to currently receiving default frame is believed
Breath, i.e. control information are judged, if it is default value that it, which controls information, then it is assumed that it is default for data currently to receive default frame
Frame, otherwise it is assumed that it is that frame is preset in order that frame is preset in current reception.Herein, the control information of first coding data packet can be " 0 "
Or " 1 ", the control information of corresponding third coded data packet can be " 1 " or " 0 ".
For example, in the corresponding default frame of setting data information, the control information of first coding data packet is " 1 ", order letter
It ceases in corresponding default frame, the control information of third coded data packet is " 0 ".Receiving terminal is in decoding, the information coding of acquisition
The control information of data packet is " 1 ", then it is assumed that the default frame received is that data preset frame, the information coding data packet of acquisition
It is " 0 " to control information, then it is assumed that the default frame received is that information presets frame.
In order to better understand following example, and this are carried out with a kind of communication means proposed by the present invention, the present invention is applied
Invention is not only limited to following example.
Example one:
Figure 11 and 12 is a kind of flow diagram of communication means of the embodiment of the present invention, with reference to figure 11, for transmitting terminal
Communication means it is as follows:
After transmitting terminal brings into operation, when transmitting terminal is in Idle state, low electricity is sent in the rising edge of each standard time clock
Flat " 0 ".After transmitting terminal, which receives coding, sends enabled instruction, in the rising edge of each standard time clock, k high level is sent
The synchronizing frame head of " 1 ";Secondly, j standard time clock is sent;Again, address coding data packet is sent by turn;Then, according to current
Information to be sent be data information or command information, send first coding data packet and several second coded datas by turn
Packet sends third coded data packet by turn;Finally, the end postamble of k low level " 0 " is sent.
Wherein, it is data information or command information for current information to be sent, transmitting terminal is by data to be sent
Control information coding in first data packet of information is " 0 ", by the control in the third data packet of command information to be sent
Information coding is " 1 ".
It is as follows for the communication means of receiving terminal with reference to figure 12:
After receiving terminal brings into operation, the FPGA of receiving terminal carries out height using system high-frequency clock to the data flow received
Frequency sampling, and each low and high level duration in enumeration data code stream.When in Idle state height of the sample count to k bit for the first time
When level, receiving terminal judgement recognizes the synchronizing frame head that the current command presets frame or data preset frame, and thus enters synchronous compile
Code standard time clock identification process.
In synchronous coding standard time clock identification process, receiving terminal carries out high frequency meter to the duration of each clock cycle
Number, obtains j clock cycle, wherein corresponding high frequency sample count average value of each clock cycle is same as synthesis is counted
The cycle count value of step decoding clock.After having identified j standard clock, receiving terminal is counted using radio frequency system clock and is closed
At synchronous decoding clock, and using this synthesis clock as the clock of the various coded data packets of sampling decoding, thus enter coded number
According to the decoding process of packet.
Receiving terminal samples the serialized encoded data stream received, obtains address coding data using the synchronised clock of synthesis
Packet and its subsequent first coding data packet or third number coded data packet.What receiving terminal judged to be currently received is that order is pre-
If the foundation that frame or data preset frame is the control information of first coding data packet or third coded data packet that decoding obtains
Whether it is " 1 ".If " 1 ", then it is that frame is preset in order to be currently received, then into the identification of default postamble;If " 0 ",
It is that data preset frame to be then currently received, then into the decoding of the second coded data packet.
When carrying out the second coded data packet decoding of the default frame of data, according to what is decoded by first coding data packet
Data amount check, using the synchronous decoding clock of synthesis, adaptively decoding obtains the second all coded data packets, and finally into
Enter the identification of postamble, completes the motor synchronizing decoding that data preset frame.
The decoding that serial order presets frame or data preset frame is completed, address coding data packet, the first coded number are obtained
After packet or third coded data packet, according to the data and parity data of each data packet, the correct of decoded packet data is judged
Property.If decoding is correct, serial data packet is reduced into parallel data, and update output data, for subsequently using;If not just
Really, then enter corresponding data communication error treatment mechanism.
It in this example, is communicated by the coded data packet built based on mB1C coding principles, realizes relatively easy, volume
Code efficiency is high, disclosure satisfy that the power electronic system demand of high switching frequency, hard real-time.In addition, self-defined frame format is logical
Letter mode effectively reduces the complexity of optical fiber physical link communication, improves the reliability of data transmission.
Example two:
For the parallel data of 1 16bit bit wide, when being encoded using mB1C patterns, m=4 makees per 4bit information codes
For 1 the first code character;Using the radix-minus-one complement of the last a data of every 1 first code character as the complement code of first code character, it is correspondingly formed
Every 1 second code character.Each parallel data can be divided into 4 the first code characters, n=4, in addition the parity values of parallel data, form
One coded data packet.
As m=4, k minimums take 6, synchronizing frame head and terminate postamble as a result, and separately include the high level " 1 " of 6bit and low
Level " 0 ".If the FPGA system clock frequency of transmitting terminal and receiving terminal is 100MHz, highest coding tranmitting data register frequency is
33.3MHz, standard time clock number are 3, and serial communication rate at this time is 33.3Mbps.
Based on any of the above-described embodiment, Figure 13 is a kind of structural schematic diagram of communication system of the embodiment of the present invention, a kind of
Communication system, including:
Third communication unit 1301, the default frame for receiving transmitting terminal transmission, decapsulates the default frame, obtains
Take several coded data packets;Wherein, the coded data packet be transmitting terminal based on above-mentioned coding method to data to be encoded
Coding acquisition is carried out, the data to be encoded are divided to obtain by information to be sent;
Fourth communication unit 1302, for being decoded simultaneously to each coded data packet based on above-mentioned coding/decoding method
The corresponding data to be encoded of each coded data packet are obtained, information to be sent is thus obtained.
It should be noted that above-mentioned third communication unit 1301 and fourth communication unit 1302 are executing above-described embodiment
In a kind of communication means, the concrete function of the system is referring to the embodiment of above-mentioned communication means, and details are not described herein again.
It in the embodiment of the present invention, is communicated, is realized opposite by the coded data packet built based on mB1C coding principles
Simply, code efficiency is high, disclosure satisfy that the power electronic system demand of high switching frequency, hard real-time.In addition, self-defined frame lattice
The communication mode of formula effectively reduces the complexity of optical fiber physical link communication, improves the reliability of data transmission.
Finally it should be noted that:The above various embodiments is only to illustrate the technical solution of the embodiment of the present invention rather than right
It is limited;Although the embodiment of the present invention is described in detail with reference to foregoing embodiments, the ordinary skill of this field
Personnel should understand that:It still can be with technical scheme described in the above embodiments is modified, or to which part
Or all technical features carries out equivalent replacement;And these modifications or replacements, it does not separate the essence of the corresponding technical solution
The range of each embodiment technical solution of the embodiment of the present invention.