Detailed Description
In order that the above-recited objects, features and advantages of the present application will be more clearly understood, a more particular description of the application will be rendered by reference to the appended drawings and appended detailed description. The embodiments of the present application and the features in the embodiments may be combined with each other without collision.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present application, and the described embodiments are merely some, rather than all, of the embodiments of the present application.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein in the description of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application.
It is further intended that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The term "at least one" in the present application means one or more, and "a plurality" means two or more. "and/or" describes an association relationship of associated objects, meaning that there may be three relationships, e.g., A and/or B may mean that A alone exists, while A and B together exist, and B alone exists, where A, B may be singular or plural. The terms "first," "second," "third," "fourth" and the like in the description and in the claims and drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order.
In embodiments of the application, words such as "exemplary" or "such as" are used to mean serving as an example, instance, or illustration. Any embodiment or design described herein as "exemplary" or "e.g." in an embodiment should not be taken as preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "such as" is intended to present related concepts in a concrete fashion.
For ease of understanding, a description of some of the concepts related to the embodiments of the application are given by way of example for reference.
TCP (Transmission Control Protocol ) a connection-oriented, secure, byte-stream-based transport layer communication protocol. When the TCP establishes a connection, the party opening the socket and monitoring is called a server, and the party opening the socket and actively initiating the connection is called a client. The process of establishing connection needs three times of data transmission, which is called three-time handshake, wherein the first handshake comprises that a client enters a SYN-SENT state and then sends a SYN message, the seq value in the message is a random value generated according to time, the second handshake comprises that a server side enters a SYN-RCVD state after receiving the SYN message and then returns a SYN-ACK message, the seq value is the random value of the server side, the ACK value is added by one to the received SYN message seq, and the third handshake comprises that the client side enters an ESTABLISHED state after receiving the SYN-ACK message of the server side, the connection is ESTABLISHED, and then the ACK message is SENT to the server side.
And the application layer protocol defines how application program processes running on different end systems mutually transmit messages. The application layer protocols include a Domain name system (Domain NAME SYSTEM, DNS) for implementing a network service for mapping a name to an IP address of a network device, a simple mail transfer Protocol (SIMPLE MAIL TRANSFER Protocol, SMTP) for implementing an electronic mailbox transfer function, a hypertext transfer Protocol (Hyper Text Transfer Protocol, HTTP) for implementing a WWW service, a simple network management Protocol (simple Network Management Protocol, SNMP) for managing and monitoring the network device, and a Telnet Protocol (Telnet) for implementing a Telnet function. It is understood that the application layer protocol also includes other protocols, not listed here.
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a method for identifying a session direction according to an embodiment of the application. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs. The method for identifying the conversation direction of the present application can be applied to a conversation direction identifying device, but is not limited thereto, and the embodiment of the present application is not limited thereto.
The specific flow of this embodiment is shown in fig. 1, and includes the following steps:
Step 101, after two devices establish session connection, obtaining messages transmitted by the two devices, where each message carries source IP information, source port information, destination IP information, destination port information, and protocol type information.
Specifically, the source IP information is a source IP address, i.e., an IP address of a computer that sends the data packet, for identifying a source of the data packet. The source port information is a source port number, i.e. a port number used by a computer sending the data packet, for identifying which application the data packet is sent from, the destination IP information is a destination IP address, i.e. an IP address of a computer receiving the data packet, for determining a destination of the data packet, the destination port information is a destination port number, i.e. a port number used by a computer receiving the data packet, for identifying which application the data packet should be submitted to for processing, and the protocol type information includes a transmission protocol, i.e. a protocol used when sending the data packet, such as TCP, UDP, etc.
In some embodiments, after two devices establish session connection, messages transmitted by the two devices are cached one by one. Specifically, in the process that two devices mutually transmit messages, the session direction recognition device caches the messages one by one according to the time sequence of message transmission.
Step 102, detecting whether the first destination IP information and the first destination port information of the obtained first message exist in the information cache table, executing step 103 if the first destination IP information and the first destination port information are detected to exist in the information cache table, otherwise executing step 104.
Specifically, the information cache table stores historical destination ID information of a plurality of servers and at least one historical destination port information corresponding to each historical destination ID information.
It can be understood that the information cache table in this embodiment is a server identification cache table, where the server identification cache table stores the history destination ID information and the history destination port information corresponding to the history confirmed message receiver, that is, the history IP address and the history port number of the server. It should be noted that, the IP address of one server may correspond to a plurality of port numbers.
Step 103, determining that the device corresponding to the first destination IP information is a message receiver, and determining that the device corresponding to the first source IP information of the first message is a message sender.
Step 104, detecting whether the session carried out by the two devices is a TCP session according to the first protocol type information of the first message, and determining a message receiver and a message sender in the two devices according to the acquired protocol type information of the first N messages when the session carried out by the two devices is detected to be the TCP session.
For ease of understanding, the following describes how the present application implements session direction identification in conjunction with fig. 2:
Referring to fig. 2, an application scenario diagram for session direction identification according to an embodiment of the present application is shown. The intranet equipment establishes session connection with the external network equipment through the core switch, and the session direction identification device is in communication connection with the core switch and is used for acquiring messages transmitted by the intranet equipment and the external network equipment when in session.
How to detect whether the session performed by the two devices is a TCP session according to the first protocol type information, and how to determine the message receiver and the message sender in the two devices according to the protocol type information of the first N messages are described in detail in the following embodiments, so that repetition is avoided, and details are not repeated here.
Compared with the related art, the embodiment of the application has the advantages that by establishing the information cache table, because the information cache table stores the historical destination ID information of a plurality of servers and at least one historical destination port information corresponding to each historical destination ID information, when the first destination IP information and the first destination port information are detected to exist in the information cache table, the first message is indicated to be sent to the server through the client, that is, the equipment corresponding to the first destination IP information can be determined to be a message receiver, and the equipment corresponding to the first source IP information is a message sender. On one hand, the method can rapidly detect the message sender and the message receiver based on the information carried by the first message and the information cache table, so that the efficiency of identifying the conversation direction is improved, and on the other hand, the information cache table stores historical data when historical equipment carries out conversation, so that the accuracy of identifying the conversation direction is improved. Under the condition that the first destination IP information and the first destination port information are detected not to exist in the information cache table, as each message carries protocol type information, whether the session carried out by two devices is a TCP session or not can be detected through the first protocol type information of the first message, and under the condition that the session carried out by the two devices is the TCP session, a message receiver and a message sender are determined based on the acquired protocol type information of the first N messages, and when the message receiver and the message sender cannot be determined based on the first destination IP information and the first destination port information, the message receiver and the message sender can be determined through the characteristics of the TCP session, so that the reliability of the session direction identification method is improved, and the session direction identification method provided by the application can accurately detect the session direction under different scenes.
Referring to fig. 3, fig. 3 is a flowchart illustrating steps of a method for identifying a session direction according to an embodiment of the application. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs. The session direction recognition method may be applied to the aforementioned session direction recognition device, but is not limited thereto, and the embodiment of the present application is not limited thereto.
This embodiment is a specific description of the foregoing embodiment, and mainly describes how to detect whether a session performed by two devices is a TCP session according to the first protocol type information, and how to determine a message receiver and a message sender in the two devices according to the protocol type information of the first N messages. By the method, the application scene of the conversation direction identification method can be enlarged, so that the reliability of the conversation direction identification method is further improved.
The specific flow of this embodiment is shown in fig. 3, and includes the following steps:
step 201, after two devices establish session connection, buffering the messages transmitted by the two devices one by one.
Step 202, detecting whether the first destination IP information and the first destination port information of the obtained first message exist in the information cache table, executing step 203 when detecting that the first destination IP information and the first destination port information exist in the information cache table, otherwise executing step 204.
Step 203, determining that the device corresponding to the first destination IP information is a message receiver, and the device corresponding to the first source IP information of the first message is a message sender.
Steps 201 to 203 of the present embodiment are similar to steps 101 to 103 of the foregoing embodiments, and are not repeated here.
Step 204, in the case that the session performed by the two devices is detected to be a TCP session according to the first protocol type information, detecting whether a SYN message or a SYN-ACK message exists in the first N messages according to the protocol type information of the first N messages, and executing step 205 in the case that the SYN message or the SYN-ACK message exists is detected, otherwise, executing step 206.
Specifically, N is an integer greater than 1.
In some embodiments, it is detected whether a SYN message or a SYN-ACK message exists in the first 3 messages according to the transmission protocol of the buffered first 3 messages.
Step 205, executing a session direction determination policy, where the session direction determination policy includes determining, when a SYN message is detected, a device corresponding to second destination IP information of the SYN message as a message receiver, and determining, when a SYN-ACK message is detected, a device corresponding to third destination IP information of the SYN-ACK message as a message sender, and determining, when a SYN-ACK message is detected, a device corresponding to third source IP information of the SYN-ACK message as a message receiver.
And 206, continuing to buffer the rest messages of the session carried out by the two devices.
Step 207, detecting whether there is SYN message or SYN-ACK message in the rest message, and executing the session direction determination strategy when detecting that there is SYN message or SYN-ACK message.
In some embodiments, after detecting a SYN message or a SYN-ACK message in the remaining messages, the destination IP information and destination port information corresponding to the determined message receiver are stored in the information cache table. By the method, when two identical devices perform the conversation in the same conversation direction next time, the message sender and the message receiver can be rapidly and accurately determined according to the detection mode in the step 202, so that the conversation direction identification efficiency is further improved.
Compared with the related art, the embodiment of the application has the advantages that by establishing the information cache table, because the information cache table stores the historical destination ID information of a plurality of servers and at least one historical destination port information corresponding to each historical destination ID information, when the first destination IP information and the first destination port information are detected to exist in the information cache table, the first message is indicated to be sent to the server through the client, that is, the equipment corresponding to the first destination IP information can be determined to be a message receiver, and the equipment corresponding to the first source IP information is a message sender. On one hand, the method can rapidly detect the message sender and the message receiver based on the information carried by the first message and the information cache table, so that the efficiency of identifying the conversation direction is improved, and on the other hand, the information cache table stores historical data when historical equipment carries out conversation, so that the accuracy of identifying the conversation direction is improved. Under the condition that the first destination IP information and the first destination port information are detected not to exist in the information cache table, as each message carries protocol type information, whether the session carried out by two devices is a TCP session or not can be detected through the first protocol type information of the first message, and under the condition that the session carried out by the two devices is the TCP session, a message receiver and a message sender are determined based on the acquired protocol type information of the first N messages, and when the message receiver and the message sender cannot be determined based on the first destination IP information and the first destination port information, the message receiver and the message sender can be determined through the characteristics of the TCP session, so that the reliability of the session direction identification method is improved, and the session direction identification method provided by the application can accurately detect the session direction under different scenes.
Referring to fig. 4, fig. 4 is a flowchart illustrating steps of a method for identifying a session direction according to an embodiment of the application. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs. The session direction recognition method may be applied to the aforementioned session direction recognition device, but is not limited thereto, and the embodiment of the present application is not limited thereto.
This embodiment is a further improvement over the previous embodiment in that in this embodiment, it is determined how to determine the session direction between two devices if it is detected that the session performed by the two devices is not a TCP session or if it is detected that the SYN message or the SYN-ACK message is not present in the remaining message. By the method, the application scene of the conversation direction identification method can be further expanded, so that the reliability of the conversation direction identification method is further improved.
The specific flow of this embodiment is shown in fig. 4, and includes the following steps:
Step 301, after two devices establish session connection, buffering the messages transmitted by the two devices one by one.
Step 302, detecting whether the first destination IP information and the first destination port information of the obtained first message exist in the information cache table, executing step 303 if the first destination IP information and the first destination port information are detected to exist in the information cache table, otherwise, executing step 304.
Step 303, determining that the device corresponding to the first destination IP information is a message receiver, and the device corresponding to the first source IP information of the first message is a message sender.
Step 304, detecting whether the session performed by the two devices is a TCP session according to the first protocol type information of the first message, executing step 305 if the session performed by the two devices is detected to be a TCP session, otherwise executing step 310.
Step 305, detecting whether there is a SYN message or a SYN-ACK message in the first N messages according to the protocol type information of the first N messages, executing step 306 if there is a SYN message or a SYN-ACK message, otherwise executing step 310.
Step 306, executing a session direction determining policy, where the session direction determining policy includes determining that a device corresponding to second destination IP information of the SYN message is a message receiver when it is detected that the SYN message exists, determining that a device corresponding to second source IP information of the SYN message is a message sender when it is detected that the SYN-ACK message exists, and determining that a device corresponding to third destination IP information of the SYN-ACK message is a message sender when it is detected that the SYN-ACK message exists, and determining that a device corresponding to third source IP information of the SYN-ACK message is a message receiver.
Step 307, continue to buffer the rest of the session messages of the two devices.
Step 308, detecting whether there is SYN message or SYN-ACK message in the rest message, executing step 309 if there is SYN message or SYN-ACK message, otherwise executing step 310.
Step 309, a session direction determination policy is executed.
Step 310, determining the interaction characteristics of the message.
In some embodiments, the application layer protocols HTTP, DNS, SMTP, POP, IMAP, TLS, TELNET, FTP, SNMP, DHCP, SAMBA, TFTP, NTP, LDAP, MYSQL, PGSQL, etc. are based on their protocol characteristics, and the client initiates a related request connection or operation, and the server responds, so that after the protocol of the session message is identified, the client and the server can be analyzed and confirmed based on the interaction characteristics of the message.
Step 311, detecting whether the protocol of the session is an application layer protocol according to the interaction characteristics, and executing step 312 if the protocol of the session is detected as the application layer protocol, otherwise executing step 313.
Step 312, the message receiver and the message sender are identified according to the interaction characteristics.
In some embodiments, after identifying the message receiver and the message sender according to the interaction characteristics, the determined destination IP information and destination port information corresponding to the message receiver are stored in an information cache table. By the method, when two identical devices perform the conversation in the same conversation direction next time, the message sender and the message receiver can be rapidly and accurately determined according to the detection mode in the step 302, so that the conversation direction identification efficiency is further improved.
For easy understanding, the following describes how to identify the message receiver and the message sender according to the interaction characteristics:
1. In the case that the application layer protocol is the HTTP protocol, since the client sends the request of HTTP GET, POST, etc. in the HTTP protocol interaction, the server responds similar to HTTP 1.1.200 OK after receiving and processing the relevant request. Through the interaction process, the party initiating the HTTP GET, POST and other requests can be confirmed to be the client, namely the message sender, and the data receiving end is the server, namely the message receiver.
2. In the case that the application layer protocol is DNS protocol, since the client sends a request such as DNS query in DNS protocol interaction, the server responds DNS query response after receiving and processing the related request. Through the interaction process, the party initiating the request such as the DNS query is confirmed to be the client, and the data receiving end is the server.
3. In the case that the application layer protocol is mail (SMTP, POP3, IMAP) protocol, since in the mail protocol interaction, after the TCP connection is successful, the server will send the mail server state, then the client initiates operations such as authentication request, and the server responds after receiving the request. Based on the interactive operation, the party which can confirm the request according to the interactive command is the client, and the data receiving end is the server.
Step 313, when it is detected that the first destination IP information exists in the information cache table and the first destination port information is smaller than the first source port information, determining that the device corresponding to the first destination IP information and the first destination port information is a message receiver, and the device corresponding to the first source IP information and the first source port information is a message sender.
Compared with the related art, the embodiment of the application has the advantages that by establishing the information cache table, because the information cache table stores the historical destination ID information of a plurality of servers and at least one historical destination port information corresponding to each historical destination ID information, when the first destination IP information and the first destination port information are detected to exist in the information cache table, the first message is indicated to be sent to the server through the client, that is, the equipment corresponding to the first destination IP information can be determined to be a message receiver, and the equipment corresponding to the first source IP information is a message sender. On one hand, the method can rapidly detect the message sender and the message receiver based on the information carried by the first message and the information cache table, so that the efficiency of identifying the conversation direction is improved, and on the other hand, the information cache table stores historical data when historical equipment carries out conversation, so that the accuracy of identifying the conversation direction is improved. Under the condition that the first destination IP information and the first destination port information are detected not to exist in the information cache table, as each message carries protocol type information, whether the session carried out by two devices is a TCP session or not can be detected through the first protocol type information of the first message, and under the condition that the session carried out by the two devices is the TCP session, a message receiver and a message sender are determined based on the acquired protocol type information of the first N messages, and when the message receiver and the message sender cannot be determined based on the first destination IP information and the first destination port information, the message receiver and the message sender can be determined through the characteristics of the TCP session, so that the reliability of the session direction identification method is improved, and the session direction identification method provided by the application can accurately detect the session direction under different scenes.
Referring to fig. 5, fig. 5 is a flowchart illustrating steps of a method for identifying a session direction according to an embodiment of the application. The order of the steps in the flowchart may be changed and some steps may be omitted according to various needs. The session direction recognition method may be applied to the aforementioned session direction recognition device, but is not limited thereto, and the embodiment of the present application is not limited thereto.
The present embodiment is a further improvement of the foregoing embodiment, and is mainly improved in that in the present embodiment, in the case where it is detected that the first destination IP information does not exist in the information cache table, or the first destination port information is greater than or equal to the first source port information, the identification of the session direction is performed. By the method, the application scene of the conversation direction identification method can be enlarged, so that the reliability of the conversation direction identification method is further improved.
The specific flow of this embodiment is shown in fig. 5, and includes the following steps:
Step 401, after two devices establish session connection, buffering the messages transmitted by the two devices one by one.
Step 402, detecting whether the first destination IP information and the first destination port information of the obtained first message exist in the information cache table, executing step 403 if the first destination IP information and the first destination port information are detected to exist in the information cache table, otherwise executing step 404.
Step 403, determining that the device corresponding to the first destination IP information is a message receiver, and the device corresponding to the first source IP information of the first message is a message sender.
Step 404, detecting whether the session carried out by the two devices is a TCP session according to the first protocol type information of the first message, executing step 405 if the session carried out by the two devices is detected to be the TCP session, otherwise executing step 410.
Step 405, according to the protocol type information of the first N buffered messages, detecting whether there is a SYN message or a SYN-ACK message in the first N messages, executing step 406 if there is a SYN message or a SYN-ACK message detected, otherwise, executing step 410.
Step 406, executing a session direction determination policy, where the session direction determination policy includes determining, when a SYN message is detected, a device corresponding to second destination IP information of the SYN message as a message receiver, and determining, when a SYN-ACK message is detected, a device corresponding to third destination IP information of the SYN-ACK message as a message sender, and determining, when a SYN-ACK message is detected, a device corresponding to third source IP information of the SYN-ACK message as a message receiver.
Step 407, continuing to buffer the rest messages of the session carried out by the two devices.
Step 408, detecting whether there is a SYN message or a SYN-ACK message in the remaining messages, executing step 409 if there is a SYN message or a SYN-ACK message, otherwise executing step 410.
Step 409, a session direction determination policy is executed.
Step 410, determining the interaction characteristics of the message.
Step 411, detecting whether the protocol of the session is an application layer protocol according to the interaction characteristics, if so, executing step 412, otherwise, executing step 413.
Step 412, identifying the message receiver and the message sender according to the interaction characteristics.
Step 413, detecting whether the first destination IP information exists in the information cache table and whether the first destination port information is smaller than the first source port information of the first packet, if so, executing step 414, otherwise, executing step 415.
Step 414, determining that the device corresponding to the first destination IP information and the first destination port information is a message receiver, and the device corresponding to the first source IP information and the first source port information is a message sender.
Step 415, detecting whether the first destination port information is greater than a first preset threshold and the first source port information is less than a second preset threshold, executing step 416 if the first destination port information is detected to be greater than the first preset threshold and the first source port information is detected to be less than the second preset threshold, otherwise executing step 417.
Specifically, the first preset threshold is greater than the second preset threshold.
In some embodiments, the first preset threshold value is 30000 and the second preset threshold value is 10000. Comparing whether the first destination port information is larger than a first preset threshold value and whether the first source port information is smaller than a second preset threshold value, namely comparing whether the first destination port number is larger than 30000 and whether the first source port number is smaller than 10000.
Step 416, determining the device corresponding to the first destination IP information and the first destination port information as a message sender, and the device corresponding to the first source IP information and the first source port information as a message receiver.
In step 417, it is determined that the device corresponding to the first destination IP information and the first destination port information is a message receiver, and the device corresponding to the first source IP information and the first source port information is a message sender.
Compared with the related art, the embodiment of the application has the advantages that by establishing the information cache table, because the information cache table stores the historical destination ID information of a plurality of servers and at least one historical destination port information corresponding to each historical destination ID information, when the first destination IP information and the first destination port information are detected to exist in the information cache table, the first message is indicated to be sent to the server through the client, that is, the equipment corresponding to the first destination IP information can be determined to be a message receiver, and the equipment corresponding to the first source IP information is a message sender. On one hand, the method can rapidly detect the message sender and the message receiver based on the information carried by the first message and the information cache table, so that the efficiency of identifying the conversation direction is improved, and on the other hand, the information cache table stores historical data when historical equipment carries out conversation, so that the accuracy of identifying the conversation direction is improved. Under the condition that the first destination IP information and the first destination port information are detected not to exist in the information cache table, as each message carries protocol type information, whether the session carried out by two devices is a TCP session or not can be detected through the first protocol type information of the first message, and under the condition that the session carried out by the two devices is the TCP session, a message receiver and a message sender are determined based on the acquired protocol type information of the first N messages, and when the message receiver and the message sender cannot be determined based on the first destination IP information and the first destination port information, the message receiver and the message sender can be determined through the characteristics of the TCP session, so that the reliability of the session direction identification method is improved, and the session direction identification method provided by the application can accurately detect the session direction under different scenes.
Based on the same ideas of the session direction identification method in the above embodiment, the present application also provides a session direction identification device that can be used to perform the above-described session direction identification method. For ease of illustration, only those portions of the structural schematic diagram of an embodiment of the session direction identification apparatus are shown, and those skilled in the art will appreciate that the illustrated structure is not limiting of the apparatus and may include more or fewer components than illustrated, or may combine certain components, or a different arrangement of components.
As shown in fig. 6, the session direction identifying apparatus 60 includes an acquisition module 601, a first detection module 602, a determination module 603, and a second detection module 604. In some embodiments, the modules described above may be programmable software instructions stored in memory and executable by a processor call. It will be appreciated that in other embodiments, the modules may be program instructions or firmware (firmware) that are resident in the processor.
An obtaining module 601, configured to obtain messages transmitted by two devices after session connection is established between the two devices, where each message carries source IP information, source port information, destination IP information, destination port information, and protocol type information;
A first detection module 602, configured to detect whether first destination IP information and first destination port information of an acquired first packet exist in an information cache table, where the information cache table stores a plurality of historical destination ID information and at least one historical destination port information corresponding to each of the historical destination ID information;
A determining module 603, configured to determine that, when the first detecting module 602 detects that the first destination IP information and the first destination port information exist in the information cache table, a device corresponding to the first destination IP information is a message receiver, and a device corresponding to the first source IP information of the first message is a message sender;
a second detection module 604, configured to detect, when the first detection module 602 detects that the first destination IP information and the first destination port information do not exist in the information cache table, whether a session performed by two devices is a TCP session according to first protocol type information of a first packet;
in the case that the second detection module 604 detects that the session performed by the two devices is a TCP session, the determining module 603 is further configured to determine the message receiving party and the message sending party in the two devices according to the acquired protocol type information of the first N messages, where N is an integer greater than 1.
Referring to fig. 7, fig. 7 is a schematic diagram of an electronic device according to an embodiment of the application.
The electronic device 100 comprises a memory 20, a processor 30 and a computer program 40 stored in the memory 20 and executable on the processor 30. The steps of the above-mentioned session direction identification method embodiment, for example, steps 101 to 104 shown in fig. 1, are implemented when the processor 30 executes the computer program 40.
By way of example, the computer program 40 may likewise be partitioned into one or more modules/units, which are stored in the memory 20 and executed by the processor 30. One or more of the modules/units may be a series of computer program instruction segments capable of performing particular functions to describe the execution of the computer program 40 in the electronic device 100. For example, it may be divided into an acquisition module 601, a first detection module 602, a determination module 603, and a second detection module 604 as shown.
It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the electronic device 100 and does not constitute a limitation of the electronic device 100, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the electronic device 100 may further include an input-output device, a network access device, a bus, etc.
The Processor 30 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (DIGITAL SIGNAL Processor, DSP), application SPECIFIC INTEGRATED Circuit (ASIC), off-the-shelf Programmable gate array (Field-Programmable GATE ARRAY, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor, a single-chip microcomputer or the processor 30 may be any conventional processor or the like.
The memory 20 may be used to store computer programs 40 and/or modules/units, and the processor 30 implements various functions of the electronic device 100 by running or executing the computer programs and/or modules/units stored in the memory 20, as well as invoking data stored in the memory 20. The memory 20 may mainly include a storage program area that may store an operating system, application programs required for at least one function (such as a sound playing function, an image playing function, etc.), etc., and a storage data area that may store data created according to the use of the electronic device 100 (such as audio data), etc. In addition, the memory 20 may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart memory card (SMART MEDIA CARD, SMC), secure Digital (SD) card, flash memory card (FLASH CARD), at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device.
The integrated modules/units of the electronic device 100 may be stored in a storage medium if implemented in the form of software functional units and sold or used as a stand-alone product. Based on such understanding, the present application may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a storage medium, and the computer program may implement the steps of each method embodiment when executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, executable files or in some intermediate form, etc. The storage medium may include any entity or device capable of carrying computer program code, recording medium, USB flash disk, removable hard disk, magnetic disk, optical disk, computer Memory, read-Only Memory (ROM), random access Memory (RAM, random Access Memory), electrical carrier wave signals, telecommunications signals, software distribution media, and so forth. It should be noted that the content of the storage medium may be appropriately increased or decreased according to the requirements of the patent practice, for example, the storage medium does not include the electric carrier signal and the telecommunication signal according to the patent practice.
The session direction identifying method, apparatus, electronic device and storage medium provided by the present application have been described in detail, and specific examples are used herein to illustrate the principles and embodiments of the present application, and the description of the above examples is only for aiding in understanding the method and core concept of the present application, and meanwhile, for those skilled in the art, according to the concept of the present application, there are variations in the specific embodiments and application scope, and in summary, the present disclosure should not be construed as limiting the present application.