Conversation identification method, device, electronic device and computer readable medium

By introducing the session structure and message status matching tree, the identification difficulty during segmented transmission of messages in the session is solved and network security is improved.

CN113765877BActive Publication Date: 2024-09-24BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110180504.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-08
Publication Date
2024-09-24
Estimated Expiration
2041-02-08

AI Technical Summary

Technical Problem

Existing session identification methods are difficult to accurately identify when messages in a session are divided into multiple segments for transmission, resulting in reduced network security.

Method used

By introducing the session structure, the packet identification results corresponding to the same session are recorded, and the target session structure is updated based on the packet status identifier and the preset packet status matching tree to ensure that the identification results of multiple segments of packets are recorded in one in the session structure.

Benefits of technology

It effectively identifies network risks in sessions, improves network security, and avoids identification failures caused by segmented transmission of messages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113765877B
    Figure CN113765877B
Patent Text Reader

Abstract

The embodiments of the present disclosure disclose a session identification method, device, electronic device and computer-readable medium. A specific implementation of the method includes: extracting information from a message in a cache to obtain five-tuple information, wherein the five-tuple information includes a session structure identifier; matching a target session structure that matches the session structure identifier included in the five-tuple information from a pre-set session structure library; in response to a successful match, performing message state identification on the message to obtain a message state identifier; and updating the target session structure based on the message state identifier and a pre-set message state matching tree. This implementation can improve the security of the network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present disclosure relate to the field of computer technology, and in particular to a session identification method, device, electronic device, and computer-readable medium. Background Art

[0002] The session identification method is a technology for identifying sessions in network traffic. At present, the commonly used session identification method is to use the string recognition engine in the mainstream detection system to perform string recognition on the session in the traffic to obtain the recognition result.

[0003] However, when the above method is used for session identification, the following technical problems often occur:

[0004] When a message in a conversation is divided into multiple segments for transmission, it is difficult for the string recognition engine to accurately identify such a conversation, making it impossible to identify the network risks existing in such a conversation, thereby reducing the security of the network. Summary of the invention

[0005] The content of this disclosure is used to introduce concepts in a brief form, which will be described in detail in the detailed implementation section below. The content of this disclosure is not intended to identify the key features or essential features of the technical solution claimed for protection, nor is it intended to limit the scope of the technical solution claimed for protection.

[0006] Some embodiments of the present disclosure propose a session identification method, an apparatus, an electronic device, and a computer-readable medium to solve one or more of the technical problems mentioned in the above background technology section.

[0007] In a first aspect, some embodiments of the present disclosure provide a session identification method, which includes: extracting information from a message in a cache to obtain five-tuple information, wherein the five-tuple information includes a session structure identifier; matching a target session structure that matches the session structure identifier included in the five-tuple information from a pre-set session structure library; in response to a successful match, performing message state identification on the message to obtain a message state identifier; and updating the target session structure based on the message state identifier and a pre-set message state matching tree.

[0008] Optionally, the method further includes: in response to a matching failure, creating an initial session structure; and adding a message state identifier of the message to the initial session structure.

[0009] Optionally, the performing message status identification on the message to obtain a message status identifier includes: performing status identification on a target character string included in the message to generate a status identifier as a message status identification identifier.

[0010] Optionally, the target session structure includes a state tree; and the target session structure is updated based on the message state identifier and a pre-set message state matching tree, including: in response to determining that there is a next hop node identifier in a pre-set next hop node identifier list that matches the message state identifier, determining the message transmission direction from the message state identifier to the matched next hop node identifier; in response to determining that the message transmission direction is the same as the transmission direction corresponding to the message state identifier, adding the message transmission direction as the state information of a child node to the state tree, wherein the state tree is used to record the jump relationship of the message from the message state identifier to the message matching identifier; adding the five-tuple information to the target session structure to update the target session structure.

