CN116320082A - HDLC frame data analysis method by application software - Google Patents

HDLC frame data analysis method by application software Download PDF

Info

Publication number
CN116320082A
CN116320082A CN202310097654.XA CN202310097654A CN116320082A CN 116320082 A CN116320082 A CN 116320082A CN 202310097654 A CN202310097654 A CN 202310097654A CN 116320082 A CN116320082 A CN 116320082A
Authority
CN
China
Prior art keywords
data
frame
hdlc
bit
continuous
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.)
Pending
Application number
CN202310097654.XA
Other languages
Chinese (zh)
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.)
Yantai North Star Automation Technology Co ltd
Original Assignee
Yantai North Star Automation 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 Yantai North Star Automation Technology Co ltd filed Critical Yantai North Star Automation Technology Co ltd
Priority to CN202310097654.XA priority Critical patent/CN116320082A/en
Publication of CN116320082A publication Critical patent/CN116320082A/en
Pending legal-status Critical Current

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/22Parsing or analysis of headers
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a method for analyzing HDLC frame data by application software, which is characterized in that a software HDLC encoding and decoding layer is added in a communication interface layer and an application program layer, the HDLC encoding and decoding layer comprises an HDLC encoding layer and an HDLC decoding layer, the HDLC encoding layer encodes and transmits through a data transmitting end, and the HDLC decoding layer receives and decodes through a data receiving end. Specifically, the data transmitting end packs the data, then generates a CRC code of a frame of data by using a CRC check generating polynomial, processes the data into the frame of data with HDLC protocol after being attached to the information end of the data, transmits the frame of data through the communication interface, and finally transmits the frame of data; the data receiving end receives the frame data transmitted in the step S1 through the communication interface, analyzes the frame data and finally reconstructs the frame data. Therefore, the invention adopts a software mode to replace the original hardware equipment, and can realize the analysis of the bit protocol HDLC protocol effective frame data under the condition that the local end application program layer interface is kept unchanged.

Description

