CN112350996A - Communication message analysis system and method adaptable to protocol upgrading - Google Patents

Communication message analysis system and method adaptable to protocol upgrading Download PDF

Info

Publication number
CN112350996A
CN112350996A CN202011103521.1A CN202011103521A CN112350996A CN 112350996 A CN112350996 A CN 112350996A CN 202011103521 A CN202011103521 A CN 202011103521A CN 112350996 A CN112350996 A CN 112350996A
Authority
CN
China
Prior art keywords
message
data item
data
processing engine
protocol
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
CN202011103521.1A
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.)
716th Research Institute of CSIC
Original Assignee
716th Research Institute of CSIC
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 716th Research Institute of CSIC filed Critical 716th Research Institute of CSIC
Priority to CN202011103521.1A priority Critical patent/CN112350996A/en
Publication of CN112350996A publication Critical patent/CN112350996A/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

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention discloses a communication message analysis system and method adaptable to protocol upgrading, the system includes: the message dictionary provides a message description file and provides a proper storage area for storing the original message; the message processing engine is used for filling the received message original text into the specified message storage area, analyzing the message description file according to the reading requirement of the upper application software on the specified message data item, and extracting the data of the specified message data item from the message storage area; meanwhile, when the upper application software assembles and sends the message, the message description file is analyzed according to the transmitted message identification code, the data item name and the data, the data is filled into the memory unit corresponding to the message storage area, and the basic communication assembly of the computer is called to send the message. When the protocol changes, the invention only needs to modify the message description file of the message dictionary, and the message processing engine can support the analysis of all message data items in the new protocol, thereby obviously reducing the workload of system upgrading.

Description

