A kind of two-way restoration methods of synchronous code and circuit
Technical field
The present invention relates to technical field of data transmission, and in particular to a kind of two-way restoration methods of synchronous code and circuit.
Background technology
Data transmission procedure is the moving process that data-signal is transferred to another place by channel by a place, is believed
Road can be wired or wireless, and wire channel and wireless channel are all inevitably by other signals
Interference:For example, the thermal noise in line, the noise that shoves of electric switch, the particle noise that solar windstorm includes is set with other
For to interference noise of this equipment etc..
The transmission of data and receiving is carried out by certain form, in particular, be exactly data be often divided into it is equal in magnitude
Several data packets, then packet-by-packet transmit.Unique field that each data packet can be different from transmission data with one represents
The beginning of data packet, the data flow received is decomposited data packet by receiving terminal by the mark of this unique field, so as to subsequent
Other processing.This unique field is called synchronous code.
Data can be caused damage and the loss of synchronous code during transmitting in the channel by various interference.Synchronous code
After impaired or loss, to be resynchronized.Resynchronisation generally comprises synchronous code and re-recognizes, and confirms and confirms again.In this way, from same
Step code is damaged or loses, and to before confirming completion again, data flow is before being damaged or lose by known form and with synchronous code
On the basis of the last one good synchronous code, by fixed length counting come decomposition data, formation data packet.Due to interference appearance or after
It renewing, counting clock is often inaccurate, so, the data packet decomposited is often mistake before synchronous code confirms completion again
Accidentally.As shown in Figure 1, channel signal can occur very to become after being interfered, at the same track the clock signal of channel signal also by
To influence;Some positions of identification synchronous code cannot recognize that for the empty synchronous code for representing the position;Count synchronization code is to be based on
What the previous synchronous code identified predicted, in case current location can not identify;When synchronous code cannot be identified correctly, by
Influence is received in the clock of tracking channel signal, deviation occurs count synchronization code for synchronous code position sometimes and correctly;To count
The data packet that synchronous CDMA solves is it some times happens that mistake.In Fig. 1, data packet 3,4,5,6,7,8 includes wrong data.
Invention content
In view of the above-mentioned problems, the present invention discloses a kind of bi-directional synchronization code restoration methods and circuit, pass through the side of two-way counting
Formula effectively avoids the influence of interference, improves synchronous code counting precision.
To solve the above problems, the designing scheme of the present invention is:A kind of two-way restoring circuit of synchronous code, including data buffer storage
Device and bi-directional synchronization code restorer;Data buffer first input end receives the data for storage, and the second input terminal receives double
The address date for accessing data buffer is generated to synchronous code restorer, and address date is exported to bi-directional synchronization code and is restored
Device, bi-directional synchronization code restorer read the synchronous code of the synchronous code data of appropriate address, write recovery or generation, are sequentially read out
Data packet.
A kind of two-way restoration methods of synchronous code, include the following steps:
Step 1: interference causes synchronous code to lose or be damaged in transmission process, restore synchronous code to method of counting using preceding:
Code position is synchronized based on the last one identified, synchronous code should occur but it is unidentified go out position artificially generate one it is same
The mark that code is walked as decomposition data packet is i.e. preceding to count synchronization code, is indicated with dotted line in figure, is obtained by confirming, confirming again
Correctly synchronous code position;
Step 2: synchronous code is restored using backward method of counting:Confirm the synchronization code position obtained again later based on interference,
Counting in reverse is counted with the direction opposite with data write-in direction and generates backward count synchronization code, indicated in figure with solid line;
The method of back forecast has effectively hidden the clock being disturbed, and is counted with clock again stable after interference,
The accuracy of synchronous code counting can be improved.
Step 3: if forward direction count synchronization code is identical with the position of backward count synchronization code, restore to synchronize in the position
Code;If forward direction count synchronization code is different with the position of backward count synchronization code, restore same in the rear position to count synchronization code
Walk code;
Step 4: according to the data buffer address where the synchronous code tick lables restored in step 3, packet-by-packet read
It is data cached and export.
Advantageous effect:Through confirming that the synchronous code correctly identified carries out counting in reverse again after the present invention is based on interference,
Counting in reverse synchronous code is generated, effectively prevents interference signal, is counted with clock again stable after interference, improves and synchronizes
The accuracy that code counts.
Description of the drawings
Fig. 1 confirms schematic diagram again for conventional synchronization code;
Fig. 2 is the two-way restoration methods schematic diagram of synchronous code;
Fig. 3 is the two-way restoring circuit schematic diagram of synchronous code.
Specific embodiment
A kind of two-way restoring circuit of synchronous code, as shown in figure 3, including data buffer and bi-directional synchronization code restorer;Number
The data for storage are received according to buffer first input end, the second input terminal receives the generation of bi-directional synchronization code restorer and accesses number
It is exported according to the address date of buffer, and by address date to bi-directional synchronization code restorer, bi-directional synchronization code restorer reads phase
The synchronous code of the synchronous code data of address, write recovery or generation is answered, is sequentially read out data packet.
A kind of two-way restoration methods of synchronous code, include the following steps:
Step 1: interference causes synchronous code to lose or be damaged in transmission process, restore synchronous code to method of counting using preceding:
Code position is synchronized based on the last one identified, synchronous code should occur but it is unidentified go out position artificially generate one it is same
The mark that code is walked as decomposition data packet is i.e. preceding to count synchronization code, as shown in phantom in Figure 2, is obtained by confirming, confirming again
Correctly synchronous code position;
Step 2: synchronous code is restored using backward method of counting:Confirm the synchronization code position obtained again later based on interference,
Counting in reverse is counted with the direction opposite with data write-in direction and generates backward count synchronization code, as illustrated in solid line in figure 2;
The method of back forecast has effectively hidden the clock being disturbed, and is counted with clock again stable after interference,
The accuracy of synchronous code counting can be improved.Compared with Fig. 1, only data packet 3,4,5 includes wrong data in Fig. 2.
Step 3: if forward direction count synchronization code is identical with the position of backward count synchronization code, restore to synchronize in the position
Code;If forward direction count synchronization code is different with the position of backward count synchronization code, restore same in the rear position to count synchronization code
Walk code;
Step 4: according to the data buffer address where the synchronous code tick lables restored in step 3, packet-by-packet read
It is data cached and export.