[0011] Optionally, the above-mentioned updating of the target session structure based on the above-mentioned message state identifier and a pre-set message state matching tree also includes: taking the child node of the next hop node matching the above-mentioned message state identifier in the above-mentioned message state matching tree as the next hop node to be matched, and obtaining a list of next hop node identifiers to be matched, wherein the above-mentioned list of next hop node identifiers to be matched is used to identify the message in the cache corresponding to the above-mentioned message.

[0012] Optionally, updating the target session structure based on the message state identifier and a preset message state matching tree also includes: storing the depth value of the next hop node matching the message state identifier in the message state matching tree to the node of the state tree corresponding to the message.

[0013] Optionally, the above-mentioned message also includes application information; and the above-mentioned method also includes: in response to determining that the next hop node matching the above-mentioned message status identifier is a leaf node of the above-mentioned message status matching tree, the application information included in the above-mentioned message is stored in the leaf node of the above-mentioned status tree to determine that the update of the above-mentioned target session structure is completed, wherein the above-mentioned updated target session structure is used to characterize the identification result of the session corresponding to the above-mentioned message.

[0014] In a second aspect, some embodiments of the present disclosure provide a session identification device, comprising: an information extraction unit, configured to extract information from a message in a cache to obtain five-tuple information, wherein the five-tuple information includes a session structure identifier; a selection unit, configured to match a target session structure that matches the session structure identifier included in the five-tuple information from a preset session structure library; a message state identification unit, configured to perform message state identification on the message in response to a successful match to obtain a message state identifier; and an update unit, configured to update the target session structure based on the message state identifier and a preset message state matching tree.

[0015] Optionally, the above-mentioned session identification device also includes: an initial session structure creating unit, configured to create an initial session structure in response to a matching failure; an initial session structure adding unit, configured to add the message state identifier of the above-mentioned message to the above-mentioned initial session structure.

[0016] Optionally, the message state identification unit is further configured to: perform state identification on a target character string included in the message to generate a state identifier as a message state identification identifier.

[0017] Optionally, the target session structure includes a state tree; and the update unit is further configured to: in response to determining that there is a next hop node identifier in a preset next hop node identifier list that matches the message state identifier, determine the message transmission direction from the message state identifier to the matched next hop node identifier; in response to determining that the message transmission direction is the same as the transmission direction corresponding to the message state identifier, add the message transmission direction as the state information of a child node to the state tree, wherein the state tree is used to record the jump relationship of the message from the message state identifier to the message matching identifier; add the five-tuple information to the target session structure to update the target session structure.

[0018] Optionally, the update unit is further configured to: use the child node of the next hop node that matches the message status identifier in the message status matching tree as the next hop node to be matched, and obtain a list of next hop node identifiers to be matched, wherein the list of next hop node identifiers to be matched is used to identify the message in the cache corresponding to the message.

[0019] Optionally, the updating unit is further configured to: store the depth value of the next hop node matching the message state identifier in the message state matching tree into a node of the state tree corresponding to the message.

[0020] Optionally, the message also includes application information; and the update unit also includes: a storage subunit, configured to store the application information included in the message in the leaf node of the status tree in response to determining that the next hop node matching the message status identifier is a leaf node of the message status matching tree, so as to determine that the update of the target session structure is completed, wherein the updated target session structure is used to characterize the identification result of the session corresponding to the message.

[0021] In a third aspect, some embodiments of the present disclosure provide an electronic device comprising: one or more processors; a storage device on which one or more programs are stored, and when the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any implementation manner of the above-mentioned first aspect.

[0022] In a fourth aspect, some embodiments of the present disclosure provide a computer-readable medium having a computer program stored thereon, wherein when the program is executed by a processor, the method described in any implementation manner of the above-mentioned first aspect is implemented.