Communication message analysis system and method adaptable to protocol upgrading
Technical Field
The invention belongs to the field of computer communication message analysis, and particularly relates to a communication message analysis method suitable for protocol upgrading.
Background
In the current control system, a large number of proprietary protocols are applied on communication buses or standard protocols such as an Ethernet TCP/UDP, a CAN, a serial port and the like, and are used for realizing the transmission of special instructions and data of the control system and realizing the special functions of the system.
With the expansion and improvement of system functions, the message protocol will be modified accordingly, for example, the types of messages increase or decrease, and the data items of the existing messages will be increased, deleted or position-adjusted. The method is limited in that the traditional message protocol completely adopts code programming to analyze the message, so that when the system function is expanded and improved, application software is not needed to be upgraded, intermediate layer software such as protocol message analysis and the like is needed to be modified, and the workload of system upgrading is increased. In order to adapt to the analysis of the scalable message protocol, the protocol message analysis mode needs to be improved.
Disclosure of Invention
The present invention aims to provide a communication message parsing system and method adaptable to protocol upgrade, which aims to solve the problems of the prior art that when a system function is upgraded, besides application software related to the function, codes of a message parsing part need to be modified, and the like.
The technical solution for realizing the purpose of the invention is as follows: a communication packet parsing system adaptable to protocol upgrades, the system comprising:
the message dictionary is used for providing a message storage space and is also used for providing attribute information of the message in the protocol;
and the message processing engine is used for realizing the storage of the received message based on the message dictionary, realizing the analysis of the data item of the received message, realizing the cache of the message to be sent and realizing the sending of the message to be sent.
Further, the message dictionary includes:
the message storage area comprises a plurality of storage blocks and is used for storing a protocol containing any number of messages, wherein each storage block can store messages with any length;
the message description file is used for describing the attribute of each message in the protocol, and comprises the corresponding relation between the message and the message storage block, the relative offset and the data length of each data item in the message in the corresponding message storage block, and the file establishes the corresponding relation between the data item and the memory address.
Further, the message processing engine includes:
the receiving and storing unit is used for receiving the message, and then filling the received message into a corresponding message storage block in the message dictionary through message description file analysis according to the message identification code;
the data item analysis unit is used for analyzing the message description file according to the reading requirement of the upper application software on the specified message data item and extracting the data of the specified message data item from the message storage area;
the buffer unit is used for analyzing the message description file according to the transmitted message identification code, the data item name and the data when the upper application software is assembled to send the message, and filling the specified data item data into the corresponding memory unit in the message storage area;
and the sending unit is used for calling a message extraction and sending interface of the message processing engine after the upper application software finishes sending message assembly, and further calling computer communication software and hardware to send the message to a destination.
A communication message parsing method adaptable to protocol upgrade, the method comprising the steps of:
(1) the system receives the message:
the message processing engine analyzes the message identification code, analyzes the message description file based on the identification code to obtain message offset, and then fills the received message into a corresponding message storage block in a message dictionary;
the message processing engine informs or waits for upper application software to extract data items, the upper application software calls a data item extraction interface, message identification codes and the data items to be extracted are transmitted to the message processing engine, then the message processing engine analyzes the message description file, finds message storage blocks, offsets and lengths where the corresponding data items are located, and returns the read data item values to the upper application software;
(2) the system sends a message:
the upper application software calls a data item insertion interface and transmits the message identification code, the data item name and the data item value to a message processing engine;
the message processing engine finds the memory address of the data item in the message storage area in the message dictionary according to the message identification code and the data item name, and copies the data item to the memory space in the block;
after preparing all data items of the message, the upper application software calls a message extraction and transmission interface of a message processing engine, and then the message processing engine calls computer communication software and hardware to transmit the message to a destination.
Compared with the prior art, the invention has the following remarkable advantages: the message structure is described by means of a description file, such as XML, and the description file is analyzed and the message is analyzed by adopting general message analysis software. When the system protocol needs to be upgraded, the message analysis software does not need to be modified, and only the message description file text needs to be modified, so that the analysis of the new protocol message can be supported, and the workload of system upgrading is remarkably reduced.
The present invention is described in further detail below with reference to the attached drawing figures.
Drawings
FIG. 1 is a system architecture diagram illustrating the present invention in one embodiment.
Fig. 2 is a diagram illustrating a correspondence between a system message dictionary description file and a message storage area in one embodiment.
FIG. 3 is a diagram illustrating a process for a message processing engine to process a received message, according to an embodiment.
FIG. 4 is a diagram illustrating a process for a message processing engine to process a send message, according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The invention is realized on the basis of a computer communication soft and hard platform. The computer communication soft and hard platform provides the basic functions required by the message analysis, such as a computer communication bus, such as a network, a basic protocol stack, such as TCP/IP, a description file operation library, such as an XML interface library, and the like.
In an embodiment, with reference to fig. 1, the system for parsing a communication packet adaptable to protocol upgrade provided by the present invention includes:
the message dictionary is used for providing a message storage space and a read-write operation function and is also used for providing attribute information of the message in the protocol;
and the message processing engine is used for realizing the storage of the received message based on the message dictionary, realizing the analysis of the data item of the received message, realizing the cache of the message to be sent and realizing the sending of the message to be sent.
Further, in one embodiment, the message dictionary includes:
the message storage area comprises a plurality of storage blocks and is used for storing a protocol containing any number of messages, wherein each storage block can store messages with any length;
the message description file is used for describing the attributes of each message in the protocol, and comprises the corresponding relation between the message and the message storage block, the relative offset and the data length (the size of the storage space occupied by the data item) of each data item in the message in the corresponding message storage block, and the like.
Further, in one embodiment, with reference to fig. 2, the packet storage area includes n storage blocks, where n is the number of packets in the protocol.
Further, in one embodiment, with reference to fig. 2, the packet description file includes n fields, each field describes a data structure of a packet, and the structure first describes an offset address of the packet in the packet storage area, that is, an address of a corresponding packet storage block, and then describes an offset address and a length of each data item in the packet relative to a header address of the packet storage block.
Further, in one embodiment, the message processing engine completes message parsing processing for upper layer application software, and data streams between the message processing engine and the application software are data items in the message, so that the application software is independent of the specific format of the message. The engine includes:
the receiving and storing unit is used for receiving the message, and then filling the received message into a corresponding message storage block in the message dictionary through message description file analysis according to the message identification code;
the data item analysis unit is used for analyzing the message description file according to the reading requirement of the upper application software on the specified message data item and extracting the data of the specified message data item from the message storage area;
the buffer unit is used for analyzing the message description file according to the transmitted message identification code, the data item name and the data when the upper application software is assembled to send the message, and filling the specified data item data into the corresponding memory unit in the message storage area;
and the sending unit is used for calling a message extraction and sending interface of the message processing engine after the upper application software finishes sending message assembly, and further calling computer communication software and hardware to send the message to a destination.
In one embodiment, a method for parsing a communication packet adaptable to protocol upgrade is provided, the method comprising the steps of:
(1) with reference to fig. 3, the system receives a message:
the message processing engine analyzes the message identification code, analyzes the message description file based on the identification code to obtain message offset, and then fills the received message into a corresponding message storage block in a message dictionary;
the message processing engine informs or waits for upper application software to extract data items, the upper application software calls a data item extraction interface, message identification codes and the data items to be extracted are transmitted to the message processing engine, then the message processing engine analyzes the message description file, finds message storage blocks, offsets and lengths where the corresponding data items are located, and returns the read data item values to the upper application software;
(2) with reference to fig. 4, the system sends a message:
the upper application software calls a data item insertion interface and transmits the message identification code, the data item name and the data item value to a message processing engine;
the message processing engine finds the memory address of the data item in the message storage area in the message dictionary according to the message identification code and the data item name, and copies the data item to the memory space in the block;
after preparing all data items of the message, the upper application software calls a message extraction and transmission interface of a message processing engine, and then the message processing engine calls computer communication software and hardware to transmit the message to a destination.
Therefore, when the protocol changes, the invention only needs to modify the message description file of the message dictionary, and the message processing engine can support the analysis of all message data items in the new protocol, thereby obviously reducing the workload of system upgrading.
The foregoing illustrates and describes the principles, general features, and advantages of the present invention. It will be understood by those skilled in the art that the present invention is not limited to the embodiments described above, which are described in the specification and illustrated only to illustrate the principle of the present invention, but that various changes and modifications may be made therein without departing from the spirit and scope of the present invention, which fall within the scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (6)

