Session connection monitoring method and device

By collecting and processing the data packet sequence number information of the terminal device in the data monitoring device, the problem of data packet sequence and integrity in the bypass mirroring mode is solved, and accurate data monitoring and security monitoring of the terminal device are realized.

CN115134434BActive Publication Date: 2024-08-23QI AN XIN TECHNOLOGY GROUP INC +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210688396.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-17
Publication Date
2024-08-23
Estimated Expiration
2042-06-17

AI Technical Summary

Technical Problem

When existing data monitoring equipment adopts bypass mirroring mode, it is difficult to accurately monitor the sequence and integrity of data packets of terminal devices, resulting in missing parsing data and inaccurate security monitoring.

Method used

By collecting the real data packets in the target session connection, the sequence number information is used to determine whether the data packets are continuously transmitted. If they are not continuous, they are converted into monitoring data packets that can be continuously parsed through completion or reordering to ensure the integrity and integrity of the data packets. order.

Benefits of technology

It achieves accurate monitoring of terminal device data packets, ensures the integrity and security of data analysis, and can accurately monitor the security of target session connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115134434B
    Figure CN115134434B
Patent Text Reader

Abstract

The present application discloses a method and device for monitoring a session connection, and relates to the field of data processing technology. The method of the present application includes: collecting a first real data packet transmitted in a target session connection, the first real data packet carrying sequence number information for characterizing the sequence of data packets transmitted by the target session connection; determining whether the first real data packet is a continuously transmitted data packet according to the sequence number information corresponding to the first real data packet and the historical real data packet; if not, converting the first real data packet into a continuously parseable monitoring data packet according to a preset rule; and performing data parsing on the monitoring data packet to monitor the security of the target session connection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a method and device for monitoring a session connection. Background Art

[0002] When using terminal devices, users will perform a large number of operations on the terminal devices. Each operation may be related to the security of the terminal devices. Therefore, it is an important task for data monitoring devices to monitor whether the user's operations trigger security issues and to issue reasonable security alarms when it is determined that the user's operations trigger security issues.

[0003] At present, enterprises or government organizations usually use data monitoring devices to monitor whether multiple terminal devices contained within themselves trigger security issues. Among them, when the data monitoring device adopts the bypass mirroring mode to monitor the data of the internal terminal device, the data monitoring device is connected to the mirror port of the switch, and the data packets of the internal terminal device interacting with the external server are collected through the mirroring port, and then the collected data packets are monitored. Since the data monitoring device does not participate in the forwarding of data packets when adopting the bypass mirroring mode for data monitoring, there will be situations such as disorder of the collected data packets and loss of data packets during the process of collecting data packets, which will cause the data monitoring device to be unable to parse these data packets normally, so that the data obtained by parsing is missing and incomplete, which will lead to the inability to accurately monitor the data of the terminal devices within the enterprise or government organization. Summary of the invention

[0004] The embodiments of the present application provide a method and device for monitoring a session connection, the main purpose of which is to accurately monitor data of terminal devices within an organization such as an enterprise or a government.

[0005] In order to solve the above technical problems, the embodiments of the present application provide the following technical solutions:

[0006] In a first aspect, the present application provides a method for monitoring a session connection, the method being applied to a data monitoring device that uses a bypass mirroring mode to perform data monitoring, comprising:

[0007] Collecting a first real data packet transmitted in a target session connection, where the first real data packet carries sequence number information for characterizing a sequence of data packets transmitted in the target session connection;

[0008] Determining whether the first real data packet is a continuously transmitted data packet according to the sequence number information corresponding to the first real data packet and the historical real data packet;

[0009] If not, converting the first real data packet into a continuously parsable monitoring data packet according to a preset rule;

[0010] The monitoring data packet is parsed to monitor the security of the target session connection.

[0011] Optionally, converting the first real data packet into a continuously parsable monitoring data packet according to a preset rule includes:

[0012] Collecting a plurality of second real data packets transmitted in the target session connection within a preset time period, wherein the second real data packets are data packets transmitted after the first real data packets;

[0013] According to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets, determining whether there is a lost data packet in the process of collecting the data packets of the target session connection;

[0014] If it exists, converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet;

[0015] If not, the first real data packet is converted into a monitoring data packet that can be continuously parsed by reordering the data packets.

[0016] Optionally, converting the first real data packet into a continuously parsable monitoring data packet according to a preset rule includes:

[0017] Collecting a preset number of multiple second real data packets transmitted in the target session connection, where the second real data packets are data packets transmitted after the first real data packet;

[0018] According to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets, determining whether there is a lost data packet in the process of collecting the data packets of the target session connection;

[0019] If it exists, converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet;

[0020] If not, the first real data packet is converted into a monitoring data packet that can be continuously parsed by reordering the data packets.

[0021] Optionally, converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet includes:

[0022] Determine the sequence number information corresponding to the lost data packet according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets;

[0023] Generate a corresponding virtual data packet according to the real data packets adjacent to the lost data packet;

[0024] According to the sequence number information of the first real data packet and the virtual data packet, the first real data packet and the virtual data packet are sorted to obtain monitoring data packets that can be continuously parsed.

[0025] Optionally, generating a corresponding virtual data packet according to a real data packet adjacent to the lost data packet includes:

[0026] Searching for the adjacent real data packets according to the sequence number information of the lost data packets;

[0027] Obtaining packet header information contained in the adjacent real data packets;

[0028] Create a blank data packet;

[0029] Filling the blank data packet with the packet header information and preset invalid data to obtain the virtual data packet;

[0030] A virtual data packet identifier is added to the virtual data packet.

[0031] Optionally, converting the first real data packet into a continuously parsable monitoring data packet by reordering the data packets includes:

[0032] Searching for a missing target data packet in a plurality of second real data packets according to the sequence number information corresponding to the historical real data packet and the first real data packet;

[0033] According to the sequence number information of the first real data packet and the target data packet, the first real data packet and the target data packet are sorted to obtain monitoring data packets that can be continuously parsed.

[0034] Optionally, the performing data parsing on the monitoring data packet to monitor the security of the target session connection includes:

[0035] Detecting whether the monitoring data packet carries a virtual data packet identifier;

[0036] If not, the monitoring data packet is parsed to obtain the application layer data contained in the monitoring data packet, and the security of the target session connection is monitored according to the application layer data parsed from the monitoring data packet;

[0037] If it is carried, the corresponding application layer data is determined according to the context information of the monitoring data packet, and the security of the target session connection is monitored according to the application layer data corresponding to the monitoring data packet.

[0038] Optionally, the context information of the monitoring data packet is application layer data and / or processing status corresponding to a monitoring data packet that is adjacent to the monitoring data packet and has been parsed; determining the corresponding application layer data according to the context information of the monitoring data packet includes:

[0039] Acquire application layer data and / or processing status corresponding to the monitoring data packet adjacent to the monitoring data packet and having been parsed;

[0040] Based on the application layer data and / or processing status, matching data content is searched in the preset protocol knowledge base as the application layer data corresponding to the monitoring data packet, wherein the preset protocol knowledge base records the mapping relationship between the application layer data and / or processing status of adjacent data packets.

[0041] In a second aspect, the present application further provides a monitoring device for a session connection, the device being applied to a data monitoring device that uses a bypass mirroring mode to perform data monitoring, comprising:

[0042] A collection unit, configured to collect a first real data packet transmitted in a target session connection, wherein the first real data packet carries sequence number information for characterizing a sequence of data packets transmitted in the target session connection;

[0043] a determining unit, configured to determine whether the first real data packet is a continuously transmitted data packet according to sequence number information corresponding to the first real data packet and the historical real data packet;

[0044] a conversion unit, configured to convert the first real data packet into a continuously parseable monitoring data packet according to a preset rule when the determination unit determines that the first real data packet is not a continuously transmitted data packet;

[0045] The parsing unit is used to parse the monitoring data packet to monitor the security of the target session connection.

[0046] Optionally, the conversion unit includes:

[0047] A first collection module, used for collecting a plurality of second real data packets transmitted in the target session connection within a preset time period, wherein the second real data packets are data packets transmitted after the first real data packets;

[0048] A first judgment module, configured to judge whether there is a lost data packet in the process of collecting data packets of the target session connection according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets;

[0049] a first conversion module, configured to convert the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet when the first determination module determines that there is a lost data packet in the process of collecting the data packets of the target session connection;

[0050] The second conversion module is used to convert the first real data packet into a continuously parsable monitoring data packet by reordering the data packets when the first judgment module determines that no data packet is lost during the process of collecting the data packets of the target session connection.

[0051] Optionally, the conversion unit includes:

[0052] A second collection module, used for collecting a preset number of second real data packets transmitted in the target session connection, where the second real data packets are data packets transmitted after the first real data packet;

[0053] A second judgment module, configured to judge whether there is a lost data packet in the process of collecting data packets of the target session connection according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets;

[0054] a third conversion module, configured to convert the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet when the second judgment module determines that there is a lost data packet in the process of collecting the data packets of the target session connection;

[0055] The fourth conversion module is used to convert the first real data packet into a continuously parsable monitoring data packet by reordering the data packets when the second judgment module determines that there is no lost data packet in the process of collecting the data packets of the target session connection.

[0056] Optionally, the first conversion module is specifically used to determine the sequence number information corresponding to the lost data packet according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets; generate a corresponding virtual data packet according to the real data packet adjacent to the lost data packet; and sort the first real data packet and the virtual data packet according to the sequence number information of the first real data packet and the virtual data packet to obtain a monitoring data packet that can be continuously parsed;

[0057] The third conversion module is specifically used to determine the sequence number information corresponding to the lost data packet based on the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets; generate a corresponding virtual data packet based on the real data packet adjacent to the lost data packet; and sort the first real data packet and the virtual data packet according to their sequence number information to obtain a monitoring data packet that can be continuously parsed.

[0058] Optionally, the first conversion module is specifically used to find the adjacent real data packet according to the sequence number information of the lost data packet; obtain the header information contained in the adjacent real data packet; create a blank data packet; fill the header information and preset invalid data into the blank data packet to obtain the virtual data packet; add a virtual data packet identifier to the virtual data packet;

[0059] The third conversion module is specifically used to find the adjacent real data packet according to the sequence number information of the lost data packet; obtain the header information contained in the adjacent real data packet; create a blank data packet; fill the blank data packet with the header information and preset invalid data to obtain the virtual data packet; and add a virtual data packet identifier to the virtual data packet.

[0060] Optionally, the second conversion module is specifically used to search for a missing target data packet in a plurality of second real data packets according to the sequence number information corresponding to the historical real data packet and the first real data packet; and sort the first real data packet and the target data packet according to the sequence number information of the first real data packet and the target data packet to obtain a monitoring data packet that can be continuously parsed;

[0061] The fourth conversion module is specifically used to search for missing target data packets in multiple second real data packets according to the sequence number information corresponding to the historical real data packets and the first real data packets; and to sort the first real data packets and the target data packets according to the sequence number information of the first real data packets and the target data packets to obtain monitoring data packets that can be continuously parsed.

[0062] Optionally, the parsing unit includes:

[0063] A detection module, used to detect whether the monitoring data packet carries a virtual data packet identifier;

[0064] A first parsing module is used to parse the monitoring data packet to obtain application layer data contained in the monitoring data packet when the detection module detects that the monitoring data packet does not carry the virtual data packet identifier, and monitor the security of the target session connection according to the application layer data parsed from the monitoring data packet;

[0065] The second parsing module is used to determine the corresponding application layer data according to the context information of the monitoring data packet when the detection module detects that the monitoring data packet carries the virtual data packet identifier, and monitor the security of the target session connection according to the application layer data corresponding to the monitoring data packet.

[0066] Optionally, the context information of the monitoring data packet is application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed;

[0067] The second parsing module is specifically used to obtain the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed; based on the application layer data and / or processing status, search for matching data content in the preset protocol knowledge base as the application layer data corresponding to the monitoring data packet, wherein the preset protocol knowledge base records the mapping relationship between the application layer data and / or processing status of adjacent data packets.

[0068] In a third aspect, an embodiment of the present application provides a storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the monitoring method for session connection described in the first aspect.

[0069] In a fourth aspect, an embodiment of the present application provides a session connection monitoring device, the device comprising a storage medium; and one or more processors, the storage medium is coupled to the processor, and the processor is configured to execute program instructions stored in the storage medium; when the program instructions are executed, the session connection monitoring method described in the first aspect is executed.

[0070] By means of the above technical solution, the technical solution provided by this application has at least the following advantages:

[0071] The present application provides a method and device for monitoring a session connection. The present application can, after a data monitoring device collects a first real data packet transmitted in a target session connection through a mirror port of a switch of a target organization, determine by the data monitoring device whether the first real data packet is a continuously transmitted data packet according to sequence number information corresponding to the first real data packet and sequence number information corresponding to a historical real data packet; when it is determined that the first real data packet is not a continuously transmitted data packet, the data monitoring device converts the first real data packet into a continuously parseable monitoring data packet according to a preset rule, so that the data monitoring device performs data parsing on the monitoring data packet, and after obtaining application layer data corresponding to the monitoring data packet, the security of the target session connection can be accurately monitored according to the application layer data parsed from the monitoring data packet, that is, data monitoring of terminal devices inside the target organization can be accurately performed.