[0023] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the session identification method of some embodiments of the present disclosure, the security of the network can be improved. Specifically, the reason for the low network security is that when a message in a session is divided into multiple message segments for transmission, the string recognition engine cannot identify such a session, so that the network risk existing in such a session cannot be identified. Based on this, the session identification method of some embodiments of the present disclosure first introduces a session structure, which can be used to store the recognition results of messages corresponding to the same session. Therefore, when a message in a session is divided into multiple message segments for transmission, the recognition results of the multiple message segments can all be recorded in a session structure. Therefore, the introduced session structure is used as the recognition result characterizing the above-mentioned session, and the recognition of a session in which a message is divided into multiple message segments for transmission can be completed. Therefore, it can be avoided that when a message in a session is divided into multiple message segments for transmission, the situation in which such a session cannot be identified can be avoided. Thus, the network risk existing in such a session can be identified to a certain extent. In turn, the security of the network is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.

[0025] Figure 1 is a schematic diagram of an application scenario of a session identification method according to some embodiments of the present disclosure;

[0026] Figure 2 is a flow chart of some embodiments of the session identification method according to the present disclosure;

[0027] Figure 3 A schematic diagram of a message state matching tree in a session identification method according to some embodiments of the present disclosure;

[0028] Figure 4is a flow chart of other embodiments of the session identification method according to the present disclosure;

[0029] Figure 5 is a schematic diagram of the structure of some embodiments of the conversation identification device according to the present disclosure;

[0030] Figure 6 It is a schematic diagram of the structure of an electronic device suitable for implementing some embodiments of the present disclosure. DETAILED DESCRIPTION

[0031] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0032] It should also be noted that, for ease of description, only the parts related to the invention are shown in the drawings. In the absence of conflict, the embodiments and features in the embodiments of the present disclosure can be combined with each other.

[0033] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0034] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0035] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0036] The present disclosure will be described in detail below with reference to the accompanying drawings and in conjunction with embodiments.

[0037] Figure 1 It is a schematic diagram of an application scenario of the session identification method of some embodiments of the present disclosure.

[0038] exist Figure 1In the application scenario, first, the computing device 101 can extract information from the message 102 in the cache to obtain the five-tuple information 103, wherein the five-tuple information 103 includes the session structure identifier 1031. As an example, the five-tuple information 103 can be [message source IP (Internet Protocol address): 192.***.1.1, message source port: 2020, message destination IP: 192.***.2.2, message destination port number: 2021, session structure identifier: 10]. Then, the computing device 101 can match the target session structure 105 that matches the session structure identifier 1031 included in the five-tuple information from the pre-set session structure library 104. Afterwards, the computing device 101 can perform message status identification on the message 102 in response to a successful match to obtain a message status identifier 106. As an example, the message status identifier 106 can be: ②. Finally, the computing device 101 may update the target session structure 105 based on the message state identifier 106 and the preset message state matching tree 107 .

[0039] It should be noted that the computing device 101 can be hardware or software. When the computing device is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device. When the computing device is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, or as a single software or software module. No specific limitation is made here.

[0040] It should be understood that Figure 1 The number of computing devices in the embodiment is only illustrative. Any number of computing devices may be provided according to implementation requirements.

[0041] Continue to refer Figure 2 , a flowchart 200 of some embodiments of the session identification method according to the present disclosure is shown. The session identification method comprises the following steps:

[0042] Step 201, extract information from the message in the cache to obtain five-tuple information.