HDLC frame data analysis method by application software
Technical Field
The invention relates to the technical field of communication transmission and information decoding, in particular to a method for analyzing HDLC (High-level Data Link Control ) frame data according to a bit protocol and application software.
Background
In the current heterogeneous network environment, one end is mature equipment facing bit protocol HDLC and PPP, and the other end is butt joint equipment. In the prior art, a special hardware device is added on a docking device side to complete HDLC protocol analysis, so that effective data service is provided for upper layer application data encoding and decoding.
For example, the prior document "design and implementation of HDLC communication interface based on STM32F 103" discloses: adopting an STM32F103 microprocessor and a check-up receiving-transmitting chip architecture, and realizing the analysis and generation of HDLC special format data frames in a software programming mode; the prior document 'design and implementation of HDLC communication card with severe environment resistance based on CPCI bus' discloses: and the CPCI bus is used as a basic framework, the communication card of the HDLC protocol controller is realized by adopting the FPGA technology, and the reliable transmission of radar data in a command control system is realized.
It can be seen that the prior art adopts a special hardware device to decode HDLC protocol data of a bit oriented protocol. Although the special hardware equipment is added to analyze the effective frame data, the special hardware equipment has higher cost and high manufacturing cost, and the purchase cost of the equipment is increased, so that the novel docking equipment cannot realize miniaturization and integration design.
Therefore, there is a need in the art for a method for performing HDLC frame data parsing without adding dedicated hardware devices or application software.
Disclosure of Invention
In order to overcome the defects in the prior art, the technical problems to be solved by the invention are as follows: under the background of the miniaturization and integration requirements, how to apply software to integrate special hardware equipment functions for the novel docking equipment and analyze HDLC frame data.
In order to solve the technical problems, the invention provides a method for analyzing HDLC frame data by application software, which is characterized in that a software HDLC encoding and decoding layer is added in a communication interface layer and an application program layer, the HDLC encoding and decoding layer comprises an HDLC encoding layer and an HDLC decoding layer, the HDLC encoding layer encodes and transmits through a data transmitting end, and the HDLC decoding layer receives and decodes through a data receiving end.
On the basis of the technical scheme, the invention can be improved as follows.
Further, the method comprises the following steps:
s1: the data transmitting terminal packs the data, then generates a CRC code of a frame of data by using a CRC check generating polynomial, processes the data into the frame of data with HDLC protocol after being attached to the information terminal of the data, transmits the frame of data through a communication interface, and finally transmits the frame of data;
s2: the data receiving end receives the frame data transmitted in the step S1 through the communication interface, analyzes the frame data and finally reorganizes the frame data.
Preferably, the processing the data into frame data having an HDLC protocol includes:
S1-A: dividing uncoded byte data into eight times and shifting down the data bit by bit;
S1-B: counting the number of continuous bits '1';
S1-C: judging whether the number of the continuous bits '1' is less than 5, if not, turning to the step S1-D; if yes, go to step S1-E;
S1-D: setting the number of the continuous bits '1' as 0, carrying out continuous 5 bits '1' plus '0' processing, and then turning to the step S1-E;
S1-E: the current bit value is processed in consecutive 8-bit reorganization bytes to form encoded data.
Further preferably, the processing of the current bit value by 8 consecutive bit reorganization bytes to form encoded data includes:
S1-E.1: inputting bit values, and counting the number of continuous bits;
S1-E.2: judging whether the number of continuous bits is 0; if yes, go to step S1-E.3, if not, go to step S1-E.4;
S1-E.3: resetting the byte 0, and then turning to the steps S1-E.5;
S1-E.4: judging whether the number of the continuous bits is 8; if not, turning to the step S1-E.5, if yes, turning to the step S1-E.6;
S1-E.5: assigning the reorganized byte as: the recombined byte and the current bit value are shifted up by the continuous bit number bit, the step S1-A is returned, and the data processing is carried out again until the encoded data is finally formed;
S1-E.6: setting the number of continuous bits to 0, outputting the reorganized bytes, and returning to the step S1-A; and (5) carrying out data processing again until the coded data is finally formed.
Preferably, the parsing frame data includes:
S2-A: searching a frame head;
S2-B: searching for non-frame header bits;
S2-C: receiving frame data;
S2-D: and (5) CRC checking treatment.
Further preferably, the receiving frame data includes:
S2-C.1: dividing the undecoded byte data into eight times and shifting the data down bit by bit;
S2-C.2: counting the number of continuous bits '1';
S2-C.3: judging whether the number of the continuous bits '1' is less than 5; if yes, jumping to the step S2-C.6; if not, turning to the step S2-C.4;
S2-C.4: judging whether the number of the continuous bits '1' is equal to 5 and the next bit is '0'; if yes, carrying out continuous 5 '1' minus '0' correction treatments, and returning to the step S2-C.1; if not, turning to the step S2-C.5;
S2-C.5: judging whether the number of the continuous bits '1' is equal to 6 and the next bit is '0'; if not, detecting the wrong frame, returning to the step S2-A, and searching the frame head again; if yes, turning to S2-C.6;
S2-C.6: performing continuous 8-bit reorganization byte processing, and entering S2-C.7;
S2-C.7: detecting the frame tail identification character and judging whether the frame tail is the frame tail or not; if yes, turning to the step S2-C.8; if not, returning to the step S2-C.1;
S2-C.8: and obtaining one frame of valid data.
Preferably, the reorganizing frame data includes:
S2-E: calculating CRC of the effective data, and placing the effective data behind the effective data to form an effective data group to be checked by CRC;
S2-F: adding a frame header '0 x 7E' before the effective data to form new effective data;
S2-G: performing continuous 5 '1' plus '0' processing and continuous 8-bit reorganization byte processing on new valid data and frame tail '0 x 7E' for eight times in a bit-by-bit manner;
S2-H: supplement a stuff byte "0x7E";
S2-I: performing CRC; if the data is valid, providing valid frame data to an upper layer application; if not, discarding.
Optionally, the data transmitting end transmits the data in a low-speed wired or wireless link.
Compared with the prior art, the invention has the following technical characteristics:
1. according to the invention, a transparent software HDLC coding and decoding layer is added in a communication interface layer and an application program layer, and under the condition that an interface of a local end application program layer is kept unchanged, the analysis of bit protocol HDLC protocol valid frame data can be realized, so that the seamless connection with bit protocol HDLC maturation equipment is realized; installing analysis software at the novel equipment end, performing coding and decoding software processing on effective frame data of an application layer in a software analysis mode, then directly utilizing a communication interface to communicate, and completing providing effective frame data service for upper layer application data, so that the upper layer application software can conveniently perform corresponding processing, and the mode is flexible to use and strong in adaptability;
2. the invention adopts a software mode to replace the original hardware equipment, if the hardware equipment adopting a special HDLC protocol brings high cost and other problems, the software mode of the invention can save equipment purchasing funds and reduce the cost of the whole project; in the aspect of structural design, the number of hardware devices is reduced, the available space is enlarged, and the miniaturization design of newly-developed devices is facilitated;
3. the invention follows the HDLC protocol of the data link layer facing the bit stream, follows the HDLC protocol standard, adopts the transparent transmission '0 bit insertion method', adopts the CRC check technology and the like, separates the data transmission from the processing, and has greater flexibility and more perfect control function.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart illustrating steps of a method for HDLC frame data analysis by an application software according to the present invention;
FIG. 2 is a flowchart showing the steps of data processing in step S1 of the present invention;
FIG. 3 is a flowchart showing steps for processing consecutive 8-bit reorganized bytes in step S1 according to the present invention;
FIG. 4 is a flowchart illustrating the steps for parsing frame data in step S2 according to the present invention;
FIG. 5 is a flowchart showing the steps of receiving frame data at step S2-C according to the present invention;
fig. 6 is a flowchart showing the steps of reconstructing frame data in step S2 according to the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The HDLC frame data analysis method by application software is that a transparent software HDLC coding and decoding layer is added in the existing communication interface layer and application program layer, the HDLC coding and decoding layer comprises an HDLC coding layer and an HDLC decoding layer, the HDLC coding layer codes and transmits through a data transmitting end, and the HDLC decoding layer receives and decodes through a data receiving end.
First, referring to fig. 1, fig. 1 is a flowchart illustrating steps of a method for performing HDLC frame data analysis by using the application software of the present invention; the HDLC frame data analysis method by the application software comprises the following steps:
s1: the data transmitting terminal packs the data, then generates a CRC code of a frame of data by using a CRC check generating polynomial, processes the data into the frame of data with HDLC protocol after being attached to the information terminal of the data, transmits the frame of data through a communication interface, and finally transmits the frame of data; the data transmission mode can be selected from low-speed wired or wireless links, but is not limited to the low-speed wired or wireless links;
s2: the data receiving end receives the frame data transmitted in the step S1 through the communication interface, analyzes the frame data and finally reorganizes the frame data.
Then, please refer to table 1 and fig. 2, wherein table 1 is a frame header identification character set, and fig. 2 is a flowchart of the steps of data processing in step S1 of the present invention;
TABLE 1
The bit pattern of the frame header/trailer identification character of the frame data is 01111110, i.e. a sequence of 6 bits of "1" in succession. The values of the identification characters are different according to the collected bits in the byte mode. The frame identification character set is shown in table 1. In the encoding process, byte stream data is processed in eight times, bits by bits, with 5 consecutive "1" plus "0" processes, and 8 consecutive bits of reorganized bytes.
As shown in fig. 2, the processing of data into frame data with HDLC protocol specifically includes the following steps:
S1-A: dividing uncoded byte data into eight times and shifting down the data bit by bit;
S1-B: counting the number of continuous bits '1';
S1-C: judging whether the number of the continuous bits '1' is less than 5, if not, turning to the step S1-D; if yes, go to step S1-E;
S1-D: setting the number of the continuous bits '1' as 0, performing continuous 5 bits '1' plus '0', namely adding one '0' bit after the continuous 5 bits '1', and then turning to the step S1-E;
S1-E: performing continuous 8-bit reorganization byte processing on the current bit value to form coded data; specifically, please refer to fig. 3, which is a flowchart illustrating a procedure of processing consecutive 8 bits of reorganized bytes in step S1 according to the present invention;
S1-E.1: inputting bit values, and counting the number of continuous bits;
S1-E.2: judging whether the number of continuous bits is 0; if yes, go to step S1-E.3, if not, go to step S1-E.4;
S1-E.3: resetting the byte 0, and then turning to the steps S1-E.5;
S1-E.4: judging whether the number of the continuous bits is 8; if not, turning to the step S1-E.5, if yes, turning to the step S1-E.6;
S1-E.5: assigning the reorganized byte as: the recombined byte and the current bit value are shifted up by the continuous bit number bit, the step S1-A is returned, and the data processing is carried out again until the encoded data is finally formed;
S1-E.6: setting the number of continuous bits to 0, outputting the reorganized bytes, and returning to the step S1-A; and (5) carrying out data processing again until the coded data is finally formed.
What needs to be explained is: in the frame structure of HDLC, if the same bit combination as the flag field F (01111110) happens to occur in the bit string between two flag fields, it is mistaken for the boundary of the frame. To avoid this, HDLC uses zero-bit padding (also called zero-bit insertion) so that 6 consecutive 1's do not occur between two F fields in a frame. The zero bit filling method comprises the following specific steps: at the transmitting end, when a string of bit streams has not been marked with a flag field, the whole frame is first scanned by hardware. As soon as 5 consecutive 1 s are found, one 0 is filled in immediately. Thus, the zero-bit-padded data ensures that no 6 consecutive 1's occur. Upon receiving a frame, the F field is found first to determine the frame boundaries. The bit stream therein is then scanned by hardware. Whenever 5 consecutive 1 s are found, one 0 after the 5 consecutive 1 s is deleted to restore to the original bit stream. This ensures that no matter what bit combination occurs in the transmitted bit stream, no judgment error of the frame boundary is caused. For example: when "01111110" happens to appear in a certain non-flag field (0 10 01111110 0 01 01 0) and is mistaken as a flag field, the sender continuously sends 5 "1", and fills 1 "0": 01 0 011111 01 0 0 01 01 0, the receiving end deletes "0" after 5 consecutive 1: 01 0 01111110 0 01 01 0.
Next, please refer to fig. 4, which is a flowchart illustrating a step of analyzing frame data in step S2 of the present invention; the analyzing frame data specifically includes the following steps:
S2-A: searching a frame head; specifically, the byte data which is not decoded is moved bit by bit until a continuous 8-bit value is found out to be 0x7E, and the value is used as a frame head;
S2-B: searching for non-frame header bits; specifically, the undecoded byte data is moved bit by bit until the value of the consecutive 8 bits is not the value corresponding to the frame header identification character set in table 1;
S2-C: receiving frame data; specifically, the un-decoded byte data is divided into eight times, the data is shifted down bit by bit, the number of continuous '1's is counted, then continuous 5 '1' minus '0' correction processes are carried out, and continuous 8 bits are recombined into a valid byte; if the frame tail identification character is detected, turning to the step S2-D, if the error frame is detected, turning back to the step S2-A, and searching for the frame head again; specifically, please refer to fig. 5, which is a flowchart illustrating steps of receiving frame data in step S2-C according to the present invention;
S2-C.1: dividing the undecoded byte data into eight times and shifting the data down bit by bit;
S2-C.2: counting the number of continuous bits '1';
S2-C.3: judging whether the number of the continuous bits '1' is less than 5; if yes, jumping to the step S2-C.6; if not, turning to the step S2-C.4;
S2-C.4: judging whether the number of the continuous bits '1' is equal to 5 and the next bit is '0'; if yes, carrying out continuous 5 '1' minus '0' correction treatments, and returning to the step S2-C.1; if not, turning to the step S2-C.5;
S2-C.5: judging whether the number of the continuous bits '1' is equal to 6 and the next bit is '0'; if not, detecting the wrong frame, returning to the step S2-A, and searching the frame head again; if yes, turning to S2-C.6;
S2-C.6: performing continuous 8-bit reorganization byte processing, and entering S2-C.7;
S2-C.7: detecting the frame tail identification character and judging whether the frame tail is the frame tail or not; if yes, turning to the step S2-C.8; if not, returning to the step S2-C.1;
S2-C.8: obtaining a frame of effective data, and then turning to the step S2-D;
S2-D: CRC check treatment; specifically, performing CRC (cyclic redundancy check) on effective data (excluding frame header and frame tail) of a frame, and if the CRC is correct, providing the effective frame data to an upper layer application; if not, discarding.
Thus, at the receiving end, data is received through the communication interface, identifying the beginning of the frame from the frame header identification field, and the ending of the frame is confirmed by the frame end identification field. The positions of other fields can be calculated through the data frame format by the data frames defined by the frame head and the frame tail. The information in the HDLC protocol is only positionally meaningful and not content-wise, which makes it transparent to the hardware, and the receiver does not have to interpret this information before reading the end-of-frame identification field. Therefore, how to correctly parse out a data frame (which can be regarded as a byte-oriented data frame) composed of each field in a fixed format from the bitstream data is a difficulty in software.
What needs to be explained is: in synchronous mode, when there is no valid data value, one idle character is filled by default, and two idle characters are used, one is 0xFF, and the other is 0x7E. If the idle code is 0xFF, only one frame head and frame tail identification field is provided, so that the frame head and frame tail can be easily searched, and the frame data can be clearly defined; if the idle code is 0x7E, the idle code is identical to the frame head and frame tail identification character, and the searching of the frame head and the frame tail is responsible for comparison at the moment, so that the loss of data is easy to cause. Therefore, the frame head and the frame tail are judged in a state machine mode, and the analysis of the effective frame data is completed.
Finally, please refer to fig. 6, which is a flowchart illustrating a step of reconstructing frame data in step S2 of the present invention; the reorganizing frame data specifically includes the following steps:
S2-E: calculating CRC of the effective data, and placing the effective data behind the effective data to form an effective data group to be checked by CRC;
S2-F: adding a frame header '0 x 7E' before the effective data to form new effective data;
S2-G: performing continuous 5 '1' plus '0' processing and continuous 8-bit reorganization byte processing on new valid data and frame tail '0 x 7E' for eight times in a bit-by-bit manner; that is, counting the number of consecutive "1"; if the number of the continuous 5 bits is less than 1, counting again; if the continuous 5 bits of 1 are met, adding a bit of 0, and continuously counting again;
S2-H: supplement a stuff byte "0x7E";
S2-I: performing CRC; if the data is valid, providing valid frame data to an upper layer application; if not, discarding.
The invention utilizes the characteristic of the advanced data link control protocol, does not depend on any character code set, and realizes transparent transmission; full duplex is supported, and the data can be continuously sent without waiting for an acknowledgement frame, so that the data transmission rate is improved; and CRC is adopted to prevent missing or resending of information and ensure the reliability of transmission. According to the characteristics, HDLC has been widely used in the fields of military and aviation and aerospace.
In order to realize that one end is mature equipment facing bit protocol HDLC and PPP under the heterogeneous network environment in a finger control communication system, and the other end is novel butt joint equipment. The mature equipment end interface of the sending end is in a synchronous serial port mode, the novel equipment interface of the receiving end is in an asynchronous serial port mode or a network port mode, and the two ends carry out data communication in a wireless communication network consisting of low-speed wires or radio stations. The invention adopts a mode of installing software at the novel docking equipment end, provides transparent and effective frame data service for upper layer application by a technology of encoding and decoding HDLC data by the software, and realizes the communication between mature equipment and the novel docking equipment in a heterogeneous network.
The invention realizes the communication transmission between the traditional equipment and the novel equipment of the heterogeneous network from point to point and from point to multipoint in the command control system, adopts a technology of analyzing frame data by software in HDLC byte stream data, ensures the stable and reliable transmission of the data and realizes the data communication. The software mode replaces hardware equipment to analyze the data frames, is more convenient in military severe environments in actual use, has strong realizability, can analyze the effective data frames without depending on external equipment, and realizes data communication.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (8)