[0072] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] By reading the detailed description below with reference to the accompanying drawings, the above and other purposes, features and advantages of the exemplary embodiments of the present application will become easy to understand. In the accompanying drawings, several embodiments of the present application are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:

[0074] Figure 1 A flow chart of a method for monitoring a session connection provided by an embodiment of the present application is shown;

[0075] Figure 2 A flow chart of another method for monitoring session connection provided by an embodiment of the present application is shown;

[0076] Figure 3 A block diagram showing a monitoring device for a session connection provided by an embodiment of the present application is shown;

[0077] Figure 4 A block diagram showing the composition of another session connection monitoring device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION

[0078] The exemplary embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided in order to enable a more thorough understanding of the present application and to fully convey the scope of the present application to those skilled in the art.

[0079] It should be noted that, unless otherwise specified, the technical terms or scientific terms used in this application should have the common meanings understood by technicians in the field to which this application belongs.

[0080] The present application embodiment provides a method for monitoring a session connection, such as Figure 1 As shown, the method includes:

[0081] 101. Collect a first real data packet transmitted in a target session connection.

[0082] In the embodiment of the present application, the execution subject in each step is a data monitoring device that adopts a bypass mirror mode to perform data monitoring.

[0083] Among them, the target session connection is a session connection established when the target terminal device within the target organization interacts with an external server. The target organization can be but is not limited to: a certain enterprise or a certain government department, etc., and the target terminal device can be any terminal device within the target organization; wherein, the first real data packet carries sequence number information, and the sequence number information carried in the first real data packet is used to characterize the transmission order of the first real data packet in the target session connection. The sequence number information carried in the first real data packet is specifically a sending sequence number and a confirmation sequence number corresponding to the first real data packet; wherein, for any data packet, the sending sequence number corresponding to the data packet is the sequence number corresponding to the first byte in the application layer data contained in the data packet, and the confirmation sequence number corresponding to the data packet is the sequence number corresponding to the first byte in the application layer data contained in the next data packet expected to be sent by the opposite device.

[0084] In an embodiment of the present application, when the target terminal device interacts with an external server through a target session connection, the data monitoring device needs to monitor the data of the target terminal device, that is, it is necessary to collect the data packets transmitted in the target session connection through the mirror port of the target organization switch, wherein the first real data packet is the data packet transmitted in the target session connection collected by the data monitoring device this time.

[0085] 102. Determine whether the first real data packet is a continuously transmitted data packet according to sequence number information corresponding to the first real data packet and historical real data packets.

[0086] Among them, the historical real data packet is the data packet collected by the data monitoring device last time and transmitted in the target session connection, and the historical real data packet is the data packet that has been successfully parsed by the data; among them, the sequence number information corresponding to the historical real data packet is the sending sequence number and confirmation sequence number corresponding to the historical real data packet.

[0087] In an embodiment of the present application, after collecting the first real data packet, the data monitoring device needs to determine whether the first real data packet is a continuously transmitted data packet based on the sequence number information corresponding to the first real data packet and the sequence number information corresponding to the historical real data packet, that is, determine whether the historical real data packet and the first real data packet are data packets continuously transmitted in the target session connection.

[0088] Specifically, in this step, the specific process by which the data monitoring device determines whether the first real data packet is a continuously transmitted data packet based on the sequence number information corresponding to the first real data packet and the historical real data packet is as follows: first, the sequence number information corresponding to the historical real data packet (i.e., the sending sequence number and confirmation sequence number corresponding to the historical real data packet) and the data volume information are obtained, wherein the data volume information corresponding to the historical real data packet is used to characterize the data volume size of the application layer data contained in the historical real data packet; secondly, based on the sending sequence number, confirmation sequence number, data volume information corresponding to the historical real data packet and the sending sequence number and confirmation sequence number corresponding to the first real data packet, determine whether the historical real data packet and the first real data packet are data packets continuously transmitted in the target session connection; if it is determined that the historical real data packet and the first real data packet are data packets continuously transmitted in the target session connection, then determine that the first real data packet is a continuously transmitted data packet; if it is determined that the historical real data packet and the first real data packet are not data packets continuously transmitted in the target session connection, then determine that the first real data packet is not a continuously transmitted data packet. For example, the sending sequence number corresponding to the historical real data packet is 200, the confirmation sequence number is 150, and the data volume information is 100 bytes. When the historical real data packet and the first real data packet are both data packets sent by the target terminal device to the external server, or both are data packets sent by the external server to the target terminal device, if the sending sequence number corresponding to the first real data packet is 300, it is determined that the historical real data packet and the first real data packet are data packets continuously transmitted in the target session connection. If the sending sequence number corresponding to the first real data packet is a value greater than 300, it is determined that the historical real data packet and the first real data packet are not data packets continuously transmitted in the target session connection. When the historical real data packet When the packet is a data packet sent by the target terminal device to an external server and the first real data packet is a data packet sent by the external server to the target terminal device, or the historical real data packet is a data packet sent by the external server to the target terminal device and the first real data packet is a data packet sent by the target terminal device to the external server, if the confirmation sequence number corresponding to the first real data packet is 300, it is determined that the historical real data packet and the first real data packet are data packets transmitted continuously in the target session connection; if the confirmation sequence number corresponding to the first real data packet is a value greater than 300, it is determined that the historical real data packet and the first real data packet are not data packets transmitted continuously in the target session connection, but is not limited to this.

[0089] It should be noted that when the first data packet and the second data packet are two data packets transmitted continuously in the same session connection, if the first data packet and the second data packet are sent by the same terminal device, the sending sequence number corresponding to the second data packet is the sum of the sending sequence number and data volume information corresponding to the first data packet, and the confirmation sequence number corresponding to the second data packet is the same as the confirmation sequence number corresponding to the first data packet; if the first data packet and the second data packet are sent by different terminal devices, the sending sequence number corresponding to the second data packet is the same as the confirmation sequence number corresponding to the first data packet, and the confirmation sequence number corresponding to the second data packet is the sum of the sending sequence number and data volume information corresponding to the first data packet.

[0090] 103. If not, convert the first real data packet into a continuously parsable monitoring data packet according to a preset rule.

