Summary of the invention
The object of the embodiment of the present invention is to provide 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, can simple and flexible, elongated transmission, the method and device also can apply to transmission and the access of the standard TDM business such as SDH, PDH simultaneously.
In order to reach foregoing invention object, a kind of coding method based on dynamic slot that the embodiment of the present invention proposes is achieved through the following technical solutions:
A coding method based on dynamic slot, described method comprises:
The number of buffer queue statistical correction frame, erroneous frame and the cache overflow of entrance;
Upper strata control module judges according to the null pointer of buffer queue, full pointer and current water level information the time slot bandwidth that current data traffic is required;
For current data assignment of traffic time slot bandwidth;
Read the data in buffer queue, to described data based frame period, frame head, the pattern of postamble, carries out the serialization of speed change and encodes;
The configuration information of the data after serialization coding and each sendaisle is mapped in super-frame, frame, sub-frame, bursts and is gone, and described configuration information comprises the time slot mapping information of each passage.
Under preferred enforcement, described method comprises:
For buffer queue described in described each sendaisle configuration one.
Under preferred enforcement, describedly for current data assignment of traffic time slot bandwidth, specifically comprise:
According to the precedence information of current access port and current time slots bandwidth information, according to Bandwidth Allocation Policy unified allocation of resources.
Under preferred enforcement, described in carry out speed change serialization coding specifically comprise:
According to the figure place of time slot passage, dynamically select bit wide and the coded system of coding, described coded system comprises serial code and parallel encoding.
In order to realize goal of the invention of the present invention, the embodiment of the present invention also provides a kind of coding/decoding method based on dynamic slot, and described method is to realize by following technical scheme:
A coding/decoding method based on dynamic slot, described method comprises:
Receive serial data, and recover parallel initial data;
According to the form of super-frame, frame, sub-frame, bursts, synchronously solve the time slot of super-frame, frame, sub-frame, bursts, and by channel slot map information, obtain the time slot mapping table of each passage;
According to described time slot mapping table, by the data separating of each passage out;
According to the pattern of frame period, frame head, postamble, carry out speed change and decode, recover normal data frame format.
In order to realize goal of the invention of the present invention, the embodiment of the present invention also provides a kind of code device based on dynamic slot, and described code device is to realize by following technical scheme:
A code device based on dynamic slot, described code device comprises:
Buffer queue, is used for the business datum that buffer memory sendaisle port sends the number of statistical correction frame, erroneous frame and cache overflow;
Upper strata control module, is used for judging according to the null pointer of buffer queue, full pointer and current water level information the time slot bandwidth that current data traffic is required;
Time slot allocation module, is used for as current data assignment of traffic time slot bandwidth;
Coding module, is used for reading the data in buffer queue, to described data based frame period, and frame head, the pattern of postamble, carries out the serialization of speed change and encodes;
Time slot mapping module, is used for the data after serialization coding and the configuration information of each sendaisle to be mapped in super-frame, frame, sub-frame, bursts, and described configuration information comprises the time slot mapping information of each passage.
Under preferred enforcement, described each sendaisle dispose one described in buffer queue.
Under preferred enforcement, described time slot allocation module is according to the precedence information of current access port and current time slots bandwidth information, according to Bandwidth Allocation Policy unified allocation of resources.
Under preferred enforcement, described coding module, according to the figure place of time slot passage, is dynamically selected bit wide and the coded system of coding, and described coded system comprises serial code and parallel encoding.
In order to realize goal of the invention of the present invention, the embodiment of the present invention also provides a kind of decoding device based on dynamic slot, and described decoding device is to realize by following technical scheme:
A decoding device based on dynamic slot, described decoding device comprises:
Receiver module, is used for receiving descending serial data, and recovers parallel initial data;
Time slot parsing module, be used for according to the form of super-frame, frame, sub-frame, bursts, synchronously parse the time slot of super-frame, frame, sub-frame, bursts, and by channel slot map information, obtain the time slot mapping table of each passage;
Data separating module, is used for according to described time slot mapping table, by the data separating of each passage out;
Decoder module, is used for according to the pattern of frame period, frame head, postamble, carries out speed change and decodes, and recovers normal data frame format.
The embodiment of the present invention is by described coding method and device based on dynamic slot, coding/decoding method and device, make Frame in coaxial cable or optical-fibre channel, can simple and flexible, elongated transmission, the method and device also can apply to transmission and the access of the standard TDM business such as SDH, PDH simultaneously, have greatly saved the bandwidth of transfer of data.
Embodiment
Below in conjunction with accompanying drawing, the present invention is described in further detail.
As shown in Figure 1, be the flow chart of 1 one kinds of the embodiment of the present invention coding method based on dynamic slot, described method comprises:
S101. the number of entrance buffer queue statistical correction frame, erroneous frame and cache overflow;
S102. upper strata control module judges according to the null pointer of buffer queue, full pointer and current water level information the time slot bandwidth that current data traffic is required;
S103. be current data assignment of traffic time slot bandwidth;
S104. read the data in entrance buffer queue, to described data based frame period, frame head, the pattern of postamble, carries out the serialization of speed change and encodes;
S105. the configuration information of the data after serialization coding and sendaisle is mapped in super-frame, frame, sub-frame, bursts and is gone, described configuration information comprises the time slot mapping information of each passage.
A plurality of Frame passages in upstream are connected with code device, and within the specific limits, code device entrance side, to each access port inlet porting buffer queue, abandons the Frame that exceeds frame length scope to its frame length.
Number, the number of erroneous frame and the number of cache overflow of entrance buffer queue statistical correction frame.
Add CRC32 check information to data postamble, check polynomial is: G (x)=x32+x26+x23+x22+x16+x12+x11+x10+x8+x7+x5+x4+x2+x+1.
Upper strata control module, according to the null pointer of buffer queue, full pointer and current water level information, judges the time slot bandwidth that current data traffic is required.If water level is expired and is had spillover, illustrate that outlet bandwidth distributes too low, can increase configuration; As more shallow in water level and frequent is empty, illustrates that outlet bandwidth is larger, can reduce configuration.
Time slot bandwidth is according to the time slot bandwidth information of the precedence information of current access port and current configuration, according to allocation strategy, and unified allocation of resources.Allocation strategy can be SP strict priority or WRR weighted priority.
In SP strategy, preferentially guarantee the scheduling of high priority, so likely there is the phenomenon of serious packet loss in low priority; In WRR strategy, by weight coefficient is arranged, balance height priority scheduling order.
Distribute after the time slot bandwidth of each passage, outlet number of queues and outlet bandwidth separately are also established substantially.Then according to the passage ID of outlet queue, the data that read entrance buffer memory of poll, enter unified serialization coding.
Serialization pattern is divided into frame period, frame head, postamble.In coding, use speed-variable module, flexibly the number of active lanes of coding and outlet time slot is bundled, improve code efficiency, to arrive linear speed.Speed-variable module refers in coding, coding or executed in parallel coding are carried out in serial, the dynamic bit wide of selecting coding: if current time slots passage is 1bit, coding module is realized by serial mechanism, if current time slots passage is 6bit, coding module is realized by parallel 6bit.
Frame period be take 0x7E as pattern, and data are read by bit displacement, as to run into continuous 5 bit be 1, inserts 0 of a bit, thus the pattern of frame head for byte be above not to be after 0x7E; The pattern of postamble is not for being or not above after 0x7E.
Being mapped in super-frame, frame, sub-frame, bursts that serialized business datum and sendaisle configuration information are unified gone, simultaneously the time slot mapping Information encapsulation of each passage in deploy content, so that decoding side can read.
After having shone upon, enter serial data scrambling passage, to obtain better DC performance.Then, enter 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 the flow chart of 2 one kinds of the embodiment of the present invention coding/decoding method based on dynamic slot, described method comprises:
S201. receive serial data, and recover parallel initial data;
S202. according to the form of super-frame, frame, sub-frame, bursts, synchronously solve the time slot of super-frame, frame, sub-frame, bursts, and by channel slot map information, obtain the time slot mapping table of each passage;
S203. according to described time slot mapping table, by the data separating of each passage out;
S204. according to the pattern of frame period, frame head, postamble, carry out speed change and decode, recover normal data frame format.
First upstream serial data module enters SERDES passage and receives serial data, recovers the parallel initial data of 10bit or 20bit and tranmitting data register.
According to the form of super-frame, frame, sub-frame, bursts, synchronously solve the time slot of super-frame, frame, sub-frame, bursts.By the channel configuration information in super-frame, obtain the time slot mapping table of each passage in current super-frame.
Then, according to time slot mapping table, the data separating of each passage out, carry out decoding separately.
In decoding, use speed-variable module, dynamically bundle with time slot passage flexibly, to improve decoding efficiency, reach linear speed.In decoding, according to frame period, frame head, the pattern of postamble, recovers normal data frame format.Speed-variable module refers in decoding, and decoding or executed in parallel decoding are carried out in serial, dynamically selects the bit wide of parallel decoding; If current time slots passage is 1bit, decoding realizes by serial mechanism, and if current time slots passage is 6bit, decoding realizes by parallel 6bit.
In decoding, as run into 0x7E, representative frame interval; The pattern of frame head for byte be above not to be after 0x7E; The pattern of postamble is not for being or not above after 0x7E; In frame as to run into continuous 5 bit be 1, delete below 0.
The Frame recovering enters detection module, the correctness of checking data frame.All passages are added up simultaneously, the correct Frame receiving of record, the Frame of mistake, the statistical value of each frame length intercepts the CRC32 check information of postamble simultaneously.Decode and carry out the Frame after verification, entering outlet buffer queue.
As shown in Figure 3, for 3 one kinds of elongated frames of the embodiment of the present invention are converted into the frame format in the coding and decoding method of dynamic slot, described frame format comprises:
In transmission channel, by 4 kinds of time slot frames, formed, be divided into super-frame, frame, sub-frame, bursts.In horizontal direction, each frame is comprised of 16 sub-frame; In vertical direction, each super-frame is comprised of 16 frame, so whole super-frame is comprised of 16*16=256sub-frame.Each sub-frame length can arrange, and if sub-frame is 125us, is equivalent to 125000bit.CH (configuration head) deposits synchronizing information, channel configuration information, time slot mapping table.
The embodiment of the present invention is by the described coding method based on dynamic slot, coding/decoding method, make Frame in coaxial cable or optical-fibre channel, can simple and flexible, elongated transmission, the method and device also can apply to transmission and the access of the standard TDM business such as SDH, PDH simultaneously, have greatly saved 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 present invention also provides a kind of code device based on dynamic slot, and described code device is to realize by following technical scheme:
A code device based on dynamic slot, described code device comprises:
Buffer queue, is used for the business datum that buffer memory sendaisle port sends the number of statistical correction frame, erroneous frame and cache overflow;
Upper strata control module, is used for judging according to the null pointer of buffer queue, full pointer and current water level information the time slot bandwidth that current data traffic is required;
Time slot allocation module, is used for as current data assignment of traffic time slot bandwidth;
Coding module, is used for reading the data in buffer queue, to described data based frame period, and frame head, the pattern of postamble, carries out the serialization of speed change and encodes;
Time slot mapping module, is used for the data after serialization coding and the configuration information of each sendaisle to be mapped in super-frame, frame, sub-frame, bursts, and described configuration information comprises the time slot mapping information of each passage.
Under preferred enforcement, described each sendaisle dispose one described in buffer queue.
Under preferred enforcement, described time slot allocation module is according to the precedence information of current access port and current time slots bandwidth information, according to Bandwidth Allocation Policy unified allocation of resources.
Under preferred enforcement, described coding module, according to the figure place of time slot passage, is dynamically selected bit wide and the coded system of coding, and described 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 present invention 5 also provides a kind of decoding device based on dynamic slot, and described decoding device is to realize by following technical scheme:
A decoding device based on dynamic slot, described decoding device comprises:
Receiver module, is used for receiving descending serial data, and recovers parallel initial data;
Time slot parsing module, be used for according to the form of super-frame, frame, sub-frame, bursts, synchronously parse the time slot of super-frame, frame, sub-frame, bursts, and by channel slot map information, obtain the time slot mapping table of each passage;
Data separating module, is used for according to described time slot mapping table, by the data separating of each passage out;
Decoder module, is used for according to the pattern of frame period, frame head, postamble, carries out speed change and decodes, and recovers normal data frame format.
The embodiment of the present invention is by the described code device based on dynamic slot, decoding device, make Frame in coaxial cable or optical-fibre channel, can simple and flexible, elongated transmission, the method and device also can apply to transmission and the access of the standard TDM business such as SDH, PDH simultaneously, have greatly saved 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 only one of the preferred embodiments of the present invention; for length restriction; here can not all execution modes of particularize; any enforcement that can embody the claims in the present invention technical scheme, all in protection scope of the present invention.
It should be noted that; above content is in conjunction with concrete execution mode further description made for the present invention; can not assert that the specific 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 above-described embodiment, and these improvement or distortion drop in protection scope of the present invention.