[0043] In some embodiments, the execution subject of the session identification method (such as Figure 1The computing device 101 shown in the figure can extract information from the message in the cache to obtain five-tuple information. Among them, the above five-tuple information can include a session structure identifier. The above information extraction can be to select the required information from the above message as the five-tuple information. For example, the source IP, source port number, destination IP, destination port number and session structure identifier of the message can be selected from the above message. The above session structure identifier can be a unique identifier of the session structure, and the session structure can be used to store the identification results of the messages corresponding to the same session.

[0044] As an example, the above five-tuple information can be: [message source IP: 192.***.1.1, message source port: 2020, message destination IP: 192.***.2.2, message destination port number: 2021, session structure identifier: 10].

[0045] Step 202: Match a target session structure that matches the session structure identifier included in the quintuple information from a preset session structure library.

[0046] In some embodiments, the execution subject may match a target session structure that matches the session structure identifier included in the five-tuple information from a pre-set session structure library. The session structure library may be composed of session structures corresponding to different identified sessions. The session structure may be a string. Each session structure has a unique identification key (i.e., session structure identifier). A key for the unique identification of a session structure is stored in each session. Therefore, each session structure may be in a one-to-one correspondence with the session through a key. The matching may be that the session structure identifier is the same as a unique identification key of a session structure in the session structure library.

[0047] Step 203: In response to a successful match, a message state identification is performed on the message to obtain a message state identifier.

[0048] In some embodiments, the execution subject may, in response to a successful match, perform message status identification on the message to obtain a message status identifier. In response to a successful match, it may be determined that the target session structure is successfully selected, which may indicate that at least one other message in the session to which the message belongs has been identified. Message status identification may be performed in the following manner: Message status identification may be performed by a recognition algorithm (e.g., Hyperscan stream pattern recognition method). The message status identifier may be a serial number used to uniquely identify a character string in the message. For example, message status identifier: ②.

[0049] Step 204: Update the target session structure based on the message state identifier and the preset message state matching tree.

[0050] In some embodiments, the execution subject may update the target session structure based on the message state identifier and a pre-set message state matching tree. The message state matching tree may represent a set of migration conditions of messages in the network, and is used to detect whether the transmission direction of the message is correct. Figure 3 As shown, the root node of the message state matching tree can be marked as 0. The child node (for example, ①, ②, ③, etc.) can include a unique identification number of the message string. The leaf node (for example, ⑧, ⑨, ⑩, etc.) can include: a unique identification number sequence consisting of the unique identification number corresponding to the root node to the current leaf node. Specifically, the above-mentioned message state identifier and the corresponding child node in the above-mentioned message state matching tree can be determined, and the unique identification number of the above-mentioned child node is added to the above-mentioned target session structure to update the above-mentioned target session structure. In addition, since the above-mentioned message state identifier and the nodes in the above-mentioned message state matching tree are both used to uniquely identify the string in the above-mentioned message, therefore, the child node in the above-mentioned message state matching tree with the above-mentioned message state identifier can be determined. In practice, each message in the cache is identified, and the identification result is added to the target session structure corresponding to the message. When the message corresponding to a session is identified, it can be indicated that the identification of the session is completed.

[0051] Optionally, the above execution entity may further include the following steps:

[0052] The first step is to create an initial session structure in response to a matching failure. The matching failure may be a failure to determine the selection of a target session structure, which may indicate that the message is the first identified message in the session to which it belongs. The initial session structure may be created in the following manner: a session structure identifier that is different from the session structure identifiers of each session structure in the session structure library is determined as the unique identifier of the created initial session structure. For example, the session structure identifiers of each session structure in the session structure library may be: [10001, 10002, 10003]. Then, the session structure identifier of the initial session structure created above may be: "10004". Afterwards, the five-tuple information may be added to the created initial session structure. The initial session structure created above may include a message status identifier field for storing a message status identifier.

[0053] As an example, the initial session structure created above can be "10004": "[message source IP: 192.***.1.1, message source port: 2020, message destination IP: 192.***.2.2, message destination port number: 2021, session structure identifier: 10004, message status identifier: [0]]".

[0054] The second step is to add the message status identifier of the message to the initial session structure. Specifically, the message status identifier of the message can be added to the message status identification field in the initial session structure, and a message status identifier transition symbol "→" can be added.

[0055] As an example, the message status identifier of the above message can be: 1. Then, the initial session structure after the above addition can be "10004": "[message source IP: 192.***.1.1, message source port: 2020, message destination IP: 192.***.2.2, message destination port number: 2021, session structure identifier: 10004, message status identifier: [0→①]]".

[0056] The above-mentioned embodiments of the present disclosure have the following beneficial effects: through the session identification method of some embodiments of the present disclosure, the security of the network can be improved. Specifically, the reason for the low network security is that when a message in a session is divided into multiple message segments for transmission, the string recognition engine cannot identify such a session, so that the network risk existing in such a session cannot be identified. Based on this, the session identification method of some embodiments of the present disclosure first introduces a session structure, which can be used to store the recognition results of messages corresponding to the same session. Therefore, when a message in a session is divided into multiple message segments for transmission, the recognition results of the multiple message segments can all be recorded in a session structure. Therefore, the introduced session structure is used as the recognition result characterizing the above-mentioned session, and the recognition of a session in which a message is divided into multiple message segments for transmission can be completed. Therefore, it can be avoided that when a message in a session is divided into multiple message segments for transmission, the situation in which such a session cannot be identified can be avoided. Thus, the network risk existing in such a session can be identified to a certain extent. In turn, the security of the network is improved.

[0057] Continue to refer Figure 4 , Figure 4 A process 400 of some embodiments of the session identification method according to the present disclosure is shown. The session identification method comprises the following steps:

[0058] Step 401, extract information from the message in the cache to obtain five-tuple information.

[0059] Step 402: Match a target session structure that matches the session structure identifier included in the quintuple information from a preset session structure library.

[0060] In some embodiments, the specific implementation of steps 401-402 and the technical effects brought about can be referred to Figure 2 The corresponding steps 201-202 in the embodiments are not described in detail here.

[0061] Step 403: In response to a successful match, the message status is identified on the message to obtain a message status identifier.

[0062] In some embodiments, the execution subject performs message status identification on the message to obtain a message status identifier, which may include the following steps:

[0063] The target character string included in the above-mentioned message is subjected to message state identification to generate a state identifier as a message state identification identifier. Among them, the message state identification can be performed by an improved character string identification algorithm (for example, Hyperscan block pattern recognition method). The above-mentioned improved character string identification algorithm can be an introduction of a state tree, and the identification result of the character string identification algorithm can be used as a node of the state tree. The above-mentioned state tree can be in a corresponding relationship with the session, and each node corresponds to the identification result of a message in the session, which is used to characterize the state migration process of the message in the session.

[0064] Step 404: in response to determining that there is a next hop node identifier in the preset next hop node identifier list that matches the message status identifier, determine a message transmission direction from the message status identifier to the matched next hop node identifier.

[0065] In some embodiments, the execution subject may determine the message transmission direction from the message status identifier to the matched next hop node identifier in response to determining that there is a next hop node identifier in a preset next hop node identifier list that matches the message status identifier. The next hop node identifier list may be used to identify the message corresponding to the above message in the cache. The message corresponding to the above message may be: a message included in the session to which the above message belongs. The above match may be that there is a next hop node identifier in the next hop node identifier list that is the same as the above message status identifier. The above determination of the message transmission direction (for example, a response direction or a request direction) from the message status identifier to the matched next hop node identifier may be: obtaining the message transmission direction stored in the node corresponding to the above matched next hop node representation identifier.

[0066] Step 405: In response to determining that the message transmission direction is the same as the transmission direction corresponding to the message state identifier, the message transmission direction is added to the state tree as state information of the child node.

[0067] In some embodiments, the execution subject may respond to determining that the message transmission direction is the same as the transmission direction corresponding to the message state identifier, and add the message transmission direction as the state information of the child node to the state tree, wherein the target session structure may include a state tree. The state tree may also be a string. The root node of the state tree may be 0, and each child node corresponds to each message in the session to which the message belongs, and is used to store the message transmission direction of the message to characterize the jump relationship between the message state identifiers. Therefore, the state tree may be used to record the jump relationship of the message from the message state identifier to the message matching identifier. The determination that the message transmission direction is the same as the transmission direction corresponding to the message state identifier may characterize that the transmission direction of the message is correct. Adding the message transmission direction as the state information of the child node to the state tree may be: adding the message transmission direction (e.g., the request direction) as the state information of the child node to the state tree.

[0068] As an example, the above state tree may be: [root node: “0”→child node 1: “request direction”].

[0069] Step 406: Add the five-tuple information to the target session structure to update the target session structure.

[0070] In some embodiments, the execution entity may add the five-tuple information to the target session structure to update the target session structure.

[0071] As an example, the five-tuple information may be: [message source IP: 192.***.1.1, message source port: 2020, message destination IP: 192.***.2.2, message destination port number: 2021, session structure identifier: 10]. The updated target session structure may be: "[message source IP: 192.***.1.1, message source port: 2020, message destination IP: 192.***.2.2, message destination port number: 2021, session structure identifier: 10004, state tree: [root node: "0" → child node 1: "request direction"]]".

[0072] In some optional implementations of some embodiments, the execution subject may also use the child nodes of the next hop node matching the message state identifier in the message state matching tree as the next hop node to be matched, and obtain a list of next hop node identifiers to be matched. The list of next hop node identifiers to be matched is used to identify the message corresponding to the message in the cache.

[0073] In some optional implementations of some embodiments, the execution subject may also store the depth value of the next hop node matching the message status identifier in the message status matching tree to the node of the state tree corresponding to the message. Figure 3 As shown, the next hop node matching the message state identifier ① may be ⑦. Then, the depth value of the message state matching tree may be 3.

[0074] In some optional implementations of some embodiments, the above-mentioned message may also include application information, and the above-mentioned execution subject may also store the application information included in the above-mentioned message in the leaf node of the above-mentioned state tree in response to determining that the next hop node matching the above-mentioned message state identifier is a leaf node of the above-mentioned message state matching tree, so as to determine that the update of the above-mentioned target session structure is completed. Among them, the above-mentioned updated target session structure is used to characterize the recognition result of the session corresponding to the above-mentioned message. Specifically, determining that the next hop node matching the above-mentioned message state identifier is a leaf node of the above-mentioned message state matching tree can indicate that the above-mentioned message is the last message identified in the session to which it belongs. It can also indicate that the session to which the above-mentioned message belongs has been identified.

[0075] from Figure 4 It can be seen that Figure 2 Compared with the description of some corresponding embodiments, Figure 4 The process 400 of the session identification method of some corresponding embodiments embodies the steps of expanding the update of the above-mentioned target session structure. It can be determined whether the identification result of the above-mentioned message state identifier is accurate based on the pre-set message state matching tree. A state tree is introduced to record the message transmission direction and related information (for example, depth value and application information, etc.) of the message. It is used to characterize the jump state of different messages in the same session. Therefore, in the case where a message is divided into multiple segments for transmission, the jump state of the multiple segments of the message can also be recorded to characterize the identification result of the message. Thereby, the ability to identify the session is further improved. In turn, the security of the network is improved.

[0076] Further references Figure 5 As an implementation of the methods shown in the above figures, the present disclosure provides some embodiments of a session identification device. These device embodiments are similar to Figure 2 Corresponding to the method embodiments shown, the device can be specifically applied to various electronic devices.

[0077] like Figure 5As shown, the session identification device 500 of some embodiments includes: an information extraction unit 501, a selection unit 502, a message state identification unit 503 and an update unit 504. The information extraction unit is configured to extract information from the message in the cache to obtain five-tuple information, wherein the five-tuple information includes a session structure identifier; the selection unit is configured to match a target session structure matching the session structure identifier included in the five-tuple information from a preset session structure library; the message state identification unit is configured to perform message state identification on the message in response to a successful match to obtain a message state identifier; the update unit is configured to update the target session structure based on the message state identifier and a preset message state matching tree.

[0078] In some optional implementations of some embodiments, the above-mentioned display data sending device 500 also includes: an initial session structure creation unit (not shown in the figure) and an initial session structure adding unit (not shown in the figure), wherein the initial session structure creation unit is configured to create an initial session structure in response to a matching failure; the initial session structure adding unit is configured to add the message status identifier of the above-mentioned message to the above-mentioned initial session structure.

[0079] In some optional implementations of some embodiments, the message state identification unit 503 is further configured to: perform state identification on the target character string included in the message to generate a state identifier as a message state identification identifier.

[0080] In some optional implementations of some embodiments, the target session structure includes a state tree; and the update unit 504 is further configured to: in response to determining that there is a next hop node identifier in a preset next hop node identifier list that matches the message state identifier, determine the message transmission direction from the message state identifier to the matched next hop node identifier; in response to determining that the message transmission direction is the same as the transmission direction corresponding to the message state identifier, add the message transmission direction as the state information of a child node to the state tree, wherein the state tree is used to record the jump relationship of the message from the message state identifier to the message matching identifier; add the five-tuple information to the target session structure to update the target session structure.

[0081] In some optional implementations of some embodiments, the update unit 504 is further configured to: use the child node of the next hop node that matches the message status identifier in the message status matching tree as the next hop node to be matched, and obtain a list of next hop node identifiers to be matched, wherein the list of next hop node identifiers to be matched is used to identify the message in the cache corresponding to the message.

[0082] In some optional implementations of some embodiments, the updating unit 504 is further configured to: store the depth value of the next hop node matching the message state identifier in the message state matching tree to the node of the state tree corresponding to the message.

[0083] In some optional implementations of some embodiments, the above-mentioned message also includes application information; and the above-mentioned update unit 504 also includes: a storage subunit (not shown in the figure), which is configured to store the application information included in the above-mentioned message in the leaf node of the above-mentioned state tree in response to determining that the next hop node matching the above-mentioned message state identifier is a leaf node of the above-mentioned message state matching tree, so as to determine that the update of the above-mentioned target session structure is completed, wherein the above-mentioned updated target session structure is used to characterize the identification result of the session corresponding to the above-mentioned message.

[0084] It is understood that the units described in the device 500 are similar to those described in the reference Figure 2 Therefore, the operations, features and beneficial effects described above for the method are also applicable to the device 500 and the units included therein, and will not be described in detail here.

[0085] like Figure 6 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0086] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 6 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead. Figure 6 Each block shown in the figure may represent one device, or may represent multiple devices as required.