[0091] In an embodiment of the present application, when the multiple data packets collected are data packets that cannot be parsed continuously, the data monitoring device cannot normally perform data parsing on these data packets, which will cause the data obtained by parsing to be missing or incomplete. The reasons why the multiple data packets collected by the data monitoring device are data packets that cannot be parsed continuously may be, but are not limited to: the problem of data packet loss in the process of collecting data packets of the target session connection, the problem of data packet disorder in the collected data packets of the target session connection, etc.; therefore, when it is determined that the first real data packet is not a continuously transmitted data packet based on the sequence number information corresponding to the first real data packet and the sequence number information corresponding to the historical real data packet, in order to ensure that the first real data packet can be parsed normally, the data monitoring device needs to convert the first real data packet into a monitoring data packet that can be parsed continuously according to preset rules.

[0092] Specifically, in this step, the data monitoring device converts the first real data packet into a continuously parsable monitoring data packet according to a preset rule in a specific manner that may be, but is not limited to: converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet, or converting the first real data packet into a continuously parsable monitoring data packet by reordering the data packets, etc., so as to solve the problem of lost data packets in the process of collecting data packets of the target session connection, and solve the problem of data packet disorder in the collected data packets of the target session connection.

[0093] It should be noted that in an embodiment of the present application, if the first real data packet is determined to be a continuously transmitted data packet based on the sequence number information corresponding to the first real data packet and the sequence number information corresponding to the historical real data packet, then the first real data packet is determined to be a continuously parsable monitoring data packet.

[0094] 104. Perform data parsing on the monitoring data packet to monitor the security of the target session connection.

[0095] In an embodiment of the present application, for any data packet transmitted in the target session connection, if the data packet is a continuously parseable data packet, the data packet is determined as a monitoring data packet; after the data monitoring device converts the first real data packet into a continuously parseable monitoring data packet according to a preset rule, the data monitoring device can perform data parsing on the converted monitoring data packet, thereby obtaining application layer data corresponding to the monitoring data packet, and monitor the security of the target session connection based on the application layer data parsed from the monitoring data packet.

[0096] It should be noted that the data monitoring device includes a TCP / IP protocol stack and an application data extraction engine. The data monitoring device can perform the operations described in the above steps 102-103 based on the TCP / IP protocol stack, and can perform the operations described in step 104 based on the application data extraction engine. The embodiments of the present application do not specifically limit this.

[0097] An embodiment of the present application provides a method for monitoring a session connection. According to the embodiment of the present application, after a data monitoring device collects a first real data packet transmitted in a target session connection through a mirror port of a switch of a target organization, the data monitoring device determines whether the first real data packet is a continuously transmitted data packet based on sequence number information corresponding to the first real data packet and sequence number information corresponding to a historical real data packet. When it is determined that the first real data packet is not a continuously transmitted data packet, the data monitoring device converts the first real data packet into a continuously parseable monitoring data packet based on a preset rule, so that the data monitoring device performs data parsing on the monitoring data packet, and after obtaining application layer data corresponding to the monitoring data packet, the security of the target session connection can be accurately monitored based on the application layer data parsed from the monitoring data packet, that is, data monitoring of terminal devices within the target organization can be accurately performed.

[0098] To explain in more detail below, the present application embodiment provides another method for monitoring session connection, specifically as follows: Figure 2 As shown, the method includes:

[0099] 201. Collect a first real data packet transmitted in a target session connection.

[0100] Regarding step 201, collecting the first real data packet transmitted in the target session connection, please refer to Figure 1 The description of the corresponding parts will not be repeated here in the embodiments of the present application.

[0101] 202. Determine whether the first real data packet is a continuously transmitted data packet according to sequence number information corresponding to the first real data packet and historical real data packets.

[0102] Regarding step 202, determining whether the first real data packet is a continuously transmitted data packet according to the sequence number information corresponding to the first real data packet and the historical real data packet, reference may be made to Figure 1 The description of the corresponding parts will not be repeated here in the embodiments of the present application.

[0103] 203. If not, convert the first real data packet into a continuously parsable monitoring data packet according to a preset rule.

[0104] In an embodiment of the present application, when it is determined that the first real data packet is not a continuously transmitted data packet based on the sequence number information corresponding to the first real data packet and the sequence number information corresponding to the historical real data packet, the data monitoring device needs to convert the first real data packet into a monitoring data packet that can be continuously parsed according to preset rules.

[0105] Specifically, in this step, the data monitoring device may convert the first real data packet into a continuously parsable monitoring data packet according to a preset rule in any one of the following two ways:

[0106] (1) First, after determining that the first real data packet is not a data packet transmitted continuously, multiple second real data packets transmitted in the target session connection are collected within a preset time length, wherein the preset time length may be but is not limited to 30S, 60S, 90S, etc., and the second real data packet is a data packet transmitted after the first real data packet in the target session connection; secondly, according to the sequence number information corresponding to the historical real data packet, the sequence number information corresponding to the first real data packet, and the sequence number information corresponding to each second real data packet (i.e., the sending sequence number and the confirmation sequence number corresponding to the second real data packet), it is determined whether there is a lost data packet in the process of collecting the data packets of the target session connection, that is, if according to the sequence number information corresponding to the historical real data packet, the sequence number information corresponding to the first real data packet, and the sequence number information corresponding to each second real data packet, it is determined that the historical real data packet, the first real data packet, and the multiple second real data packets are the target session connection. If there are multiple data packets continuously transmitted in the target session connection, it is determined that there is no lost data packet; if it is determined that the historical real data packet, the first real data packet and the multiple second real data packets are not multiple data packets continuously transmitted in the target session connection according to the sequence number information corresponding to the historical real data packet, the sequence number information corresponding to the first real data packet and the sequence number information corresponding to each second real data packet, it is determined that there is a lost data packet; if it is determined that there is a lost data packet, it is determined that there is a problem of lost data packets in the process of collecting the data packets of the target session connection, so that it is necessary to convert the first real data packet into a monitoring data packet that can be continuously parsed by completing the lost data packets; if it is determined that there is no lost data packet, it is determined that there is a problem of data packet disorder in the data packets of the target session connection collected, so it is necessary to convert the first real data packet into a monitoring data packet that can be continuously parsed by reordering the data packets.

[0107] (2) First, after determining that the first real data packet is not a continuously transmitted data packet, a preset number of multiple second real data packets transmitted in the target session connection are collected, wherein the preset number may be but is not limited to 5, 10, 15, etc.; secondly, according to the sequence number information corresponding to the historical real data packet, the sequence number information corresponding to the first real data packet, and the sequence number information corresponding to each second real data packet, it is determined whether there is a lost data packet in the process of collecting the data packets of the target session connection; if it is determined that there is a lost data packet, it is determined that there is a problem of lost data packets in the process of collecting the data packets of the target session connection, and it is necessary to convert the first real data packet into a continuously parsable monitoring data packet by completing the lost data packets; if it is determined that there is no lost data packet, it is determined that there is a problem of data packet disorder in the collected data packets of the target session connection, and it is necessary to convert the first real data packet into a continuously parsable monitoring data packet by reordering the data packets.