1. A system for parsing a communication packet adaptable to protocol upgrade, the system comprising:
the message dictionary is used for providing a message storage space and is also used for providing attribute information of the message in the protocol;
and the message processing engine is used for realizing the storage of the received message based on the message dictionary, realizing the analysis of the data item of the received message, realizing the cache of the message to be sent and realizing the sending of the message to be sent.
2. The protocol-upgradeable communication packet parsing system of claim 1 wherein the packet dictionary comprises:
the message storage area comprises a plurality of storage blocks and is used for storing a protocol containing any number of messages, wherein each storage block can store messages with any length;
the message description file is used for describing the attribute of each message in the protocol, and comprises the corresponding relation between the message and the message storage block, the relative offset and the data length of each data item in the message in the corresponding message storage block, and the file establishes the corresponding relation between the data item and the memory address.
3. The system according to claim 2, wherein the message storage area comprises n storage blocks, where n is the number of messages in the protocol.
4. The system according to claim 3, wherein the message description file comprises n fields, each field describing a data structure of a message, including an offset address of the message in the message storage area, i.e. an address of a corresponding message storage block, and an offset address and a length of each data item in the message relative to a header address of the message storage block.
5. The protocol-upgradeable communication message parsing system of claim 4 wherein the message processing engine comprises:
the receiving and storing unit is used for receiving the message, and then filling the received message into a corresponding message storage block in the message dictionary through message description file analysis according to the message identification code;
the data item analysis unit is used for analyzing the message description file according to the reading requirement of the upper application software on the specified message data item and extracting the data of the specified message data item from the message storage area;
the buffer unit is used for analyzing the message description file according to the transmitted message identification code, the data item name and the data when the upper application software is assembled to send the message, and filling the specified data item data into the corresponding memory unit in the message storage area;
and the sending unit is used for calling a message extraction and sending interface of the message processing engine after the upper application software finishes sending message assembly, and further calling computer communication software and hardware to send the message to a destination.
6. A communication message parsing method adaptable to protocol upgrade, the method comprising the steps of:
(1) the system receives the message:
the message processing engine analyzes the message identification code, analyzes the message description file based on the identification code to obtain message offset, and then fills the received message into a corresponding message storage block in a message dictionary;
the message processing engine informs or waits for upper application software to extract data items, the upper application software calls a data item extraction interface, message identification codes and the data items to be extracted are transmitted to the message processing engine, then the message processing engine analyzes the message description file, finds message storage blocks, offsets and lengths where the corresponding data items are located, and returns the read data item values to the upper application software;
(2) the system sends a message:
the upper application software calls a data item insertion interface and transmits the message identification code, the data item name and the data item value to a message processing engine;
the message processing engine finds the memory address of the data item in the message storage area in the message dictionary according to the message identification code and the data item name, and copies the data item to the memory space in the block;
after preparing all data items of the message, the upper application software calls a message extraction and transmission interface of a message processing engine, and then the message processing engine calls computer communication software and hardware to transmit the message to a destination.
CN202011103521.1A 2020-10-15 2020-10-15 Communication message analysis system and method adaptable to protocol upgrading Pending CN112350996A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011103521.1A CN112350996A (en) 2020-10-15 2020-10-15 Communication message analysis system and method adaptable to protocol upgrading

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011103521.1A CN112350996A (en) 2020-10-15 2020-10-15 Communication message analysis system and method adaptable to protocol upgrading