[0087] In particular, according to some embodiments of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, some embodiments of the present disclosure include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In some such embodiments, the computer program can be downloaded and installed from the network through the communication device 609, or installed from the storage device 608, or installed from the ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of some embodiments of the present disclosure are executed.

[0088] It should be noted that the computer-readable medium in some embodiments of the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In some embodiments of the present disclosure, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In some embodiments of the present disclosure, the computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0089] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0090] The computer-readable medium may be included in the electronic device; or it may exist independently without being installed in the electronic device. The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: extracts information from the message in the cache to obtain five-tuple information, wherein the five-tuple information includes a session structure identifier; matches a target session structure that matches the session structure identifier included in the five-tuple information from a preset session structure library; in response to a successful match, performs message status identification on the message to obtain a message status identifier; and updates the target session structure based on the message status identifier and a preset message status matching tree.

[0091] Computer program code for performing the operations of some embodiments of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0092] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0093] The units described in some embodiments of the present disclosure may be implemented by software or hardware. The units described may also be set in a processor, for example, may be described as: a processor includes an information extraction unit, a selection unit, a message state identification unit and an update unit. The names of these units do not constitute limitations on the units themselves in certain circumstances, for example, the update unit may also be described as "a unit that updates the above-mentioned target session structure based on the above-mentioned message state identifier and a pre-set message state matching tree".

