CN112995330B - Transparent information extraction method and device for data - Google Patents

Transparent information extraction method and device for data Download PDF

Info

Publication number
CN112995330B
CN112995330B CN202110305193.1A CN202110305193A CN112995330B CN 112995330 B CN112995330 B CN 112995330B CN 202110305193 A CN202110305193 A CN 202110305193A CN 112995330 B CN112995330 B CN 112995330B
Authority
CN
China
Prior art keywords
byte
code table
bit
current
value
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
CN202110305193.1A
Other languages
Chinese (zh)
Other versions
CN112995330A (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.)
Beijing Northern Sky Long Hawk Uav Technology Co ltd
Original Assignee
Beijing Northern Sky Long Hawk Uav Technology 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 Beijing Northern Sky Long Hawk Uav Technology Co ltd filed Critical Beijing Northern Sky Long Hawk Uav Technology Co ltd
Priority to CN202110305193.1A priority Critical patent/CN112995330B/en
Publication of CN112995330A publication Critical patent/CN112995330A/en
Application granted granted Critical
Publication of CN112995330B publication Critical patent/CN112995330B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC
    • 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 invention provides a method and a device for extracting transparent information of high-level data link control procedure data, wherein the method comprises the following steps: receiving HDLC data; acquiring an initial bit of transparent information transmission in HDLC data; extracting transparent transmission information in the HDLC data from a start bit; obtaining a first number of continuous bits 1 in the current byte, a second number of continuous bits 1 connected with the previous byte and a third number of continuous bits 1 connected with the next byte according to a byte value lookup code table of the current byte in the transparent transmission information; and comparing the first number, the second number and the third number with preset numerical values respectively, and outputting a transparent information processing result of the current byte or a transmission end mark according to the comparison result. The unit of the processing of the invention is byte, the processing time consumption is short, the processing speed is high, the invention can meet the requirement of high-speed network transmission, and the realization is simpler and the processing speed is higher.

Description