Publications (1)

Publication Number Publication Date
CN112350996A true CN112350996A (en) 2021-02-09

Family

ID=74362059

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011103521.1A Pending CN112350996A (en) 2020-10-15 2020-10-15 Communication message analysis system and method adaptable to protocol upgrading

Country Status (1)

Country Link
CN (1) CN112350996A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075432A (en) * 2011-01-25 2011-05-25 上海聚欣网络科技有限公司 Method, device, equipment and system for transmitting and receiving message
WO2017128299A1 (en) * 2016-01-29 2017-08-03 瑞斯康微电子(深圳)有限公司 Method and system for parsing multi-protocol message based on file mode
WO2018107681A1 (en) * 2016-12-13 2018-06-21 深圳市中兴微电子技术有限公司 Processing method, device, and computer storage medium for queue operation
CN110177046A (en) * 2019-04-18 2019-08-27 中国人民解放军战略支援部队信息工程大学 Secure exchange chip, implementation method and the network switching equipment based on mimicry thought

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102075432A (en) * 2011-01-25 2011-05-25 上海聚欣网络科技有限公司 Method, device, equipment and system for transmitting and receiving message
WO2017128299A1 (en) * 2016-01-29 2017-08-03 瑞斯康微电子(深圳)有限公司 Method and system for parsing multi-protocol message based on file mode
WO2018107681A1 (en) * 2016-12-13 2018-06-21 深圳市中兴微电子技术有限公司 Processing method, device, and computer storage medium for queue operation
CN110177046A (en) * 2019-04-18 2019-08-27 中国人民解放军战略支援部队信息工程大学 Secure exchange chip, implementation method and the network switching equipment based on mimicry thought

Similar Documents

Publication Publication Date Title
CN113810791B (en) Method for improving intelligent network card/DPU network telemetering technology performance
CN104820701A (en) Method and system for recording and synchronizing data
CN101902473B (en) Method for synchronously updating data based on grid GIS (Geographic Information System)
US8224980B2 (en) Adaptive parsing and compression of SOAP messages
US10887415B1 (en) Common agnostic data exchange systems and methods
CN109861998B (en) Plug-in type dynamic analysis system and method based on Beidou short message protocol
CN104618444A (en) Reverse agent server processing request based method and device
CN102195895A (en) Message sending and receiving processing method and device
CN106656714A (en) Communication protocol method and system based on EtherCAT bus
CN113014510B (en) Data caching method and device in distributed test of inertial navigation system
CN102694730B (en) Method and device for parallel processing
CN106992940A (en) Message processing method, device, system and terminal
EP1154352A1 (en) Data transmission method, computer-readable medium, and data transmission apparatus
CN113726762A (en) Internet of things equipment protocol analysis method based on configuration file
US5948079A (en) System for non-sequential transfer of data packet portions with respective portion descriptions from a computer network peripheral device to host memory
CN103326889B (en) Communicate between a kind of new and old edition compatible method and device
CN112350996A (en) Communication message analysis system and method adaptable to protocol upgrading
CN114422624B (en) Data receiving method
CN112769741B (en) Message communication method and electronic equipment
CN110865973A (en) Data processing method and equipment and related device
CN112511609B (en) Data transmission method, device and storage medium
CN111541697A (en) On-line communication method based on protocol configuration
CN110784368A (en) Memcached-based data acquisition method and system
CN114978950B (en) Network algorithm calling method and system based on FPGA and CPU cooperation
CN114884881B (en) Data compression transmission method and terminal

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
CB02 Change of applicant information

Address after: 222001 No.18 Shenghu Road, Lianyungang City, Jiangsu Province

Applicant after: The 716th Research Institute of China Shipbuilding Corp.

Address before: 222001 No.18 Shenghu Road, Lianyungang City, Jiangsu Province

Applicant before: 716TH RESEARCH INSTITUTE OF CHINA SHIPBUILDING INDUSTRY Corp.

CB02 Change of applicant information
RJ01 Rejection of invention patent application after publication

Application publication date: 20210209

RJ01 Rejection of invention patent application after publication