1. A method for analyzing HDLC frame data by application software is characterized in that a software HDLC encoding and decoding layer is added in a communication interface layer and an application program layer, the HDLC encoding and decoding layer comprises an HDLC encoding layer and an HDLC decoding layer, the HDLC encoding layer encodes and transmits through a data transmitting end, and the HDLC decoding layer receives and decodes through a data receiving end.
2. The method for performing HDLC frame data parsing by application software according to claim 1, comprising the steps of:
s1: the data transmitting terminal packs the data, then generates a CRC code of a frame of data by using a CRC check generating polynomial, processes the data into the frame of data with HDLC protocol after being attached to the information terminal of the data, transmits the frame of data through a communication interface, and finally transmits the frame of data;
s2: the data receiving end receives the frame data transmitted in the step S1 through the communication interface, analyzes the frame data and finally reorganizes the frame data.
3. The method for performing HDLC frame data parsing by application software according to claim 2, wherein said processing data into frame data having HDLC protocol comprises:
S1-A: dividing uncoded byte data into eight times and shifting down the data bit by bit;
S1-B: counting the number of continuous bits '1';
S1-C: judging whether the number of the continuous bits '1' is less than 5, if not, turning to the step S1-D; if yes, go to step S1-E;
S1-D: setting the number of the continuous bits '1' as 0, carrying out continuous 5 bits '1' plus '0' processing, and then turning to the step S1-E;
S1-E: the current bit value is processed in consecutive 8-bit reorganization bytes to form encoded data.
4. The method for performing HDLC frame data parsing by application software according to claim 3, wherein said performing consecutive 8-bit reorganization byte processing on the current bit value to form encoded data comprises:
S1-E.1: inputting bit values, and counting the number of continuous bits;
S1-E.2: judging whether the number of continuous bits is 0; if yes, go to step S1-E.3, if not, go to step S1-E.4;
S1-E.3: resetting the byte 0, and then turning to the steps S1-E.5;
S1-E.4: judging whether the number of the continuous bits is 8; if not, turning to the step S1-E.5, if yes, turning to the step S1-E.6;
S1-E.5: assigning the reorganized byte as: the recombined byte and the current bit value are shifted up by the continuous bit number bit, the step S1-A is returned, and the data processing is carried out again until the encoded data is finally formed;
S1-E.6: setting the number of continuous bits to 0, outputting the reorganized bytes, and returning to the step S1-A; and (5) carrying out data processing again until the coded data is finally formed.
5. The method for performing HDLC frame data parsing by application software according to claim 2, wherein said parsing frame data includes:
S2-A: searching a frame head;
S2-B: searching for non-frame header bits;
S2-C: receiving frame data;
S2-D: and (5) CRC checking treatment.
6. The method for performing HDLC frame data parsing by application software according to claim 5, wherein said receiving frame data comprises:
S2-C.1: dividing the undecoded byte data into eight times and shifting the data down bit by bit;
S2-C.2: counting the number of continuous bits '1';
S2-C.3: judging whether the number of the continuous bits '1' is less than 5; if yes, jumping to the step S2-C.6; if not, turning to the step S2-C.4;
S2-C.4: judging whether the number of the continuous bits '1' is equal to 5 and the next bit is '0'; if yes, carrying out continuous 5 '1' minus '0' correction treatments, and returning to the step S2-C.1; if not, turning to the step S2-C.5;
S2-C.5: judging whether the number of the continuous bits '1' is equal to 6 and the next bit is '0'; if not, detecting the wrong frame, returning to the step S2-A, and searching the frame head again; if yes, turning to S2-C.6;
S2-C.6: performing continuous 8-bit reorganization byte processing, and entering S2-C.7;
S2-C.7: detecting the frame tail identification character and judging whether the frame tail is the frame tail or not; if yes, turning to the step S2-C.8; if not, returning to the step S2-C.1;
S2-C.8: and obtaining one frame of valid data.
7. The method for HDLC frame data parsing by application software according to claim 2, wherein said reorganizing frame data includes:
S2-E: calculating CRC of the effective data, and placing the effective data behind the effective data to form an effective data group to be checked by CRC;
S2-F: adding a frame header '0 x 7E' before the effective data to form new effective data;
S2-G: performing continuous 5 '1' plus '0' processing and continuous 8-bit reorganization byte processing on new valid data and frame tail '0 x 7E' for eight times in a bit-by-bit manner;
S2-H: supplement a stuff byte "0x7E";
S2-I: performing CRC; if the data is valid, providing valid frame data to an upper layer application; if not, discarding.
8. The method for performing HDLC frame data analysis by application software according to claim 2, wherein the data transmitting end performs data transmission in a low-speed wired or wireless link.
CN202310097654.XA 2023-02-10 2023-02-10 HDLC frame data analysis method by application software Pending CN116320082A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310097654.XA CN116320082A (en) 2023-02-10 2023-02-10 HDLC frame data analysis method by application software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310097654.XA CN116320082A (en) 2023-02-10 2023-02-10 HDLC frame data analysis method by application software