Transparent information extraction method and device for data
Technical Field
The invention relates to the technical field of network transmission, in particular to a method and a device for extracting transparent information of high-level data link control procedure data.
Background
High-Level Data Link Control (HDLC) is a set of protocols for transferring Data between network nodes. When transparent information is transmitted according to the HDLC, data is grouped into units (called frames), and is transmitted through a network after being processed by inserting a bit "0" after 5 bits "1", and a receiving device usually adopts a traditional extraction processing method of transparent transmission information, that is, bits are extracted one by one to judge that the bits are "0" and "1", and accumulate and calculate the continuous length of the bit "1", and for the situation that the bit "0" is inserted after 5 continuous bits "1", a method of removing the bit "0" in a single-bit manner is adopted to obtain the transparent transmission information.
Disclosure of Invention
The present invention is directed to solving one of the problems set forth above.
The invention mainly aims to provide a method for extracting transparent information of high-level data link control procedure data.
Another object of the present invention is to provide a transparent information extraction apparatus of the advanced data link control procedure data.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
one aspect of the present invention provides a method for extracting transparent information of high-level data link control procedure data, comprising:
receiving high-level data link control procedure HDLC data;
judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data, if so, acquiring the initial bit of transparent information transmission in the next byte in the continuous 2 bytes;
extracting transparent transmission information in the HDLC data from the starting bit;
obtaining a first number of continuous bits 1 in the current byte, a second number of continuous bits 1 connected with the previous byte and a third number of continuous bits 1 connected with the next byte according to a byte value lookup code table of the current byte in the transparent transmission information;
and comparing the first number, the second number and the third number with preset numerical values respectively, and outputting the transparent information processing result of the current byte according to the comparison result, or inquiring the code table according to the comparison result to output the transparent information processing result of the current byte, or outputting a transmission end mark according to the comparison result.
Optionally, the bytes identifying the network idle data include one of: the device comprises a mark sequence byte and 7 derived sequence bytes of the mark sequence byte, wherein the derived sequence bytes are obtained by circularly shifting bit bits of the mark sequence byte;
the judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data comprises the following steps: and respectively comparing the continuous 2 bytes with the bytes for identifying the network idle data, and judging whether only the previous byte is the network idle data.
Optionally, the code table includes a first code table, where:
the obtaining of the start bit of the transparent information transmission in the next byte in the consecutive 2 bytes includes:
and inquiring the first code table by using the byte numerical value of the previous byte in the continuous 2 bytes as a code table array sequence number to obtain the initial bit of transparent information transmission in the next byte in the continuous 2 bytes.
Optionally, the code table further includes a second code table, a third code table, and a fourth code table, where:
the obtaining a first number of consecutive bits 1 in the current byte according to the current byte lookup code table in the transparent transmission information includes:
inquiring the second code table by taking the byte numerical value of the current byte as a code table array sequence number to obtain a first number of continuous bits 1 in the byte, wherein the bit positions occupied by the continuous bits 1 in the current byte at most start from a 0 th bit and end at most from a 7 th bit;
the obtaining a second number of consecutive bits 1 of the current byte connected to the previous byte according to the current byte lookup code table in the transparent transmission information includes:
judging whether the code table query processing identifier is true, if true, the second number is 0, otherwise, the byte value of the current byte is used as the code table array sequence number to query the third code table, and a fourth number of continuous bits 1 from the 0 th bit position to the back in the current byte is obtained; inquiring the fourth code table by taking the byte numerical value of the last byte of the current byte as a code table array sequence number to obtain a fifth number of continuous bits 1 of the last byte of the current byte from the 7 th bit, and taking the sum of the fourth number and the fifth number as the second number;
the obtaining a third number of consecutive bits 1 of the current byte and the next byte according to the current byte lookup code table in the transparent transmission information includes: inquiring the third code table by taking the byte numerical value of the next byte of the current byte as a code table array sequence number to obtain the sixth number of continuous bits 1 from the 0 th bit in the next byte of the current byte to the back; and inquiring the fourth code table by taking the byte numerical value of the current byte as a code table array sequence number to obtain a seventh number of continuous bits 1 from a 7 th bit of the current byte to the front, and taking the sum of the sixth number and the seventh number as the third number.
Optionally, the preset number is equal to 5; the code table comprises a fifth code table, a sixth code table and a seventh code table;
the comparing the first number, the second number, and the third number with a preset number, and outputting the transparent information processing result of the current byte according to the comparison result, or querying the code table according to the comparison result to output the transparent information processing result of the current byte, or outputting a transmission end flag according to the comparison result, includes:
under the condition that the first number and the second number are both smaller than 5, outputting a transparent information processing result of the current byte;
under the condition that only one of the first number and the second number is equal to 5 and the third number is not greater than 5, if the byte value of the next byte of the current byte is greater than or equal to 0 and less than 128, inquiring the fifth code table by taking the byte value of the current byte as a code table array sequence number, and if the byte value of the next byte of the current byte is greater than 127 and less than 256, inquiring the sixth code table by taking the byte value of the current byte as a code table array sequence number, so as to obtain and output the transparent information processing result of the current byte;
under the condition that the first number and the second number are both equal to 5 and the third number is not greater than 5, selecting a corresponding array in the seventh code table according to the byte value of the current byte, and querying the corresponding array in the seventh code table by using a value obtained by combining the bit value of the 0 th bit and the bit value of the 1 st bit of the next byte of the current byte as an array sequence number to obtain and output a transparent information processing result of the current byte;
outputting the transmission end flag if one of the first number, the second number, and the third number is greater than 5.
Optionally, extracting transparent transmission information in the HDLC data from the start bit includes:
s1, setting the position i of the extracted byte to be 1; the starting bit N is one of the following bits: 0. 1, 2, 3, 4, 5, 6 and 7;
s2, obtaining the ith byte from the start bit N as the current byte in the transparent transmission information;
s3, judging whether the current byte is the network idle data, if so, executing a step S8, otherwise, executing a step S4;
s4, comparing the first number, the second number and the third number with the preset number, wherein the preset number is 5; if both the first number and the second number are less than 5, performing step S5; in a case where only one of the first number and the second number is equal to 5 and the third number is not greater than 5, performing step S6; in a case where the first number and the second number are both equal to 5 and the third number is not greater than 5, performing step S7; if one of the first number, the second number, and the third number is greater than 5, performing step S8;
s5, if both the first number and the second number are less than 5, making i equal to i +1, and returning to step S2;
s6, if only one of the first number and the second number is equal to 5 and the third number is not greater than 5, making N equal to N +1, and determining whether N is greater than 7; if yes, making i equal to i +2 and N equal to 0, returning to step S2, otherwise, making i equal to i +1, returning to step S2;
s7, if the first number and the second number are both equal to 5, making N equal to N +2, and determining whether N is greater than 7; if so, the process returns to step S2 by setting i to i +2 and N to N% 8, otherwise, the process returns to step S2 by setting i to i + 1.
And S8, finishing extracting the transparent transmission information.
Another aspect of the present invention provides an apparatus for extracting transparent information of control procedure data of an advanced data link, comprising:
the receiving module is used for receiving HDLC data of a high-level data link control procedure;
the starting position judging module is used for judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data, and if so, acquiring a starting bit for transmitting transparent information in the next byte in the continuous 2 bytes;
a transparent information extraction module, configured to extract transparent transmission information in the HDLC data from the start bit; obtaining a first number of continuous bits 1 in the current byte, a second number of continuous bits 1 connected with the previous byte and a third number of continuous bits 1 connected with the next byte according to a byte value lookup code table of the current byte in the transparent transmission information; and comparing the first number, the second number and the third number with preset numerical values respectively, and outputting the transparent information processing result of the current byte according to the comparison result, or inquiring the code table according to the comparison result to output the transparent information processing result of the current byte, or outputting a transmission end mark according to the comparison result.
Optionally, the bytes identifying the network idle data include one of: the device comprises a mark sequence byte and 7 derived sequence bytes of the mark sequence byte, wherein the derived sequence bytes are obtained by circularly shifting bit bits of the mark sequence byte;
the starting position judging module is configured to judge whether only a previous byte in consecutive 2 bytes in the HDLC data is network idle data, and includes: and respectively comparing the continuous 2 bytes with the bytes for identifying the network idle data, and judging whether only the previous byte is the network idle data.
Optionally, the code table includes a first code table, where:
the starting position determining module is configured to obtain a starting bit for transmitting transparent information in a subsequent byte of the consecutive 2 bytes, and includes: and inquiring the first code table by using the byte numerical value of the previous byte in the continuous 2 bytes as a code table array sequence number to obtain the initial bit of transparent information transmission in the next byte in the continuous 2 bytes.
Optionally, the code table further includes a second code table, a third code table, and a fourth code table, where:
the transparent information extraction module is configured to obtain, according to a current byte lookup code table in the transparent transmission information, a first number of consecutive bits 1 in the current byte, and includes: inquiring the second code table by taking the byte numerical value of the current byte as a code table array sequence number to obtain a first number of continuous bits 1 in the byte, wherein the bit positions occupied by the continuous bits 1 in the current byte at most start from a 0 th bit and end at most from a 7 th bit;
the transparent information extraction module is configured to obtain, according to a current byte lookup code table in the transparent transmission information, a second number of consecutive bits 1 of the byte connected to a previous byte, and includes: judging whether the code table query processing identifier is true, if true, the second number is 0, otherwise, the byte value of the current byte is used as the code table array sequence number to query the third code table, and a fourth number of continuous bits 1 from the 0 th bit position to the back in the current byte is obtained; inquiring the fourth code table by taking the byte numerical value of the last byte of the current byte as a code table array sequence number to obtain a fifth number of continuous bits 1 of the last byte of the current byte from the 7 th bit, and taking the sum of the fourth number and the fifth number as the second number;
the transparent information extraction module is configured to obtain, according to a current byte lookup code table in the transparent transmission information, a third number of consecutive bits 1 of the byte connected to a next byte, and includes: inquiring the third code table by taking the byte numerical value of the next byte of the current byte as a code table array sequence number to obtain the sixth number of continuous bits 1 from the 0 th bit in the next byte of the current byte to the back; and inquiring the fourth code table by taking the byte numerical value of the current byte as a code table array sequence number to obtain a seventh number of continuous bits 1 from a 7 th bit of the current byte to the front, and taking the sum of the sixth number and the seventh number as the third number.
Optionally, the preset number is equal to 5; the code table comprises a fifth code table, a sixth code table and a seventh code table;
the transparent information extraction module is configured to compare the first number, the second number, and the third number with preset numerical values, and output the transparent information of the current byte according to a comparison result, or query the code table according to the comparison result to output the transparent information of the current byte, or output a transmission end flag according to the comparison result, and includes:
under the condition that the first number and the second number are both smaller than 5, outputting a transparent information processing result of the current byte;
under the condition that only one of the first number and the second number is equal to 5 and the third number is not greater than 5, if the byte value of the next byte of the current byte is greater than or equal to 0 and less than 128, inquiring the fifth code table by taking the byte value of the current byte as a code table array sequence number, and if the byte value of the next byte of the current byte is greater than 127 and less than 256, inquiring the sixth code table by taking the byte value of the current byte as a code table array sequence number, so as to obtain and output the transparent information processing result of the current byte;
under the condition that the first number and the second number are both equal to 5 and the third number is not greater than 5, selecting a corresponding array in the seventh code table according to the byte value of the current byte, and querying the corresponding array in the seventh code table by using a value obtained by combining the bit value of the 0 th bit and the bit value of the 1 st bit of the next byte of the current byte as an array sequence number to obtain and output a transparent information processing result of the current byte;
outputting the transmission end flag if one of the first number, the second number, and the third number is greater than 5.
Compared with the traditional transparent information extraction processing method, the method has the advantages that the processing unit is byte, the processing time is short, the processing speed is high, and the method can meet the requirement of high-speed network transmission; the method is very suitable for extracting and processing the HDLC data transparent transmission information through software, and is simpler to realize and higher in processing speed.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on the drawings without creative efforts.
Fig. 1 is a flowchart of a transparent information extraction method for high-level data link control procedure data according to embodiment 1 of the present invention;
fig. 2 is a flowchart of extracting transparent transmission information from a start bit according to embodiment 1 of the present invention;
fig. 3 is a schematic structural diagram of a transparent information extraction apparatus for the hdlc procedure data according to embodiment 2 of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention are clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present invention without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "center", "longitudinal", "lateral", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", and the like, indicate orientations or positional relationships based on those shown in the drawings, and are used only for convenience in describing the present invention and for simplicity in description, and do not indicate or imply that the referenced devices or elements must have a particular orientation, be constructed and operated in a particular orientation, and thus, are not to be construed as limiting the present invention. Furthermore, the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying a relative importance or quantity or location.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Example 1
The embodiment of the invention provides a method for extracting transparent information of high-level data link control procedure data. As shown in fig. 1, the method for extracting transparent information of the advanced data link control procedure data includes the following steps (S101-S105):
s101, receiving HDLC data of a high-level data link control procedure;
the HDLC data includes a plurality of bytes, each byte includes 8 bits, and from 0 th bit to 7 th bit, such as 01011111, the value of the 0 th bit in the byte is bit 0, and the value of the 7 th bit is bit 1. And when the network idle data is detected again, the transparent information transmission is marked to be finished.
S102, judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data, if so, acquiring the initial bit of transparent information transmission in the next byte in the continuous 2 bytes;
as an optional implementation manner in this embodiment, the bytes for identifying the network idle data include one of the following: the flag sequence byte and 7 derived sequence bytes of the flag sequence byte, wherein the derived sequence bytes are obtained by circularly shifting the bit of the flag sequence byte. Where the standard flag sequence byte is 01111110, and hexadecimal representation is 0x 7E. After cyclic shifting the bits of the flag sequence byte, the following 7 derived sequence bytes can be obtained: 00111111, 10011111, 11001111, 11100111, 11110011, 11111001 and 11111100, hexadecimal as 0x3F, 0x9F, 0xCF, 0xE7, 0xF3, 0xF9 and 0 xFC. In this embodiment, the determining whether only the previous byte in the consecutive 2 bytes in the HDLC data is network idle data includes: and respectively comparing the continuous 2 bytes with the bytes for identifying the network idle data, and judging whether only the previous byte is the network idle data. When the previous byte is judged to be network idle data, transparent information is transmitted from the next byte. Therefore, the starting byte of the transparent information transmitted in the HDLC data can be determined, and then the transparent transmission information in the HDLC data is extracted and analyzed.
In the present embodiment, when extracting the transparent transmission information in the HDLC data, each byte of the transparent transmission information outputs the transparent information processing result of the byte as a code table array sequence number lookup code table by the byte value (i.e., decimal value) of the byte. Therefore, before implementing the present method for extracting transparent data information in the advanced data link control procedure, the following code table needs to be established:
a first code table:
Figure GDA0003197674140000081
the first code table is an array consisting of 256 code table values, the sequence number of the code table array is 0-255, and the first code table is used for recording the start bit of 8 flag sequence bytes for identifying the byte comparison standard of the network idle data, and is referred to as the first code table.
A second code table:
Figure GDA0003197674140000082
the second code table is also an array consisting of 256 code table values, the sequence number of the code table array is 0-255, and the second code table is used for recording the number of continuous longest bits of 1 in all bytes consisting of 8 bits, and is referred to as the second code table.
A third code table:
Figure GDA0003197674140000083
Figure GDA0003197674140000091
the third code table is also an array consisting of 256 code table values, the sequence number of the code table array is 0-255, and the third code table is used for recording the number of continuous longest bits of 1 from the 0 th bit in all bytes consisting of 8 bits, and is referred to as the third code table.
Fourth code table:
Figure GDA0003197674140000092
the fourth code table is also an array consisting of 256 code table values, the sequence number of the code table array is 0-255, and the fourth code table is used for recording the number of continuous longest bits of 1 from the 7 th bit in all bytes consisting of 8 bits, and the fourth code table is referred to.
The fifth code table:
Figure GDA0003197674140000093
sixth code table:
Figure GDA0003197674140000094
Figure GDA0003197674140000101
the fifth code table and the sixth code table are also arrays consisting of 256 code table numerical values, and the sequence number of the code table arrays is 0-255. When the current byte satisfies 5 consecutive bits of length "1" or the current byte is connected with the previous byte to form 5 consecutive bits of "1", and the number of the consecutive bits of "1" formed by connecting the current byte with the next byte is not greater than 5, it is necessary to delete the bit "0" after 5 consecutive bits of "1", and move the bit value of the 0 th bit of the next byte forward by one bit to complement the 7 th bit of the current byte. And establishing a fifth code table and a sixth code table corresponding to all bytes formed by 8 bits, and referring to the fifth code table and the sixth code table. The fifth code table records the condition that the 0 th bit of the next byte of the current byte is 0, outputs the byte after the bit '0' of the current byte is complemented, and the sixth code table records the condition that the 0 th bit of the next byte of the current byte is 1, and outputs the byte after the bit '1' of the current byte is complemented. Judging the bit value of the 0 th bit of the next byte of the current byte according to the byte value of the next byte, if the byte value of the next byte belongs to 0-127, indicating that the 0 th bit of the next byte is '0', inquiring a fifth code table to obtain a processing result and outputting the processing result; if the byte value of the next byte is 128-255, which indicates that the 0 th bit of the next byte is "1", the sixth code table is queried to obtain the processing result output, and the last bit of the output result byte is from the bit value of the 0 th bit of the next byte at this time.
Seventh code table:
Byte[]AddByte159=new Byte[6]{190,191,0,0};
Byte[]AddByte190=new Byte[6]{252,253,254,255};
Byte[]AddByte223=new Byte[6]{254,255,0,0};
when the current byte satisfies 5 consecutive bit lengths '1' and also satisfies 5 consecutive bit lengths '1' formed by connecting with the previous byte, and the number of consecutive bits '1' formed by connecting the current byte with the next byte is not more than 5, it is necessary to delete the bit '0' after 5 consecutive bits '1' twice, and shift the bit values of the 0 th bit and the 1 st bit of the next byte forward by 2 bits to complement the 6 th bit and the 7 th bit of the current byte. That is, the current byte is 11011111 (byte value is 223), the previous byte is 0111, or the current byte is 10111110 (byte value is 190), the next byte is 01111, or the current byte is 10011111 (byte value is 159), the next byte is 01111), a seventh code table of the special byte in which the situation occurs is established (byte values are 159, 190, 223 respectively), each byte value is established a code table array containing 4 values, see the seventh code table. The array AddByte159 in the seventh code table records that the first 2-bit values of the next byte are 00, 01, 10 and 11 respectively when the byte value of the current byte is 159, the array AddByte190 in the seventh code table records that the first 2-bit values of the next byte are 00, 01, 10 and 11 respectively when the byte value of the current byte is 190, and the array AddByte223 in the seventh code table records that the first 2-bit values of the next byte are 00, 01, 10 and 11 respectively when the byte value of the current byte is 223. When looking up the table, selecting the corresponding array in the seventh code table according to the byte value of the current byte to query, and determining the first 2-bit value of the next byte according to the byte value of the next byte of the current byte, if the byte value of the next byte belongs to 0-63, which indicates that the 0 th and 1-bit bits of the next byte are "00", querying the 0 th value of the corresponding array in the seventh code table, if the byte value of the next byte belongs to 64-127, which indicates that the 0 th and 1-bit bits of the next byte are "01", querying the 1 st value of the corresponding array in the seventh code table, if the byte value of the current byte belongs to 128-, and when the bit number 0 and the bit number 1 of the next byte are '11', inquiring the 3 rd numerical value of the corresponding array in the seventh code table, thereby inquiring the 1 st to 3 rd array entries (the array AddByte159, the array AddByte190 and the array AddByte223) of the corresponding array of the seventh code table respectively according to the four situations to obtain the processing result output, wherein the last two bit values of the output result byte are from the bit values of the bit number 0 and the bit number 1 of the next byte.
CRC check code table:
Figure GDA0003197674140000111
the CRC check code table is also an array consisting of 256 code table values, and the sequence number of the code table array is 0-255. And establishing a CRC code table corresponding to the byte formed by all 8 bits according to the CRC polynomial, and referring to the CRC code table.
Byte-inside anti-sequence code table:
Figure GDA0003197674140000112
the byte internal anti-sequence code table is also an array consisting of 256 code table values, and the sequence number of the code table array is 0-255. According to the results (only 256 kinds of possible) obtained by the byte inner bit reverse order, a reverse order code table corresponding to the byte formed by all 8 bits is established, and the byte inner reverse order code table is referred to above.
As an optional implementation manner in this embodiment, obtaining the start bit of transparent information transmission in the following byte in consecutive 2 bytes includes: and inquiring the first code table by taking the byte numerical value of the previous byte in the continuous 2 bytes as the sequence number of the code table array, and obtaining the initial bit of the transparent information transmission in the next byte in the continuous 2 bytes.
In particular, the first code table may be queried as follows. For example, the previous byte is 01111110(0x7E), the corresponding byte value (decimal value) 126 is the code table array sequence number, and the value of the 126 th code table value in the first code table can be seen to be 0 by querying the first code table, that is, the starting bit of the transparent information transmission in the subsequent byte is 0 bit of the byte; for another example, the previous byte is 00111111(0x3F), the corresponding byte value (decimal value) 63 is the code table array sequence number, and it can be seen by looking up the first code table that the value of the 63 th code table value in the first code table is 1, that is, the starting bit of the transparent information transmission in the next byte is 1 bit of the byte; for another example, the previous byte is 11111100(0xFC), the corresponding byte value (decimal value) 252 is the code table array sequence number, and it can be seen by looking up the first code table that the value of the 252 th code table in the first code table is 7, that is, the start bit of the transparent information transmission in the next byte is 7 bits of the byte.
S103, extracting transparent transmission information from the initial bit;
in this embodiment, the transparent transmission information is extracted from the start bit of the start byte (i.e. the "start bit of transparent information transmission in the next byte in 2 consecutive bytes" mentioned in step S102) in sequence byte by byte, and the extraction is stopped until a flag indicating the end of transparent information transmission appears.
S104, obtaining a first number of continuous bits 1 in the byte in the current byte, a second number of continuous bits 1 connected with the previous byte and a third number of continuous bits 1 connected with the next byte according to the current byte lookup code table in the transparent transmission information;
as an optional implementation manner in this embodiment, obtaining the first number of consecutive bits 1 in this byte according to the current lookup code table of this byte in the transparent transmission information includes: inquiring a second code table by taking the byte numerical value of the current byte as the sequence number of the array of the code table to obtain a first number of continuous bits 1 in the byte, wherein the bit positions occupied by the continuous bits 1 in the current byte in the byte start from the 0 th bit at most and end with the 7 th bit at most;
as an optional implementation manner in this embodiment, obtaining the second number of consecutive bits 1 of the present byte connected to the previous byte according to the current present byte lookup code table in the transparent transmission information includes: judging whether the code table query processing identifier is true, if true, the second number is 0, otherwise, taking the byte numerical value of the current byte as the code table array sequence number to query a third code table, and obtaining a fourth number of continuous bits 1 from the 0 th bit position to the back in the current byte; inquiring a fourth code table by taking the byte numerical value of the last byte of the current byte as the sequence number of the code table array, obtaining the fifth number of the continuous bit 1 of the last byte of the current byte from the 7 th bit, and taking the sum of the fourth number and the fifth number as the second number;
as an optional implementation manner in this embodiment, obtaining, according to the current byte lookup code table in the transparent transmission information, a third number of consecutive bits 1 of the byte connected to the next byte includes: inquiring a third code table by taking the byte numerical value of the next byte of the current byte as the sequence number of the code table array, and obtaining the sixth number of the continuous bits 1 from the 0 th bit position to the back in the next byte of the current byte; and inquiring a fourth code table by taking the byte numerical value of the current byte as the sequence number of the code table array, obtaining a seventh number of continuous bits 1 from the 7 th bit of the current byte to the front, and taking the sum of the sixth number and the seventh number as a third number.
In this embodiment, the meaning of the first number is the number of consecutive bits 1 in this byte in the current byte, and the first number is obtained and compared with the preset number of 5, so as to determine whether there is a situation of consecutive 5 bits 1 in this byte.
In this embodiment, the second number means the number of consecutive bits 1 of the byte connected to the previous byte, and the second number is obtained and compared with the preset number 5, so as to determine whether there is a situation of consecutive 5 bits 1 when the byte is connected to the previous byte. The code table query processing identifier is true, which indicates that the transparent information processing result of the previous byte is output by querying the fifth code table, the sixth code table or the seventh code table, otherwise, the code table query processing identifier is false.
In this embodiment, the third number means the number of consecutive bits 1 connecting this byte and the next byte in the present byte. And acquiring a third number, and judging whether the third number is greater than a preset number 5, thereby determining whether the connection between the byte and the next byte is greater than 5 continuous bits 1. When the following special cases occur: the last 5 bits of the current byte are all 1 (the second number is equal to 5), and meanwhile, the 0 th bit of the next byte is also 1, that is, the current byte is connected with the next byte to form a situation of more than 5 continuous bits 1, namely 6 continuous bits 1, and the special situation can directly output the current byte as a transmission end mark. In order to avoid that the processing performed after the byte is connected with the previous byte to form 5 consecutive bits 1 is determined to conflict with the special situation, in this embodiment, the third number is compared with the preset number, when the third number is not greater than the preset number 5, that is, when 6 consecutive bits 1 do not occur, the byte of the transparent transmission information is read, step S105 is performed, that is, the first number and the second number are compared with the preset number, and the transparent information processing result of the current byte is output according to the comparison result, or the transmission end flag is output according to the comparison result.
In particular, the second code table may be queried as follows. For example, when the present byte is 01100000, the corresponding byte value (decimal value) 96 is the sequence number of the array of the code tables, and it can be seen by looking up the second code table that the value of the 96 th code table in the second code table is 2, i.e. the first number representing the continuous longest bit "1" of the byte is 2. For another example, when the current byte is 00111100, the corresponding byte value (decimal value) 60 is the sequence number of the array of the code table, and the value of the 60 th code table in the second code table can be seen to be 4 by looking up the second code table, that is, the first number representing the continuous longest bit "1" of the byte is 4.
In particular, the third code table may be queried as follows. For example, when the present byte is 11100000, the corresponding byte value (decimal value) 224 is the code table array sequence number, and the value of the 224 th code table value in the third code table can be seen to be 3 by querying the third code table, that is, the number of the continuous longest bits "1" from the 0 th bit in the byte is 3. For another example, when the current byte is 11110000, the corresponding byte value (decimal value) 240 is the code table array sequence number, and the value of the 240 th code table value in the third code table can be seen to be 4 by querying the third code table, that is, the number of the continuous longest bits "1" from the 0 th bit in the byte is 4.
In particular, the fourth code table may be queried as follows. For example, the current byte is 00000111, the corresponding byte value (decimal value) 7 is the code table array sequence number, and it can be seen by querying the fourth code table that the value of the 7 th code table value in the fourth code table is 3, that is, it means that the number of the continuous longest bits "1" of the current byte from the 7 th bit is 3. For another example, the current byte is 00001111, the corresponding byte value (decimal value) 15 is the code table array sequence number, and it can be seen by looking up the fourth code table that the value of the 15 th code table value in the fourth code table is 4, that is, it means that the number of consecutive longest bits "1" of the current byte from the 7 th bit to the front is 4.
In specific implementation, the current byte is 1100000, the last byte is 00000111, the byte value (decimal value) 192 corresponding to the current byte is the sequence number of the code table array, and it can be seen by querying the third code table that the value of the 192 th code table value in the third code table is 2, that is, it indicates that the fourth number of the longest continuous bits "1" from the 0 th bit backward in the current byte is 2. The byte value (decimal value) 7 corresponding to the previous byte of the current byte is the sequence number of the array of the code table, and it can be seen by looking up the fourth code table that the value of the 7 th code table in the fourth code table is 3, that is, the fifth number representing the previous byte of the current byte and the previous continuous longest bit "1" from the 7 th bit is 3, and the sum of the fourth number 2 and the fifth number 3 is 5, that is, the second number of the continuous bit 1 connecting the current byte and the previous byte is 5.
In specific implementation, the current byte is 0000111, the next byte is 10000011, the byte value (decimal value) 7 corresponding to the current byte is the sequence number of the array of the code table, and by looking up the fourth code table, it can be seen that the value of the 7 th code table in the fourth code table is 3, that is, it means that the seventh number of the longest continuous bits "1" from the 7 th bit in the byte is 3. The byte value (decimal value) 131 corresponding to the next byte of the current byte is the code table array sequence number, and it can be seen by querying the fourth code table that the value of the 131 th code table value in the third code table is 1, that is, the sixth number of the continuous longest bit "1" of the next byte of the current byte from the 0 th bit to the back is 1, and the sum of the sixth number 1 and the seventh number 3 is 4, that is, the third number of the continuous bit 1 connected with the next byte in the current byte is 4.
And S105, comparing the first number, the second number and the third number with preset numerical values respectively, and outputting a transparent information processing result of the current byte according to the comparison result, or inquiring a code table, or outputting a transmission end mark according to the comparison result.
As an optional implementation manner in this embodiment, the preset number is equal to 5; comparing the first number, the second number and the third number with preset numerical values respectively, and outputting a transparent information processing result of the current byte according to a comparison result, or outputting a transparent information processing result of the current byte according to a comparison result query code table, or outputting a transmission end mark according to the comparison result, wherein the method comprises the following judgment and processing modes:
mode (1): under the condition that the first number and the second number are both less than 5, outputting the current byte as a transparent information processing result;
mode (2): under the condition that only one of the first number and the second number is equal to 5 and the third number is not greater than 5, if the byte value of the next byte of the current byte is greater than or equal to 0 and less than 128, inquiring a fifth code table by taking the byte value of the current byte as the code table array sequence number, and if the byte value of the next byte of the current byte is greater than 127 and less than 256, inquiring a sixth code table by taking the byte value of the current byte as the code table array sequence number, and obtaining and outputting the transparent information processing result of the current byte; after deleting bit 0 after 5 continuous bits 1 of the current byte and the previous byte or deleting bit 0 after 5 continuous bits 1 of the current byte, the transparent information processing result of the current byte is obtained by advancing the bit value of the 0 th bit of the next byte of the current byte by one bit to complement the 7 th bit of the current byte, wherein the fifth code table records that the bit value of the 0 th bit of the next byte is bit 0, and the sixth code table records that the bit value of the 0 th bit of the next byte is bit 1.
In particular, the fifth code table and the sixth code table may be queried as follows. Judging the bit value of the 0 th bit of the next byte according to the byte number value of the next byte of the current byte, if the byte value of the next byte belongs to 0-127, indicating that the 0 th bit of the next byte is '0', inquiring a fifth code table to obtain a processing result and outputting the processing result; if the byte value of the next byte is 128-255, which indicates that the 0 th bit of the next byte is "1", the sixth code table is queried to obtain the processing result output, and the last bit of the output result byte is from the bit value of the 0 th bit of the next byte at this time.
Specifically, for example, 00111110 of the current byte satisfies 5 consecutive bits of "1", the corresponding byte value (decimal value) 62 is used as the sequence number of the array of the code table, and if the byte value of the next byte of the current byte is less than 128, the fifth code table is searched by using the byte value 62 of the current byte to obtain 62, that is, 00111110. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0, the bit "0" after the consecutive 5 bits "1" in the current byte is deleted, and then the bit "0" is complemented from the next byte, so as to obtain 00111110, but by the method of this embodiment, the fifth code table can be directly queried to output the result 00111110. If the byte value of the next byte of the current byte is greater than 127, the sixth code table is looked up 63 by using the byte value 62 of the current byte, i.e., 00111111. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 1, the bit "0" after the continuous 5 bits "1" in the current byte is deleted, and then the bit "1" is complemented from the next byte, the result is 00111111, but by the method of this embodiment, the sixth code table can be directly queried to output the result 00111111. Therefore, the current byte is output through the direct code lookup table, the processing time is short, the processing speed block is high, and the method can meet the requirement of high-speed network transmission.
For another example, the current byte is 01111100 and satisfies 5 consecutive bits of "1", the corresponding byte value (decimal value) 124 is the code table array sequence number, and if the byte value of the next byte of the current byte is less than 128, the fifth code table is queried by the code table array sequence number 124 to obtain 124, that is, 01111100. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0, the bit "0" after the consecutive 5 bits "1" in the current byte is deleted, and then the bit "0" is complemented from the next byte to obtain 01111100, but by the method of this embodiment, the result 01111100 can be directly queried. If the byte value of the next byte of the current byte is greater than 127, the sixth code table is queried with the code table array sequence number 124 to obtain 125, 01111101. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 1, the bit "0" after the continuous 5 bits "1" in the current byte is deleted, and then the bit "1" is complemented from the next byte, the obtained result is 01111101, but by the method of the embodiment, the sixth code table can be directly inquired to output the result 01111101. Therefore, the current byte is output through the direct code lookup table, the processing time is short, the processing speed block is high, and the method can meet the requirement of high-speed network transmission.
For another example, the current byte is 11110000, the previous byte is 00001001, the current byte and the previous byte are connected to form a continuous 5-bit "1", the byte value (decimal value) 240 corresponding to the current byte being 11110000 is the code table array sequence number, if the byte value of the next byte of the current byte is less than 128, the fifth code table is queried by the code table array sequence number 240 to obtain 240, that is, 11110000. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0, the bit "0" after the continuous 5 bits "1" of the current byte is deleted, and then the bit "0" is complemented from the next byte, so that 11110000 is obtained. By the method of this embodiment, the output result of the fifth code table can be directly queried to be 11110000. If the byte value of the next byte of the current byte is greater than 127, the sixth code table is queried by using the code table array sequence number 240 to obtain 241, that is, 11110001, it can be determined that the bit value of the 0 th bit of the next byte of the current byte is 1, according to the prior art, the bit "0" after consecutive 5 bits "1" is deleted, and then the bit "1" is complemented from the next byte to obtain 11110001, but by the method of this embodiment, the output result of the sixth code table can be directly queried to be 11110001. Therefore, the current byte is output through the direct code lookup table, the processing time is short, the processing speed block is high, and the method can meet the requirement of high-speed network transmission.
For another example, the current byte is 11100001, the previous byte is 00001011, the current byte and the previous byte are connected to form a continuous 5-bit "1", the byte value (decimal value) 225 corresponding to the current byte being 11100001 is the code table array sequence number, and if the byte value of the next byte of the current byte is less than 128, the fifth code table is queried by the code table array sequence number 225 to obtain 226, that is, 11100010. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0, the bit "0" after the consecutive 5 bits "1" in the current byte is deleted, and then the bit "0" is complemented from the next byte to obtain 11100010, but by the method of this embodiment, the output result of the fifth code table can be directly queried to be 11110010. If the byte value of the next byte of the current byte is greater than 127, the sixth code table is queried using the code table array sequence number 225 to obtain 227, i.e., 11100011. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 1, the bit "0" after the consecutive 5 bits "1" in the current byte is deleted, and then the bit "1" is complemented from the next byte, so as to obtain 11100011, but by the method of the embodiment, the output result of the sixth code table can be directly inquired to be 11100011. Therefore, the current byte is output through the direct code lookup table, the processing time is short, the processing speed block is high, and the method can meet the requirement of high-speed network transmission.
Mode (3): under the condition that the first number and the second number are both equal to 5 and the third number is not more than 5, selecting a corresponding array in the seventh code table according to the byte value of the current byte, and then using the numerical value of the first 2 bits in the next byte of the current byte as an array sequence number to query the corresponding array in the seventh code table, so as to obtain and output the transparent information processing result of the current byte; after deleting bit 0 after continuous 5 bits 1 of the current byte and the previous byte are connected and bit 0 after continuous 5 bits 1 in the current byte are deleted, shifting the bit value of the 0 th bit and the bit value of the 1 st bit of the next byte of the current byte forward to complement the 6 th bit and the 7 th bit of the current byte;
in particular, the seventh code table may be queried as follows. Firstly, selecting a corresponding array in the seventh code table according to the byte value of the current byte, for example, when the byte value of the current byte is 159, selecting an array AddByte159 in the seventh code table; when the byte value of the current byte is 190, the array AddByte190 in the seventh code table is selected, and when the byte value of the current byte is 223, the array AddByte223 in the seventh code table is selected. Then, the first 2-bit value is determined according to the byte value of the next byte of the current byte. If the byte value of the next byte of the current byte belongs to 0-63, it means that the 0 th and 1 st bits of the next byte are "00", then query the 0 th value of the corresponding array in the seventh code table, if the byte value of the next byte of the current byte belongs to 64-127, it means that the 0 th and 1 st bits of the next byte are "01", query the 1 st value of the corresponding array in the seventh code table, if the byte value of the next byte of the current byte belongs to 128-191, it means that the 0 th and 1 st bits of the next byte are "10", query the 2 nd value of the corresponding array in the seventh code table, if the byte value of the next byte of the current byte belongs to 192-255, it means that the 0 th and 1 st bits of the next byte are "11", then query the 3 rd value of the corresponding array in the seventh code table, thereby query the 1 st to 3 rd array items of the corresponding code table 7 according to the above four cases Array AddByte159, array AddByte190, and array AddByte223) to obtain the processing result output, where the last two-bit value of the output result byte comes from the 0 th and 1 st bits of the next byte.
For example, the current byte is 10111110, the previous byte is 00001111, the current byte satisfies 5 consecutive bit lengths "1" and simultaneously satisfies 5 consecutive bit lengths "1" connected to the previous byte, the value (decimal value) of the byte corresponding to the current byte is 10111110 is 190, and the array AddByte190 in the seventh code table is selected for query. If the next byte of the current byte is 00110011, the byte value is 51, which belongs to the range from 0 to 63, and the values of the first two bits 00 are 0, then the seventh code table AddByte190 is queried with the array sequence number 0 to obtain 252, i.e., 11111100. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0 and the bit value of the 1 st bit is 0, deleting the bit "0" after the bit "1" of the 0 th bit and the bit "0" after the bit "1" of the 6 th bit in the current byte 10111110, and then padding the bit "00" from the next byte to obtain 11111100, while by the method of the present embodiment, the output result of the number AddByte190 in the seventh code table can be directly queried to be 11111100; if the next byte of the current byte is 01010011, the byte value is 83, which belongs to between 64-127, and the first two bits are 01, whose value is 1, then the array AddByte190 in the seventh code table is looked up with the array sequence number 1, resulting in 253, i.e., 11111101. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0 and the bit value of the 1 st bit is 1, deleting the bit "0" after the bit "1" of the 0 th bit and the bit "0" after the bit "1" of the 6 th bit in the current byte 10111110, and then padding the bit "01" from the next byte to obtain 11111101, while by the method of the present embodiment, the output result of the array AddByte190 in the seventh code table can be directly queried to be 11111101; therefore, the current byte is output through the direct code lookup table, the processing time is short, the processing speed block is high, and the method can meet the requirement of high-speed network transmission.
For another example, the current byte is 10011111, the previous byte is 00001111, the current byte satisfies 5 consecutive bit lengths "1" and also satisfies 5 consecutive bit lengths "1" connected to the previous byte, the value (decimal value) of the byte corresponding to the current byte 10011111 is 159, and the array AddByte159 in the seventh code table is selected for query. If the next byte of the current byte is 00000011, the byte value is 3, which belongs to the range from 0 to 63, and the value of the first two bits 00 is 0, then the array AddByte159 in the seventh code table is queried with the array sequence number 0, resulting in 190, i.e., 10111110. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0 and the bit value of the 1 st bit is 0, the "0" of the 0 th bit after deleting the "1" of the 0 th bit and the "0" of the 0 th bit after deleting the "1" of the 7 th bit in the previous byte 10011111, and then the "0" of the 1 st bit is complemented from the next byte, so that 10111110 is obtained, while by the method of the present embodiment, the output result of the array AddByte159 in the seventh code table can be directly inquired to be 10111110; if the next byte of the current byte is 01000011, the byte value is 67, which belongs to between 64-127, and the first two bits are 01, the value is 1, so the array AddByte159 in the seventh code table is looked up with the array sequence number 1, resulting in 191, i.e. 10111111. According to the prior art, if the bit value of the 0 th bit of the next byte of the current byte is 0 and the bit value of the 1 st bit is 1, the bit "0" after the bit "1" of the 0 th bit and the bit "0" of the 0 th bit of the 7 th bit in the previous byte 10011111 are deleted, and then the bit "1" of the 1 st bit is complemented from the next byte, so that 10111111 is obtained, while by the method of the present embodiment, the output result of the array AddByte159 in the seventh code table can be directly queried to be 10111111; therefore, the current byte is output through the direct code lookup table, the processing time is short, the processing speed block is high, and the method can meet the requirement of high-speed network transmission.
If the next byte of the current byte is 10000011, the byte value is 131, which belongs to the range between 128 and 191, and the value of the first two bits is 2, but since the continuous 5 bits "1" of the current byte 10011111 and the 1 bit "1" of the 0 th bit of the next byte of the current byte is 10000011 form 6 bits "1", that is, the third number of the current byte is 6, the transparent information transmission end flag appears, and the processing can be performed by referring to the method (4). If the next byte of the current byte is 11000011, the byte value is 195, which belongs to the interval between 192 and 255, and the value of the first two bits is "11" is 3, but since the continuous 5 bits "1" of the current byte 10011111 plus the 1 bit "1" of the 0 th bit and the 1 bit "1" of the 1 st bit of the current byte which is 11000011, form 7 bits "1", according to the encoding rule of HDLC, there is no case of more than 6 bits "1", and no such case occurs, and it can be handled with reference to the method (4).
And (4) outputting a transmission end flag if one of the first number, the second number and the third number is greater than 5.
In this manner, if there is one greater than 5, it indicates that there are bytes for identifying network idle data, i.e. flag sequence bytes and 7 derived sequence bytes of the flag sequence bytes, and at this time, it indicates that the transparent information transmission is finished.
As an alternative implementation manner in this embodiment, as shown in fig. 2, the step S103 of extracting the transparent transmission information in the HDLC data from the start bit includes the following steps (S1-S8):
s1, setting the position i of the extracted byte to be 1; the start bit N is one of: 0. 1, 2, 3, 4, 5, 6 and 7;
in this alternative embodiment, when the last byte of the consecutive 2 bytes is determined to be network idle data, since the standard flag sequence byte has 7 derived sequence bytes, the start bit of the transparent information transmission in the next byte may be any value from 0 to 7, and one byte includes 8 bits, from 0 bit to 7 bit from left to right. By querying the first code table, one can obtain: when the last byte is the standard mark sequence byte 01111110, the start bit is the 0 th bit; when the last byte is 00111111, the start bit is bit 1; when the last byte is 10011111, the start bit is bit 2; when the last byte is 11001111, the start bit is bit 3; when the last byte is 11100111, the start bit is bit 4; when the last byte is 11110011, the start bit is bit 5; when the last byte is 11111001, the start bit is bit 6; when the last byte is 11111100, the start bit is bit 7.
Where i ═ 1 indicates that the extracted byte position is the 1 st byte from the start bit N.
S2, obtaining the ith byte from the start bit N as the current byte in the transparent transmission information;
s3, judging whether the current byte is network idle data, if so, executing a step S8, otherwise, executing a step S4;
for determining whether the current byte is network idle data, reference may be made to the specific description in step S102, which is not described herein again. After extracting the plurality of bytes, if the current byte is the network control data, it indicates that the transmission end flag appears, then step S8 is executed, and the transmission end flag is output.
S4, comparing the first number, the second number and the third number with preset numerical values respectively; in a case where both the first number and the second number are less than 5, performing step S5; in the case where only one of the first number and the second number is equal to 5 and the third number is not greater than 5, performing step S6; in a case where the first number and the second number are both equal to 5 and the third number is not greater than 5, performing step S7; in a case where one of the first number, the second number, and the third number is greater than 5, performing step S8;
s5, if both the first number and the second number are less than 5, making i equal to i +1, and returning to step S2;
when the first number and the second number are both less than 5, it indicates that the number of the current byte and the number of the consecutive bits 1 formed by connecting with the previous byte are less than 5, and no bit padding operation is needed, so that the start bit is not changed, the transparent information processing result of the current byte is directly output, and step S2 is executed to continue reading the next byte.
S6, if only one of the first number and the second number is equal to 5 and the third number is not greater than 5, making N equal to N +1, and determining whether N is greater than 7; if yes, making i equal to i +2 and N equal to 0, returning to step S2, otherwise, making i equal to i +1, returning to step S2;
in this embodiment, only one of the first number and the second number is equal to 5, and the third number is not greater than 5, which indicates that consecutive 5 bits 1 occur in the current byte, or the number of consecutive bits 1 formed by connecting the current byte with the previous byte is equal to 5, and the consecutive bits 1 formed by connecting the current byte with the next byte is not greater than 5, and no end mark sequence occurs. At this time, the bit value of the 0 th bit of the next byte needs to be complemented with the 7 th bit of the current byte, and the start bit is shifted backward by one bit, that is, the value of N is added by 1, alternatively, the N after adding 1 is complemented by 8 (N% 8), and the operation result is a new start bit. Specifically, when N is 7, the start bit is the last bit of a byte, and if one bit is complemented and the start bit is shifted backward by one bit, N +1 is 8>7, then the next time a new byte is read, it needs to be extracted from the 0 th bit of the next byte next to the current byte. For example, assuming that the current byte is read from the 5 th byte with the start bit N being 7, when 5 consecutive bits 1 occur and the start bit needs to be shifted backward by one bit, the value of N is added with 1, at this time, the value of N +1 is 8, the N after 1 addition is complemented with 8, N% 8 is 0, i.e. the new start bit is 0 bit, N is 0, and i is i +2, and then the process returns to step S2 to obtain the 7 th byte from the start bit 0 as the current byte in the transparent transmission information. Of course, if N +1 is not greater than 7, the byte is still read from the start bit N (N ═ N +1) of the next byte (i.e., i ═ i +1) of the current present byte.
In the case that only one of the first number and the second number is equal to 5 and the third number is not greater than 5, the transparent information processing result of the current byte may be output by querying the fifth code table and the sixth code table in the manner mentioned in the step S105 in this embodiment in the manner (2), and the specific implementation manner may be referred to above and is not described here again.
S7, if the first number and the second number are both equal to 5 and the third number is not greater than 5, making N equal to N +2, and determining whether N is greater than 7; if yes, making i equal to i +2 and N equal to N% 8, returning to step S2, otherwise, making i equal to i +1, returning to step S2;
in this embodiment, the first number and the second number are both equal to 5 and the third number is not greater than 5, which indicates that 5 consecutive bits 1 appear in the current byte, the number of consecutive bits 1 formed by connecting the current byte with the previous byte is equal to 5, the number of consecutive bits 1 formed by connecting the current byte with the next byte is not greater than 5, and no end flag sequence appears. At this time, the bit value of the 0 th bit and the 1 st bit of the next byte needs to be complemented with the 6 th bit and the 7 th bit of the current byte, and the start bit is shifted backward by two bits, that is, the value of N is added by 2, optionally, the N after adding 2 is subjected to the remainder operation (N% 8), and the operation result is a new start bit. For example, when N is 6, the start bit is the 2 nd bit from the last of one byte, and if 2 bits are complemented and the start bit is shifted backward by 2 bits, N +2 is 8>7, then the next time a new byte is read, it is necessary to start extraction from the 0 th bit of the next byte next to the current byte. For example, when the current byte is read from the 5 th byte with the start bit N being 6, and 2 consecutive 5 bits 1 occur, and the start bit needs to be shifted backward by 2 bits, the value of N is added by 2, at this time, the value of N +2 is 8, the N after 2 addition is complemented by 8, N% 8 is 0, that is, the new start bit is 0 bit, N is 0, and i +2 is 7, and then the process returns to step S2 to obtain the 7 th byte from the start bit 0 as the current byte in the transparent transmission information. For another example, if N is 7, the start bit is the 1 st bit from the last of one byte, and if 2 bits are complemented and the start bit is shifted backward by 2 bits, N +2 is 9>7, then the next time a new byte is read, it is necessary to start extraction from the 1 st bit of the next byte next to the current byte. For example, when the current byte is read from the 5 th byte with the start bit N being 7, and 2 consecutive 5 bits 1 occur, and the start bit needs to be shifted backward by 2 bits, the value of N is added by 2, at this time, the value of N +2 is 9, the N after 2 addition is complemented by 8, N% 8 being 1, that is, the new start bit is 1 bit, N being 1, and i +2 being 7, and then the process returns to step S2 to obtain the 7 th byte from the start bit 1 as the current byte in the transparent transmission information. Of course, if N +2 is not greater than 7, the byte is still read from the start bit N (N ═ N +2) of the next byte (i.e., i ═ i +1) of the current present byte.
In the case that the first number and the second number are both equal to 5 and the third number is not greater than 5, the transparent information processing result of the current byte may be output by querying the seventh code table in the manner mentioned in the manner (3) in step S105 of this embodiment, and the specific implementation manner may be referred to above and is not described herein again.
It should be noted that, in step S6 and step S7, if the current byte is one of 00011111, 01011111, 10011111 and 11011111, and if the 0 th bit of the next byte is 1, the third number is greater than 5, and when this occurs, step S8 is executed, i.e., the extraction of the transparent transmission information is finished, and the current byte is output as the transmission end flag.
And S8, finishing extracting the transparent transmission information.
The transparent transmission information can be read byte by byte through the above steps S1-S8 until the reading is stopped after the bytes of the network idle identification data are read. In the process of reading each byte of the transparent transmission information, the transparent information processing result of each byte is output by adopting the transparent information extraction method of the high-level data link control procedure data provided by the embodiment.
As an optional implementation manner in this embodiment, after outputting the transparent information of the current byte in step S105, the method for extracting transparent information of the high-level data link control procedure data provided in this embodiment further includes: and applying a CRC (cyclic redundancy check) code table to check the transparent information of the current byte, and if the check is passed, applying an in-byte anti-sequence code table to perform anti-sequence processing to obtain an extraction processing result of the transparent information of the current byte.
In this optional manner, the CRC check is performed on the transparent information of the current byte, if the CRC check passes, it indicates that the transparent information of the current byte output in step S105 is error-free and has no error code in transmission, if the CRC check fails, the current byte is discarded, the CRC check is performed using the code table, and the CRC check is performed using the byte value of the current byte to query the CRC code table, so as to obtain the processing result. The method comprises the steps of carrying out byte internal bit reverse order on transparent information of a current byte passing CRC check, wherein the byte internal bit reverse order means that 0-7 bits of each byte of the transparent information are arranged in a reverse order, 0-7 bits of the converted byte are 7-0 bits of an original byte, the byte internal reverse order processing is also realized by using a code table, and a processing result can be obtained by using a byte value of the current byte to query the byte internal reverse order code table. As an optional implementation manner, after the CRC check is passed, performing reverse order processing by using an in-byte reverse order code table, and obtaining an extraction processing result of the transparent information of the current byte includes: and removing the CRC bytes (the last two bytes) of the transparent information of the current byte which passes the CRC check, and taking the bytes which are output in the reverse order in the bytes as the extraction processing result of the transparent information of the current byte.
Compared with the traditional transparent information extraction processing method, the method for extracting the transparent information of the high-level data link control procedure data has the advantages that the processing unit is byte, the processing time consumption is short, the processing speed is high, and the method can be more suitable for the requirement of high-speed network transmission; the method is very suitable for extracting and processing the HDLC data transparent transmission information through software, and is simpler to realize and higher in processing speed.
Example 2
The embodiment provides a transparent information extraction device of the advanced data link control procedure data. The measurement and control data analysis device of the unmanned aerial vehicle can be applied to the transparent information extraction method of the high-level data link control procedure data in the embodiment 1. The present embodiment simply describes the structure of the transparent information extraction apparatus for the high level data link control procedure data, and please refer to the description in embodiment 1 for specific relevant matters.
As shown in fig. 3, the apparatus for extracting transparent information of the advanced data link control procedure data includes: receiving module, initial position judge module and transparent information extraction module, wherein:
the receiving module is used for receiving HDLC data of a high-level data link control procedure;
the starting position judging module is used for judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data, and if so, acquiring a starting bit for transmitting transparent information in the next byte in the continuous 2 bytes;
the transparent information extraction module is used for extracting transparent transmission information in the HDLC data from the starting bit; obtaining a first number of continuous bits 1 in the current byte, a second number of continuous bits 1 connected with the previous byte and a third number of continuous bits 1 connected with the next byte according to a byte value lookup code table of the current byte in the transparent transmission information; and comparing the first number, the second number and the third number with preset numerical values respectively, and outputting a transparent information processing result of the current byte according to the comparison result, or querying a code table according to the comparison result to output a transparent information processing result of the current byte, or outputting a transmission end mark according to the comparison result.
As an optional implementation manner in this embodiment, the bytes for identifying the network idle data include one of the following: the identification sequence byte and 7 derived sequence bytes of the identification sequence byte, the derived sequence byte is obtained by circularly shifting the bit of the identification sequence byte;
the starting position judging module is used for judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data, and comprises the following steps: and respectively comparing the continuous 2 bytes with the bytes for identifying the network idle data, and judging whether only the previous byte is the network idle data.
As an optional implementation manner in this embodiment, the code table includes a first code table, where: the starting position judging module is used for acquiring a starting bit of transparent information transmission in a next byte in the continuous 2 bytes, and comprises: and inquiring the first code table by taking the byte numerical value of the previous byte in the continuous 2 bytes as the sequence number of the code table array, and obtaining the initial bit of the transparent information transmission in the next byte in the continuous 2 bytes.
As an optional implementation manner in this embodiment, the code table further includes a second code table, a third code table, and a fourth code table, where:
the transparent information extraction module is configured to obtain a first number of consecutive bits 1 in the current byte according to the current byte lookup code table in the transparent transmission information, and includes: inquiring a second code table by taking the byte numerical value of the current byte as the sequence number of the array of the code table to obtain a first number of continuous bits 1 in the byte, wherein the bit positions occupied by the continuous bits 1 in the current byte in the byte start from the 0 th bit at most and end with the 7 th bit at most;
the transparent information extraction module is configured to obtain a second number of consecutive bits 1 of the current byte connected to the previous byte according to the current byte lookup code table in the transparent transmission information, and includes: judging whether the code table query processing identifier is true, if true, the second number is 0, otherwise, taking the byte numerical value of the current byte as the sequence number of the code table array to query a third code table, and obtaining a fourth number of continuous bits 1 from the 0 th bit position to the back in the current byte; inquiring a fourth code table by taking the byte numerical value of the last byte of the current byte as the sequence number of the code table array, obtaining the fifth number of the continuous bit 1 of the last byte of the current byte from the 7 th bit, and taking the sum of the fourth number and the fifth number as the second number;
the transparent information extraction module is used for obtaining a third number of continuous bits 1 of the byte connected with the next byte according to the current byte lookup code table in the transparent transmission information, and comprises: inquiring a third code table by taking the byte numerical value of the next byte of the current byte as the sequence number of the code table array, and obtaining the sixth number of the continuous bits 1 from the 0 th bit position to the back in the next byte of the current byte; and inquiring a fourth code table by taking the byte numerical value of the current byte as the sequence number of the code table array, obtaining a seventh number of continuous bits 1 from the 7 th bit of the current byte to the front, and taking the sum of the sixth number and the seventh number as a third number.
As an optional implementation manner in this embodiment, the preset number is equal to 5; the code table comprises a fifth code table, a sixth code table and a seventh code table;
the transparent information extraction module is used for comparing the first number, the second number and the third number with preset numerical values respectively, outputting the transparent information of the current byte according to the comparison result, or inquiring a code table according to the comparison result to output the transparent information of the current byte, or outputting a transmission end mark according to the comparison result, and comprises:
under the condition that the first number and the second number are both less than 5, outputting a transparent information processing result of the current byte;
under the condition that only one of the first number and the second number is equal to 5 and the third number is not greater than 5, if the byte value of the next byte of the current byte is greater than or equal to 0 and less than 128, inquiring a fifth code table by taking the byte value of the current byte as the code table array sequence number, and if the byte value of the next byte of the current byte is greater than 127 and less than 256, inquiring a sixth code table by taking the byte value of the current byte as the code table array sequence number, and obtaining and outputting the transparent information processing result of the current byte;
under the condition that the first number and the second number are both equal to 5 and the third number is not greater than 5, selecting a corresponding array in a seventh code table according to the byte value of the current byte, and inquiring the corresponding array in the seventh code table by taking a value obtained by combining the bit value of the 0 th bit and the bit value of the 1 st bit of the next byte of the current byte as an array sequence number to obtain and output the transparent information processing result of the current byte;
and outputting a transmission end mark when one of the first number, the second number and the third number is larger than 5.
Compared with the traditional transparent information extraction processing method, the device for extracting the transparent information of the high-level data link control procedure data has the advantages that the processing unit is byte, the processing time is short, the processing speed is high, and the device can meet the requirement of high-speed network transmission; the method is very suitable for extracting and processing the HDLC data transparent transmission information through software, and is simpler to realize and higher in processing speed.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made in the above embodiments by those of ordinary skill in the art without departing from the principle and spirit of the present invention. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (11)

