Summary of the invention
The purpose of the embodiment of the invention provides a kind of coding method and device based on dynamic slot; Coding/decoding method and device; Make Frame in coaxial cable or optical-fibre channel; But simple and flexible, elongated the transmission, this method and device also can apply to standard TDM traffic transmission and accesses such as SDH, PDH simultaneously.
In order to reach the foregoing invention purpose, a kind of coding method based on dynamic slot that the embodiment of the invention proposes realizes through following technical scheme:
A kind of coding method based on dynamic slot, said method comprises:
The number that buffer queue statistical correction frame, erroneous frame and the buffer memory of inlet overflows;
The upper strata control module is judged the current required time slot bandwidth of data traffic according to the null pointer of buffer queue, full pointer and current water level information;
Be current data assignment of traffic time slot bandwidth;
Read the data in the buffer queue, to said data based frame period, frame head, the sign indicating number type of postamble carries out the serialization of speed change and encodes;
The configuration information of the data behind the serialization coding and each sendaisle is mapped among super-frame, frame, sub-frame, the bursts goes, said configuration information comprises the time slot mapping information of each passage.
Preferred enforcement down, said method comprises:
For said each sendaisle disposes a said buffer queue.
Preferred enforcement down saidly specifically comprises for current data assignment of traffic time slot bandwidth:
According to the precedence information and the current time slots bandwidth information of current access port, according to the unified allocation of resources of allocated bandwidth strategy.
Preferred enforcement down, the said serialization coding that carries out speed change specifically comprises:
According to the figure place of time slot passage, dynamically select the bit wide and the coded system of coding, said coded system comprises serial code and parallel encoding.
In order to realize goal of the invention of the present invention, the embodiment of the invention also provides a kind of coding/decoding method based on dynamic slot, and said method is to realize through following technical scheme:
A kind of coding/decoding method based on dynamic slot, said method comprises:
Receive serial data, and recover parallel initial data;
According to the form of super-frame, frame, sub-frame, bursts, solve the time slot of super-frame, frame, sub-frame, bursts synchronously, and, obtain the time slot mapping table of each passage through the channel slot map information;
According to said time slot mapping table, the data separating of each passage is come out;
According to the sign indicating number type of frame period, frame head, postamble, carry out the decoding of speed change ground, recover normal data frame format.
In order to realize goal of the invention of the present invention, the embodiment of the invention also provides a kind of code device based on dynamic slot, and said code device is to realize through following technical scheme:
A kind of code device based on dynamic slot, said code device comprises:
Buffer queue is used for the business datum that buffer memory sendaisle port sends, and statistical correction frame, erroneous frame and the buffer memory number of overflowing;
The upper strata control module is used for judging the current required time slot bandwidth of data traffic according to the null pointer of buffer queue, full pointer and current water level information;
The time slot allocation module is used for being current data assignment of traffic time slot bandwidth;
Coding module is used for reading the data in the buffer queue, to said data based frame period, and frame head, the sign indicating number type of postamble carries out the serialization of speed change and encodes;
The time slot mapping module is used for the configuration information of the data behind the serialization coding and each sendaisle is mapped among super-frame, frame, sub-frame, the bursts, and said configuration information comprises the time slot mapping information of each passage.
Preferred enforcement down, said each sendaisle all disposes a said buffer queue.
Preferred enforcement down, said time slot allocation module is according to the precedence information and the current time slots bandwidth information of current access port, according to the unified allocation of resources of allocated bandwidth strategy.
Preferred enforcement down, said coding module is dynamically selected the bit wide and the coded system of coding according to the figure place of time slot passage, and said coded system comprises serial code and parallel encoding.
In order to realize goal of the invention of the present invention, the embodiment of the invention also provides a kind of decoding device based on dynamic slot, and said decoding device is to realize through following technical scheme:
A kind of decoding device based on dynamic slot, said decoding device comprises:
Receiver module is used for receiving descending serial data, and recovers parallel initial data;
The time slot parsing module; Be used for form according to super-frame, frame, sub-frame, bursts; Parse the time slot of super-frame, frame, sub-frame, bursts synchronously, and, obtain the time slot mapping table of each passage through the channel slot map information;
The data separating module is used for according to said time slot mapping table the data separating of each passage being come out;
Decoder module is used for sign indicating number type according to frame period, frame head, postamble, carries out the decoding of speed change ground, recovers normal data frame format.
The embodiment of the invention is through said coding method and device based on dynamic slot; Coding/decoding method and device; Make Frame in coaxial cable or optical-fibre channel; But simple and flexible, elongated the transmission, this method and device also can apply to standard TDM traffic transmission and accesses such as SDH, PDH simultaneously, have greatly practiced thrift the bandwidth of transfer of data.
Embodiment
Below in conjunction with accompanying drawing the present invention is done further explain.
As shown in Figure 1, be 1 one kinds of flow charts of the embodiment of the invention based on the coding method of dynamic slot, said method comprises:
S101. the number that buffer queue statistical correction frame, erroneous frame and buffer memory overflow enters the mouth;
S102. the upper strata control module is judged the current required time slot bandwidth of data traffic according to the null pointer of buffer queue, full pointer and current water level information;
S103. be current data assignment of traffic time slot bandwidth;
S104. read the data in the inlet buffer queue, to said data based frame period, frame head, the sign indicating number type of postamble carries out the serialization of speed change and encodes;
S105. the data after serialization being encoded and the configuration information of sendaisle are mapped among super-frame, frame, sub-frame, the bursts and go, and said configuration information comprises the time slot mapping information of each passage.
The a plurality of Frame passages in the upper reaches link to each other with code device, its frame length within the specific limits, the code device entrance side to each access port inlet porting buffer queue, abandons the Frame that exceeds the frame length scope.
Number, the number of erroneous frame and the number that buffer memory overflows of inlet buffer queue statistical correction frame.
Add the CRC32 check information to the data postamble, check polynomial is: G (x)=x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1.
The upper strata control module is judged the time slot bandwidth that current data traffic is required according to the null pointer of buffer queue, full pointer and current water level information.If water level is full and spillover is arranged, it is low to explain that then outlet bandwidth distributed, and can increase configuration; More shallow and often be sky like water level, explain that outlet bandwidth is bigger, can reduce configuration.
The time slot bandwidth is according to the precedence information of current access port and the time slot bandwidth information of current configuration, according to allocation strategy, and unified allocation of resources.Allocation strategy can be SP strict priority or WRR weighted priority.
In the SP strategy, preferentially guarantee the scheduling of high priority, so the phenomenon of serious packet loss might appear in low priority; In the WRR strategy, through to the weight coefficient setting, balance height priority scheduling order.
After distributing the time slot bandwidth of each passage, outlet number of queues and outlet bandwidth are separately also established basically.Then according to the passage ID of outlet formation, poll read the inlet data in buffer, gets into unified serialization and encodes.
Serialization sign indicating number type is divided into frame period, frame head, postamble.Use speed-variable module in the coding, bundle the number of active lanes of coding and outlet time slot flexibly, improve code efficiency, to arrive linear speed.Speed-variable module refers in the coding; Still executed in parallel coding of coding is carried out in serial, and the dynamic bit wide of selecting coding: like the current time slots passage is 1bit, and coding module is realized through serial mechanism; Like the current time slots passage is 6bit, and coding module is realized through parallel 6bit.
Frame period is a yard type with 0x7E, and data are read by bit displacement, as to run into continuous 5 bit be 1, then inserts 0 of a bit, so the sign indicating number type of frame head is that 0x7E is not for the front byte at the back; The sign indicating number type of postamble is that the front is not that 0x7E is at the back.
Being mapped among super-frame, frame, sub-frame, the bursts that serialized business datum and sendaisle configuration information are unified gone, and is encapsulated in the time slot mapping information of each passage in the deploy content simultaneously, so that the decoding side can read.
After having shone upon, get into serial data scrambling passage, to obtain better DC performance.Then, get into down
Row serial sending module.The multi-form of scrambling module is: G (X)=X16+X5+X4+X3+1
As shown in Figure 2, be 2 one kinds of flow charts of the embodiment of the invention based on the coding/decoding method of dynamic slot, said method comprises:
S201. receive serial data, and recover parallel initial data;
S202. according to the form of super-frame, frame, sub-frame, bursts, solve the time slot of super-frame, frame, sub-frame, bursts synchronously, and, obtain the time slot mapping table of each passage through the channel slot map information;
S203. according to said time slot mapping table, the data separating of each passage is come out;
S204. according to the sign indicating number type of frame period, frame head, postamble, carry out the decoding of speed change ground, recover normal data frame format.
Upper reaches serial data module at first gets into the SERDES passage and receives serial data, recovers 10bit or 20bit parallel initial data and tranmitting data register.
According to the form of super-frame, frame, sub-frame, bursts, solve the time slot of super-frame, frame, sub-frame, bursts synchronously.Through the channel configuration information among the super-frame, obtain the time slot mapping table of each passage among the current super-frame.
Then,, come out the data separating of each passage, carry out decoding separately according to the time slot mapping table.
Use speed-variable module in the decoding, dynamically bundle flexibly,, reach linear speed to improve decoding efficiency with the time slot passage.In the decoding, according to frame period, frame head, the sign indicating number type of postamble recovers normal data frame format.Speed-variable module refers in the decoding, and still executed in parallel decoding of decoding is carried out in serial, dynamically selects the bit wide of parallel decoding; Like the current time slots passage is 1bit, and decoding realizes through serial mechanism, is 6bit like the current time slots passage, and decoding realizes through parallel 6bit.
In the decoding, as run into 0x7E, then representative frame at interval; The sign indicating number type of frame head is that a front byte is that the 0x7E back is not; The sign indicating number type of postamble is that the front is not that 0x7E is at the back; In the frame as to run into continuous 5 bit be 1, then 0 of the deletion back.
The Frame that recovers gets into detection module, the correctness of checking data frame.Simultaneously all passages are added up the correct Frame that receives of record, the Frame of mistake, the statistical value of each frame length, the CRC32 check information of the postamble of intercepting simultaneously.Decoding is also carried out the Frame after the verification, gets into the outlet buffer queue.
As shown in Figure 3, be converted into the frame format in the coding and decoding method of dynamic slot for 3 one kinds of elongated frames of the embodiment of the invention, said frame format comprises:
Form by 4 kinds of time slot frames in the transmission channel, be divided into super-frame, frame, sub-frame, bursts.On the horizontal direction, each frame is made up of 16 sub-frame; On the vertical direction, each super-frame is made up of 16 frame, so whole super-frame is made up of 16*16=256sub-frame.Each sub-frame length can be provided with, and is 125us like sub-frame, is equivalent to 125000bit.CH (configuration head) deposits synchronizing information, channel configuration information, time slot mapping table.
The embodiment of the invention is through said coding method based on dynamic slot; Coding/decoding method; Make Frame in coaxial cable or optical-fibre channel; But simple and flexible, elongated the transmission, this method and device also can apply to standard TDM traffic transmission and accesses such as SDH, PDH simultaneously, have greatly practiced thrift the bandwidth of transfer of data.
In order to realize goal of the invention of the present invention, as shown in Figure 4, the embodiment of the invention also provides a kind of code device based on dynamic slot, and said code device is to realize through following technical scheme:
A kind of code device based on dynamic slot, said code device comprises:
Buffer queue is used for the business datum that buffer memory sendaisle port sends, and statistical correction frame, erroneous frame and the buffer memory number of overflowing;
The upper strata control module is used for judging the current required time slot bandwidth of data traffic according to the null pointer of buffer queue, full pointer and current water level information;
The time slot allocation module is used for being current data assignment of traffic time slot bandwidth;
Coding module is used for reading the data in the buffer queue, to said data based frame period, and frame head, the sign indicating number type of postamble carries out the serialization of speed change and encodes;
The time slot mapping module is used for the configuration information of the data behind the serialization coding and each sendaisle is mapped among super-frame, frame, sub-frame, the bursts, and said configuration information comprises the time slot mapping information of each passage.
Preferred enforcement down, said each sendaisle all disposes a said buffer queue.
Preferred enforcement down, said time slot allocation module is according to the precedence information and the current time slots bandwidth information of current access port, according to the unified allocation of resources of allocated bandwidth strategy.
Preferred enforcement down, said coding module is dynamically selected the bit wide and the coded system of coding according to the figure place of time slot passage, and said coded system comprises serial code and parallel encoding.
In order to realize goal of the invention of the present invention, as shown in Figure 5, the embodiment of the invention 5 also provides a kind of decoding device based on dynamic slot, and said decoding device is to realize through following technical scheme:
A kind of decoding device based on dynamic slot, said decoding device comprises:
Receiver module is used for receiving descending serial data, and recovers parallel initial data;
The time slot parsing module; Be used for form according to super-frame, frame, sub-frame, bursts; Parse the time slot of super-frame, frame, sub-frame, bursts synchronously, and, obtain the time slot mapping table of each passage through the channel slot map information;
The data separating module is used for according to said time slot mapping table the data separating of each passage being come out;
Decoder module is used for sign indicating number type according to frame period, frame head, postamble, carries out the decoding of speed change ground, recovers normal data frame format.
The embodiment of the invention is through said code device based on dynamic slot; Decoding device; Make Frame in coaxial cable or optical-fibre channel; But simple and flexible, elongated the transmission, this method and device also can apply to standard TDM traffic transmission and accesses such as SDH, PDH simultaneously, have greatly practiced thrift the bandwidth of transfer of data.
One of ordinary skill in the art of the present invention are appreciated that; The above embodiment of the present invention is merely one of the preferred embodiments of the present invention; Be the length restriction; Here can not all execution modes of particularize, any enforcement that can embody claim technical scheme of the present invention is all in protection scope of the present invention.
It should be noted that; Above content is to combine concrete execution mode to further explain that the present invention did; Can not assert that embodiment of the present invention only limits to this; Under above-mentioned guidance of the present invention, those skilled in the art can carry out various improvement and distortion on the basis of the foregoing description, and these improve or distortion drops in protection scope of the present invention.