Publications (1)

Publication Number Publication Date
CN116320082A true CN116320082A (en) 2023-06-23

Family

ID=86778845

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310097654.XA Pending CN116320082A (en) 2023-02-10 2023-02-10 HDLC frame data analysis method by application software

Country Status (1)

Country Link
CN (1) CN116320082A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118158300A (en) * 2024-05-10 2024-06-07 成都天地一格科技有限公司 HDLC protocol-based communication method and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN118158300A (en) * 2024-05-10 2024-06-07 成都天地一格科技有限公司 HDLC protocol-based communication method and electronic equipment

Similar Documents

Publication Publication Date Title
CN1223134C (en) Methods and systems for decoding headers on radio channel
JP5925741B2 (en) Multiplex protocol data unit transmission in physical layer packets
CN101296055B (en) Data package dispatching method and device
CN101800757B (en) No-feedback one-way data transmission method based on single fiber structure
AU733218B2 (en) Method for decreasing the frame error rate in data transmission in the form of data frames
JP2002141810A (en) Channel error protection realizable across network layers of communication system
KR20010005484A (en) Encoding method for radio transceiving of multimedia data and device thereof
CN105681342A (en) Anti-error code method and system of multi-channel video conference system based on H264
JPH0673940U (en) Data receiver
CN116320082A (en) HDLC frame data analysis method by application software
CN101090293A (en) Method and system for transmitting information
KR20040018119A (en) Wireless communication method and apparatus
US7821999B2 (en) Identical puncturing of UE identification data and load data in the HS-SCCH channel
CN104135345A (en) Cross-layer coding and decoding method applied to long-term evolution system
US6985726B2 (en) Method of blind transport format detection
CN109428676B (en) Method and device for synchronizing forward error correction coding and decoding modes
CN101895742B (en) Unequal error protection is applied to the method for video transmission of single-carrier system
CN107528672A (en) A kind of efficient wireless data transceiving method and device
CN103944690B (en) Bitmap compression method in RLC data retransmission system
CN113922924B (en) Absolute encoder communication method and system based on spi
US6622278B1 (en) Method and apparatus for formatting a message in a wireless communication system
CA2298221C (en) Encoder for multiplexing blocks error protected bits with blocks of unprotected bits
KR100299540B1 (en) Method and device for data transmission using Manchester code
CN114337929A (en) High-reliability communication verification method
KR100489043B1 (en) Method of formating data when mobile terminals are on communicating in mobile communication system

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