1. A method for transparent information extraction of advanced data link control procedure data, comprising:
receiving high-level data link control procedure HDLC data;
judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data, if so, inquiring a first code table to obtain the initial bit of transparent information transmission in the next byte in the continuous 2 bytes;
extracting transparent transmission information in the HDLC data from the starting bit;
according to the byte value of the current byte in the transparent transmission information, inquiring a second code table to obtain a first number of continuous bits 1 in the current byte, inquiring a third code table to obtain a second number of continuous bits 1 of the byte connected with the previous byte and inquiring a fourth code table to obtain a third number of continuous bits 1 of the byte connected with the next byte;
comparing the first number, the second number and the third number with a preset number of 5, if the first number and the second number are both less than 5, outputting a transparent information processing result of the current byte, if only one of the first number and the second number is equal to 5 and the third number is not greater than 5, querying a fifth code table or a sixth code table to output the transparent information processing result of the current byte, if the first number and the second number are both equal to 5 and the third number is not greater than 5, querying a seventh code table to output the transparent information processing result of the current byte, and if one of the first number, the second number and the third number is greater than 5, outputting a transmission end mark.
2. The method of claim 1, wherein:
identifying bytes of the network idle data includes one of: the device comprises a mark sequence byte and 7 derived sequence bytes of the mark sequence byte, wherein the derived sequence bytes are obtained by circularly shifting bit bits of the mark sequence byte;
the judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data comprises the following steps: and respectively comparing the continuous 2 bytes with the bytes for identifying the network idle data, and judging whether only the previous byte is the network idle data.
3. The method of claim 1, wherein: the first code table refers to that,
Figure FDA0003197674130000011
Figure FDA0003197674130000021
4. the method of claim 1, wherein:
the obtaining a first number of consecutive bits 1 in the current byte by querying a second code table according to the current byte in the transparent transmission information includes: inquiring the second code table by using the byte numerical value of the current byte as a code table array sequence number to obtain a first number of continuous bits 1 in the byte, wherein the bit positions occupied by the continuous bits 1 in the current byte at most start from the 0 th bit and end with the 7 th bit,
the second code table refers to the code table that,
Figure FDA0003197674130000022
the obtaining of the second number of consecutive bits 1 of the byte connected to the previous byte by querying a third code table according to the current byte in the transparent transmission information includes: judging whether the code table query processing identifier is true, if true, the second number is 0, otherwise, the byte value of the current byte is used as the code table array sequence number to query the third code table, and a fourth number of continuous bits 1 from the 0 th bit position to the back in the current byte is obtained; inquiring the fourth code table by using the byte numerical value of the last byte of the current byte as the sequence number of the code table array to obtain the fifth number of the continuous bits 1 of the last byte of the current byte from the 7 th bit to the front, and using the sum of the fourth number and the fifth number as the second number,
the third code table refers to that,
Figure FDA0003197674130000023
Figure FDA0003197674130000031
the obtaining of the third number of consecutive bits 1 of the present byte and the next byte by querying the fourth code table according to the present byte in the transparent transmission information includes: inquiring the third code table by taking the byte numerical value of the next byte of the current byte as a code table array sequence number to obtain the sixth number of continuous bits 1 from the 0 th bit in the next byte of the current byte to the back; inquiring the fourth code table by using the byte numerical value of the current byte as a code table array sequence number to obtain a seventh number of continuous bits 1 from a 7 th bit of the current byte to the front, and using the sum of the sixth number and the seventh number as the third number,
the fourth code table refers to the code table that,
Figure FDA0003197674130000032
5. the method of claim 1, wherein:
under the condition that only one of the first number and the second number is equal to 5 and the third number is not greater than 5, if the byte value of the next byte of the current byte is greater than or equal to 0 and less than 128, inquiring the fifth code table by taking the byte value of the current byte as a code table array sequence number, and if the byte value of the next byte of the current byte is greater than 127 and less than 256, inquiring the sixth code table by taking the byte value of the current byte as a code table array sequence number, obtaining and outputting the transparent information processing result of the current byte,
the fifth code table refers to the code table that,
Figure FDA0003197674130000033
Figure FDA0003197674130000041
the sixth code table refers to the code table that,
Figure FDA0003197674130000042
Figure FDA0003197674130000051
under the condition that the first number and the second number are both equal to 5 and the third number is not more than 5, selecting a corresponding array in the seventh code table according to the byte value of the current byte, and querying the corresponding array in the seventh code table by using a value obtained by combining the bit value of the 0 th bit and the bit value of the 1 st bit of the next byte of the current byte as an array sequence number to obtain and output the transparent information processing result of the current byte,
the seventh code table refers to the code table,
Byte[]AddByte159=new Byte[6]{190,191,0,0};
Byte[]AddByte190=new Byte[6]{252,253,254,255};
Byte[]AddByte223=new Byte[6]{254,255,0,0}。
6. the method of any of claims 1 to 5, wherein:
extracting transparent transmission information in the HDLC data from the start bit, including:
s1, setting the position i of the extracted byte to be 1; the starting bit N is one of the following bits: 0. 1, 2, 3, 4, 5, 6 and 7;
s2, obtaining the ith byte from the start bit N as the current byte in the transparent transmission information;
s3, judging whether the current byte is the network idle data, if so, executing a step S8, otherwise, executing a step S4;
s4, comparing the first number, the second number and the third number with the preset number, wherein the preset number is 5; if both the first number and the second number are less than 5, performing step S5; in a case where only one of the first number and the second number is equal to 5 and the third number is not greater than 5, performing step S6; in a case where the first number and the second number are both equal to 5 and the third number is not greater than 5, performing step S7; if one of the first number, the second number, and the third number is greater than 5, performing step S8;
s5, if both the first number and the second number are less than 5, making i equal to i +1, and returning to step S2;
s6, if only one of the first number and the second number is equal to 5 and the third number is not greater than 5, making N equal to N +1, and determining whether N is greater than 7; if yes, making i equal to i +2 and N equal to 0, returning to step S2, otherwise, making i equal to i +1, returning to step S2;
s7, if the first number and the second number are both equal to 5, making N equal to N +2, and determining whether N is greater than 7; if yes, making i equal to i +2 and N equal to N% 8, returning to step S2, otherwise, making i equal to i +1, returning to step S2;
and S8, finishing extracting the transparent transmission information.
7. An apparatus for transparent information extraction of advanced data link control procedure data, comprising:
the receiving module is used for receiving HDLC data of a high-level data link control procedure;
the starting position judging module is used for judging whether only the previous byte in the continuous 2 bytes in the HDLC data is network idle data, if so, inquiring a first code table to obtain a starting bit position of transparent information transmission in the next byte in the continuous 2 bytes;
a transparent information extraction module, configured to extract transparent transmission information in the HDLC data from the start bit; according to the byte value of the current byte in the transparent transmission information, inquiring a second code table to obtain a first number of continuous bits 1 in the current byte, inquiring a third code table to obtain a second number of continuous bits 1 of the byte connected with the previous byte and inquiring a fourth code table to obtain a third number of continuous bits 1 of the byte connected with the next byte; comparing the first number, the second number and the third number with preset numerical values respectively, if the first number and the second number are both less than 5, outputting a transparent information processing result of the current byte, if only one of the first number and the second number is equal to 5 and the third number is not more than 5, querying a fifth code table or a sixth code table to output the transparent information processing result of the current byte, if the first number and the second number are both equal to 5 and the third number is not more than 5, querying a seventh code table to output the transparent information processing result of the current byte, and if one of the first number, the second number and the third number is more than 5, outputting a transmission end mark.
8. The apparatus of claim 7, wherein:
identifying bytes of the network idle data includes one of: the device comprises a mark sequence byte and 7 derived sequence bytes of the mark sequence byte, wherein the derived sequence bytes are obtained by circularly shifting bit bits of the mark sequence byte;
the starting position judging module is configured to judge whether only a previous byte in consecutive 2 bytes in the HDLC data is network idle data, and includes: and respectively comparing the continuous 2 bytes with the bytes for identifying the network idle data, and judging whether only the previous byte is the network idle data.
9. The apparatus of claim 7, wherein:
the first code table refers to that,
Figure FDA0003197674130000061
Figure FDA0003197674130000071
10. the apparatus of claim 7, wherein:
the transparent information extraction module takes the byte numerical value of the current byte as a code table array sequence number to inquire the second code table to obtain a first number of continuous bits 1 in the byte, the bit positions of the continuous bits 1 in the byte occupied in the current byte start from the 0 th bit at most and end with the 7 th bit at most,
the second code table refers to the code table that,
Figure FDA0003197674130000072
the transparent information extraction module judges whether the code table query processing identifier is true, if true, the second number is 0, otherwise, the byte value of the current byte is used as the code table array sequence number to query the third code table, and a fourth number of continuous bits 1 from the 0 th bit position to the back in the current byte is obtained; inquiring the fourth code table by using the byte numerical value of the last byte of the current byte as the sequence number of the code table array to obtain the fifth number of the continuous bits 1 of the last byte of the current byte from the 7 th bit to the front, and using the sum of the fourth number and the fifth number as the second number,
the third code table refers to that,
Figure FDA0003197674130000073
Figure FDA0003197674130000081
the transparent information extraction module takes the byte numerical value of the next byte of the current byte as a code table array sequence number to inquire the third code table, and obtains the sixth number of the continuous bits 1 from the 0 th bit position to the back in the next byte of the current byte; inquiring the fourth code table by using the byte numerical value of the current byte as a code table array sequence number to obtain a seventh number of continuous bits 1 from a 7 th bit of the current byte to the front, and using the sum of the sixth number and the seventh number as the third number,
the fourth code table refers to the code table that,
Figure FDA0003197674130000082
11. the apparatus of claim 7, wherein:
under the condition that only one of the first number and the second number is equal to 5 and the third number is not greater than 5, if the byte value of the next byte of the current byte is greater than or equal to 0 and less than 128, inquiring the fifth code table by taking the byte value of the current byte as a code table array sequence number, and if the byte value of the next byte of the current byte is greater than 127 and less than 256, inquiring the sixth code table by taking the byte value of the current byte as a code table array sequence number, obtaining and outputting the transparent information processing result of the current byte,
the fifth code table refers to the code table that,
Figure FDA0003197674130000083
Figure FDA0003197674130000091
under the condition that the first number and the second number are both equal to 5 and the third number is not more than 5, selecting a corresponding array in the seventh code table according to the byte value of the current byte, and querying the corresponding array in the seventh code table by using a value obtained by combining the bit value of the 0 th bit and the bit value of the 1 st bit of the next byte of the current byte as an array sequence number to obtain and output the transparent information processing result of the current byte,
the sixth code table refers to the code table that,
Figure FDA0003197674130000092
Figure FDA0003197674130000101
CN202110305193.1A 2021-03-19 2021-03-19 Transparent information extraction method and device for data Active CN112995330B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110305193.1A CN112995330B (en) 2021-03-19 2021-03-19 Transparent information extraction method and device for data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110305193.1A CN112995330B (en) 2021-03-19 2021-03-19 Transparent information extraction method and device for data