[0108] For example, the sending sequence number corresponding to the historical real data packet is 200, the confirmation sequence number is 150, and the data volume information is 100 bytes, and the sending sequence number corresponding to the first real data packet is 300, the confirmation sequence number is 200, and the data volume information is 150 bytes. According to the sending sequence number, confirmation sequence number, data volume information corresponding to the historical real data packet and the sending sequence number, confirmation sequence number, data volume information corresponding to the first real data packet, it can be determined that the sending sequence number corresponding to the data packet between the historical real data packet and the first real data packet is 150, the confirmation sequence number is 300, and the data volume information is 50 bytes. If there is no second real data packet with a sending sequence number of 150, a confirmation sequence number of 300, and a data volume information of 50 bytes among multiple second real data packets, it is determined that there is a lost data packet. If there is a second real data packet with a sending sequence number of 150, a confirmation sequence number of 300, and a data volume information of 50 bytes among multiple second real data packets, it is determined that there is no lost data packet, but it is not limited to this.

[0109] Further, in an embodiment of the present application, the specific process of the data monitoring device converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet is as follows: first, according to the sequence number information corresponding to the historical real data packet, the sequence number information corresponding to the first real data packet and the sequence number information corresponding to each second real data packet, the sequence number information corresponding to the lost data packet is determined. For example, the sending sequence number corresponding to the historical real data packet is 200, the confirmation sequence number is 150, and the data volume information is 100 bytes, and the sending sequence number corresponding to the first real data packet is 300, the confirmation sequence number is 200, and the data volume information is 150 bytes. According to the sending sequence number, confirmation sequence number, data volume information corresponding to the historical real data packet and the sending sequence number, confirmation sequence number, data volume information corresponding to the first real data packet, it can be determined that the sending sequence number corresponding to the data packet between the historical real data packet and the first real data packet is 150, the confirmation sequence number is 300, and the data volume information is 50 bytes, that is, the sending sequence number corresponding to the lost data packet is 150, and the confirmation sequence number is 300; then, the corresponding virtual data packet is generated according to the real data packet adjacent to the lost data packet, wherein the lost data packet is The real data packets adjacent to the lost data packet are data packets transmitted before and after the lost data packet in the target session connection. For example, if the real data packet A is the fifth data packet transmitted in the target session connection, the lost data packet is the sixth data packet transmitted in the target session connection, and the real data packet B is the seventh data packet transmitted in the target session connection, then the real data packet A and the real data packet B are the real data packets adjacent to the lost data packet. Finally, according to the sequence number information of the first real data packet and the virtual data packet, the first real data packet and the virtual data packet are sorted so that the first real data packet is converted into a monitoring data packet that can be continuously parsed, thereby obtaining a monitoring data packet that can be continuously parsed (i.e., the virtual data packet-the first real data packet). For example, the sending sequence number corresponding to the first real data packet is 300, the confirmation sequence number is 200, and the data volume information is 150 bytes. The sending sequence number corresponding to the virtual data packet is 150, the confirmation sequence number is 300, and the data volume information is 50 bytes. After the first real data packet and the virtual data packet are sorted, the sorting result is the virtual data packet-the first real data packet.

[0110] Among them, the specific process of generating a corresponding virtual data packet based on the real data packet adjacent to the lost data packet is: first, find the adjacent real data packet according to the sequence number information of the lost data packet; second, obtain the header information contained in the adjacent real data packet; third, create a blank data packet; then, fill the header information and preset invalid data into the blank data packet to obtain a virtual data packet corresponding to the lost data packet, wherein the preset invalid data can be but is not limited to: a digital string composed of multiple 0s, a digital string composed of multiple 1s, etc.; finally, add a virtual data packet identifier to the virtual data packet.

[0111] Further, in the embodiment of the present application, the specific process of the data monitoring device converting the first real data packet into the continuously parsable monitoring data packet by reordering the data packets is as follows:

[0112] First, according to the sequence number information corresponding to the historical real data packets and the first real data packets, the missing target data packets are searched among multiple second real data packets; secondly, according to the sequence number information of the first real data packets and the target data packets, the first real data packets and the target data packets are sorted to obtain monitoring data packets that can be continuously parsed.

[0113] 204. Detect whether the monitoring data packet carries a virtual data packet identifier.

[0114] In an embodiment of the present application, for any monitoring data packet that needs to be parsed, before parsing the data packet, it is necessary to detect whether the monitoring data packet carries a virtual data packet identifier, that is, to detect whether the monitoring data packet is a virtual data packet.

[0115] 205a. If not, the monitoring data packet is parsed to obtain the application layer data contained in the monitoring data packet, and the security of the target session connection is monitored according to the application layer data parsed from the monitoring data packet.

[0116] In an embodiment of the present application, when a monitoring data packet does not carry a virtual data packet identifier, the data monitoring device can directly parse the monitoring data packet to obtain the application layer data contained in the monitoring data packet, and monitor the security of the target session connection based on the application layer data parsed from the monitoring data packet.

[0117] For the embodiment of the present application, step 205b parallel to step 205a, if carried, determines the corresponding application layer data according to the context information of the monitoring data packet, and monitors the security of the target session connection according to the application layer data corresponding to the monitoring data packet.

[0118] In the embodiment of the present application, when the monitoring data packet carries a virtual data packet identifier, that is, the monitoring data packet is a virtual data packet, the data monitoring device needs to determine the corresponding application layer data according to the context information of the monitoring data packet, and monitor the security of the target session connection according to the application layer data corresponding to the monitoring data packet;

[0119] Among them, the context information of the monitoring data packet is the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed, wherein the processing status corresponding to the monitoring data packet is the processing status of the state machine of the application data extraction engine when the data monitoring device performs data parsing on the monitoring data packet based on the application data extraction engine, and the processing status corresponding to the monitoring data packet is used to indicate the function of the monitoring data packet. For example, a data packet sent by the target terminal device to an external server is used to request a data table from the external server, that is, the function of the data packet is to request data from the external server, then the processing status corresponding to the data packet is requesting data.

[0120] Specifically, in this step, the specific process of determining the corresponding application layer data of a monitoring data packet (i.e., a virtual data packet) according to its context information is as follows: first, obtaining the application layer data and processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed; secondly, based on the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed, searching the preset protocol knowledge base for matching data content as the application layer data corresponding to the monitoring data packet, wherein the preset protocol knowledge base records the mapping relationship between the application layer data and / or processing status of adjacent data packets, that is, the preset protocol knowledge base records: the mapping relationship between the application layer data contained in each preceding data packet and the application layer data contained in its corresponding subsequent data packet, the mapping relationship between the processing status of each preceding data packet and the application layer data contained in its corresponding subsequent data packet, and the mapping relationship between the application layer data contained in each preceding data packet and the processing status of its corresponding subsequent data packet.