[0094] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0095] The above descriptions are only some preferred embodiments of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present disclosure is not limited to the technical solutions formed by a specific combination of the above-mentioned technical features, but should also cover other technical solutions formed by any combination of the above-mentioned technical features or their equivalent features without departing from the above-mentioned inventive concept. For example, the above-mentioned features are replaced with the technical features with similar functions disclosed in the embodiments of the present disclosure (but not limited to) and the technical solutions formed.

Claims

1. A session identification method, comprising: Extracting information from the message in the cache to obtain five-tuple information, wherein the five-tuple information includes a session structure identifier; Matching a target session structure that matches the session structure identifier included in the quintuple information from a preset session structure library, wherein the target session structure includes a state tree; In response to a successful match, performing message status identification on the message to obtain a message status identifier; Based on the message state identifier and a preset message state matching tree, updating the target session structure, wherein the message state matching tree represents a set of migration conditions of the message in the network; The updating of the target session structure based on the message state identifier and a preset message state matching tree includes: Taking the child nodes of the next hop node matching the message state identifier in the message state matching tree as the next hop node to be matched, and obtaining a list of next hop node identifiers to be matched, wherein the list of next hop node identifiers to be matched is used to identify the message included in the session to which the message belongs in the cache; In response to determining that there is a next hop node identifier in a preset next hop node identifier list that matches the message state identifier, determining a message transmission direction from the message state identifier to the matched next hop node identifier; In response to determining that the message transmission direction is the same as the transmission direction corresponding to the message state identifier, adding the message transmission direction as state information of a child node to the state tree, wherein the state tree is used to record a jump relationship of the message from the message state identifier to the message matching identifier; The five-tuple information is added to the target session structure to update the state tree in the target session structure.