Publications (2)

Publication Number Publication Date
CN112995330A CN112995330A (en) 2021-06-18
CN112995330B true CN112995330B (en) 2021-10-01

Family

ID=76332950

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110305193.1A Active CN112995330B (en) 2021-03-19 2021-03-19 Transparent information extraction method and device for data

Country Status (1)

Country Link
CN (1) CN112995330B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5461618A (en) * 1992-06-30 1995-10-24 Industrial Technology Research Institute Adapter for transmission lines using HDLC frames
CN1393996A (en) * 2001-06-29 2003-01-29 日本胜利株式会社 Method and apparatus for modulating digital signal and recording medium
CN107682114A (en) * 2017-09-01 2018-02-09 惠州市德赛西威汽车电子股份有限公司 A kind of method for improving data transmission efficiency

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7152942B2 (en) * 2002-12-02 2006-12-26 Silverbrook Research Pty Ltd Fixative compensation
US11108672B2 (en) * 2019-07-15 2021-08-31 Qualcomm Incorporated Measuring and verifying layer 2 sustained downlink maximum data rate decoding performance

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5461618A (en) * 1992-06-30 1995-10-24 Industrial Technology Research Institute Adapter for transmission lines using HDLC frames
CN1393996A (en) * 2001-06-29 2003-01-29 日本胜利株式会社 Method and apparatus for modulating digital signal and recording medium
CN107682114A (en) * 2017-09-01 2018-02-09 惠州市德赛西威汽车电子股份有限公司 A kind of method for improving data transmission efficiency

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"面向无人机平台的数据链交互技术研究";顾俊义;《中国优秀硕士学位论文全文数据库信息科技辑》;20180315;全文 *