[0121] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an embodiment of the present application further provides a storage medium, wherein the storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned session connection monitoring method.

[0122] In order to achieve the above-mentioned purpose, according to another aspect of the present application, an embodiment of the present application also provides a monitoring device for a session connection, the device comprising a storage medium; and one or more processors, the storage medium is coupled to the processor, and the processor is configured to execute program instructions stored in the storage medium; when the program instructions are executed, the above-mentioned monitoring method for the session connection is executed.

[0123] Furthermore, as a response to the above Figure 1 and Figure 2In order to realize the method shown in the figure, another embodiment of the present application also provides a monitoring device for session connection. This device embodiment corresponds to the aforementioned method embodiment. For ease of reading, this device embodiment will not repeat the details of the aforementioned method embodiment one by one, but it should be clear that the device in this embodiment can correspond to all the contents of the aforementioned method embodiment. This device is used to accurately monitor the data of terminal devices within an organization such as an enterprise or government, specifically as follows Figure 3 As shown, the device comprises:

[0124] A collecting unit 31 is used to collect a first real data packet transmitted in a target session connection, where the first real data packet carries sequence number information for representing the sequence of data packets transmitted in the target session connection;

[0125] A determination unit 32, configured to determine whether the first real data packet is a continuously transmitted data packet according to sequence number information corresponding to the first real data packet and the historical real data packet;

[0126] a conversion unit 33, configured to convert the first real data packet into a continuously parseable monitoring data packet according to a preset rule when the determination unit 32 determines that the first real data packet is not a continuously transmitted data packet;

[0127] The parsing unit 34 is used to parse the monitoring data packet to monitor the security of the target session connection.

[0128] Further, such as Figure 4 As shown, the conversion unit 33 includes:

[0129] A first collection module 331 is used to collect a plurality of second real data packets transmitted in the target session connection within a preset time period, where the second real data packets are data packets transmitted after the first real data packets;

[0130] A first judging module 332 is used to judge whether there is a lost data packet in the process of collecting data packets of the target session connection according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets;

[0131] A first conversion module 333 is configured to convert the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet when the first determination module 332 determines that there is a lost data packet in the process of collecting the data packets of the target session connection;

[0132] The second conversion module 334 is used to convert the first real data packet into a continuously parsable monitoring data packet by reordering the data packets when the first judgment module 332 determines that there is no lost data packet in the process of collecting the data packets of the target session connection.

[0133] Further, such as Figure 4 As shown, the conversion unit 33 includes:

[0134] A second collection module 335 is used to collect a preset number of second real data packets transmitted in the target session connection, where the second real data packets are data packets transmitted after the first real data packet;

[0135] A second judgment module 336 is used to judge whether there is a lost data packet in the process of collecting the data packets of the target session connection according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets;

[0136] A third conversion module 337 is configured to convert the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet when the second determination module 336 determines that there is a lost data packet in the process of collecting the data packets of the target session connection;

[0137] The fourth conversion module 338 is used to convert the first real data packet into a continuously parsable monitoring data packet by reordering the data packets when the second judgment module 336 determines that there is no lost data packet in the process of collecting the data packets of the target session connection.

[0138] Further, such as Figure 4 As shown, the first conversion module 333 is specifically used to determine the sequence number information corresponding to the lost data packet according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets; generate a corresponding virtual data packet according to the real data packet adjacent to the lost data packet; and sort the first real data packet and the virtual data packet according to the sequence number information of the first real data packet and the virtual data packet to obtain a monitoring data packet that can be continuously parsed;

[0139] The third conversion module 337 is specifically used to determine the sequence number information corresponding to the lost data packet based on the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets; generate a corresponding virtual data packet based on the real data packet adjacent to the lost data packet; and sort the first real data packet and the virtual data packet according to the sequence number information of the first real data packet and the virtual data packet to obtain a monitoring data packet that can be continuously parsed.

[0140] Further, such as Figure 4 As shown, the first conversion module 333 is specifically used to find the adjacent real data packet according to the sequence number information of the lost data packet; obtain the header information contained in the adjacent real data packet; create a blank data packet; fill the header information and preset invalid data into the blank data packet to obtain the virtual data packet; add a virtual data packet identifier to the virtual data packet;

[0141] The third conversion module 337 is specifically used to find the adjacent real data packet according to the sequence number information of the lost data packet; obtain the header information contained in the adjacent real data packet; create a blank data packet; fill the header information and preset invalid data into the blank data packet to obtain the virtual data packet; and add a virtual data packet identifier to the virtual data packet.

[0142] Further, such as Figure 4 As shown, the second conversion module 334 is specifically used to search for a missing target data packet in a plurality of second real data packets according to the sequence number information corresponding to the historical real data packet and the first real data packet; and to sort the first real data packet and the target data packet according to the sequence number information of the first real data packet and the target data packet to obtain a monitoring data packet that can be continuously parsed;

[0143] The fourth conversion module 338 is specifically used to search for missing target data packets in multiple second real data packets according to the sequence number information corresponding to the historical real data packets and the first real data packets; and sort the first real data packets and the target data packets according to the sequence number information of the first real data packets and the target data packets to obtain monitoring data packets that can be continuously parsed.

[0144] Further, such as Figure 4 As shown, the parsing unit 34 includes:

[0145] A detection module 341 is used to detect whether the monitoring data packet carries a virtual data packet identifier;

[0146] The first parsing module 342 is used to parse the monitoring data packet to obtain the application layer data contained in the monitoring data packet when the detection module 341 detects that the monitoring data packet does not carry the virtual data packet identifier, and monitor the security of the target session connection according to the application layer data parsed from the monitoring data packet;

[0147] The second parsing module 343 is used to determine the corresponding application layer data according to the context information of the monitoring data packet when the detection module 341 detects that the monitoring data packet carries a virtual data packet identifier, and monitor the security of the target session connection according to the application layer data corresponding to the monitoring data packet.

[0148] Further, such as Figure 4 As shown, the context information of the monitoring data packet is the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed;

[0149] The second parsing module 343 is specifically used to obtain the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed; based on the application layer data and / or processing status, search for matching data content in the preset protocol knowledge base as the application layer data corresponding to the monitoring data packet, wherein the preset protocol knowledge base records the mapping relationship between the application layer data and / or processing status of adjacent data packets.

