Message data analysis method, device and equipment
By updating the query table of offset and protocol type memory in real time, dynamically configuring the type of packet analysis, the problem of slow update and iteration of traditional packet analysis methods is solved, and the effect of flexible adaptation to new business needs is achieved.
Patent Information
- Application Number
- CN202111273061.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-29
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-10-29
AI Technical Summary
Traditional message analysis methods need to determine the range of all parsable messages first, and write logical code according to the types to be parsed. Each new message type needs to be updated, the code needs to be modified and the FPGA program is re-composed, resulting in update iteration. Slow speed and difficult to adapt to growing business needs.
By updating the offset memory data query table and protocol type memory data query table in real time, dynamically configure the type of packet analysis, identify the first-layer protocol type of packet data, determine the first-layer and lower-layer offset query addresses, and extract the key fields Data is parsed based on preset policies to avoid modifying code and re-burning the program.
It realizes dynamic configuration of packet analysis types, improves product update and iteration speed, can flexibly adapt to new business needs, and reduces development and testing time.
Smart Images

Figure CN114006956B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer information processing, and in particular, to a message data parsing method, device, equipment, electronic equipment and computer-readable medium. Background Art
[0002] A message is a unit of data exchanged and transmitted in a network, that is, a block of data that a station wants to send at one time. These data blocks begin with some text-based meta-information that describes the content and meaning of the message, followed by an optional data section. The message contains the complete data information to be sent, and its length is very inconsistent, with an unlimited and variable length. Messages are organized based on the protocol defined by file transfer. Parsing messages is to parse file data in a specific format into the desired result for easy processing.
[0003] FPGA is widely used in network communication equipment due to its low latency and parallel processing capabilities. With the development of network communication technology and the emergence of new businesses such as 5G mobile Internet, big data centers, and autonomous driving, network communication equipment is required to be able to quickly adapt to the needs of new businesses, update and iterate products, and flexibly use the characteristics of FPGA to derive new message parsing solutions.
[0004] Traditional parsing methods must first determine the range of all message types that can be parsed, and write logic code based on the types that need to be parsed. Each time a new message type is updated, the code needs to be modified and the FPGA program needs to be re-burned, and then the relevant functions are tested. Network communication equipment using this parsing method has a slow update iteration speed and is difficult to adapt to growing business needs.
[0005] Therefore, a new message data parsing method, device, equipment, electronic device and computer-readable medium are needed.
[0006] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0007] In view of this, the present disclosure provides a message data parsing method, apparatus, device, electronic device and computer-readable medium, which can update the offset memory data query table and the protocol type memory data query table in real time, thereby realizing dynamic configuration of the message parsing type, without modifying the code and re-burning the FPGA program, thereby accelerating the product update iteration speed.
[0008] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0009] According to one aspect of the present disclosure, a message data parsing method is proposed, the method comprising: identifying a first-layer protocol type of message data; determining a first-layer offset query address and a lower-layer protocol query address based on the first-layer protocol type; extracting key field data of the message data based on the first-layer offset query address and the lower-layer protocol query address; when the key field data meets a preset strategy, parsing the message data based on the preset strategy to generate a parsing result.
[0010] In an exemplary embodiment of the present disclosure, it also includes: when the key field data does not meet the preset strategy, determining the lower layer protocol type based on the key field data; determining the lower layer offset query address and the last layer protocol query address based on the lower layer protocol type; parsing the message data based on the lower layer offset query address and the last layer protocol query address to generate a parsing result.
[0011] In an exemplary embodiment of the present disclosure, it further includes: storing multiple offset query addresses based on an offset memory; and storing multiple protocol query addresses based on a protocol type query.
[0012] In an exemplary embodiment of the present disclosure, it includes: modifying the multiple offset query addresses and the multiple protocol query addresses in real time according to a data modification instruction.
[0013] In an exemplary embodiment of the present disclosure, determining a first-layer offset query address and a lower-layer protocol query address based on the first-layer protocol type includes: determining the first-layer offset query address based on data length information of the first-layer protocol type; determining the lower-layer protocol query address based on data length information of the first-layer protocol type.
[0014] In an exemplary embodiment of the present disclosure, the key field data of the message data is extracted based on the first-layer offset query address and the lower-layer protocol query address, including: determining the offset data based on the first-layer offset query address; determining the protocol type based on the lower-layer protocol query address; parsing the message data based on the offset data and the protocol type to extract the key field data.
[0015] In an exemplary embodiment of the present disclosure, the message data is parsed based on the offset data and the protocol type to extract the key field data, including: offsetting the message data based on the offset data; and parsing the offset message data according to the protocol type to extract the key field data.
[0016] In an exemplary embodiment of the present disclosure, when the key field data satisfies a preset strategy, the message data is parsed based on the preset strategy to generate a parsing result, including: when the key field data is a TCP protocol, the message data is parsed according to the TCP protocol to generate a parsing result.
[0017] According to one aspect of the present disclosure, a message data parsing device is proposed, which includes: an identification module for identifying a first-layer protocol type of message data; an address module for determining a first-layer offset query address and a lower-layer protocol query address based on the first-layer protocol type; a data module for extracting key field data of the message data based on the first-layer offset query address and the lower-layer protocol query address; and a parsing module for parsing the message data based on a preset policy to generate a parsing result when the key field data meets a preset policy.
[0018] In an exemplary embodiment of the present disclosure, it includes: an instruction module, which is used to modify the multiple offset query addresses and the multiple protocol query addresses in real time according to the data modification instruction.
[0019] According to one aspect of the present disclosure, a message data parsing device is proposed, which includes: a message data parsing device, used to identify the first layer protocol type of message data; determine the first layer offset query address and the lower layer protocol query address based on the first layer protocol type; extract key field data of the message data based on the first layer offset query address and the lower layer protocol query address; when the key field data meets a preset strategy, parse the message data based on the preset strategy to generate a parsing result; an offset memory, used to store multiple offset query addresses for the message data parsing device to query; a protocol type memory, used to store multiple protocol query addresses for the message data parsing device to query.
[0020] According to one aspect of the present disclosure, an electronic device is proposed, which includes: one or more processors; a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the one or more processors implement the method as described above.
[0021] According to one aspect of the present disclosure, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the method described above is implemented.
[0022] According to the message data parsing method, device, equipment, electronic device and computer-readable medium disclosed in the present invention, the first-layer protocol type of the message data is identified; the first-layer offset query address and the lower-layer protocol query address are determined based on the first-layer protocol type; the key field data of the message data is extracted based on the first-layer offset query address and the lower-layer protocol query address; when the key field data meets the preset strategy, the message data is parsed based on the preset strategy to generate a parsing result, which can update the offset memory data query table and the protocol type memory data query table in real time, thereby realizing dynamic configuration of the message parsing type, without modifying the code and re-burning the FPGA program, thereby accelerating the product update iteration speed.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail its exemplary embodiments with reference to the accompanying drawings. The accompanying drawings described below are only some embodiments of the present disclosure, and it is clear to a person skilled in the art that other accompanying drawings can be obtained from these accompanying drawings without creative work.
[0025] Figure 1 It is a schematic diagram of a message parsing method according to the prior art.
[0026] Figure 2 The figure is a flow chart of a message data parsing method according to an exemplary embodiment.
[0027] Figure 3 The figure is a flow chart of a message data parsing method according to another exemplary embodiment.
[0028] Figure 4 It is a schematic diagram of a message data parsing method according to another exemplary embodiment.
[0029] Figure 5 It is a schematic diagram of a message data parsing method according to another exemplary embodiment.
[0030] Figure 6 It is a schematic diagram of a message data parsing method according to another exemplary embodiment.
[0031] Figure 7 It is a block diagram of a message data parsing device according to an exemplary embodiment.
[0032] Figure 8 It is a block diagram of a message data parsing device according to another exemplary embodiment.
[0033] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.
[0034] Fig.10 It is a block diagram of a computer-readable medium according to an exemplary embodiment. DETAILED DESCRIPTION
[0035] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that this disclosure will be comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0036] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, equipment, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0037] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0038] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0039] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the disclosed concepts. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.
[0040] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present disclosure, and therefore cannot be used to limit the protection scope of the present disclosure.
[0041] The technical abbreviations are explained as follows:
[0042] FPGA: Field Programmable Gate Array field programmable gate array.
[0043] IPv4: Internet Protocol version 4 The fourth version of the Internet Protocol.
[0044] IHL: Internet Header Length IP header length, IPv4 header length information data.
[0045] TCP: Transmission Control Protocol is a connection-oriented, reliable, byte stream-based transport layer communication protocol.
[0046] Figure 1 FIG. 1 is a schematic diagram of a message parsing method according to the prior art. Figure 1 As shown, the invention disclosed in the present invention finds that the traditional message parsing method is to first identify the protocol layer as Ethernet based on the received protocol layer 1 data, and then obtain the next layer protocol as IPv4 based on the type information of the Ethernet layer, and determine the offset 1 of the protocol layer 1, thereby extracting the IPv4 layer data, and then obtain the next layer protocol as TCP based on the IPv4 layer data, and determine the offset 2 of the protocol layer 2, and complete the parsing of all protocol layers layer by layer.
[0047] Traditional parsing methods must first determine the range of all message types that can be parsed, and write logic code based on the types that need to be parsed. Each time a new message type is updated, the code needs to be modified and the FPGA program needs to be re-burned, and then the relevant functions are tested. Network communication equipment using this parsing method has a slow update iteration speed and is difficult to adapt to growing business needs.
[0048] In view of the technical bottlenecks in the prior art, in the message data parsing method, device, and equipment disclosed in the present invention, a memory is used to store the header offset and protocol type that need to be queried during the message parsing process, and the memory is connected through the communication bus of the external processor to modify the offset value and the lower layer protocol type in real time, thereby realizing a dynamic configuration message parsing method without modifying the code and re-burning the program.
[0049] The contents of the present disclosure are described in detail below with the help of specific embodiments.
[0050] Figure 2 2 is a flow chart of a message data parsing method according to an exemplary embodiment. The message data parsing method 20 at least includes steps S202 to S208.
[0051] like Figure 2 As shown, in S202, the first layer protocol type of the message data is identified. According to the prior art, the message data is obtained and identified, and the first layer protocol type identified by the message data can be any type of data protocol in the prior art.
[0052] In S204, a first layer offset query address and a lower layer protocol query address are determined based on the first layer protocol type. The first layer offset query address may be determined based on data length information of the first layer protocol type; and the lower layer protocol query address may also be determined based on data length information of the first layer protocol type.
[0053] In S206, the key field data of the message data is extracted based on the first layer offset query address and the lower layer protocol query address. The offset data is determined based on the first layer offset query address; the protocol type is determined based on the lower layer protocol query address; and the message data is parsed based on the offset data and the protocol type to extract the key field data.
[0054] In one embodiment, it also includes: storing multiple offset query addresses based on the offset memory; and storing multiple protocol query addresses based on the protocol type query.
[0055] More specifically, the offset memory stores the correspondence between multiple offset query addresses and offsets through an offset query table, and the offset data is queried in the offset query table according to the first-layer offset query address.
[0056] More specifically, the protocol type query device stores the correspondence between multiple protocol query addresses and protocol types through a protocol query address table, and queries the protocol type in the protocol query address table according to the lower layer protocol query address.
[0057] In one embodiment, the method further includes: modifying the multiple offset query addresses and the multiple protocol query addresses in real time according to the data modification instruction. Both the protocol query address table and the offset query table may reserve spaces and may be modified in real time. The correspondence between the offset query address and the offset, and the correspondence between the protocol query address and the protocol type may be modified in real time according to the data modification instruction.
[0058] Among them, parsing the message data based on the offset data and the protocol type to extract the key field data includes: offsetting the message data based on the offset data; and parsing the offset message data according to the protocol type to extract the key field data.
[0059] In S208, when the key field data meets the preset strategy, the message data is parsed based on the preset strategy to generate a parsing result. When the key field data is TCP protocol, the message data is parsed according to the TCP protocol to generate a parsing result.
[0060] In one embodiment, the method further includes: when the key field data does not meet the preset strategy, determining the lower layer protocol type based on the key field data; determining the lower layer offset query address and the last layer protocol query address based on the lower layer protocol type; extracting the key field data of the message data based on the lower layer offset query address and the last layer protocol query address, and when the key field data is the TCP protocol, parsing the message data to generate a parsing result. When the key field data is not the TCP protocol, extracting the lower layer protocol address again to extract the key field data and parse it.
[0061] According to the message data parsing method disclosed in the present invention, the first-layer protocol type of the message data is identified; based on the first-layer protocol type, the first-layer offset query address and the lower-layer protocol query address are determined; based on the first-layer offset query address and the lower-layer protocol query address, the key field data of the message data is extracted; when the key field data meets the preset strategy, the message data is parsed based on the preset strategy to generate a parsing result, which can update the offset memory data query table and the protocol type memory data query table in real time, thereby realizing dynamic configuration of the message parsing type, without modifying the code and re-burning the FPGA program, thereby accelerating the product update iteration speed.
[0062] It should be clearly understood that the present disclosure describes how to form and use specific examples, but the principles of the present disclosure are not limited to any details of these examples. On the contrary, based on the teachings of the contents disclosed in the present disclosure, these principles can be applied to many other embodiments.
[0063] Figure 3 The figure is a flow chart of a message data parsing method according to another exemplary embodiment. Figure 3 The process 30 shown is for Figure 2 Detailed description of the process shown.
[0064] like Figure 3 As shown, in S302, message data is received.
[0065] In S304, the first layer protocol type is identified.
[0066] In S306, the offset query address is determined.
[0067] In S308, a lower layer protocol query address is determined.
[0068] In S310 , key field data is extracted.
[0069] In S312, whether it is a preset analysis result.
[0070] In S314, the analysis result is output.
[0071] In S316, the lower layer data is parsed.
[0072] After receiving new message data, the first-layer protocol type is identified, and the offset query address of the layer is calculated based on the first-layer protocol data length information and output to the offset memory. The offset memory outputs the offset corresponding to the query address, and then the lower-layer protocol query address is calculated based on the lower-layer protocol data information, and output to the protocol type memory. The protocol type memory outputs the protocol type corresponding to the query address, extracts key field data based on the current protocol type, and determines whether the parsing is completed based on the received lower-layer protocol type. If the parsing is completed, the current parsing result is output, and new packet data is received. If it is not completed, jump to the lower-layer protocol according to the received offset to continue parsing.
[0073] Figure 4 is a schematic diagram of a message data parsing method according to another exemplary embodiment. Figure 5 As shown, the first layer protocol is identified as Ethernet, the offset query address 1 is generated, output to the offset query memory, and the return value is fixed to 14, such as Figure 6 As shown, the protocol query address 1 is obtained according to the type information of the Ethernet layer, output to the protocol type query memory, and the return value is 2 (IPv4 protocol).
[0074] The message data can be offset by 14 bytes and then the IPv4 layer data can be parsed. The offset query address 2 is calculated based on the IPv4 layer IHL information and output to the offset query memory, with a return value of 20. The protocol query address 2 is obtained based on the IPv4 layer Protocol information and output to the protocol type query memory, with a return value of 4 (TCP protocol).
[0075] The message data can be offset by 20 bytes and then the data of the TCP layer can be parsed. When the current protocol layer is identified as TCP, the end parsing flag information is generated, and after the parsing result is output, the message parsing device receives new packet data.
[0076] During the analysis process, key data at each layer is extracted based on actual project needs.
[0077] More specifically, according to the message data parsing method disclosed in the present invention, the offset memory data query table and the protocol type memory data query table pre-set default data according to the type of message to be parsed, and can be updated in real time through the processor (CPU, etc.) to increase the type of message to be parsed, without the need to re-burn the FPGA program, thereby realizing a dynamic configuration function.
[0078] The disclosed message data parsing method can update the offset memory data query table and the protocol type memory data query table in real time through an external processor, thereby realizing dynamic configuration of message parsing types. During the message parsing process, the offset memory and the protocol type memory are used to realize query and allocation of the offset and protocol type.
[0079] Those skilled in the art will appreciate that all or part of the steps for implementing the above embodiments are implemented as a computer program executed by a CPU. When the computer program is executed by the CPU, the above functions defined by the above method provided by the present disclosure are performed. The program may be stored in a computer-readable storage medium, which may be a read-only memory, a disk, or an optical disk, etc.
[0080] In addition, it should be noted that the above figures are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, and are not intended to be limiting. It is easy to understand that the processes shown in the above figures do not indicate or limit the time sequence of these processes. In addition, it is also easy to understand that these processes can be performed synchronously or asynchronously, for example, in multiple modules.
[0081] The following are embodiments of the device disclosed herein, which can be used to execute the method embodiments disclosed herein. For details not disclosed in the device embodiments disclosed herein, please refer to the method embodiments disclosed herein.
[0082] Figure 7 FIG. 1 is a block diagram of a message data parsing device according to an exemplary embodiment. Figure 7 As shown, the message data parsing device 70 includes: an identification module 702 , an address module 704 , a data module 706 , and a parsing module 708 . The message data parsing device 70 may further include: an instruction module 710 .
[0083] The identification module 702 is used to identify the first layer protocol type of the message data;
[0084] The address module 704 is used to determine the first layer offset query address and the lower layer protocol query address based on the first layer protocol type;
[0085] The data module 706 is used to extract key field data of the message data based on the first layer offset query address and the lower layer protocol query address;
[0086] The parsing module 708 is used to parse the message data based on the preset strategy to generate a parsing result when the key field data meets the preset strategy.
[0087] The instruction module 710 is used to modify the multiple offset query addresses and the multiple protocol query addresses in real time according to the data modification instruction.
[0088] The message data parsing device disclosed in the present invention uses an offset memory and a protocol type memory to query and allocate offsets and protocol types during the message parsing process. The offset memory data query table and the protocol type memory data query table can be updated in real time through an external processor, thereby realizing dynamic configuration of message parsing types without modifying the code and re-burning the FPGA program, thereby accelerating the product update and iteration speed.
[0089] Figure 8 FIG. 1 is a block diagram of a message data parsing device according to another exemplary embodiment. Figure 8 As shown, the message data analysis device 80 includes: a message data analysis device 802 , an offset memory 804 , a protocol type memory 806 , and the message data analysis device 80 may also include: a processor 808 .
[0090] The message data parsing device 802 is used to identify the first-layer protocol type of the message data; determine the first-layer offset query address and the lower-layer protocol query address based on the first-layer protocol type; extract the key field data of the message data based on the first-layer offset query address and the lower-layer protocol query address; when the key field data meets the preset strategy, parse the message data based on the preset strategy to generate a parsing result; wherein the specific internal modules of the message data parsing device 802 can be set as the internal modules of the message data parsing device 70.
[0091] More specifically, the message data parsing device 802 can be used to identify the first layer protocol type of the message data, calculate the offset query address, calculate the lower layer protocol query address, extract key field data, and receive the data matching switch information sent by the processor.
[0092] The offset memory 804 is used to store multiple offset query addresses so that the message data parsing device can query;
[0093] More specifically, the offset memory 804 may be used to output a corresponding offset according to a received query address and receive a processor data modification instruction.
[0094] The protocol type memory 806 is used to store multiple protocol query addresses so that the message data parsing device can query them.
[0095] More specifically, the protocol type memory 806 may be used to output a corresponding protocol type according to a received query address and receive a processor data modification instruction.
[0096] The processor 808 is configured to modify the multiple offset query addresses and the multiple protocol query addresses in real time according to the data modification instruction.
[0097] According to the message data parsing device disclosed in the present invention, by identifying the first-layer protocol type of the message data; determining the first-layer offset query address and the lower-layer protocol query address based on the first-layer protocol type; extracting the key field data of the message data based on the first-layer offset query address and the lower-layer protocol query address; when the key field data meets the preset strategy, the message data is parsed based on the preset strategy to generate a parsing result, which can update the offset memory data query table and the protocol type memory data query table in real time, thereby realizing dynamic configuration of the message parsing type, without modifying the code and re-burning the FPGA program, thereby accelerating the product update iteration speed.
[0098] Fig. 9 It is a block diagram of an electronic device according to an exemplary embodiment.
[0099] Refer to the following Fig. 9 The electronic device 900 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0100] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910), a display unit 940, etc.
[0101] The storage unit stores a program code, which can be executed by the processing unit 910, so that the processing unit 910 performs the steps described in this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 910 can perform the following steps: Figure 2 , Figure 3 Follow the steps shown in .
[0102] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 9201 and / or a cache memory unit 9202 , and may further include a read-only memory unit (ROM) 9203 .
[0103] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0104] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0105] The electronic device 900 may also communicate with one or more external devices 900' (e.g., keyboards, pointing devices, Bluetooth devices, etc.) to enable a user to communicate with the electronic device 900, and / or any device (e.g., routers, modems, etc.) that the electronic device 900 can communicate with one or more other computing devices. Such communication may be performed through an input / output (I / O) interface 950. In addition, the electronic device 900 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 960. The network adapter 960 may communicate with other modules of the electronic device 900 through a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0106] Through the above description of the implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by combining software with necessary hardware. Fig.10 As shown, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, or a network device, etc.) to execute the above method according to the embodiment of the present disclosure.
[0107] The software product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0108] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0109] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0110] The computer-readable medium carries one or more programs. When the one or more programs are executed by a device, the computer-readable medium implements the following functions: identifying the first-layer protocol type of the message data; determining the first-layer offset query address and the lower-layer protocol query address based on the first-layer protocol type; extracting the key field data of the message data based on the first-layer offset query address and the lower-layer protocol query address; when the key field data meets the preset strategy, parsing the message data based on the preset strategy to generate a parsing result. The computer-readable medium can also implement the following functions: modifying the multiple offset query addresses and the multiple protocol query addresses in real time according to the data modification instruction.
[0111] Those skilled in the art will appreciate that the above modules can be distributed in the device according to the description of the embodiment, or can be changed accordingly and only used in one or more devices different from the embodiment. The modules of the above embodiments can be combined into one module, or further divided into multiple sub-modules.
[0112] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0113] The exemplary embodiments of the present disclosure are specifically shown and described above. It should be understood that the present disclosure is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present disclosure is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended claims.
Claims
1. A message data parsing method, characterized in that: include: Identify the first layer protocol type of the message data; Determine a first layer offset query address and a lower layer protocol query address based on the first layer protocol type; Extracting key field data of the message data based on the first layer offset query address and the lower layer protocol query address, including: determining offset data based on the first layer offset query address, determining a protocol type based on the lower layer protocol query address, offsetting the message data based on the offset data, and parsing the offset message data according to the protocol type to extract the key field data; When the key field data satisfies a preset policy, parsing the message data based on the preset policy to generate a parsing result; When the key field data does not satisfy a preset policy, determining a lower layer protocol type based on the key field data; Determine a lower layer offset query address and a last layer protocol query address based on the lower layer protocol type; The message data is parsed based on the lower layer offset query address and the last layer protocol query address to generate a parsing result.
2. The method according to claim 1, characterized in that Also includes: storing a plurality of offset query addresses based on the offset memory; The protocol type querier stores multiple protocol query addresses.
3. The method according to claim 2, characterized in that Also includes: The multiple offset query addresses and the multiple protocol query addresses are modified in real time according to the data modification instruction.
4. The method according to claim 1, characterized in that Determining a first layer offset query address and a lower layer protocol query address based on the first layer protocol type includes: Determine the first layer offset query address based on the data length information of the first layer protocol type; The lower layer protocol query address is determined based on the data length information of the first layer protocol type.
5. The method according to claim 1, characterized in that When the key field data satisfies a preset policy, parsing the message data based on the preset policy to generate a parsing result includes: When the key field data is TCP protocol, the message data is parsed according to the TCP protocol to generate a parsing result.
6. A message data analysis device, characterized in that: include: An identification module, used to identify the first layer protocol type of the message data; An address module, used to determine a first layer offset query address and a lower layer protocol query address based on the first layer protocol type; A data module, used to extract key field data of the message data based on the first layer offset query address and the lower layer protocol query address, including: determining offset data based on the first layer offset query address, determining a protocol type based on the lower layer protocol query address, offsetting the message data based on the offset data, and parsing the offset message data according to the protocol type to extract the key field data; A parsing module is used to parse the message data based on the preset strategy to generate a parsing result when the key field data meets the preset strategy, and to determine the lower layer protocol type based on the key field data when the key field data does not meet the preset strategy, determine the lower layer offset query address and the last layer protocol query address based on the lower layer protocol type, and parse the message data based on the lower layer offset query address and the last layer protocol query address to generate a parsing result.
7. The device according to claim 6, characterized in that Also includes: The instruction module is used to modify multiple offset query addresses and multiple protocol query addresses in real time according to the data modification instruction.
8. A message data analysis device, characterized in that: include: A message data parsing device, used to identify the first layer protocol type of the message data; Determine a first layer offset query address and a lower layer protocol query address based on the first layer protocol type; Extracting the key field data of the message data based on the first layer offset query address and the lower layer protocol query address; when the key field data meets the preset strategy, parsing the message data based on the preset strategy to generate a parsing result, and when the key field data does not meet the preset strategy, determining the lower layer protocol type based on the key field data, determining the lower layer offset query address and the last layer protocol query address based on the lower layer protocol type, parsing the message data based on the lower layer offset query address and the last layer protocol query address to generate a parsing result, wherein extracting the key field data of the message data based on the first layer offset query address and the lower layer protocol query address includes: determining the offset data based on the first layer offset query address, determining the protocol type based on the lower layer protocol query address, offsetting the message data based on the offset data, and parsing the offset message data according to the protocol type to extract the key field data; An offset memory, used for storing a plurality of offset query addresses so as to facilitate query by the message data parsing device; The protocol type memory is used to store a plurality of protocol query addresses so that the message data parsing device can perform inquiries.