Also Published As

Publication number Publication date
CN112995330A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
US7152198B2 (en) Encoding/decoding device and encoding/decoding method
US7325168B2 (en) Trace data source identification within a trace data stream
KR101743772B1 (en) Method and device for processing data packets
CN107395565B (en) Serial port receiving preprocessing method under fixed-length single byte format message protocol
KR102314768B1 (en) Single line transmission method, chip and communication system
US7102550B1 (en) System and method for decoding a variable-length codeword while updating the variable-length codeword
CN112995330B (en) Transparent information extraction method and device for data
US6331829B2 (en) Decoding device and method
CN115834027B (en) Message filling method, device, equipment and computer readable storage medium
US20050122240A1 (en) Method and apparatus for effectively decoding huffman code
CN111984591A (en) File storage method, file reading method, file storage device, file reading device, equipment and computer readable storage medium
US20220360278A1 (en) Data compression techniques using partitions and extraneous bit elimination
JPH09246995A (en) Code error detection circuit
CN111684804B (en) Data encoding method, data decoding method, equipment and storage medium
KR100474722B1 (en) A method for synchronizing data frames in digital communication system
CN102802023B (en) Method and device for rapidly preventing false start code
CN116665836B (en) Editing and storing method, reading and playing method and electronic equipment for sequence data
CN1254973C (en) Command frame and its connection method
CN116527467A (en) Mixed data decoding method, apparatus, computer device and storage medium
CN117079703B (en) Method and device for testing embedded memory of chip and electronic equipment
CN113949487A (en) Data communication method, device, communication terminal and computer readable storage medium
CN110781100B (en) Data detection method, logic chip and network equipment
US20190319777A1 (en) Systems and Methods for Aligning Received Data
CN117785782A (en) Data detection method, device, equipment and medium based on NVMe 2.0 protocol
CN116055350A (en) Json-based data communication quality detection method

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