[0150] The embodiment of the present application provides a method and device for monitoring a session connection. The embodiment of the present application can, after a data monitoring device collects a first real data packet transmitted in a target session connection through a mirror port of a switch of a target organization, determine by the data monitoring device whether the first real data packet is a continuously transmitted data packet based on sequence number information corresponding to the first real data packet and sequence number information corresponding to a historical real data packet; when it is determined that the first real data packet is not a continuously transmitted data packet, the data monitoring device converts the first real data packet into a continuously parseable monitoring data packet based on a preset rule, so that the data monitoring device performs data parsing on the monitoring data packet, and after obtaining application layer data corresponding to the monitoring data packet, the security of the target session connection can be accurately monitored based on the application layer data parsed from the monitoring data packet, that is, data monitoring of terminal devices within the target organization can be accurately performed.

[0151] The monitoring device for the session connection includes a processor and a memory. The above-mentioned acquisition unit, determination unit, conversion unit and analysis unit are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0152] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the data of terminal devices within an enterprise or government organization can be accurately monitored by adjusting the kernel parameters.

[0153] An embodiment of the present application provides a storage medium, which includes a stored program, wherein when the program is executed, a device where the storage medium is located is controlled to execute the above-mentioned method for monitoring session connection.

[0154] The storage medium may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.

[0155] An embodiment of the present application also provides a monitoring device for a session connection, the device comprising a storage medium; and one or more processors, the storage medium is coupled to the processor, and the processor is configured to execute program instructions stored in the storage medium; when the program instructions are executed, the above-mentioned monitoring method for the session connection is executed.

[0156] The embodiment of the present application provides a device, which includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, the following steps are implemented:

[0157] Collecting a first real data packet transmitted in a target session connection, where the first real data packet carries sequence number information for characterizing a sequence of data packets transmitted in the target session connection;

[0158] Determining whether the first real data packet is a continuously transmitted data packet according to the sequence number information corresponding to the first real data packet and the historical real data packet;

[0159] If not, converting the first real data packet into a continuously parsable monitoring data packet according to a preset rule;

[0160] The monitoring data packet is parsed to monitor the security of the target session connection.

[0161] Furthermore, converting the first real data packet into a continuously parsable monitoring data packet according to a preset rule includes:

[0162] Collecting a plurality of second real data packets transmitted in the target session connection within a preset time period, wherein the second real data packets are data packets transmitted after the first real data packets;

[0163] According to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets, determining whether there is a lost data packet in the process of collecting the data packets of the target session connection;

[0164] If it exists, converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet;

[0165] If not, the first real data packet is converted into a monitoring data packet that can be continuously parsed by reordering the data packets.

[0166] Furthermore, converting the first real data packet into a continuously parsable monitoring data packet according to a preset rule includes:

[0167] Collecting a preset number of multiple second real data packets transmitted in the target session connection, where the second real data packets are data packets transmitted after the first real data packet;

[0168] According to the sequence number information corresponding to the historical real data packets, the first real data packets, and each of the second real data packets, determining whether there is a lost data packet in the process of collecting the data packets of the target session connection;

[0169] If it exists, converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet;

[0170] If not, the first real data packet is converted into a monitoring data packet that can be continuously parsed by reordering the data packets.

[0171] Furthermore, the method of converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet includes:

[0172] Determine the sequence number information corresponding to the lost data packet according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets;

[0173] Generate a corresponding virtual data packet according to the real data packets adjacent to the lost data packet;

[0174] According to the sequence number information of the first real data packet and the virtual data packet, the first real data packet and the virtual data packet are sorted to obtain monitoring data packets that can be continuously parsed.

[0175] Furthermore, the generating a corresponding virtual data packet according to the real data packet adjacent to the lost data packet includes:

[0176] Searching for the adjacent real data packets according to the sequence number information of the lost data packets;

[0177] Obtaining packet header information contained in the adjacent real data packets;

[0178] Create a blank data packet;

[0179] Filling the blank data packet with the packet header information and preset invalid data to obtain the virtual data packet;

[0180] A virtual data packet identifier is added to the virtual data packet.

[0181] Furthermore, the converting the first real data packet into a continuously parsable monitoring data packet by reordering the data packets includes:

[0182] Searching for a missing target data packet in a plurality of second real data packets according to the sequence number information corresponding to the historical real data packet and the first real data packet;

[0183] According to the sequence number information of the first real data packet and the target data packet, the first real data packet and the target data packet are sorted to obtain monitoring data packets that can be continuously parsed.

[0184] Further, the data parsing of the monitoring data packet to monitor the security of the target session connection includes:

[0185] Detecting whether the monitoring data packet carries a virtual data packet identifier;

[0186] If not, the monitoring data packet is parsed to obtain the application layer data contained in the monitoring data packet, and the security of the target session connection is monitored according to the application layer data parsed from the monitoring data packet;

[0187] If it is carried, the corresponding application layer data is determined according to the context information of the monitoring data packet, and the security of the target session connection is monitored according to the application layer data corresponding to the monitoring data packet.

[0188] Further, the context information of the monitoring data packet is the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed; the determining the corresponding application layer data according to the context information of the monitoring data packet includes:

[0189] Acquire application layer data and / or processing status corresponding to the monitoring data packet adjacent to the monitoring data packet and having been parsed;

[0190] Based on the application layer data and / or processing status, matching data content is searched in the preset protocol knowledge base as the application layer data corresponding to the monitoring data packet, wherein the preset protocol knowledge base records the mapping relationship between the application layer data and / or processing status of adjacent data packets.

[0191] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing program code that initializes the following method steps: collecting a first real data packet transmitted in a target session connection, the first real data packet carrying sequence number information used to characterize the order of data packets transmitted by the target session connection; determining whether the first real data packet is a continuously transmitted data packet based on the sequence number information corresponding to the first real data packet and a historical real data packet; if not, converting the first real data packet into a continuously parseable monitoring data packet based on a preset rule; and performing data parsing on the monitoring data packet to monitor the security of the target session connection.

[0192] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may 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 may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0193] The present application is described with reference to the flowcharts and / or block diagrams of the methods, 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 device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing 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.

[0194] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising 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.

[0195] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0196] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0197] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0198] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0199] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0200] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may 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 may 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.) that contain computer-usable program code.

