Industrial control network data packet parsing method, device, electronic device and storage medium
By extracting and mapping the characteristic data of industrial control network data packets, the contradiction between the analysis capabilities and costs of network security equipment in industrial control networks is solved, efficient data packet analysis is achieved, and resource consumption and processing time are reduced.
Patent Information
- Application Number
- CN202110736560.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-06-30
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-06-30
AI Technical Summary
When network security equipment in existing industrial control networks parses a large number of network data packets, it is difficult to reduce costs without reducing performance, and the potential of existing technology to improve performance is limited.
By extracting the characteristic data of the target industrial control network data packet and searching for the parsing results based on the predetermined mapping relationship between the characteristic data and the parsing results, real-time parsing operations are avoided, resource consumption is reduced, and processing time is saved.
It effectively reduces the resource consumption and processing time of network security equipment, improves equipment performance, and reduces costs.
Smart Images

Figure CN115550470B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network security technology, and in particular to an industrial control network data packet parsing method, device, electronic equipment and storage medium. Background Art
[0002] Industrial control network is the specific application of network technology in the field of industrial control, involving local area network, wide area network, distributed computing and other technologies.
[0003] In order to improve the security of industrial control networks, network security devices need to be set up in industrial control networks, such as industrial control firewalls, threat detection devices, etc. When these network security devices are running, they will parse the network data packets transmitted in the industrial control network.
[0004] The industrial control process has the characteristics of large data transmission volume and high requirements for data timeliness. Therefore, network security equipment in the industrial control network needs to have the ability to parse a large number of network data packets in a short period of time.
[0005] High-performance network security equipment will inevitably bring about the problem of high costs. How to maximize the performance of network security equipment and reduce equipment costs without reducing the parsing capabilities of network security equipment is an urgent problem to be solved.
[0006] In the prior art, some technical means are used to improve the parsing ability of network security equipment, such as optimizing code, variable memory allocation, increasing cache, optimizing data management, reducing memory copies, parallel CPU processing, etc.
[0007] The above-mentioned technologies have been applied in existing network security equipment, so the potential for further improving the performance of network security equipment through the above-mentioned technologies is limited; in addition, improving performance through the above-mentioned technologies will also compress the performance space of other performance of network security equipment. Summary of the invention
[0008] In view of the problems existing in the prior art, the present invention provides an industrial control network data packet parsing method, device, electronic equipment and storage medium.
[0009] The present invention provides an industrial control network data packet parsing method, device, electronic device and storage medium, including:
[0010] Receive target industrial control network data packets;
[0011] Extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type;
[0012] The parsing result of the target industrial control network data packet is determined according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result.
[0013] According to a method for parsing an industrial control network data packet provided by the present invention, the feature data is extracted from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type, including:
[0014] Determining whether the target industrial control network data packet is an industrial control network data packet to be reassembled;
[0015] In the case that the target industrial control network data packet is not the industrial control network data packet to be reassembled, the protocol type of the target industrial control network data packet is determined, and a feature data extraction method corresponding to the protocol type is determined according to the protocol type; and feature data is extracted from the target industrial control network data packet according to the determined feature data extraction method.
[0016] According to a method for parsing an industrial control network data packet provided by the present invention, the protocol type of the target industrial control network data packet is determined, and a feature data extraction method corresponding to the protocol type is determined according to the protocol type; and feature data is extracted from the target industrial control network data packet according to the determined feature data extraction method, including:
[0017] Determining that the target industrial control network data packet is a link layer network protocol data packet;
[0018] The data in the target industrial control network data packet that does not include the link layer header part and does not include the protocol header part is used as the characteristic data, or the data in the target industrial control network data packet that does not include the link layer header part is used as the characteristic data.
[0019] According to a method for parsing an industrial control network data packet provided by the present invention, the protocol type of the target industrial control network data packet is determined, and a feature data extraction method corresponding to the protocol type is determined according to the protocol type; and feature data is extracted from the target industrial control network data packet according to the determined feature data extraction method, including:
[0020] Determining that the target industrial control network data packet is an application layer network protocol data packet, wherein the application layer network protocol is carried by the UDP protocol or the TCP protocol;
[0021] All data contained in the TCP structure data or UDP structure data in the target industrial control network data packet is used as characteristic data; or, a specified part of data contained in the TCP structure data or UDP structure data in the target industrial control network data packet is used as characteristic data.
[0022] According to a method for parsing an industrial control network data packet provided by the present invention, the feature data is extracted from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type, and further includes:
[0023] In the case where the target industrial control network data packet is an industrial control network data packet to be reassembled, reassembling the target industrial control network data packet with other industrial control network data packets in the same group to obtain a reassembled industrial control network data packet;
[0024] The type of the reorganized industrial control network data packet is determined, and characteristic data is extracted from the reorganized industrial control network data packet according to the type and a preset characteristic data extraction method corresponding to the type.
[0025] According to a method for parsing an industrial control network data packet provided by the present invention, the parsing result of the target industrial control network data packet is determined according to the feature data of the target industrial control network data packet and a set of mapping relationships between the predetermined feature data and the parsing result, including:
[0026] The parsing result of the reorganized industrial control network data packet corresponding to the characteristic data of the reorganized industrial control network data packet is searched from the mapping relationship set between the characteristic data and the parsing result.
[0027] According to a method for parsing an industrial control network data packet provided by the present invention, the feature data is extracted from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type, and further includes:
[0028] In the case where the target industrial control network data packet is an industrial control network data packet to be reorganized, determining the protocol type of the target industrial control network data packet and other industrial control network data packets in the same group, and determining a feature data extraction method corresponding to the protocol type according to the protocol type; extracting feature data from the target industrial control network data packet and other industrial control network data packets in the same group respectively according to the determined feature data extraction method;
[0029] Correspondingly, determining the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0030] Determine a first industrial control network data packet; wherein the first industrial control network data packet is the target industrial control network data packet and the first industrial control network data packet in the same group;
[0031] Searching for characteristic data of the first industrial control network data packet in the mapping relationship set between the characteristic data and the parsing result;
[0032] When the characteristic data of the first industrial control network data packet can be found, the parsing results of the first industrial control network data packet and other industrial control network data packets in the same group are obtained from a mapping relationship set between the characteristic data and the parsing results.
[0033] According to an industrial control network data packet parsing method provided by the present invention, the mapping relationship set between the feature data and the parsing result is a mapping relationship set between the hash value of the feature data and the parsing result;
[0034] Correspondingly, determining the parsing result of the target industrial control network data packet according to the feature data and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0035] Calculate the hash value of the characteristic data of the target industrial control network data packet;
[0036] The parsing result of the target industrial control network data packet corresponding to the hash value of the characteristic data of the target industrial control network data packet is searched from the mapping relationship set between the hash value of the characteristic data and the parsing result.
[0037] According to a method for parsing an industrial control network data packet provided by the present invention, the method further includes:
[0038] According to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing results, the parsing results of the target industrial control data cannot be determined;
[0039] The target industrial control network data packet is parsed.
[0040] According to a method for parsing an industrial control network data packet provided by the present invention, after parsing the target industrial control network data packet, the method further includes:
[0041] The mapping relationship between the characteristic data of the target industrial control network data packet and the parsing result of the target industrial control network data packet is stored in the mapping relationship set.
[0042] The present invention also provides an industrial control network data packet parsing device, comprising:
[0043] A receiving module, used to receive target industrial control network data packets;
[0044] A feature data extraction module, used to extract feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type;
[0045] The parsing result acquisition module is used to determine the parsing result of the target industrial control network data packet according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result.
[0046] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the industrial control network data packet parsing method when executing the program.
[0047] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the industrial control network data packet parsing method are implemented.
[0048] The present invention also provides a computer program product, which includes computer executable instructions, and the instructions are used to implement the steps of the industrial control network data packet parsing method when being executed.
[0049] The industrial control network data packet parsing method, device, electronic device and storage medium provided by the present invention can avoid real-time parsing operations on the target industrial control network data packet by extracting the characteristic data of the target industrial control network data packet and searching for the parsing result in a set of mapping relationships between predetermined characteristic data and the parsing result based on the characteristic data, thereby helping to reduce resource consumption and save processing time. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0051] Figure 1 A flow chart of the industrial control network data packet parsing method provided by the present invention;
[0052] Figure 2 A schematic diagram of the industrial control network data packet parsing device provided by the present invention;
[0053] Figure 3 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0054] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] Combine the following Figure 1-Figure 3 The invention describes an industrial control network data packet parsing method, device, electronic device and storage medium.
[0056] Figure 1 The flowchart of the industrial control network data packet parsing method provided by the present invention is as follows: Figure 1 As shown, the industrial control network data packet parsing method provided by the present invention includes:
[0057] Step 101: Receive a target industrial control network data packet.
[0058] In this embodiment, the network data packets transmitted in the industrial control network are referred to as industrial control network data packets. In the industrial control network, various types of protocols can be run, such as the data link layer protocol Profinet DCP, the application layer protocol DNP3, etc. According to different protocols, there may be various types of industrial control network data packets. For example, industrial control network data packets generated based on the protocol Profinet DCP, industrial control network data packets generated based on the protocol DNP3.
[0059] In this embodiment, the target industrial control network data packet refers to the industrial control network data packet to be parsed.
[0060] Step 102: extract characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a preset characteristic data extraction method corresponding to the protocol type.
[0061] Industrial control network data packets with the same content may be transmitted multiple times on the industrial control network. In the present invention, the parsing results of the parsed industrial control network data packets can be stored. Then, when an industrial control network data packet with the same content as the parsed industrial control network data packet is received again, the newly received industrial control network data packet will no longer be parsed, but the existing parsing results will be directly assigned to the industrial control network data packet.
[0062] Those skilled in the art know that some information in a network data packet is irrelevant to the content of the network data packet itself and may change with external factors. In this embodiment, such information is referred to as variable information. Some typical variable information may include a frame ID, a sequence number, a negotiation message, etc. in a network data packet.
[0063] For example, user A sends a control instruction "start" to the blower through the industrial control network at time a, and sends another control instruction "start" to the blower through the industrial control network at time b. Since the transmission time of these two control instructions is different, they must be transmitted through two independent network data packets. Although these two network data packets are transmitting the same content - the "start" instruction, their frame numbers are different.
[0064] Except for the aforementioned variable information, the remaining information in different network data packets with the same content is the same. In this embodiment, the data used to distinguish network data packets with different contents is called characteristic data, so the remaining information after removing the variable information can be used as the characteristic data for distinguishing different network data packets, and the characteristic data usually does not change with external information.
[0065] The specific information selected as the characteristic data in the network data packet is related to the protocol type based on the network data packet. In the following embodiments, the process of extracting the characteristic data in the network data packet will be further described.
[0066] Step 103: Determine the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result.
[0067] The mapping relationship between the characteristic data and the parsing result reflects the one-to-one correspondence between the characteristic data and the parsing result. Based on the mapping relationship, the parsing result corresponding to the characteristic data can be found under the premise of knowing the characteristic data of the target industrial control network data packet.
[0068] In this embodiment, the mapping relationship set between the characteristic data of the industrial control network data packet and the parsing result of the industrial control network data packet can be represented by a cache table. The cache table includes at least two items, one for storing the characteristic data and one for storing the parsing result, wherein there is a corresponding relationship between the characteristic data and the parsing result. After obtaining the characteristic data of the target industrial control network data packet, the characteristic data item in the cache table is searched according to the characteristic data. If a characteristic data item is found to be consistent, the content of the parsing result item corresponding to the characteristic data item is read from the cache table, and the parsing result read out is the parsing result of the target industrial control network data packet.
[0069] In this embodiment, the mapping relationship set between the feature data and the analysis results is predetermined. In the following embodiments, the generation process of the mapping relationship set will be described.
[0070] It should be noted that, as an optional implementation, in addition to extracting characteristic data from the target industrial control network data packet and searching for parsing results in a predefined cache table based on the characteristic data, variable information can also be extracted from the target industrial control network data packet and the variable information can be parsed in real time. The obtained real-time parsing results are combined with the parsing results found in the cache table to serve as the complete parsing results of the target industrial control network data packet.
[0071] The industrial control network data packet parsing method provided by the present invention can avoid real-time parsing operations on the target industrial control network data packet by extracting the characteristic data of the target industrial control network data packet and searching for the parsing result in a set of mapping relationships between predetermined characteristic data and the parsing result based on the characteristic data, thereby helping to reduce resource consumption and save processing time.
[0072] Based on any of the above embodiments, in this embodiment, extracting feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type includes:
[0073] Determining whether the target industrial control network data packet is an industrial control network data packet to be reassembled;
[0074] In the case that the target industrial control network data packet is not the industrial control network data packet to be reassembled, the protocol type of the target industrial control network data packet is determined, and a feature data extraction method corresponding to the protocol type is determined according to the protocol type; and feature data is extracted from the target industrial control network data packet according to the determined feature data extraction method.
[0075] Those skilled in the art know that the size of the data unit defined in different layers of the network model is different. For example, excluding the IP header and UDP header, a UDP packet can contain up to 1472 bytes; excluding the IP header and TCP header, a TCP packet can contain up to 1460 bytes. When the size of the data contained in the data packet of the application layer exceeds the capacity of the data unit in the transport layer, the data packet needs to be fragmented for transmission.
[0076] If the received target industrial control network data packet is a fragmented industrial control network data packet, it is necessary to reassemble the data packet before parsing it. In the present invention, such data packets are referred to as industrial control network data packets to be reassembled.
[0077] In this embodiment, it is judged whether the target industrial control network data packet is the industrial control network data packet to be reassembled, and then the case where the target industrial control network data packet is not the industrial control network data packet to be reassembled is discussed.
[0078] Those skilled in the art know that when a data packet is transmitted in fragments, a corresponding mark will be set for the data packet. Therefore, the existing technology can be used to determine the industrial control network data packet to be reassembled.
[0079] If the target industrial control network data packet is not the industrial control network data packet to be reassembled, it means that the data packet can be directly processed. When processing, the protocol type of the target industrial control network data packet must first be determined, and then the feature data extraction method corresponding to the protocol type must be determined according to the protocol type; finally, feature data is extracted from the target industrial control network data packet according to the determined feature data extraction method.
[0080] Specifically, if the target industrial control network data packet is a link layer network protocol data packet, the data in the target industrial control network data packet that does not contain the link layer header part and does not contain the protocol header part is used as the characteristic data, or the data in the target industrial control network data packet that does not contain the link layer header part is used as the characteristic data. If the target industrial control network data packet is an application layer network protocol data packet (the application layer network protocol is carried by the UDP protocol or the TCP protocol), all the data contained in the TCP structure data or the UDP structure data in the target industrial control network data packet is used as the characteristic data; or, the data in the specified part contained in the TCP structure data or the UDP structure data in the target industrial control network data packet is used as the characteristic data.
[0081] To facilitate understanding, the feature data extraction process is classified and explained below according to the characteristics of different types of network protocols.
[0082] Type 1: This type of industrial control network data packet is implemented based on the Layer 2 (link layer) protocol, and its data structure includes: a link layer header part used to implement network transmission, a protocol header part used for protocol negotiation and transmission, and a content part.
[0083] The link layer header part and the protocol header part are variable information related to the transmission process. Therefore, the "content part" of this type of industrial control network data packet except the link layer header part and the protocol header part can be used as feature data.
[0084] Typical representatives of this type of industrial control network data packets are industrial control network data packets based on the Profinet DCP protocol and industrial control network data packets based on the Siemens S7 protocol.
[0085] For example, the code of an industrial control network data packet based on the Profinet DCP protocol is:
[0086] Frame 1:28bytes on wire(224bits),28bytes captured(224bits)
[0087] EthernetⅡ,Src:Vmware_ba:2e:2b(00:0c:29:ba:2e:2b),
[0088] Dst: Vmware_9d:09:7a (00:50:56:9d:09:7a)
[0089] PROFINET acyclic Real-Time, ID: 0xfefd, len: 12
[0090] FrameID: 0xfefd(Real-Time: DCP (Dynamic Configuration Protocol) get / set)
[0091] PROFINET DCP,Get Req,Xid:0x4000003,Status from IP-MAC address
[0092] ServiceID:Get(3)
[0093] ServiceType:Request(0)
[0094] Xid: 0x04000003
[0095] Reserved: 0
[0096] DCPDataLength: 2
[0097] Option: IP(1)
[0098] Suboption: MAC address(1)
[0099] In this code, starting from "PROFINET DCP, Get Req, Xid: 0x4000003, Status from IP-MACaddress", all the subsequent contents belong to the "content part" except the link layer header part and the protocol header part. This part of the content can be used as feature data.
[0100] Type 2: Type 2 is a special form of Type 1. In Type 2, if there is no frequently changing value such as a timestamp or sequence number in the payload of the industrial control network data packet, then the entire payload can be used as feature data. Therefore, the data after the link layer header in the industrial control network data packet can be used as feature data.
[0101] A typical representative of this type of network data packet is a network data packet based on SMV (Sampled Measured Value).
[0102] For example, the code for an SMV-based network packet is:
[0103] Frame 2:56bytes on wire(448bits),56bytes captured(448bits)
[0104] EthernetⅡ,Src: Xerox_01:20:01(00:00:01:01:20:01),
[0105] Dst:Iec-Tc57_01:20:01(01:0c:cd:01:20:01)
[0106] 802.1Q Virtual LAN,PRI:0,DEI:0,ID:1
[0107] IEC61850 Sampled Values
[0108] APPID: 0x2001
[0109] length:38
[0110] Reserved 1: 0x0000(0)
[0111] Reserved 2: 0x0000(0)
[0112] savPdu
[0113] noASDU: 1
[0114] seqASDU 1item
[0115] In this code, the value contained in the "IEC61850 Sampled Values" field and the fields following it can be used as characteristic data. The value contained in the "IEC61850 Sampled Values" field is, for example, "20 01 00 26 0000......00 87 00".
[0116] Type 3: This type of industrial control network data packet is based on the application layer protocol carried by TCP or UDP.
[0117] Those skilled in the art know that when a network data packet generated based on an application layer protocol is transmitted, if the application layer protocol is carried by TCP or UDP, then the structure data of TCP or UDP will be encapsulated outside the network data packet.
[0118] This part of structure data is variable information related to the transmission process, so the part contained in the TCP or UDP structure data in the industrial control network data packet can be used as feature data.
[0119] This type of industrial control network data packets covers a wide range, and typical representatives include network data packets based on DNP3 (Disturbed Network Protocol 3.0), network data packets based on ModBus, network data packets based on MMS (Microsoft Media Server Protocol), and network data packets based on IEC104.
[0120] For example, the code of an industrial control network data packet based on the DNP3 protocol is:
[0121] Frame 6:153bytes on wire(1224bits),153bytes captured(1224bits)
[0122] EthernetⅡ,Src:PcsCompu_e2:e7:ab(00:00:27:e2:e7:ab),
[0123] PcsCompu_ff:2f:c5(08:00:27:ff:2f:c5)
[0124] Internet Protocol Version 4,Src: 192.168.1.2, Dst: 192.168.1.1
[0125] Transmission Control Protocol,Src Port: 49159, Dst Port: 20000, Seq: 22, ACK: 41, Len: 99
[0126] Disturbed Network Protocol 3.0
[0127] In this code, the content of the "Disturbed Network Protocol 3.0" field is used as characteristic data. For example, if the content is "05 64 54c4 04 00 03 00......", these values are used as characteristic data.
[0128] Type 4: This type of industrial control network data packet is also implemented based on the application layer protocol carried by TCP or UDP.
[0129] Different from type three, this type of industrial control network data packet cannot be used as feature data except for the TCP or UDP structure data, and some data in the application layer protocol cannot be used as feature data.
[0130] A typical representative of this type of network data packet is the network data packet based on the Omron FINS protocol.
[0131] For example, the code of a network data packet based on the FINS protocol is:
[0132] Frame 97:104bytes on wire(832bits),104bytes captured(832bits)
[0133] EthernetⅡ,Src: OmronTat_9b:85:5a (00:00:0a:9b:85:5a),
[0134] Dst: Vmware-f7:75:bb(00:0c:29:01:20:01)
[0135] Internet Protocol Version 4,Src: 169.254.91.133, Dst: 169.254.92.32
[0136] Transmission Control Protocol,Src Port: 9600, Dst Port: 49187, Seq: 4294225823, ACK: 41, Len: 99
[0137] OMRON FINS Protocol
[0138] FINS / TCP Header
[0139] FINS Header
[0140] Command Data
[0141] In this code, the part before "OMRON FINS Protocol" is the structure data of the transport layer, and the content of the "FINS / TCP Header" field is considered to be variable information. Therefore, the "FINS Header" field and the content after it are regarded as characteristic data.
[0142] The above is an explanation of the process of how to extract feature data from industrial control network data packets of different protocol types.
[0143] It should be noted that the size of the variable information of the industrial control network data packet corresponding to some communication protocols is fixed. In view of this feature, a fixed offset relative to the data packet header can be determined according to the type of communication protocol corresponding to the industrial control network data packet, and the variable information can be quickly excluded according to the fixed offset, so as to achieve the purpose of quickly locating the characteristic data of the industrial control network data packet.
[0144] The industrial control network data packet parsing method provided by the present invention analyzes the protocol type of the target industrial control network, determines the feature data extraction method according to the protocol type, and then extracts the feature data. It can quickly find the parsing result in a set of mapping relationships between predetermined feature data and parsing results based on the feature data, avoids real-time parsing operations on the target industrial control network data packets, helps to reduce resource consumption, and saves processing time.
[0145] Based on any of the above embodiments, in this embodiment, extracting feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type also includes:
[0146] In the case where the target industrial control network data packet is an industrial control network data packet to be reassembled, reassembling the target industrial control network data packet with other industrial control network data packets in the same group to obtain a reassembled industrial control network data packet;
[0147] The type of the reorganized industrial control network data packet is determined, and characteristic data is extracted from the reorganized industrial control network data packet according to the type and a preset characteristic data extraction method corresponding to the type.
[0148] In the previous embodiment, the process of extracting characteristic data when the target industrial control network data packet is not the industrial control network data packet to be reassembled is described. In this embodiment, the process of extracting characteristic data when the target industrial control network data packet is the industrial control network data packet to be reassembled is described.
[0149] First, other industrial control network data packets in the same group can be obtained based on the target industrial control network data packet.
[0150] In this embodiment, multiple network data packets obtained by slicing a network data packet are referred to as network data packets in the same group. If the target industrial control network data packet is the industrial control network data packet to be reassembled, then the industrial control network data packet must be in the same group as the industrial control network data packet. Based on the tag information of the industrial control network data packet, other industrial control network data packets in the same group as the target industrial control network data packet can be obtained.
[0151] Next, the target industrial control network data packet is reassembled with other industrial control network data packets in the same group to obtain a reassembled industrial control network data packet.
[0152] How to reorganize industrial control network data packets is common knowledge to those skilled in the art, and therefore will not be described again here.
[0153] Finally, the type of the reorganized industrial control network data packet is determined, and characteristic data is extracted from the reorganized industrial control network data packet according to the type and a pre-set characteristic data extraction method corresponding to the type.
[0154] In the previous embodiment, it has been described how to extract characteristic data from the target industrial control network data packet that does not need to be reorganized. For the reorganized industrial control network data packet, there is no essential difference in determining the characteristic data extraction method according to the protocol type of the industrial control network data packet, and the specific implementation process of extracting the characteristic data, so it is not repeated here. It should be particularly noted that the characteristic data finally obtained in this embodiment is the characteristic data of the reorganized industrial control network data packet, not just the characteristic data of a single fragment.
[0155] For example, in a network data packet based on the FINS protocol, the data to be transmitted by the application layer is 2973 bytes, which exceeds the capacity of the TCP packet, and is therefore divided into two TCP packets. Before parsing, the two related TCP packets are reassembled. The protocol type of the reassembled network data packet is determined, and it is found that it meets the type 4 described in the above embodiment, so the feature data is extracted according to the feature data extraction method described in type 4.
[0156] The industrial control network data packet parsing method provided by the present invention reorganizes the industrial control network data packet to be reorganized, and then extracts characteristic data from the reorganized industrial control network data packet, thereby providing a basis for subsequently obtaining the parsing result of the reorganized industrial control network data packet based on the characteristic data, helping to reduce resource consumption and save processing time.
[0157] Based on any of the above embodiments, in this embodiment, determining the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0158] The parsing result of the reorganized industrial control network data packet corresponding to the characteristic data of the reorganized industrial control network data packet is searched from the mapping relationship set between the characteristic data and the parsing result.
[0159] In the case where the target industrial control network data packet is an industrial control network data packet to be reassembled, there will be certain changes when determining the parsing result, and corresponding explanations are made in this embodiment.
[0160] As mentioned in the previous embodiments, when the target industrial control network data packet is an industrial control network data packet to be reassembled, it is necessary to reassemble it before parsing to obtain a reassembled industrial control network data packet, and then extract feature data from the reassembled industrial control network data packet. During parsing, based on the feature data of the reassembled industrial control network data packet, it is possible to directly search for corresponding feature data items in the mapping relationship set between the feature data and the parsing result. If it can be found, the corresponding parsing result will be the parsing result of the entire reassembled industrial control network data packet, rather than the parsing result of a single fragment.
[0161] The industrial control network data packet parsing method provided by the present invention is based on the feature data of the reorganized industrial control network data packet, and quickly finds the parsing result in a set of mapping relationships between predetermined feature data and parsing results, thereby avoiding real-time parsing operations on the reorganized industrial control network data packet, helping to reduce resource consumption and save processing time.
[0162] Based on any of the above embodiments, in this embodiment, extracting feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type also includes:
[0163] In the case where the target industrial control network data packet is an industrial control network data packet to be reorganized, determining the protocol type of the target industrial control network data packet and other industrial control network data packets in the same group, and determining a feature data extraction method corresponding to the protocol type according to the protocol type; extracting feature data from the target industrial control network data packet and other industrial control network data packets in the same group respectively according to the determined feature data extraction method;
[0164] Correspondingly, determining the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0165] Determine a first industrial control network data packet; wherein the first industrial control network data packet is the target industrial control network data packet and the first industrial control network data packet in the same group;
[0166] Searching for characteristic data of the first industrial control network data packet in the mapping relationship set between the characteristic data and the parsing result;
[0167] When the characteristic data of the first industrial control network data packet can be found, the parsing results of the first industrial control network data packet and other industrial control network data packets in the same group are obtained from a mapping relationship set between the characteristic data and the parsing results.
[0168] In this embodiment, another feature data extraction method is described when the target industrial control network data packet is an industrial control network data packet to be reassembled.
[0169] After research, the applicant found that: according to the generation rules of network data packets, after the application layer data packets are fragmented, when two application layer data packets each have one fragment data in common, the probability that the two application layer data packets are different as a whole is very low.
[0170] For example, there are application layer data packet A and application layer data packet B. Application layer data packet A is divided into fragmented data A1 and A2, and application layer data packet B is divided into fragmented data B1 and B2. If A1 and B1 are the same, then the probability of A and B being different is very low.
[0171] In view of this feature, after receiving multiple fragments of the same application layer data packet (such as multiple TCP packets or UDP packets), these fragments are not reassembled, but feature data is extracted from these fragments separately. Then, the parsing result of the entire application layer network data packet is found based on the feature data of the fragments.
[0172] When extracting feature data for these individual fragments, the feature data extraction method of the corresponding type can be selected according to their protocol type (such as the aforementioned type 3 or type 4) to extract feature data. How to select the feature data extraction method of the corresponding type to extract feature data has been described in detail in the previous embodiment, so it will not be repeated here.
[0173] Searching for the parsing result of the entire application layer network data packet based on the characteristic data of the fragment means that once the characteristic data of a certain fragment has been found in the mapping relationship set between the characteristic data and the parsing result, the parsing result of the fragment and the parsing results of other fragments in the same group as the fragment can be returned together as the parsing result of the application layer network data packet before fragmentation.
[0174] For example, application layer data packet A is divided into data fragments A1 and A2. After receiving A1, the feature data of A1 is extracted; based on the feature data of A1, a search is performed in the mapping relationship set between feature data and parsing results. If the feature data of A1 can be found, the parsing results of A1 and A2 corresponding to the feature data of A1 can be returned together based on the pre-set association relationship. When A2 is received next time, there is no need to search for the parsing results of A2, and only related operations such as forwarding need to be performed on A2.
[0175] It should be noted that the processing method described in this embodiment is not applicable to all network protocols, but is generally applicable to network protocols in which network packets are pure data, such as network packets without timestamps and sequence number changes. The processing method described in this embodiment can be used for the FINS protocol.
[0176] The industrial control network data packet parsing method provided by the present invention helps to reduce resource consumption and save processing time by extracting feature data for fragmented data packets and quickly finding the parsing results of the complete application layer network data packets before fragmentation in a set of mapping relationships between predetermined feature data and parsing results based on the feature data of the fragmented data packets.
[0177] Based on any of the above embodiments, in this embodiment, the mapping relationship set between the feature data and the parsing results is a mapping relationship set between the hash value of the feature data and the parsing results;
[0178] Correspondingly, determining the parsing result of the target industrial control network data packet according to the feature data and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0179] Calculate the hash value of the characteristic data of the target industrial control network data packet;
[0180] The parsing result of the target industrial control network data packet corresponding to the hash value of the characteristic data of the target industrial control network data packet is searched from the mapping relationship set between the hash value of the characteristic data and the parsing result.
[0181] In the previous embodiments, after obtaining the characteristic data of the target industrial control network data packet, the characteristic data is used to search for the corresponding parsing result. However, in actual applications, it is found that since the amount of characteristic data is generally large, it will occupy a large storage space when stored, and there are problems such as long time consumption and low efficiency when searching.
[0182] Therefore, in this embodiment, after obtaining the characteristic data of the target industrial control network data packet, a hash value is calculated for the characteristic data. Accordingly, the mapping relationship set between the characteristic data and the parsing result is the mapping relationship set between the hash value of the characteristic data and the parsing result. Based on the hash value of the characteristic data of the target industrial control network data packet, the corresponding hash value item can be searched in the mapping relationship set between the hash value of the characteristic data and the parsing result, and the parsing result corresponding to the hash value item found is the parsing result of the target industrial control network data packet.
[0183] The industrial control network data packet parsing method provided by the present invention calculates a hash value for the characteristic data and searches for the parsing result of the industrial control network data packet according to the hash value. Compared with the characteristic data, it not only has a small storage space but also has a high search efficiency.
[0184] Based on any of the above embodiments, in this embodiment, the method further includes:
[0185] According to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing results, the parsing results of the target industrial control data cannot be determined;
[0186] The target industrial control network data packet is parsed.
[0187] In the previous embodiments, the acquisition process of the parsing results is described based on the premise that the feature data of the target industrial control network data packet can be found in the mapping relationship set between the feature data and the parsing results. However, in actual applications, there is a possibility that the feature data of the target industrial control network data packet cannot be found in the mapping relationship set. For example, an industrial control network data packet of a certain content is transmitted in the industrial control network for the first time.
[0188] In this embodiment, if the characteristic data of the target industrial control network data packet cannot be found in the mapping relationship set, the target industrial control network data packet will be directly parsed.
[0189] Since this implementation process is not substantially different from the prior art, it will not be described again here.
[0190] The industrial control network data packet parsing method provided by the present invention performs real-time parsing on the industrial control network data packets that cannot be found in the mapping relationship set, thereby avoiding the defect that all industrial control network data packets cannot be found through the mapping relationship set.
[0191] Based on any of the above embodiments, in this embodiment, after parsing the target industrial control network data packet, the method further includes:
[0192] The mapping relationship between the characteristic data of the target industrial control network data packet and the parsing result of the target industrial control network data packet is stored in the mapping relationship set.
[0193] If the parsing result of the target industrial control network data packet is not pre-saved in the mapping relationship set but is obtained through real-time parsing, the characteristic data and the parsing result of the target industrial control network data packet may be saved in the mapping relationship set.
[0194] When an industrial control network data packet with the same content arrives next time, the corresponding item can be found in the mapping relationship set according to the characteristic data of the industrial control network data packet, thereby avoiding the need to perform a parsing operation on it. This helps reduce resource consumption and saves processing time.
[0195] Preferably, in this embodiment, a hash value can be calculated for the feature data, and then the hash value of the feature data and the parsing result are saved in a mapping relationship set. When an industrial control network data packet with the same content arrives next time, the corresponding item can be found in the mapping relationship set according to the hash value of the feature data of the industrial control network data packet, and the corresponding parsing result can be obtained, thereby avoiding parsing operations on it.
[0196] The industrial control network data packet parsing method provided by the present invention saves the real-time parsing results of the industrial control network data packets in a mapping relationship set, so that when an industrial control network data packet with the same content arrives next time, the parsing results can be directly obtained through a search operation without the need for real-time parsing operations, which helps to reduce resource consumption and save processing time.
[0197] The industrial control network data packet parsing device provided by the present invention is described below. The industrial control network data packet parsing device described below and the industrial control network data packet parsing method described above can be referenced to each other.
[0198] Figure 2 A schematic diagram of the industrial control network data packet parsing device provided by the present invention, such as Figure 2 As shown, the industrial control network data packet parsing device provided by the present invention includes:
[0199] Receiving module 201, used to receive target industrial control network data packets;
[0200] The feature data extraction module 202 is used to extract feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a preset feature data extraction method corresponding to the protocol type;
[0201] The parsing result acquisition module 203 is used to determine the parsing result of the target industrial control network data packet according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result.
[0202] The industrial control network data packet parsing device provided by the present invention can avoid real-time parsing operations on the target industrial control network data packet by extracting the characteristic data of the target industrial control network data packet and searching for the parsing result in a set of mapping relationships between predetermined characteristic data and the parsing result based on the characteristic data, thereby helping to reduce resource consumption and save processing time.
[0203] Based on any of the above embodiments, in this embodiment, extracting feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type includes:
[0204] Determining whether the target industrial control network data packet is an industrial control network data packet to be reassembled;
[0205] In the case that the target industrial control network data packet is not the industrial control network data packet to be reassembled, the protocol type of the target industrial control network data packet is determined, and a feature data extraction method corresponding to the protocol type is determined according to the protocol type; and feature data is extracted from the target industrial control network data packet according to the determined feature data extraction method.
[0206] The industrial control network data packet parsing device provided by the present invention analyzes the protocol type of the target industrial control network, determines the feature data extraction method according to the protocol type, and then extracts the feature data. It can quickly find the parsing result in a set of mapping relationships between predetermined feature data and parsing results based on the feature data, and can avoid real-time parsing operations on the target industrial control network data packets, which helps to reduce resource consumption and save processing time.
[0207] Based on any of the above embodiments, in this embodiment, the determining the protocol type of the target industrial control network data packet, determining the feature data extraction method corresponding to the protocol type according to the protocol type; extracting feature data from the target industrial control network data packet according to the determined feature data extraction method, includes:
[0208] Determining that the target industrial control network data packet is a link layer network protocol data packet;
[0209] The data in the target industrial control network data packet that does not include the link layer header part and does not include the protocol header part is used as the characteristic data, or the data in the target industrial control network data packet that does not include the link layer header part is used as the characteristic data.
[0210] Based on any of the above embodiments, in this embodiment, the determining the protocol type of the target industrial control network data packet, determining the feature data extraction method corresponding to the protocol type according to the protocol type; extracting feature data from the target industrial control network data packet according to the determined feature data extraction method, includes:
[0211] Determining that the target industrial control network data packet is an application layer network protocol data packet, wherein the application layer network protocol is carried by the UDP protocol or the TCP protocol;
[0212] All data contained in the TCP structure data or UDP structure data in the target industrial control network data packet is used as characteristic data; or, a specified part of data contained in the TCP structure data or UDP structure data in the target industrial control network data packet is used as characteristic data.
[0213] Based on any of the above embodiments, in this embodiment, extracting feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type also includes:
[0214] In the case where the target industrial control network data packet is an industrial control network data packet to be reassembled, reassembling the target industrial control network data packet with other industrial control network data packets in the same group to obtain a reassembled industrial control network data packet;
[0215] The type of the reorganized industrial control network data packet is determined, and characteristic data is extracted from the reorganized industrial control network data packet according to the type and a preset characteristic data extraction method corresponding to the type.
[0216] The industrial control network data packet parsing device provided by the present invention reorganizes the industrial control network data packets to be reorganized, and then extracts characteristic data from the reorganized industrial control network data packets, thereby providing a basis for subsequently obtaining the parsing results of the reorganized industrial control network data packets based on the characteristic data, helping to reduce resource consumption and save processing time.
[0217] Based on any of the above embodiments, in this embodiment, determining the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0218] The parsing result of the reorganized industrial control network data packet corresponding to the characteristic data of the reorganized industrial control network data packet is searched from the mapping relationship set between the characteristic data and the parsing result.
[0219] The industrial control network data packet parsing device provided by the present invention quickly searches for parsing results in a set of mapping relationships between predetermined characteristic data and parsing results based on the characteristic data of the reorganized industrial control network data packet, thereby avoiding real-time parsing operations on the reorganized industrial control network data packet, helping to reduce resource consumption and save processing time.
[0220] Based on any of the above embodiments, in this embodiment, extracting feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type also includes:
[0221] In the case where the target industrial control network data packet is an industrial control network data packet to be reorganized, determining the protocol type of the target industrial control network data packet and other industrial control network data packets in the same group, and determining a feature data extraction method corresponding to the protocol type according to the protocol type; extracting feature data from the target industrial control network data packet and other industrial control network data packets in the same group respectively according to the determined feature data extraction method;
[0222] Correspondingly, determining the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0223] Determine a first industrial control network data packet; wherein the first industrial control network data packet is the target industrial control network data packet and the first industrial control network data packet in the same group;
[0224] Searching for characteristic data of the first industrial control network data packet in the mapping relationship set between the characteristic data and the parsing result;
[0225] When the characteristic data of the first industrial control network data packet can be found, the parsing results of the first industrial control network data packet and other industrial control network data packets in the same group are obtained from a mapping relationship set between the characteristic data and the parsing results.
[0226] The industrial control network data packet parsing device provided by the present invention helps to reduce resource consumption and save processing time by extracting feature data for fragmented data packets and quickly finding the parsing results of the complete application layer network data packets before fragmentation in a set of mapping relationships between predetermined feature data and parsing results based on the feature data of the fragmented data packets.
[0227] Based on any of the above embodiments, in this embodiment, the mapping relationship set between the feature data and the parsing results is a mapping relationship set between the hash value of the feature data and the parsing results;
[0228] Correspondingly, determining the parsing result of the target industrial control network data packet according to the feature data and a predetermined set of mapping relationships between the feature data and the parsing result includes:
[0229] Calculate the hash value of the characteristic data of the target industrial control network data packet;
[0230] The parsing result of the target industrial control network data packet corresponding to the hash value of the characteristic data of the target industrial control network data packet is searched from the mapping relationship set between the hash value of the characteristic data and the parsing result.
[0231] The industrial control network data packet parsing device provided by the present invention calculates a hash value for the characteristic data and searches for the parsing result of the industrial control network data packet according to the hash value. Compared with the characteristic data, it not only has a small storage space but also has a high search efficiency.
[0232] Based on any of the above embodiments, in this embodiment, the method further includes:
[0233] According to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing results, the parsing results of the target industrial control data cannot be determined;
[0234] The target industrial control network data packet is parsed.
[0235] The industrial control network data packet parsing device provided by the present invention performs real-time parsing on the industrial control network data packets that cannot be found in the mapping relationship set, thereby avoiding the defect that all industrial control network data packets cannot be found through the mapping relationship set.
[0236] Based on any of the above embodiments, in this embodiment, after parsing the target industrial control network data packet, the method further includes:
[0237] The mapping relationship between the characteristic data of the target industrial control network data packet and the parsing result of the target industrial control network data packet is stored in the mapping relationship set.
[0238] The industrial control network data packet parsing device provided by the present invention saves the real-time parsing results of the industrial control network data packets in a mapping relationship set, so that when an industrial control network data packet with the same content arrives next time, the parsing results can be directly obtained through a search operation without the need for real-time parsing operations, which helps to reduce resource consumption and save processing time.
[0239] Figure 3is a schematic diagram of the structure of the electronic device provided by the present invention, such as Figure 3 As shown, the electronic device may include: a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320 and the memory 330 communicate with each other through the communication bus 340. The processor 310 may call the logic instructions in the memory 330 to execute the industrial control network data packet parsing method, which includes:
[0240] Receive target industrial control network data packets;
[0241] Extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type;
[0242] The parsing result of the target industrial control network data packet is determined according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result.
[0243] In addition, the logic instructions in the above-mentioned memory 330 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0244] On the other hand, the present invention further provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer can execute the industrial control network data packet parsing method provided by the above methods, the method comprising:
[0245] Receive target industrial control network data packets;
[0246] Extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type;
[0247] The parsing result of the target industrial control network data packet is determined according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result.
[0248] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the method for parsing industrial control network data packets provided above is implemented, and the method comprises:
[0249] Receive target industrial control network data packets;
[0250] Extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type;
[0251] The parsing result of the target industrial control network data packet is determined according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result.
[0252] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0253] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0254] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for parsing industrial control network data packets, characterized in that: include: Receive target industrial control network data packets; Extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type; Determine the parsing result of the target industrial control network data packet according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result; The step of determining the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result includes: In the case where the target industrial control network data packet is an industrial control network data packet to be reassembled, determining that the target industrial control network data packet is an application layer network protocol data packet, wherein the application layer network protocol is carried by a UDP protocol or a TCP protocol; Determine a first industrial control network data packet; wherein the first industrial control network data packet is the target industrial control network data packet and the first industrial control network data packet in the same group; Searching for characteristic data of the first industrial control network data packet in the mapping relationship set between the characteristic data and the parsing result; When the characteristic data of the first industrial control network data packet can be found, the parsing results of the first industrial control network data packet and other industrial control network data packets in the same group are obtained from a mapping relationship set between the characteristic data and the parsing results.
2. The industrial control network data packet parsing method according to claim 1, characterized in that: The extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type includes: Determining whether the target industrial control network data packet is an industrial control network data packet to be reassembled; In the case that the target industrial control network data packet is not the industrial control network data packet to be reassembled, the protocol type of the target industrial control network data packet is determined, and a feature data extraction method corresponding to the protocol type is determined according to the protocol type; and feature data is extracted from the target industrial control network data packet according to the determined feature data extraction method.
3. The industrial control network data packet parsing method according to claim 2, characterized in that: The step of determining the protocol type of the target industrial control network data packet, determining a feature data extraction method corresponding to the protocol type according to the protocol type, and extracting feature data from the target industrial control network data packet according to the determined feature data extraction method includes: Determining that the target industrial control network data packet is a link layer network protocol data packet; The data in the target industrial control network data packet that does not include the link layer header part and does not include the protocol header part is used as the characteristic data, or the data in the target industrial control network data packet that does not include the link layer header part is used as the characteristic data.
4. The industrial control network data packet parsing method according to claim 2, characterized in that: The step of determining the protocol type of the target industrial control network data packet, determining a feature data extraction method corresponding to the protocol type according to the protocol type, and extracting feature data from the target industrial control network data packet according to the determined feature data extraction method includes: Determining that the target industrial control network data packet is an application layer network protocol data packet, wherein the application layer network protocol is carried by the UDP protocol or the TCP protocol; All data contained in the TCP structure data or UDP structure data in the target industrial control network data packet is used as characteristic data; or, a specified part of data contained in the TCP structure data or UDP structure data in the target industrial control network data packet is used as characteristic data.
5. The industrial control network data packet parsing method according to claim 2, characterized in that: The method of extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type further includes: In the case where the target industrial control network data packet is an industrial control network data packet to be reassembled, reassembling the target industrial control network data packet with other industrial control network data packets in the same group to obtain a reassembled industrial control network data packet; The type of the reorganized industrial control network data packet is determined, and characteristic data is extracted from the reorganized industrial control network data packet according to the type and a preset characteristic data extraction method corresponding to the type.
6. The industrial control network data packet parsing method according to claim 5, characterized in that: The step of determining the parsing result of the target industrial control network data packet according to the feature data of the target industrial control network data packet and a predetermined set of mapping relationships between the feature data and the parsing result includes: The parsing result of the reorganized industrial control network data packet corresponding to the characteristic data of the reorganized industrial control network data packet is searched from the mapping relationship set between the characteristic data and the parsing result.
7. The industrial control network data packet parsing method according to claim 2, characterized in that: The method of extracting characteristic data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set characteristic data extraction method corresponding to the protocol type further includes: In the case that the target industrial control network data packet is an industrial control network data packet to be reorganized, the protocol type of the target industrial control network data packet and other industrial control network data packets in the same group are determined, and a feature data extraction method corresponding to the protocol type is determined according to the protocol type; according to the determined feature data extraction method, feature data is extracted from the target industrial control network data packet and other industrial control network data packets in the same group, respectively.
8. The industrial control network data packet parsing method according to claim 1, characterized in that: The mapping relationship set between the feature data and the parsing results is a mapping relationship set between the hash value of the feature data and the parsing results; Correspondingly, determining the parsing result of the target industrial control network data packet according to the feature data and a predetermined set of mapping relationships between the feature data and the parsing result includes: Calculate the hash value of the characteristic data of the target industrial control network data packet; The parsing result of the target industrial control network data packet corresponding to the hash value of the characteristic data of the target industrial control network data packet is searched from the mapping relationship set between the hash value of the characteristic data and the parsing result.
9. The industrial control network data packet parsing method according to any one of claims 1 to 8, characterized in that: The method also includes: According to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing results, the parsing results of the target industrial control data cannot be determined; The target industrial control network data packet is parsed.
10. The industrial control network data packet parsing method according to claim 9, characterized in that: After parsing the target industrial control network data packet, the method further includes: The mapping relationship between the characteristic data of the target industrial control network data packet and the parsing result of the target industrial control network data packet is stored in the mapping relationship set.
11. An industrial control network data packet parsing device, characterized in that: include: A receiving module, used to receive target industrial control network data packets; A feature data extraction module, used to extract feature data from the target industrial control network data packet according to the protocol type of the target industrial control network data packet and a pre-set feature data extraction method corresponding to the protocol type; A parsing result acquisition module, used to determine the parsing result of the target industrial control network data packet according to the characteristic data of the target industrial control network data packet and a predetermined set of mapping relationships between the characteristic data and the parsing result; The parsing result acquisition module is specifically used for: In the case where the target industrial control network data packet is an industrial control network data packet to be reassembled, determining that the target industrial control network data packet is an application layer network protocol data packet, wherein the application layer network protocol is carried by a UDP protocol or a TCP protocol; Determine a first industrial control network data packet; wherein the first industrial control network data packet is the target industrial control network data packet and the first industrial control network data packet in the same group; Searching for characteristic data of the first industrial control network data packet in the mapping relationship set between the characteristic data and the parsing result; When the characteristic data of the first industrial control network data packet can be found, the parsing results of the first industrial control network data packet and other industrial control network data packets in the same group are obtained from a mapping relationship set between the characteristic data and the parsing results.
12. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the industrial control network data packet parsing method as described in any one of claims 1 to 10 are implemented.
13. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the industrial control network data packet parsing method as claimed in any one of claims 1 to 10 are implemented.
14. A computer program product comprising computer executable instructions, characterized in that: When executed, the instruction is used to implement the steps of the industrial control network data packet parsing method as described in any one of claims 1 to 10.
Citation Information
Patent Citations
Memory optimization implementation method and device
CN104639214A
Network protocol analysis method, system and device
CN112751845A