2. The method according to claim 1, wherein: The method further comprises: In response to a match failure, creating an initial session structure; Add the message status identifier of the message to the initial session structure.

3. The method according to claim 1, wherein: The step of performing message status identification on the message to obtain a message status identifier includes: The target character string included in the message is subjected to state identification to generate a state identifier as a message state identification identifier.

4. The method according to claim 1, wherein: The updating of the target session structure based on the message state identifier and the preset message state matching tree further includes: The depth value of the next hop node that matches the message state identifier in the message state matching tree is stored in the node of the state tree corresponding to the message.

5. The method according to claim 1, wherein: The message also includes application information; as well as The method further comprises: In response to determining that the next hop node matching the message status identifier is a leaf node of the message status matching tree, the application information included in the message is stored in the leaf node of the status tree to determine that the update of the target session structure is completed, wherein the updated target session structure is used to characterize the identification result of the session corresponding to the message.

6. A conversation identification device, comprising: An information extraction unit is configured to extract information from the message in the cache to obtain five-tuple information, wherein the five-tuple information includes a session structure identifier; A selection unit is configured to match a target session structure that matches the session structure identifier included in the quintuple information from a preset session structure library, wherein the target session structure includes a state tree; a message state identification unit, configured to, in response to a successful match, perform message state identification on the message to obtain a message state identifier; An updating unit, configured to update the target session structure based on the message state identifier and a preset message state matching tree; The updating of the target session structure based on the message state identifier and a preset message state matching tree includes: Taking the child nodes of the next hop node matching the message state identifier in the message state matching tree as the next hop node to be matched, and obtaining a list of next hop node identifiers to be matched, wherein the list of next hop node identifiers to be matched is used to identify the message included in the session to which the message belongs in the cache; In response to determining that there is a next hop node identifier in a preset next hop node identifier list that matches the message state identifier, determining a message transmission direction from the message state identifier to the matched next hop node identifier; In response to determining that the message transmission direction is the same as the transmission direction corresponding to the message state identifier, adding the message transmission direction as state information of a child node to the state tree, wherein the state tree is used to record a jump relationship of the message from the message state identifier to the message matching identifier; The five-tuple information is added to the target session structure to update the state tree in the target session structure.

7. An electronic device comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 5.

8. A computer readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 5 is implemented.