[0201] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for monitoring a session connection, It is characterized in that The method is applied to a data monitoring device that uses a bypass mirror mode to perform data monitoring, and includes: Collecting a first real data packet transmitted in a target session connection, where the first real data packet carries sequence number information for characterizing a sequence of data packets transmitted in the target session connection; Determining whether the first real data packet is a continuously transmitted data packet according to the sequence number information corresponding to the first real data packet and the historical real data packet; If not, converting the first real data packet into a continuously parsable monitoring data packet according to a preset rule; Performing data parsing on the monitoring data packet to monitor the security of the target session connection; The converting the first real data packet into a monitoring data packet that can be continuously parsed according to a preset rule includes: Collecting a plurality of second real data packets transmitted in the target session connection within a preset time period, wherein the second real data packets are data packets transmitted after the first real data packets; According to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets, determining whether there is a lost data packet in the process of collecting the data packets of the target session connection; If it exists, converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet; If not, converting the first real data packet into a monitoring data packet that can be continuously parsed by reordering the data packets; The method of converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet includes: Determine the sequence number information corresponding to the lost data packet according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets; Generate a corresponding virtual data packet according to the real data packet adjacent to the lost data packet, wherein the virtual data packet carries a virtual data packet identifier; According to the sequence number information of the first real data packet and the virtual data packet, the first real data packet and the virtual data packet are sorted to obtain monitoring data packets that can be continuously parsed; The performing data parsing on the monitoring data packet to monitor the security of the target session connection includes: Detecting whether the monitoring data packet carries a virtual data packet identifier; If not, the monitoring data packet is parsed to obtain the application layer data contained in the monitoring data packet, and the security of the target session connection is monitored according to the application layer data parsed from the monitoring data packet; If it is carried, determining the corresponding application layer data according to the context information of the monitoring data packet, and monitoring the security of the target session connection according to the application layer data corresponding to the monitoring data packet; The context information of the monitoring data packet is the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed; the determining the corresponding application layer data according to the context information of the monitoring data packet includes: Acquire application layer data and / or processing status corresponding to the monitoring data packet adjacent to the monitoring data packet and having been parsed; Based on the application layer data and / or processing status, matching data content is searched in the preset protocol knowledge base as the application layer data corresponding to the monitoring data packet, wherein the preset protocol knowledge base records the mapping relationship between the application layer data and / or processing status of adjacent data packets.

2. The method according to claim 1, It is characterized in that The converting the first real data packet into a monitoring data packet that can be continuously parsed according to a preset rule includes: Collecting a preset number of multiple second real data packets transmitted in the target session connection, where the second real data packets are data packets transmitted after the first real data packet; According to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets, determining whether there is a lost data packet in the process of collecting the data packets of the target session connection; If it exists, converting the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet; If not, the first real data packet is converted into a monitoring data packet that can be continuously parsed by reordering the data packets.

3. The method according to claim 1, It is characterized in that The step of generating a corresponding virtual data packet according to a real data packet adjacent to the lost data packet comprises: Searching for the adjacent real data packets according to the sequence number information of the lost data packets; Obtaining packet header information contained in the adjacent real data packets; Create a blank data packet; Filling the blank data packet with the packet header information and preset invalid data to obtain the virtual data packet; A virtual data packet identifier is added to the virtual data packet.

4. The method according to claim 1 or 2, It is characterized in that The method of converting the first real data packet into a monitoring data packet that can be continuously parsed by reordering the data packets includes: Searching for a missing target data packet in a plurality of second real data packets according to the sequence number information corresponding to the historical real data packet and the first real data packet; According to the sequence number information of the first real data packet and the target data packet, the first real data packet and the target data packet are sorted to obtain monitoring data packets that can be continuously parsed.

5. A monitoring device for a session connection, It is characterized in that The device is applied to a data monitoring device that uses a bypass mirror mode to perform data monitoring, and includes: A collection unit, configured to collect a first real data packet transmitted in a target session connection, wherein the first real data packet carries sequence number information for characterizing a sequence of data packets transmitted in the target session connection; a determining unit, configured to determine whether the first real data packet is a continuously transmitted data packet according to sequence number information corresponding to the first real data packet and the historical real data packet; a conversion unit, configured to convert the first real data packet into a continuously parseable monitoring data packet according to a preset rule when the determination unit determines that the first real data packet is not a continuously transmitted data packet; A parsing unit, used for parsing the monitoring data packet to monitor the security of the target session connection; The conversion unit comprises: A first collection module, used for collecting a plurality of second real data packets transmitted in the target session connection within a preset time period, wherein the second real data packets are data packets transmitted after the first real data packets; A first judgment module, configured to judge whether there is a lost data packet in the process of collecting data packets of the target session connection according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets; a first conversion module, configured to convert the first real data packet into a continuously parsable monitoring data packet by completing the lost data packet when the first determination module determines that there is a lost data packet in the process of collecting the data packets of the target session connection; a second conversion module, configured to convert the first real data packet into a continuously parsable monitoring data packet by reordering the data packets when the first judgment module determines that no data packet is lost during the process of collecting the data packets of the target session connection; The first conversion module is specifically used to determine the sequence number information corresponding to the lost data packet according to the sequence number information corresponding to the historical real data packet, the first real data packet and each of the second real data packets; generate a corresponding virtual data packet according to the real data packet adjacent to the lost data packet, wherein the virtual data packet carries a virtual data packet identifier; and sort the first real data packet and the virtual data packet according to the sequence number information of the first real data packet and the virtual data packet to obtain a monitoring data packet that can be continuously parsed; The parsing unit comprises: A detection module, used to detect whether the monitoring data packet carries a virtual data packet identifier; A first parsing module is used to parse the monitoring data packet to obtain application layer data contained in the monitoring data packet when the detection module detects that the monitoring data packet does not carry the virtual data packet identifier, and monitor the security of the target session connection according to the application layer data parsed from the monitoring data packet; a second parsing module, configured to determine the corresponding application layer data according to the context information of the monitoring data packet when the detection module detects that the monitoring data packet carries the virtual data packet identifier, and monitor the security of the target session connection according to the application layer data corresponding to the monitoring data packet; The context information of the monitoring data packet is the application layer data and / or processing status corresponding to the monitoring data packet adjacent to the monitoring data packet and having been parsed; The second parsing module is specifically used to obtain the application layer data and / or processing status corresponding to the monitoring data packet that is adjacent to the monitoring data packet and has been parsed; based on the application layer data and / or processing status, search for matching data content in the preset protocol knowledge base as the application layer data corresponding to the monitoring data packet, wherein the preset protocol knowledge base records the mapping relationship between the application layer data and / or processing status of adjacent data packets.

6. A storage medium, It is characterized in that The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method for monitoring a session connection according to any one of claims 1 to 4.

7. A monitoring device for a session connection, It is characterized in that The device includes a storage medium; and one or more processors, the storage medium is coupled to the processor, and the processor is configured to execute program instructions stored in the storage medium; when the program instructions are executed, the monitoring method for session connection described in any one of claims 1 to 4 is executed.