CN114168517A - Universal asynchronous serial data analysis method and device - Google Patents

Universal asynchronous serial data analysis method and device Download PDF

Info

Publication number
CN114168517A
CN114168517A CN202010957697.7A CN202010957697A CN114168517A CN 114168517 A CN114168517 A CN 114168517A CN 202010957697 A CN202010957697 A CN 202010957697A CN 114168517 A CN114168517 A CN 114168517A
Authority
CN
China
Prior art keywords
message
data
receiving
length
cache region
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.)
Granted
Application number
CN202010957697.7A
Other languages
Chinese (zh)
Other versions
CN114168517B (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 Machinery Equipment Research Institute
Original Assignee
Beijing Machinery Equipment Research Institute
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 Machinery Equipment Research Institute filed Critical Beijing Machinery Equipment Research Institute
Priority to CN202010957697.7A priority Critical patent/CN114168517B/en
Publication of CN114168517A publication Critical patent/CN114168517A/en
Application granted granted Critical
Publication of CN114168517B publication Critical patent/CN114168517B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus

Abstract

The invention relates to a method and a device for analyzing universal asynchronous serial data, wherein the method comprises the following steps: establishing a receiving parameterized configuration table of asynchronous serial data, and configuring the parameterized configuration table according to a data format of data to be read from a communication receiving port; reading data from a communication receiving port, shifting and caching the data into a receiving cache region, and simultaneously recording the length of the data stored in the receiving cache region; when the length of the data stored in the receiving cache region is larger than the judgment length of the receiving message configured in the parameterized configuration table, processing the data in the receiving cache region; if the data in the cache region is satellite data, analyzing and processing the satellite message; if the data in the buffer area is asynchronous serial data, parameters are configured according to the format of the asynchronous serial data in the parameterization configuration table, and message analysis processing is carried out. The invention supports the analysis of message data in various typical formats; and analyzing the fixed-length and variable-length messages, and performing traversal multi-frame processing on the data in the cache region.

Description

Universal asynchronous serial data analysis method and device
Technical Field
The invention relates to the technical field of communication, in particular to a method and a device for analyzing universal asynchronous serial data.
Background
In an embedded system with a plurality of serial low-speed communication ports, the interface characteristic definitions of the ports are usually different, so that different message receiving processing logics are designed for each port when software analyzes protocol messages, so that the whole system software is large and bloated, and the maintenance and management of subsequent protocol analysis are not facilitated.
Disclosure of Invention
In view of the foregoing analysis, the present invention is directed to a method and apparatus for parsing universal asynchronous serial data; the problem of real-time analysis of asynchronous serial data under the condition of multiple ports and multiple protocol formats is solved.
The invention discloses a universal asynchronous serial data analysis method, which comprises the following steps:
establishing a receiving parameterized configuration table of asynchronous serial data, and configuring the parameterized configuration table according to a data format of data to be read from a communication receiving port; the parameterized configuration table comprises configuration parameters for NAME0183 protocol system satellite data and various asynchronous serial data formats;
reading data from a communication receiving port, shifting and caching the read data into a receiving cache region, and simultaneously recording the length of the data stored in the receiving cache region;
when the length of the data stored in the receiving cache region is larger than the judgment length of the receiving message configured in the parameterized configuration table, processing the data in the receiving cache region; the processing comprises the step of analyzing and processing the satellite message if the format of the data in the cache region is NAME0183 protocol standard satellite data; if the data in the cache region is a certain asynchronous serial data, determining the message format of the data in the cache region according to the corresponding asynchronous serial data format configuration parameters in the parameterization configuration table, searching the number of message headers and the index positions of the message headers in the message, and analyzing to obtain the message data.
Furthermore, the configuration of the reference numbers of the messages in the parameterized configuration table is configured according to the data format to be read from the communication receiving port, and the configuration of the criteria of the message header, the configuration of the judgment length of the received message, the configuration of the message format, the configuration of the message length index, the configuration of the message receiving analysis callback function and the configuration of the message header judgment callback function are included.
Further, according to the data format to be read from the communication receiving port, the first byte, the second byte or the third byte of the message data is configured as the criterion of the message header in the parameterized configuration table.
Further, according to a data format to be read from a communication receiving port, configuring the message format into one of the following message formats in the parameterized configuration table;
the first method comprises the following steps: defining a message header, command words, data and a checksum;
and the second method comprises the following steps: message header + data + checksum;
and the third is that: message header + length + command word + data + check;
and fourthly: satellite data NAME0183 protocol standard.
Further, according to a data format to be read from a communication receiving port, configuring the message length index into one of the following four formats in the parameterized configuration table;
the first method comprises the following steps: the message length is fixed, and the message length is contained in the message;
and the second method comprises the following steps: the position index is positioned in the second byte of the message, and the message contains the message length;
and the third is that: the position index is positioned in the third byte of the message, and the message contains the message length;
and fourthly: the position index is positioned in the fourth byte of the message, and the message contains the message length.
Furthermore, when data is read from the communication receiving port, the remaining space of the data buffer area cannot store the data received this time, the data in the receiving buffer area is cleared first, the size of the received data is cleared to 0, and then the currently received data is cached.
Further, when asynchronous serial data cached in the receiving cache region are analyzed, a callback function is judged according to a message format, message header fixed bytes and a message header judgment function which are configured in a parameterized configuration table, message headers of data in the receiving cache region are sequentially judged, the number of the message headers and the index positions of the message headers are recorded, when the number of the searched messages is not more than the maximum number of the configured processing messages, the message headers are continuously searched, and otherwise, the searching is stopped; and according to the searched message header, analyzing and processing the data.
Further, the data analysis processing is divided into three situations according to the number of the message headers, which specifically comprises:
0 message header, clear the current receiving buffer area and clear the receiving count;
1 message header, obtaining the message length according to the message format, if the receiving buffer area has a message completed by one frame, adopting an analysis callback function to analyze the message, and simultaneously emptying the current receiving buffer area and clearing the receiving count; if the message in the buffer area is not analyzed enough, moving the message from the head position of the message to the beginning of the receiving buffer area, and updating the message count;
and the message headers sequentially acquire the message length according to the message format, check whether the number of data between the two message headers is equal to the message length, if so, analyze the message by adopting an analysis callback function, otherwise, move to the next message header for processing until the last message.
Further, the analysis of the NAME0183 protocol standard satellite data comprises the following steps:
searching for '$' message headers in a round-robin receiving cache region, simultaneously recording the number of the message headers and the index positions of the message headers, continuously searching for the message headers when the number of the searched messages is not more than the maximum number of the configured processed messages, and stopping searching otherwise;
and searching the message tail in a round-robin manner, recording the number of the message tail and the index position of the message tail when the number of the message tail is greater than the corresponding number of the message head, calling a callback function to analyze the message, and stopping searching the message tail if the number of the message tail exceeds the number of the message head.
If the message header is not found, clearing the current receiving buffer area and clearing the receiving count; if the message end is not found and the message head exists, the message starting from the last message head position is moved to the beginning of the receiving buffer area, and the message count is updated at the same time.
The invention also discloses a device for analyzing the universal asynchronous serial data, which comprises a parameterization configuration table module, a receiving buffer area module and a data processing module;
the parameterized configuration table module is used for configuring the processing parameters in the receiving buffer area module and the data processing module into parameters matched with the data format of the data to be read; configuring the satellite data of NAME0183 protocol standard and parameters of various asynchronous serial data formats;
the receiving buffer area module is used for buffering the data read from the communication receiving port and recording the length of the data stored in the receiving buffer area;
the data processing module is respectively connected with the parameterized configuration table module and the receiving cache region module, acquires configured parameter information from the parameterized configuration table module, and receives the data length stored in the receiving cache region from the receiving cache region module; when the length of the data stored in the receiving cache region is larger than the judgment length of the receiving message configured in the parameterized configuration table, processing the data in the receiving cache region; if the format of the data in the cache region is NAME0183 protocol standard satellite data, analyzing and processing the satellite message; if the data in the cache region is a certain asynchronous serial data, determining the message format of the data in the cache region according to the corresponding asynchronous serial data format configuration parameters in the parameterization configuration table, searching the number of message headers and the index positions of the message headers in the message, and analyzing to obtain the message data.
The invention has the following beneficial effects:
the invention realizes the real-time analysis of asynchronous serial data by the configuration of the parameters in the receiving parameterization configuration table; the message data analysis of various typical formats (including NAME0183 format) is supported; analyzing the fixed-length and variable-length messages; the data buffer area design is provided, and traversal multi-frame processing of the data in the buffer area is supported.
Drawings
The drawings are only for purposes of illustrating particular embodiments and are not to be construed as limiting the invention, wherein like reference numerals are used to designate like parts throughout.
FIG. 1 is a flowchart illustrating a method for parsing universal asynchronous serial data according to a first embodiment;
fig. 2 is a schematic diagram of a general asynchronous serial data parsing apparatus in the second embodiment.
Detailed Description
The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings, which form a part hereof, and which together with the embodiments of the invention serve to explain the principles of the invention.
Example one
The embodiment discloses a universal asynchronous serial data parsing method, as shown in fig. 1, including the following steps:
step S1, establishing a receiving parameterized configuration table of asynchronous serial data, and configuring the parameterized configuration table according to the data format of data to be read from the communication receiving port;
the parameterized configuration table comprises configuration parameters for NAME0183 protocol system satellite data and various asynchronous serial data formats;
the specific parameter configuration of the parameterization configuration table comprises asynchronous serial port configuration, message parameter configuration and receiving buffer area configuration.
The asynchronous serial port configuration comprises configuration of an asynchronous serial port number, communication speed and check modes (odd check, even check or no check). By configuring the asynchronous serial port, the physical layer link relation between the receiving end and the transmitting end can be realized, and the data transmission and reception are completed.
And the message parameter configuration realizes the abstraction of the receiving end to the receiving data application layer logics with different formats, thereby being capable of analyzing the message data with various formats.
The message parameter configuration comprises the following steps:
configuring a criterion of a message header;
according to the position of a message header in a data format of data to be read, designating a first byte, a second byte or a third byte of the message data in the parameterized configuration table, wherein the first byte, the second byte or the third byte is used as a criterion for determining the message header in analysis processing;
the first byte, the second byte or the third byte of the message is used for judging whether the message is a message header, and the message header judging process judges that a legal message header exists at the position meeting the matching of the three bytes simultaneously.
Configuring the judgment length of a received message;
taking the judged length of the received message as the maximum number of the received message data processed each time;
configuring a message format;
configuring the message format into one of the following message formats in the parameterized configuration table according to the data format to be read from the communication receiving port;
the first method comprises the following steps: defining a message header, command words, data and a checksum;
and the second method comprises the following steps: message header + data + checksum;
and the third is that: message header + length + command word + data + check;
and fourthly: satellite data NAME0183 protocol standard.
Of course, the message format of other types of asynchronous serial data can be adopted, and the analysis of other types of asynchronous serial data can be realized by configuring in a parameterization configuration table in advance.
Configuring a message length index;
configuring the message length index into one of the following four formats in the parameterized configuration table according to a data format to be read from a communication receiving port;
the first method comprises the following steps: the message length is fixed, and the message length is contained in the message;
and the second method comprises the following steps: the position index is positioned in the second byte of the message, and the message contains the message length;
and the third is that: the position index is positioned in the third byte of the message, and the message contains the message length;
and fourthly: the position index is positioned in the fourth byte of the message, and the message contains the message length.
The position index is the position of the message length information in the frame message.
Configuring a message receiving and analyzing callback function;
void(*RecvMsgUnpack)(BYTE*pucMsg,BYTE ucMsgLen)
pucMSg: analyzing a data head pointer of the message information;
ucMsgLen: and analyzing the length of the message information.
The message receiving and analyzing callback function is a defined message analyzing format function, the function only has definition in the method and does not include specific function realization, a user needs to introduce a function entity head pointer consistent with the definition during configuration, and the specific function is automatically called for analyzing the message during operation.
Configuring a message header judgment callback function;
BOOL(*MsgLenOrderCheck)(UINT8 uiMsgLen,UINT8 uiMsgOrder)。
uiMsgLen: specified message length
uiMsgOrder: a specified message command word.
The message header judgment callback function is a function of a defined message header judgment format, the function only has definition in the method and does not include specific function realization, a user needs to introduce a function entity header pointer consistent with the definition during configuration, and the specific function is automatically called to participate in message header judgment during operation.
The memory size of the receiving buffer area is configured, and the default size is 512B.
The method highlights generalization and openness on parameter configuration of a received parameterization configuration table, can support asynchronous serial data in various typical formats including NAME0183 format, and can also be expanded according to a specific asynchronous serial data format.
And step S2, reading in data from the communication receiving port, shifting and buffering the read data into the receiving buffer area, and recording the length of the data stored in the receiving buffer area.
If the residual space of the data buffer area can not store the data received this time, firstly clearing the data in the receiving buffer area, clearing the size of the received data to 0, and then caching the currently received data.
Step S3, when the length of the data stored in the receiving buffer area is larger than the judgment length of the receiving message configured in the parameterization configuration table, the data in the receiving buffer area is processed;
the processing comprises the step of analyzing and processing the satellite message if the format of the data in the cache region is NAME0183 protocol standard satellite data; if the data in the cache region is a certain asynchronous serial data, determining the message format of the data in the cache region according to the corresponding asynchronous serial data format configuration parameters in the parameterization configuration table, searching the number of message headers and the index positions of the message headers in the message, and analyzing to obtain the message data.
In particular, the method comprises the following steps of,
when asynchronous serial data cached in a receiving cache region are analyzed, judging a callback function according to a message format, message header fixed bytes and a message header judgment callback function configured in a parameterized configuration table, sequentially judging the message headers of the data in the receiving cache region, simultaneously recording the number of the message headers and the index positions of the message headers, when the number of the searched messages is not more than the maximum number of the configured processing messages, continuously searching the message headers, and otherwise, stopping searching; and according to the searched message header, analyzing and processing the data.
Specifically, the data analysis processing is divided into three cases according to the number of the message headers, which specifically includes:
0 message header, clear the current receiving buffer area and clear the receiving count;
1 message header, obtaining the message length according to the message format, if the receiving buffer area has a message completed by one frame, adopting an analysis callback function to analyze the message, and simultaneously emptying the current receiving buffer area and clearing the receiving count; if the message in the buffer area is not analyzed enough, moving the message from the head position of the message to the beginning of the receiving buffer area, and updating the message count;
and the message headers sequentially acquire the message length according to the message format, check whether the number of data between the two message headers is equal to the message length, if so, analyze the message by adopting an analysis callback function, otherwise, move to the next message header for processing until the last message. The processing logic of the last header is consistent with the second case, and is not described again.
Specifically, the analysis of NAME0183 protocol standard satellite data comprises the following steps:
searching for '$' message headers in a round-robin receiving cache region, simultaneously recording the number of the message headers and the index positions of the message headers, continuously searching for the message headers when the number of the searched messages is not more than the maximum number of the configured processed messages, and stopping searching otherwise;
and searching the message tail in a round-robin manner, recording the number of the message tail and the index position of the message tail when the number of the message tail is greater than the corresponding number of the message head, calling a callback function to analyze the message, and stopping searching the message tail if the number of the message tail exceeds the number of the message head.
If the message header is not found, clearing the current receiving buffer area and clearing the receiving count; if the message end is not found and the message head exists, the message starting from the last message head position is moved to the beginning of the receiving buffer area, and the message count is updated at the same time.
To sum up, the embodiment implements real-time analysis of asynchronous serial data by configuring parameters in the received parameterized configuration table; the message data analysis of various typical formats (including NAME0183 format) is supported; analyzing the fixed-length and variable-length messages; the data buffer area design is provided, and traversal multi-frame processing of the data in the buffer area is supported.
Example two
The embodiment discloses a universal asynchronous serial data analysis device, as shown in fig. 2, comprising a parameterization configuration table module, a receiving buffer module and a data processing module;
the parameterized configuration table module is used for configuring the processing parameters in the receiving buffer area module and the data processing module into parameters matched with the data format of the data to be read; configuring the satellite data of NAME0183 protocol standard and parameters of various asynchronous serial data formats;
the receiving buffer area module is used for buffering the data read from the communication receiving port and recording the length of the data stored in the receiving buffer area;
the data processing module is respectively connected with the parameterized configuration table module and the receiving cache region module, acquires configured parameter information from the parameterized configuration table module, and receives the data length stored in the receiving cache region from the receiving cache region module; when the length of the data stored in the receiving cache region is larger than the judgment length of the receiving message configured in the parameterized configuration table, processing the data in the receiving cache region;
if the format of the data in the cache region is NAME0183 protocol standard satellite data, analyzing and processing the satellite message; if the data in the cache region is a certain asynchronous serial data, determining the message format of the data in the cache region according to the corresponding asynchronous serial data format configuration parameters in the parameterization configuration table, searching the number of message headers and the index positions of the message headers in the message, and analyzing to obtain the message data.
Specifically, the data processing module comprises a satellite data processing module and an asynchronous serial data processing module;
and the satellite data processing module is used for processing NAME0183 protocol system satellite data.
The specific processing method comprises the following steps:
searching for '$' message headers in a round-robin receiving cache region, simultaneously recording the number of the message headers and the index positions of the message headers, continuously searching for the message headers when the number of the searched messages is not more than the maximum number of the configured processed messages, and stopping searching otherwise;
and searching the message tail in a round-robin manner, recording the number of the message tail and the index position of the message tail when the number of the message tail is greater than the corresponding number of the message head, calling a callback function to analyze the message, and stopping searching the message tail if the number of the message tail exceeds the number of the message head.
If the message header is not found, clearing the current receiving buffer area and clearing the receiving count; if the message end is not found and the message head exists, the message starting from the last message head position is moved to the beginning of the receiving buffer area, and the message count is updated at the same time.
And the asynchronous serial data processing module is used for processing asynchronous serial data. The specific processing method comprises the following steps:
sequentially judging the message headers for receiving the data in the cache region according to the message format, the message header fixed bytes and the message header judgment callback function configured in the parameterized configuration table, simultaneously recording the number of the message headers and the index positions of the message headers, continuously searching the message headers when the number of the searched messages is not more than the maximum number of the configured processed messages, and stopping searching otherwise; and according to the searched message header, analyzing and processing the data.
Specifically, the data analysis processing is divided into three cases according to the number of the message headers, which specifically includes:
0 message header, clear the current receiving buffer area and clear the receiving count;
1 message header, obtaining the message length according to the message format, if the receiving buffer area has a message completed by one frame, adopting an analysis callback function to analyze the message, and simultaneously emptying the current receiving buffer area and clearing the receiving count; if the message in the buffer area is not analyzed enough, moving the message from the head position of the message to the beginning of the receiving buffer area, and updating the message count;
and the message headers sequentially acquire the message length according to the message format, check whether the number of data between the two message headers is equal to the message length, if so, analyze the message by adopting an analysis callback function, otherwise, move to the next message header for processing until the last message. The processing logic of the last header is consistent with the second case, and is not described again.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention.

Claims (10)

1. A universal asynchronous serial data parsing method is characterized by comprising the following steps:
establishing a receiving parameterized configuration table of asynchronous serial data, and configuring the parameterized configuration table according to a data format of data to be read from a communication receiving port; the parameterized configuration table comprises configuration parameters for NAME0183 protocol system satellite data and various asynchronous serial data formats;
reading data from a communication receiving port, shifting and caching the read data into a receiving cache region, and simultaneously recording the length of the data stored in the receiving cache region;
when the length of the data stored in the receiving cache region is larger than the judgment length of the receiving message configured in the parameterized configuration table, processing the data in the receiving cache region; the processing comprises the step of analyzing and processing the satellite message if the format of the data in the cache region is NAME0183 protocol standard satellite data; if the data in the cache region is a certain asynchronous serial data, determining the message format of the data in the cache region according to the corresponding asynchronous serial data format configuration parameters in the parameterization configuration table, searching the number of message headers and the index positions of the message headers in the message, and analyzing to obtain the message data.
2. The method according to claim 1, wherein the configuration of the reference numbers in the parameterized configuration table is configured according to the data format to be read from the communication receiving port, and includes a message header criterion configuration, a received message judgment length configuration, a message format configuration, a message length index configuration, a message receiving parsing callback function configuration, and a message header judgment callback function configuration.
3. The method according to claim 2, wherein the first byte, the second byte or the third byte of the message data is configured as a criterion of a header in the parameter configuration table according to a data format to be read from a communication receiving port.
4. The universal asynchronous serial data parsing method as claimed in claim 3, wherein the message format is configured to be one of the following message formats in the parameterized configuration table according to the data format to be read in from the communication receiving port;
the first method comprises the following steps: defining a message header, command words, data and a checksum;
and the second method comprises the following steps: message header + data + checksum;
and the third is that: message header + length + command word + data + check;
and fourthly: satellite data NAME0183 protocol standard.
5. The UART-SDA according to claim 4, wherein the message length index is configured in the parameterized configuration table into one of the following four formats according to the data format to be read from the communication receiving port;
the first method comprises the following steps: the message length is fixed, and the message length is contained in the message;
and the second method comprises the following steps: the position index is positioned in the second byte of the message, and the message contains the message length;
and the third is that: the position index is positioned in the third byte of the message, and the message contains the message length;
and fourthly: the position index is positioned in the fourth byte of the message, and the message contains the message length.
6. The UART according to any of claims 1-5, wherein when data is read from the communication receiving port, the remaining space of the data buffer is unable to store the data received this time, the data in the receiving buffer is cleared first, the size of the received data is cleared to 0, and then the currently received data is buffered.
7. The UART-SDA method according to claim 6, wherein when parsing the ASSDA cached in the receiving buffer, sequentially determining the headers of the data in the receiving buffer according to the message format, header fixed bytes and header determination callback function configured in the parameterized configuration table, and simultaneously recording the number of the headers and the index position of the headers, when the number of the searched messages is not greater than the maximum number of the configured processed messages, continuing to search the headers, otherwise, stopping the search; and according to the searched message header, analyzing and processing the data.
8. The UART according to claim 7, wherein the data parsing process is divided into three cases according to the number of headers, specifically:
0 message header, clear the current receiving buffer area and clear the receiving count;
1 message header, obtaining the message length according to the message format, if the receiving buffer area has a message completed by one frame, adopting an analysis callback function to analyze the message, and simultaneously emptying the current receiving buffer area and clearing the receiving count; if the message in the buffer area is not analyzed enough, moving the message from the head position of the message to the beginning of the receiving buffer area, and updating the message count;
and the message headers sequentially acquire the message length according to the message format, check whether the number of data between the two message headers is equal to the message length, if so, analyze the message by adopting an analysis callback function, otherwise, move to the next message header for processing until the last message.
9. The universal asynchronous serial data parsing method as claimed in claim 1, wherein the parsing of the satellite data of NAME0183 protocol standard comprises the following steps:
searching for '$' message headers in a round-robin receiving cache region, simultaneously recording the number of the message headers and the index positions of the message headers, continuously searching for the message headers when the number of the searched messages is not more than the maximum number of the configured processed messages, and stopping searching otherwise;
and searching the message tail in a round-robin manner, recording the number of the message tail and the index position of the message tail when the number of the message tail is greater than the corresponding number of the message head, calling a callback function to analyze the message, and stopping searching the message tail if the number of the message tail exceeds the number of the message head.
If the message header is not found, clearing the current receiving buffer area and clearing the receiving count; if the message end is not found and the message head exists, the message starting from the last message head position is moved to the beginning of the receiving buffer area, and the message count is updated at the same time.
10. An apparatus for universal asynchronous serial data parsing method according to any one of claims 1-9 comprising a parameterized configuration table module, a receive buffer module and a data processing module;
the parameterized configuration table module is used for configuring the processing parameters in the receiving buffer area module and the data processing module into parameters matched with the data format of the data to be read; configuring the satellite data of NAME0183 protocol standard and parameters of various asynchronous serial data formats;
the receiving buffer area module is used for buffering the data read from the communication receiving port and recording the length of the data stored in the receiving buffer area;
the data processing module is respectively connected with the parameterized configuration table module and the receiving cache region module, acquires configured parameter information from the parameterized configuration table module, and receives the data length stored in the receiving cache region from the receiving cache region module; when the length of the data stored in the receiving cache region is larger than the judgment length of the receiving message configured in the parameterized configuration table, processing the data in the receiving cache region; if the format of the data in the cache region is NAME0183 protocol standard satellite data, analyzing and processing the satellite message; if the data in the cache region is a certain asynchronous serial data, determining the message format of the data in the cache region according to the corresponding asynchronous serial data format configuration parameters in the parameterization configuration table, searching the number of message headers and the index positions of the message headers in the message, and analyzing to obtain the message data.
CN202010957697.7A 2020-09-11 2020-09-11 Universal asynchronous serial data analysis method and device Active CN114168517B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010957697.7A CN114168517B (en) 2020-09-11 2020-09-11 Universal asynchronous serial data analysis method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010957697.7A CN114168517B (en) 2020-09-11 2020-09-11 Universal asynchronous serial data analysis method and device

Publications (2)

Publication Number Publication Date
CN114168517A true CN114168517A (en) 2022-03-11
CN114168517B CN114168517B (en) 2024-01-16

Family

ID=80476207

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010957697.7A Active CN114168517B (en) 2020-09-11 2020-09-11 Universal asynchronous serial data analysis method and device

Country Status (1)

Country Link
CN (1) CN114168517B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880148A (en) * 2022-07-12 2022-08-09 深圳融安网络科技有限公司 Data processing method, device and computer readable storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075401A (en) * 2011-01-28 2011-05-25 成都市华为赛门铁克科技有限公司 Method, equipment and system for transmitting message on peripheral component interface express (PCIE) bus
CN103164538A (en) * 2013-04-11 2013-06-19 深圳市华力特电气股份有限公司 Method and device for analyzing data
CN103873448A (en) * 2012-12-17 2014-06-18 北京旋极信息技术股份有限公司 High-speed Internet specification protocol solving method and system for embedded system
CN104008080A (en) * 2014-06-17 2014-08-27 杭州士兰微电子股份有限公司 Serial data analytic method and device
CN104660372A (en) * 2015-02-09 2015-05-27 重庆华数机器人有限公司 Multichannel data transmission method and system based on asynchronous serial port of single chip microcomputer
CN105701053A (en) * 2014-11-24 2016-06-22 中兴通讯股份有限公司 Method and device for transmitting and receiving serial data
CN105978886A (en) * 2016-05-31 2016-09-28 西安交通大学 Parameter dynamic parsing method suitable for various metering instrument communication
CN106445854A (en) * 2016-08-31 2017-02-22 航宇救生装备有限公司 Method and system for supporting transparent transmission of serial interfaces
CN107395565A (en) * 2017-06-15 2017-11-24 北京机械设备研究所 Serial ports receives preprocess method under a kind of fixed length single byte form message protocol
CN109408426A (en) * 2018-10-23 2019-03-01 四川九洲电器集团有限责任公司 A kind of agile and all-purpose serial communication method and system
CN109739747A (en) * 2018-12-13 2019-05-10 西安现代控制技术研究所 A kind of general analytic method of serial communication information protocol
CN109981599A (en) * 2019-03-06 2019-07-05 南京理工大学 A kind of the general-purpose data parsing platform and method of communication data stream
CN110012031A (en) * 2019-04-26 2019-07-12 中国电子科技集团公司第二十九研究所 Data message is general to automatically parse method and storage method
CN110297796A (en) * 2019-07-03 2019-10-01 广东蓄能发电有限公司 Accumulation of energy unit multi-serial ports communication agreement real time parsing system and its analytic method
US20200356519A1 (en) * 2018-03-29 2020-11-12 Wayne Ballantyne Techniques for serial communication

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075401A (en) * 2011-01-28 2011-05-25 成都市华为赛门铁克科技有限公司 Method, equipment and system for transmitting message on peripheral component interface express (PCIE) bus
CN103873448A (en) * 2012-12-17 2014-06-18 北京旋极信息技术股份有限公司 High-speed Internet specification protocol solving method and system for embedded system
CN103164538A (en) * 2013-04-11 2013-06-19 深圳市华力特电气股份有限公司 Method and device for analyzing data
CN104008080A (en) * 2014-06-17 2014-08-27 杭州士兰微电子股份有限公司 Serial data analytic method and device
CN105701053A (en) * 2014-11-24 2016-06-22 中兴通讯股份有限公司 Method and device for transmitting and receiving serial data
CN104660372A (en) * 2015-02-09 2015-05-27 重庆华数机器人有限公司 Multichannel data transmission method and system based on asynchronous serial port of single chip microcomputer
CN105978886A (en) * 2016-05-31 2016-09-28 西安交通大学 Parameter dynamic parsing method suitable for various metering instrument communication
CN106445854A (en) * 2016-08-31 2017-02-22 航宇救生装备有限公司 Method and system for supporting transparent transmission of serial interfaces
CN107395565A (en) * 2017-06-15 2017-11-24 北京机械设备研究所 Serial ports receives preprocess method under a kind of fixed length single byte form message protocol
US20200356519A1 (en) * 2018-03-29 2020-11-12 Wayne Ballantyne Techniques for serial communication
CN109408426A (en) * 2018-10-23 2019-03-01 四川九洲电器集团有限责任公司 A kind of agile and all-purpose serial communication method and system
CN109739747A (en) * 2018-12-13 2019-05-10 西安现代控制技术研究所 A kind of general analytic method of serial communication information protocol
CN109981599A (en) * 2019-03-06 2019-07-05 南京理工大学 A kind of the general-purpose data parsing platform and method of communication data stream
CN110012031A (en) * 2019-04-26 2019-07-12 中国电子科技集团公司第二十九研究所 Data message is general to automatically parse method and storage method
CN110297796A (en) * 2019-07-03 2019-10-01 广东蓄能发电有限公司 Accumulation of energy unit multi-serial ports communication agreement real time parsing system and its analytic method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
桂勋;姚兰;钱清泉;: "海量COMTRADE数据并行解析算法", 电力系统自动化, no. 15 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114880148A (en) * 2022-07-12 2022-08-09 深圳融安网络科技有限公司 Data processing method, device and computer readable storage medium
CN114880148B (en) * 2022-07-12 2022-10-04 深圳融安网络科技有限公司 Data processing method, device and computer readable storage medium

Also Published As

Publication number Publication date
CN114168517B (en) 2024-01-16

Similar Documents

Publication Publication Date Title
US6473621B1 (en) Method and apparatus for entering shortcut messages
CN109246671A (en) Data transmission method, apparatus and system
JP4571008B2 (en) Channelization apparatus and method for analyzing cellular phone data
KR20210086420A (en) Neural network data processing apparatus, method and electronic device
US20120221747A1 (en) Method for reordering the request queue of a hardware accelerator
EP2265029A1 (en) Image processor, image generator and computer program
EP3657744B1 (en) Message processing
CN1225212A (en) Half duplex uart control for single channel bi-directional wireless communications
CN108287877A (en) A kind of RIB renders compressed file FPGA compression/decompression compression systems and hardware decompressing method
CN114168517A (en) Universal asynchronous serial data analysis method and device
CN111277612A (en) Network message processing strategy generation method, system and medium
WO2021189195A1 (en) Data querying method and apparatus, server, and storage medium
US20070094278A1 (en) Data transfer services
US7751346B2 (en) Apparatus for searching TCP and UDP sockets
JP2978519B2 (en) Document data display method and system
CN113312008B (en) Processing method, system, equipment and medium for file read-write service
US6661792B1 (en) Apparatus for processing data packet of ethernet switch system and method thereof
CN113014510B (en) Data caching method and device in distributed test of inertial navigation system
KR100455166B1 (en) Short message search and display method for mobile communication terminal
US8625619B2 (en) Domain gateway control system and method thereof
US6772417B1 (en) Method for processing receiving message of monitor terminal in communication operating system
EP3770767B1 (en) Data processing method and device, and computer readable storage medium
CN113556292B (en) Audio playing method and system of IP network
US20200356368A1 (en) Vector Processor for Heterogeneous Data Streams
CN110865887A (en) Method for saving and outputting direct output short message

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