Data transmission method, system, device, electronic device and readable storage medium
By introducing the interaction between business processes and front-end processes in Suricata, the transmission and display of data packets is realized, which solves the problems of tedious operations and low efficiency in the alarm analysis process and improves the efficiency of alarm analysis.
Patent Information
- Application Number
- CN202311224089.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-21
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-09-21
AI Technical Summary
The existing Suricata operation is cumbersome and inefficient during the alarm analysis process. Network security personnel need to manually obtain the data packets corresponding to the alarm log from the Internet server for analysis.
The business process obtains traffic information from the preset storage area, converts it into data packets, and sends it to the front-end process for display, realizing the transmission and display of data packets, allowing users to directly analyze based on the data packets corresponding to the alarm log.
The alarm analysis process is simplified and the efficiency of alarm analysis is improved. Users can analyze packets while viewing traffic logs, reducing the time of manually obtaining and parsing data packets.
Smart Images

Figure CN117156005B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of data processing technology, and specifically relates to a data transmission method, system, device, electronic device and readable storage medium. Background Art
[0002] Suricata is a free, open source, mature, high-performance, and stable network threat detection engine. Suricata can implement real-time intrusion detection (IDS), inline intrusion prevention (IPS), network security monitoring (NSM), and offline pcap (packet capture) processing. Suricata relies on powerful scalable rules and feature languages to filter network traffic, making it easy to integrate with other databases or security data analysis platforms.
[0003] However, the current Suricata can only transmit log data such as quintuples and upstream and downstream traffic packet sizes, and lacks the transmission of original data packets. When an alarm occurs, network security personnel need to manually obtain the data packet corresponding to the alarm log from the Internet server, which makes the alarm analysis process cumbersome and inefficient. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a data transmission method, system, device, electronic device and readable storage medium, which can solve the problems of cumbersome operation and low efficiency in the alarm analysis process.
[0005] In a first aspect, an embodiment of the present application provides a data transmission method, which is applied to a first device, wherein the first device includes a service process, a front-end process, and a message queue process; the method includes:
[0006] The first flow information is obtained from a preset storage area through the business process, and a data packet in a first data format is obtained from the first flow information; the first flow information is stored in the preset storage area by the message queue process; the first flow information is obtained by the second device adding the data packet to the first target field of the flow log; the data packet is a data packet in the first data format obtained by the second device converting the original flow data according to the preset format conversion rule; the flow log is generated by the second device according to the original flow data;
[0007] Converting the data packet into a data packet in a second data format through the service process to obtain second flow information;
[0008] Sending the second flow information to the front-end process through the business process;
[0009] The traffic log and the data packets in the second data format are displayed based on the second traffic information by the front-end process.
[0010] In a second aspect, an embodiment of the present application provides a data transmission method, which is applied to a second device, and the method includes:
[0011] Obtaining original traffic data, and generating a traffic log based on the original traffic data;
[0012] According to a preset format conversion rule, converting the original traffic data into a data packet in a first data format;
[0013] The data packet is added to the first target field of the traffic log to generate first traffic information, and the first traffic information is sent to the message queue process of the first device so that the message queue process can store the first traffic information in a preset storage area.
[0014] In a third aspect, an embodiment of the present application provides a data transmission system, the system comprising a first device and a second device, the first device comprising a service process, a front-end process and a message queue process;
[0015] The business process is used to obtain first flow information from a preset storage area, and obtain a data packet in a first data format from the first flow information; and convert the data packet in the first flow information into a data packet in a second data format to obtain second flow information; and send the second flow information to the front-end process;
[0016] The front-end process is used to display the traffic log and the data packet in the second data format based on the second traffic information;
[0017] The second device is used to obtain original traffic data and generate a traffic log based on the original traffic data; and convert the original traffic data into a data packet in a first data format according to a preset format conversion rule; and add the data packet to a first target field of the traffic log to generate first traffic information, and send the first traffic information to the message queue process of the first device, so that the message queue process can store the first traffic information in a preset storage area.
[0018] In a fourth aspect, an embodiment of the present application provides a data transmission device, which is applied to a first device, wherein the first device includes a service process, a front-end process, and a message queue process; the device includes:
[0019] An acquisition module, used for acquiring first flow information from a preset storage area through the business process, and acquiring a data packet in a first data format from the first flow information; the first flow information is stored in the preset storage area by the message queue process; the first flow information is obtained by the second device adding the data packet to the first target field of the flow log; the data packet is a data packet in the first data format obtained by the second device converting the original flow data according to a preset format conversion rule; the flow log is generated by the second device according to the original flow data;
[0020] A first conversion module, configured to convert the data packets in the first flow information into data packets in a second data format through the service process to obtain second flow information;
[0021] A sending module, used for sending the second flow information to the front-end process through the business process;
[0022] A display module is used to display the traffic log and the data packet in the second data format based on the second traffic information through the front-end process.
[0023] In a fifth aspect, an embodiment of the present application provides a data transmission device, which is applied to a second device, and the device includes:
[0024] A first generating module, used to obtain original traffic data and generate a traffic log according to the original traffic data;
[0025] A second conversion module, used to convert the original traffic data into a data packet in a first data format according to a preset format conversion rule;
[0026] The second generating module is used to add the data packet to the first target field of the traffic log, generate the first traffic information, and send the first traffic information to the message queue process of the first device so that the message queue process can store the first traffic information in a preset storage area.
[0027] In a sixth aspect, an embodiment of the present application provides an electronic device, comprising a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the methods described in the first and second aspects are implemented.
[0028] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the method described in the first aspect and the second aspect are implemented.
[0029] Compared with the prior art, this application has the following advantages:
[0030] In an embodiment of the present application, the first device first obtains the first flow information from a preset storage area through a business process, and obtains a data packet in a first data format from the first flow information; then, the data packet is converted into a data packet in a second data format through the business process to obtain the second flow information, and the second flow information is sent to the front-end process; finally, the front-end process displays the flow log and the data packet in the second data format based on the second flow information to realize the transmission and display of the data packet in the first flow information. The embodiment of the present application realizes the transmission and display of the data packet in the first flow information through the interaction between the business process, the front-end process and the message queue process in the first terminal device, so that the user can analyze the flow log based on the data packet while viewing the flow log. In the event of an alarm, the user can directly perform an alarm analysis based on the data packet corresponding to the alarm log, which simplifies the operation process of the alarm analysis and improves the efficiency of the alarm analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] Figure 1 It is a flowchart of the steps of a data transmission method of the present application;
[0032] Figure 2 is a logic block diagram of a first device of the present application;
[0033] Figure 3 is a flowchart of another data transmission method of the present application;
[0034] Figure 4 is a flowchart of the steps of another data transmission method of the present application;
[0035] Figure 5 It is a logic block diagram of a data transmission link of the present application;
[0036] Figure 6 It is a logic block diagram of a data transmission system of the present application;
[0037] Figure 7 It is a logic block diagram of a data transmission device of the present application;
[0038] Figure 8 It is a logic block diagram of another data transmission device of the present application. DETAILED DESCRIPTION
[0039] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0040] In conjunction with the accompanying drawings, a data transmission method, system, device, electronic device and readable storage medium provided by the embodiments of the present application are described in detail through specific embodiments and their application scenarios.
[0041] In the related art, only traffic logs can be transmitted in the transmission link of the traffic log. The traffic log includes information such as a five-tuple and the sizes of upstream and downstream traffic packets. When a user wants to analyze a certain traffic log while viewing the traffic log, he needs to manually search for a traffic data packet that matches the traffic log from the Internet server. When the traffic data packet is found, the traffic data packet is obtained from the Internet server, and then the traffic log is analyzed based on the content in the traffic data packet. The operation process is cumbersome and inefficient.
[0042] In response to the problems existing in the related art, the embodiments of the present application provide a data transmission method, system, device, electronic device and readable storage medium. The first device obtains the first flow information from the preset storage area through the business process, and obtains the data packet in the first data format from the first flow information; converts the data packet into a data packet in the second data format through the business process to obtain the second flow information, and sends the second flow information to the front-end process; and displays the flow log and the data packet in the second data format based on the second flow information through the front-end process to realize the transmission and display of the data packet in the first flow information. The second device obtains the original flow data, generates a flow log based on the original flow data, and converts the original flow data into a data packet in the first data format according to the preset format conversion rules; and adds the data packet to the first target field of the flow log to generate the first flow information, and sends the first flow information to the message queue process of the first device, so that the message queue process can store the first flow information in the preset storage area to realize the generation of the first flow information. The embodiment of the present application realizes the transmission and display of data packets in the first flow information through the interaction between the business process, the front-end process and the message queue process in the first device, and the interaction between the first device and the second device, so that the user can analyze the flow log based on the data packet while viewing the flow log. In the event of an alarm, the user can directly perform an alarm analysis based on the data packet corresponding to the alarm log, which simplifies the operation process of the alarm analysis and improves the efficiency of the alarm analysis.
[0043] Reference Figure 1 , shows a flowchart of a data transmission method of the present application. The method may include the following steps S110 to S140:
[0044] Step S110: obtaining first flow information from a preset storage area through the business process, and obtaining a data packet in a first data format from the first flow information.
[0045] Step S120: converting the data packet into a data packet in a second data format through the service process to obtain second flow information.
[0046] Step S130: Send the second flow information to the front-end process through the business process.
[0047] Step S140: Displaying the traffic log and the data packet in the second data format based on the second traffic information through the front-end process.
[0048] The data transmission method provided in the embodiment of the present application can be applied to the first device. The first device can be any terminal device or server that can implement the method described in step S110 to step S140. The first device may include but is not limited to a business process, a front-end process, and a message queue process. Among them, the business process establishes connections with the front-end process and the preset storage area respectively, and the business process is used to obtain the first flow information from the preset storage area, and after converting the first flow information into the second flow information that can be recognized by the front-end process, the second flow information is sent to the front-end process. The front-end process establishes connections with the display device and the business process of the first device respectively, and the front-end process is used to display the flow log and the data packet in the second data format to the user based on the second flow information. The message queue process can specifically be a kafka distributed stream processing platform, which is used to receive the first flow information sent by the second device and store the first flow information in a preset storage area.
[0049] It should be noted that the preset storage area can be an open source column database, and the preset storage area can be set in the first device or outside the first device, which is not specifically limited in the embodiment of the present application. The users in the embodiment of the present application include but are not limited to operation and maintenance personnel, developers, etc.
[0050] Reference Figure 2 , shows a logic block diagram of a first device of the present application. The first device 10 includes a front-end process 101, a business process 102, a preset storage area 103 and a message queue process 104. The business process 102 establishes connections with the front-end process 101 and the preset storage area 103, respectively, and the message queue process 104 establishes connections with the second device 20 and the preset storage area 103, respectively.
[0051] Specifically, after the second device 20 generates the first flow information, the second device 20 sends the first flow information to the message queue process 104, and the message queue process 104 stores the first flow information in the preset storage area 103; the user can input a flow information viewing request to the front-end process 101 through the display interface of the display device of the first device 10; the front-end process 101 responds to the flow information viewing request and sends a flow acquisition request to the business process 102; the business process 102 responds to the flow acquisition request and sends a flow acquisition request to the preset storage area 103, and obtains the first flow information from the preset storage area 103, obtains the second flow information by executing the operations corresponding to step S110 and step S120, and sends the second flow information to the front-end process 101; when the front-end process 101 receives the second flow information, based on the second flow information, displays the flow log and data packet in the second flow information to the user through the display device of the first device 10.
[0052] In the embodiment of the present application, the first flow information is stored by the message queue process in the preset storage area; the first flow information is obtained by the second device adding the data packet to the first target field of the flow log; the data packet is a data packet of the first data format obtained by the second device converting the original flow data according to the preset format conversion rule; the flow log is generated by the second device according to the original flow data. It should be noted that the number of the first flow information is at least one.
[0053] The second device may be a host device, a network card and a network threat detection engine are installed in the second device, and the network threat detection engine may be Suricata.
[0054] The first flow information includes a data packet in a first data format and a flow log corresponding to the data packet. It is understandable that the data packet and the flow log correspond to the same original flow data. By analyzing the flow log, the user can find the alarm log corresponding to abnormal behaviors such as abnormal requests and important interface accesses, and further analyze and confirm the alarm log in combination with the data packet corresponding to the alarm log, which can improve the analysis efficiency of the flow log, and timely discover and handle malicious behaviors.
[0055] The data packet is stored in the first target field of the traffic log. The first target field may be a field added in the traffic log, used to store traffic packets in the first data format. Exemplarily, the first data format may be a Base64 format, and the first target field may be a packetBase64 field. Of course, the first data format may also be other data formats that can be recognized by the message queue process, and the embodiments of the present application do not specifically limit this. In addition, the format of the traffic log in the first traffic information may be a json format.
[0056] In an embodiment of the present application, the business process can identify the first target field of the traffic log in the first traffic information and obtain the data packet from the first target field.
[0057] After acquiring the data packet, the service process can convert the data packet into a data packet in the second data format, thereby obtaining second flow information including the data packet in the second data format. It should be noted that in the second flow information, the data packet in the second data format can still be stored in the first target field.
[0058] The second data format is a json format, or other data formats that can be recognized by the front-end process. For example, when the first data format is Base64, the business process can first decode the data packet in Base64 format, and convert the decoded data into a data packet in json format.
[0059] When the traffic log in the first traffic information is in a data format recognizable by the front-end process (e.g., json format), the business process does not need to convert the traffic log format and can send the traffic log as is to the front-end process. When the traffic log is not in a format recognizable by the front-end process, the business process can convert the traffic log into a data format recognizable by the front-end process based on the corresponding data format conversion rules, and then send the second traffic information to the front-end process.
[0060] In an embodiment of the present application, after receiving the second flow information sent by the business process, the front-end process displays the flow log and the data packet in the second data format based on the second flow information. Specifically, it can be: obtaining the flow log and the data packet in the second data format from the second flow information, and displaying the flow log and the data packet based on the display specification of the display device in the first device.
[0061] Exemplarily, after obtaining the traffic log, the front-end process can directly display the traffic log in the display interface of the display device; after obtaining the traffic log, the front-end process can also first nest the traffic log into a preset log template, and then display the traffic log according to the preset log template.
[0062] After acquiring the data packet in the second data format, the front-end process may first convert the data packet in the second data format into a data format that is convenient for the user to view, and then display the data in the data packet in the data format.
[0063] In the embodiment of the present application, the transmission and display of the traffic log and data packet corresponding to the original traffic data can be realized through the interaction between the various processes in the first device. When the user finds an alarm log during the analysis of the traffic log, the data packet corresponding to the alarm log can be obtained, and the alarm log can be intuitively analyzed based on the information in the data packet, which reduces the time for the user to manually obtain the data packet from the Internet server and parse the data packet, simplifies the operation process of the alarm analysis, and improves the efficiency of the alarm analysis.
[0064] Reference Figure 3 , shows a flowchart of another data transmission method of the present application. The method is applied to a first device, and the method may include the following steps S210 to S280:
[0065] Step S210: reading first flow information from the preset storage area through the business process.
[0066] Specifically, when the business process receives the flow information acquisition request sent by the front-end process, it can read the flow information corresponding to the flow information acquisition request from the preset storage area.
[0067] As an example, a traffic acquisition request carries a traffic information identifier. When the business process receives the traffic information acquisition request, it can search for the first traffic information matching the traffic information identifier from a preset storage area based on the traffic information identifier carried in the traffic acquisition request and read the first traffic information, thereby acquiring the first traffic information.
[0068] It should be noted that the flow information identifier may include but is not limited to: a time period identifier and a flow information type identifier, etc. Among them, the time period identifier may be a time period identifier formed by the moment when the first flow information is stored in the preset storage area, or a time period identifier formed by the moment when the first flow information is generated, for example, the time period identifier may be 2023.04.06 11:30 to 2023.04.06 11:35. The flow information type identifier may be a type identifier determined based on different network behaviors, for example, the flow information type identifier may be an access identifier, a scanning behavior identifier, etc.
[0069] Exemplarily, in the case where the flow information identifier is a time period identifier, the service process may read all first flow information within the time period indicated by the time period identifier from a preset storage area according to the time period identifier.
[0070] In the embodiment of the present application, the business process can establish a connection with the preset storage area through a Java database connection (Java DataBase Connectivity, JDBC), and read the data in the preset storage area in a structured query language (Structured Query Language, SQL).
[0071] Step S220: Generate a log list corresponding to the first flow information through the business process; the log list includes a second target field, and the second target field is used to store data packets in the first flow information.
[0072] The log list may be a data entity class list. The log list may include multiple entries for storing different first flow information, and the entry may include a third target field for storing the flow log in the first flow information and a second target field of the data packet.
[0073] Step S230: looping through the log list through the business process, and obtaining the data packet from the second target field of the log list.
[0074] Specifically, when the business process generates a log list corresponding to the first traffic information, it can loop through the log list, identify the second target field from the log list, and obtain the data packet in the first data format from the second target field.
[0075] Step S240: Decoding the data packet through the service process to obtain a data stream corresponding to the data packet.
[0076] Step S250: calling a data packet capture function library through the business process, and converting the data stream into a data packet in a second data format based on the data packet capture function library.
[0077] In an embodiment of the present application, when the first device converts the data packet in the first traffic information into a data packet in a second data format through a business process, the first device can first decode the data packet through the business process through step S240 to obtain a data stream corresponding to the data packet; then the first device calls the data packet capture function library through the business process through step S250, and converts the data stream into a data packet in the second data format based on the data packet capture function library.
[0078] Specifically, when the first data format is in Base64 format, the service process needs to first decode the data packet in Base64 format into a data stream, and the format of the data stream can be a network data packet capture format that complies with industry standards, such as pcap (Packet Capture) format. Afterwards, the service process calls the data packet capture function library, and based on the data packet capture function library, further converts the data stream in the network data packet capture format that complies with industry standards into a data packet in the second data format.
[0079] Among them, the data packet capture function library can be stored in the storage area of the first device to reduce the delay of the business process calling the data packet capture function library. Of course, the data packet capture function library can also be stored in other areas outside the first device, and the embodiment of the present application does not specifically limit this. The data packet capture function library can specifically be libpcap (Packet Capture Libray,). Exemplarily, the first device can call libpcap through the business process, and parse the data stream in pcap format into a data packet in json format that can be recognized by the front-end process based on libpcap.
[0080] In an optional embodiment of the present application, the step S250 of calling a data packet capture function library by the business process and converting the data stream into a data packet in a second data format based on the data packet capture function library includes step S2501:
[0081] Step S2501: calling the data packet capture function library through the business service using the jni (Java Native Interface) interface, and converting the data stream into a data packet in a second data format based on the data packet capture function library.
[0082] Among them, jni provides a series of application program interfaces (Application Program Interface, API) to allow Java and other languages to interact, and realize calling functions of other languages in Java code.
[0083] Step S260: Send the second flow information to the front-end process through the business process.
[0084] This step can refer to the detailed description of step S130 and will not be repeated here.
[0085] Step S270: Obtain the traffic log from the second traffic information and display it through the front-end process.
[0086] Step S280: converting the data packet in the second data format into a data packet in the wireshark format through the front-end process and displaying the data packet.
[0087] In an embodiment of the present application, when the first device displays the traffic log and the data packets in the second data format based on the second traffic information through the front-end process, the traffic log can be obtained from the second traffic information through the front-end process and displayed, and the data packets in the second data format can be converted into data packets in the wireshark format and displayed through the front-end process.
[0088] It should be noted that step S270 may be executed before step S280 or after step S280, and step S270 may also be executed simultaneously with step S280, which is not specifically limited in the embodiment of the present application.
[0089] Specifically, the front-end process can obtain the traffic log from the second traffic information, and display the traffic log on the display device according to the display specification of the first device, so that the user can analyze the traffic log by viewing the traffic log.
[0090] The front-end process can obtain a data packet in the second data format from the second traffic information, convert the data packet in the second data format into a data packet in the wireshark format using the wireshark tool, and display the data packet in the wireshark format on the display device according to the display specification of the first device.
[0091] In an optional embodiment of the present application, the first device may further include a storage management process; before obtaining the first flow information from the preset storage area through the service process in step S110, the method may further include steps A11 to A13:
[0092] Step A11: Receive the first flow information sent by the second device through the message queue process, and send the first flow information to the storage management process.
[0093] Step A12: adding a storage space corresponding to the data packet in the first flow information in the preset storage area through the storage management process; the storage space is used to store the data packet.
[0094] Step A13: The first flow information is stored in the preset storage area through the storage management process, so that the business process can obtain the first flow information from the preset storage area.
[0095] In an embodiment of the present application, the first device may include a business process, a front-end process, a message queue process, and a storage management process. The storage management process is used to manage the analysis, query, storage, reading, etc. of the preset storage area. The storage management process may be any storage management tool in an open source columnar database management system (DBMS), for example, the storage management process may be ClickHouse.
[0096] Specifically, in the case where the first device includes a storage management process, before the first device obtains the first flow information from the preset storage area through the business process, the first device may also first receive the first flow information sent by the second device through the message queue process, and send the first flow information to the storage management process; then, through the storage management process, according to the data packet in the first flow information, add a storage space corresponding to the data packet in the preset storage area; finally, through the storage management process, store the first flow information in the preset storage area, so that the business process can obtain the first flow information from the preset storage area.
[0097] Among them, the first device can pre-set the association relationship between the storage management process and the preset storage area, so that when the storage management process receives the first traffic information sent by the message queue process, it can immediately respond to the first traffic information and perform operations corresponding to steps A12 and A13 to improve the execution efficiency of the storage management process.
[0098] Before storing the first flow information in the preset storage area, the storage management process first needs to add storage space corresponding to the data packet in the preset storage area based on information such as the size and format of the data packet in the first flow information. The storage space is used to store the data packet in the first flow information.
[0099] Among them, the preset storage area may include a data table for storing the first flow information. The storage management process can add a table entry corresponding to the data packet in the data table of the preset storage area according to the data packet in the first flow information. The table entry is used to store the data packet in the first flow information.
[0100] When the first device adds storage space corresponding to a data packet in the preset storage area through the storage management process, the first device can continue to store the first flow information in the data table in the preset storage area through the storage management process, so that the business process can obtain the first flow information from the data table in the preset storage area.
[0101] As an optional implementation, when the first device obtains the first flow information from the preset storage area through the business process, the business process may first access the storage management process and obtain the first flow information from the preset storage area through the storage management process.
[0102] The data transmission method provided in the embodiment of the present application realizes the transmission and display of the data packet in the first flow information through the interaction between the business process, the front-end process and the message queue process in the first terminal device, so that the user can analyze the flow log based on the data packet while viewing the flow log. In the event of an alarm, the user can directly perform an alarm analysis based on the data packet corresponding to the alarm log, which simplifies the operation process of the alarm analysis and improves the efficiency of the alarm analysis.
[0103] Reference Figure 4 , shows a flowchart of another data transmission method of the present application. The method may include steps S310 to S330:
[0104] Step S310: Acquire original traffic data, and generate a traffic log according to the original traffic data.
[0105] Step S320: converting the original traffic data into a data packet in a first data format according to a preset format conversion rule.
[0106] Step S330: Add the data packet to the first target field of the traffic log, generate first traffic information, and send the first traffic information to the message queue process of the first device so that the message queue process stores the first traffic information in a preset storage area.
[0107] The data transmission method provided in the embodiment of the present application can be applied to the second device. The second device can be a host device, and a network card and a network threat detection engine are installed in the second device, and the network threat detection engine can be Suricata.
[0108] In an embodiment of the present application, the second device may implement operations corresponding to step S310 to step S330 through a network threat detection engine.
[0109] The second device establishes connections with the switch and the message queue process in the first device respectively. The second device can mirror the original traffic data passing through the switch to the network card of the second device through the mirror port by means of a direct network cable connection; thereafter, the network threat detection engine obtains the original traffic data from the network card and executes steps S310 to S330 based on the original traffic data.
[0110] In the application embodiment, the traffic log generated by the second device can be in yaml format or json format. Specifically, when the network threat detection engine in the second device obtains the original traffic data, it can generate a traffic log corresponding to the original traffic data after calculating the traffic and alarm rules. Among them, the alarm rules include but are not limited to real-time intrusion detection rules, inline intrusion prevention rules, network security monitoring rules, and offline pcap processing rules.
[0111] After generating the traffic log, the network threat detection engine can also convert the original traffic data into a data packet in the first data format according to a preset format conversion rule. The preset format conversion rule can be a Base64 format conversion rule, and the network threat detection engine can encode the original traffic data into a data packet in Base64 format according to the Base64 format conversion rule.
[0112] When a data packet in the first data format is obtained through step S320, the network threat detection engine can add a first target field in the traffic log according to the size of the data packet, so that when the network threat detection engine executes step S330, the data packet in the first data format can be added to the first target field of the traffic log, thereby generating first traffic information based on the traffic log including the data packet.
[0113] In an embodiment of the present application, after the second device generates the first flow information, it can send the first flow information to the message queue process of the first device, so that the message queue process can store the first flow information in a preset storage area, so that the first device can perform operations corresponding to steps S110 to S140 based on the first flow information in the preset storage area.
[0114] Reference Figure 5 , shows a logic block diagram of a data transmission link of the present application. Figure 5 As shown, the data transmission link includes an Internet server, a switch, a first device and a second device. The first device includes a message queue process, a storage management process, a business process and a front-end process; the second device includes a network card and a network threat detection engine.
[0115] Specifically, when a user accesses an Internet application, the switch transmits the access request to the Internet server; the Internet server returns the original traffic data to the user through the switch in response to the access request.
[0116] The network card in the second device mirrors the original traffic data to the network card of the network threat detection engine through the mirror port by directly connecting the network cable; then, the network threat detection engine obtains the original traffic data from the network card and generates a traffic log based on the original traffic data; the network threat detection engine also converts the original traffic data into a data packet in a first data format according to a preset format conversion rule, adds the data packet to the first target field of the traffic log, generates first traffic information, and sends the first traffic information to the message queue process of the first device.
[0117] The message queue process in the first device receives the first flow information sent by the network threat detection engine of the second device, and sends the first flow information to the storage management process; the storage management process adds a storage space corresponding to the data packet in the preset storage area according to the data packet in the first flow information, and stores the first flow information in the preset storage area; the business process obtains the first flow information from the preset storage area, and obtains the data packet in the first data format from the first flow information; thereafter, the business process converts the data packet into a data packet in the second data format, obtains the second flow information, and sends the second flow information to the front-end process; finally, the front-end process displays the flow log and the data packet in the second data format based on the second flow information.
[0118] The data transmission method provided by the embodiment of the present application, the interaction between the business process, the front-end process and the message queue process in the first device, and the interaction between the first device and the second device, realizes the transmission and display of the data packet in the first flow information, so that the user can analyze the flow log based on the data packet while viewing the flow log. In the event of an alarm, the user can directly perform an alarm analysis based on the data packet corresponding to the alarm log, which simplifies the operation process of the alarm analysis and improves the efficiency of the alarm analysis.
[0119] System Example
[0120] An embodiment of the present application provides a data transmission system, the system comprising a first device and a second device, the first device comprising a service process, a front-end process and a message queue process;
[0121] The business process is used to obtain first flow information from a preset storage area, and obtain a data packet in a first data format from the first flow information; and convert the data packet in the first flow information into a data packet in a second data format to obtain second flow information; and send the second flow information to the front-end process;
[0122] The front-end process is used to display the traffic log and the data packet in the second data format based on the second traffic information;
[0123] The second device is used to obtain original traffic data and generate a traffic log based on the original traffic data; and convert the original traffic data into a data packet in a first data format according to a preset format conversion rule; and add the data packet to a first target field of the traffic log to generate first traffic information, and send the first traffic information to the message queue process of the first device, so that the message queue process can store the first traffic information in a preset storage area.
[0124] Reference Figure 6 , shows a logical block diagram of a data transmission system of the present application. The data transmission system includes: a first device 10 and a second device 20. The first device 10 includes a front-end process 101, a business process 102, a storage management process 105 and a message queue process 104. The second device 20 includes a network card 201 and a network threat detection engine 202.
[0125] Specifically, the network card 201 is used to mirror the original traffic data passing through the switch to the local network card 201 of the second device 20 through the mirror port by means of a direct network cable connection.
[0126] The network threat detection engine 202 is used to obtain original traffic from the network card 201 and generate a traffic log based on the original traffic data; convert the original traffic data into a data packet in a first data format according to a preset format conversion rule; and add the data packet to the first target field of the traffic log, generate first traffic information, and send the first traffic information to the message queue process 104 of the first device 10.
[0127] The message queue process 104 is used to receive the first flow information sent by the second device 20 and send the first flow information to the storage management process 105.
[0128] The storage management process 105 is used to add storage space corresponding to the data packet in the preset storage area according to the data packet in the first flow information, and store the first flow information in the preset storage area so that the business process 102 can obtain the first flow information from the preset storage area.
[0129] The business process 102 is used to obtain the first flow information from a preset storage area and obtain a data packet in a first data format from the first flow information; and convert the data packet into a data packet in a second data format to obtain the second flow information, and send the second flow information to the front-end process 101.
[0130] The front-end process 101 is used to display the traffic log and the data packet in the second data format based on the second traffic information.
[0131] The data transmission system provided by the embodiment of the present application realizes the transmission and display of data packets in the first flow information through the interaction between the business process, the front-end process and the message queue process in the first device, and the interaction between the first device and the second device, so that the user can analyze the flow log based on the data packet while viewing the flow log. In the event of an alarm, the user can directly perform an alarm analysis based on the data packet corresponding to the alarm log, which simplifies the operation process of the alarm analysis and improves the efficiency of the alarm analysis.
[0132] Device Embodiment
[0133] Figure 7 This is a logical block diagram of a data transmission device of the present application. The data transmission device is applied to a first device, the first device includes a service process, a front-end process and a message queue process; the device may include:
[0134] The acquisition module 710 is used to acquire the first flow information from the preset storage area through the business process, and acquire a data packet in a first data format from the first flow information; the first flow information is stored in the preset storage area by the message queue process; the first flow information is obtained by the second device adding the data packet to the first target field of the flow log; the data packet is a data packet in the first data format obtained by the second device converting the original flow data according to the preset format conversion rule; the flow log is generated by the second device according to the original flow data;
[0135] A first conversion module 720, configured to convert the data packets in the first flow information into data packets in a second data format through the service process to obtain second flow information;
[0136] A sending module 730, configured to send the second flow information to the front-end process through the business process;
[0137] The display module 740 is used to display the traffic log and the data packet in the second data format based on the second traffic information through the front-end process.
[0138] Optionally, the first conversion module may include:
[0139] A decoding submodule, used to decode the data packet through the service process to obtain a data stream corresponding to the data packet;
[0140] The first conversion submodule is used to call a data packet capture function library through the business process, and convert the data stream into a data packet in a second data format based on the data packet capture function library.
[0141] Optionally, the first conversion submodule may include:
[0142] The conversion unit is used to call the data packet capture function library by using the jni interface through the business service, and convert the data stream into a data packet in a second data format based on the data packet capture function library.
[0143] Optionally, the first device further includes a storage management process; the apparatus may further include:
[0144] a forwarding module, configured to receive the first flow information sent by the second device through the message queue process, and send the first flow information to the storage management process;
[0145] a storage space management module, configured to add a storage space corresponding to the data packet in the preset storage area according to the data packet in the first flow information through the storage management process; the storage space is used to store the data packet;
[0146] A storage module is used to store the first flow information in the preset storage area through the storage management process, so that the business process can obtain the first flow information from the preset storage area.
[0147] Optionally, the acquisition module may include:
[0148] A reading submodule, configured to read the first flow information from the preset storage area through the service process;
[0149] A generating submodule, configured to generate a log list corresponding to the first flow information through the business process; the log list includes a second target field, and the second target field is used to store data packets in the first flow information;
[0150] The first acquisition submodule is used to loop through the log list through the business process and acquire the data packet from the second target field of the log list.
[0151] Optionally, the display module may include:
[0152] A second acquisition submodule, used for acquiring and displaying the traffic log from the second traffic information through the front-end process;
[0153] The second conversion submodule is used to convert the data packet in the second data format into a data packet in the wireshark format and display it through the front-end process.
[0154] Figure 8It is a logic block diagram of another data transmission device of the present application. The data transmission device is applied to a second device, and the device may include:
[0155] A first generating module 810 is used to obtain original traffic data and generate a traffic log according to the original traffic data;
[0156] A second conversion module 820, configured to convert the original traffic data into a data packet in a first data format according to a preset format conversion rule;
[0157] The second generation module 830 is used to add the data packet to the first target field of the traffic log, generate first traffic information, and send the first traffic information to the message queue process of the first device so that the message queue process can store the first traffic information in a preset storage area.
[0158] The data transmission device provided in the embodiment of the present application realizes the transmission and display of data packets in the first flow information through the interaction between the business process, the front-end process and the message queue process in the first device, and the interaction between the first device and the second device, so that the user can analyze the flow log based on the data packet while viewing the flow log. In the event of an alarm, the user can directly perform an alarm analysis based on the data packet corresponding to the alarm log, which simplifies the operation process of the alarm analysis and improves the efficiency of the alarm analysis.
[0159] Correspondingly, an embodiment of the present application also provides an electronic device, a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the data transmission method described above are implemented.
[0160] An embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the data transmission method described above are implemented.
[0161] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, devices, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0162] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing terminal device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing terminal device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0163] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0164] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal device so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions for executing on the computer or other programmable terminal device to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0165] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0166] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0167] The above is a detailed introduction to a data transmission method, system, device, electronic device and readable storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A data transmission method, characterized in that: Applied to a first device, the first device includes a business process, a front-end process, a message queue process and a storage management process; the method includes: The first flow information is obtained from a preset storage area through the business process, and a data packet in a first data format is obtained from the first flow information; the first flow information is stored in the preset storage area by the message queue process; the first flow information is obtained by the second device adding the data packet to the first target field of the flow log; the data packet is a data packet in the first data format obtained by the second device converting the original flow data according to the preset format conversion rule; the flow log is generated by the second device according to the original flow data; Converting the data packet into a data packet in a second data format through the service process to obtain second flow information; Sending the second flow information to the front-end process through the business process; Displaying the traffic log and the data packet in the second data format based on the second traffic information by the front-end process; The converting of the data packet in the first flow information into a data packet in a second data format through the service process includes: Decoding the data packet through the service process to obtain a data stream corresponding to the data packet; Calling a data packet capture function library through the business process, and converting the data stream into a data packet in a second data format based on the data packet capture function library; The data packet capture function library is stored in the preset storage area; Before obtaining the first flow information from the preset storage area through the service process, the method further includes: receiving the first flow information sent by the second device through the message queue process, and sending the first flow information to the storage management process; According to the data packet in the first flow information, a storage space corresponding to the data packet is added in the preset storage area through the storage management process; the storage space is used to store the data packet; storing the first flow information in the preset storage area through the storage management process, so that the service process can obtain the first flow information from the preset storage area; The obtaining of first flow information from a preset storage area through the service process, and obtaining a data packet in a first data format from the first flow information, includes: Reading first flow information from the preset storage area through the business process; Generate a log list corresponding to the first flow information through the business process; the log list includes a second target field, and the second target field is used to store data packets in the first flow information; Looping through the log list through the business process, and obtaining the data packet from the second target field of the log list; The preset storage area is set in the first device.
2. The method according to claim 1, characterized in that The calling of the data packet capture function library by the business process and converting the data stream into a data packet in a second data format based on the data packet capture function library comprises: The data packet capture function library is called by the business service using a jni interface, and the data stream is converted into a data packet in a second data format based on the data packet capture function library.
3. The method according to claim 1, characterized in that The displaying, by the front-end process based on the second traffic information, the traffic log and the data packet in the second data format comprises: Obtaining the flow log from the second flow information and displaying it through the front-end process; The front-end process converts the data packet in the second data format into a data packet in a wireshark format and displays the data packet.
4. A data transmission system, characterized in that: The system comprises a first device and a second device; The second device is used to obtain original traffic data and generate a traffic log according to the original traffic data; and convert the original traffic data into a data packet in a first data format according to a preset format conversion rule; and adding the data packet to a first target field of the traffic log, generating first traffic information, and sending the first traffic information to a message queue process of the first device, so that the message queue process stores the first traffic information in a preset storage area; The first device includes a business process, a front-end process, a message queue process and a storage management process; The business process is used to obtain first flow information from a preset storage area, and obtain a data packet in a first data format from the first flow information; and converting the data packets in the first flow information into data packets in a second data format to obtain second flow information; and sending the second flow information to the front-end process; The front-end process is used to display the traffic log and the data packet in the second data format based on the second traffic information; The message queue process is used to receive the first flow information sent by the second device, and send the first flow information to the storage management process; The storage management process is used to add a storage space corresponding to a data packet in the preset storage area according to the data packet in the first flow information, and store the first flow information in the preset storage area, so that the business process can obtain the first flow information from the preset storage area; Acquiring first flow information from a preset storage area through the business process, and acquiring a data packet in a first data format from the first flow information, including: Reading first flow information from the preset storage area through the business process; Generate a log list corresponding to the first flow information through the business process; the log list includes a second target field, and the second target field is used to store data packets in the first flow information; Looping through the log list through the business process, and obtaining the data packet from the second target field of the log list; The converting of the data packet in the first flow information into a data packet in a second data format includes: Decoding the data packet through the service process to obtain a data stream corresponding to the data packet; The data packet capture function library is called through the business process, and the data stream is converted into a data packet in a second data format based on the data packet capture function library; wherein the data packet capture function library is stored in a storage area of the first device.
5. A data transmission device, characterized in that: Applied to a first device, the first device includes a business process, a front-end process, a message queue process and a storage management process; the device includes: An acquisition module, used for acquiring first flow information from a preset storage area through the business process, and acquiring a data packet in a first data format from the first flow information; the first flow information is stored in the preset storage area by the message queue process; the first flow information is obtained by the second device adding the data packet to the first target field of the flow log; the data packet is a data packet in the first data format obtained by the second device converting the original flow data according to a preset format conversion rule; the flow log is generated by the second device according to the original flow data; A first conversion module, configured to convert the data packets in the first flow information into data packets in a second data format through the service process to obtain second flow information; A sending module, used for sending the second flow information to the front-end process through the business process; A display module, configured to display the traffic log and the data packet in the second data format based on the second traffic information through the front-end process; The first conversion module includes: A decoding submodule, used to decode the data packet through the service process to obtain a data stream corresponding to the data packet; A first conversion submodule, configured to call a data packet capture function library through the service process, and convert the data stream into a data packet in a second data format based on the data packet capture function library; a forwarding module, configured to receive the first flow information sent by the second device through the message queue process, and send the first flow information to the storage management process; a storage space management module, configured to add a storage space corresponding to the data packet in the preset storage area according to the data packet in the first flow information through the storage management process; the storage space is used to store the data packet; a storage module, configured to store the first flow information in the preset storage area through the storage management process, so that the service process can obtain the first flow information from the preset storage area; The acquisition module further includes: A reading submodule, configured to read the first flow information from the preset storage area through the service process; A generating submodule, configured to generate a log list corresponding to the first flow information through the business process; the log list includes a second target field, and the second target field is used to store data packets in the first flow information; A first acquisition submodule, configured to loop through the log list through the business process and acquire the data packet from the second target field of the log list; The data packet capturing function library is stored in a storage area of the first device.
6. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a program or instruction that can be run on the processor, and when the program or instruction is executed by the processor, the steps of the data transmission method according to any one of claims 1 to 3 are implemented.
7. A readable storage medium, characterized in that: The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the data transmission method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Warning method and device for monitoring on basis of system log
CN110990223A
Threat detection method and device, electronic equipment and storage medium
CN116389099A
