Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of the embodiments of the present invention, there is provided a method for transmitting session information, as shown in fig. 1, the method includes:
s102, detecting a target operation executed on a target client, wherein the target operation is used for establishing a target session between the target client and a target server corresponding to the target client through a target router;
s104, acquiring session information of the target session;
and S106, sending the session information to the target router, wherein the session information is used for indicating the target router to preferentially forward the data carrying the session information.
Alternatively, in this embodiment, the transmission method of the session information may be applied to a hardware environment formed by thetarget client 202, thetarget router 204, and thetarget server 206 shown in fig. 2. As shown in fig. 2, atarget client 202 is connected to atarget server 206 through atarget router 204, thetarget client 202 detects a target operation performed on thetarget client 202, where the target operation is used to establish a target session between thetarget client 202 and thetarget server 206 through thetarget router 204, thetarget client 202 obtains session information of the target session, and thetarget client 202 sends the session information to thetarget router 204, where the session information is used to instruct thetarget router 204 to preferentially forward data carrying the session information.
Optionally, in this embodiment, the above-mentioned transmission method of the session information may be, but is not limited to, applied in a scenario where the client transmits the session information to the router. The client may be, but not limited to, various types of applications, such as an online education application, an instant messaging application, a community space application, a game application, a shopping application, a browser application, a financial application, a multimedia application, a live application, and the like. In particular, but not limited to, the method may be applied to a scenario in which the client of the game application transmits session information to the router, or may also be applied to a scenario in which the client of the multimedia application transmits session information to the router, so as to improve the accuracy of identifying traffic flow. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the transmission method of the session information may be, but is not limited to, performed by an SDK embedded in the target client. The SDK communicates with the target router via a proprietary protocol negotiated with the target router.
Sdk (software Development kit) is a software Development kit, typically a collection of Development tools used by some software engineers to build application software for a particular software package, software framework, hardware platform, operating system, etc.
Optionally, in this embodiment, the SDK embedded in the target client obtains session information of the session connection each time the target client establishes a session connection with the target server, and sends the session information to the target router, so as to instruct the target router to perform QoS forwarding on data carrying the session information.
QoS (Quality of Service) refers to a network that can provide better Service capability for specified network communication by using various basic technologies, and is a security mechanism of the network, which is a technology for solving the problems of network delay and congestion. Under normal circumstances, if the network is only used for a specific application system without time limitation, no QoS is required, such as Web application, or E-mail settings, etc. But is essential for critical and multimedia applications. When the network is overloaded or congested, QoS can ensure that important traffic is not delayed or dropped while ensuring efficient operation of the network. In this embodiment, the session information is used to enable the router to perform QoS forwarding on data transmitted between the target client and the target server, so that the service of the target client is not affected by delay and is not discarded, and efficient operation of the target client is ensured.
Optionally, in this embodiment, the target operation is used to establish a target session between the target client and the target server through the target router. Such as: starting operation executed on the target client, triggering operation executed on information such as resources or icons in the target client, and the like.
Optionally, in this embodiment, the target router may include, but is not limited to, a home router, and the like.
In an optional implementation manner, taking a target client as a game client as an example, as shown in fig. 3, an SDK embedded in the game client detects a target operation performed on the game client, where the target operation is used to establish a target session between the game client and a game server corresponding to the game client through a target router, acquire session information of the target session, and send the session information to the target router, where the session information is used to instruct the target router to preferentially forward game data carrying the session information.
Therefore, through the steps, when the target operation executed on the target client is detected, the acquired session information of the target session is sent to the target router, and the target router can accurately and preferentially forward the data carrying the session information, so that the accuracy of the target router in identifying the data transmitted between the target client and the target server can be improved, the technical effect of improving the identification accuracy of the service traffic is realized, and the technical problem of low identification accuracy of the service traffic in the related technology is solved.
As an optional scheme, before obtaining the session information of the target session, the method further includes: establishing connection with a target router through an application program API (application programming interface) provided by the target router;
sending session information to the target router includes: and sending the session information to the target router through the API interface.
Optionally, in this embodiment, the target router may provide, but is not limited to, an API interface for the SDK embedded in the target client, and the SDK embedded in the target client communicates with the target router through the API interface.
As an optional scheme, the obtaining session information of the target session includes:
s1, acquiring the version information of the target router through the API;
s2, verifying the legality of the API interface under the condition that the version information is used for indicating that the target router supports the priority forwarding strategy;
and S3, acquiring the session information of the target session when the legality of the API is verified to be legal.
Optionally, in this embodiment, the SDK embedded in the target client may first verify version information of the target router, verify whether the target router supports the online forwarding policy, if so, continue to verify the validity of the API interface provided by the target router, and if so, obtain session information of the target session.
Optionally, in this embodiment, if the target router does not support the preferential forwarding policy, or the API provided by the target router is not legal, the data between the target client and the target server is transmitted in the original data transmission form, or the data between the target client and the target server is identified in the original data identification manner, without performing preferential forwarding conforming to the preferential forwarding policy on the data transmitted between the target client and the target server.
As an optional scheme, the obtaining session information of the target session includes:
s1, reading the network connection corresponding to the target session;
s2, acquiring quintuple information of the network connection, wherein the quintuple information comprises: a source IP address of the network connection, a source port number of the network connection, a destination IP address of the network connection, a destination port number of the network connection, and a transmission protocol used by the network connection;
s3, the quintuple information is determined as the session information.
Optionally, in this embodiment, five tuple information of the network connection established between the target client and the target server is sent to the target router as session information of the target session.
Quintuple is a communication term. Typically a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.
Optionally, in this embodiment, the SDK embedded in the target client sends five-tuple information of the network connection to the target router, and the target router may regard the data carrying the five-tuple information as data transmitted between the target client and the target server, and identify the data of the target client from the received data, so as to forward the data of the target client preferentially.
In an alternative embodiment, taking the target client as the mobile client, the target router as the home router, and the session information as the quintuple information, as shown in fig. 4, the transmission process of the session information includes the following steps:
step 1, after a mobile client is started, initializing the mobile client, including an SDK;
step 2, connecting the SDK with the router API, directly reading the version information of the router, and judging whether the router supports the strategy of identifying the game flow based on the SDK to carry out QOS; if the version acquisition fails or the router version information does not support the QOS strategy, directly skipping QOS guarantee fails;
step 3, on the premise of successfully obtaining the version information and conforming to the QOS strategy, performing the legality verification of the SDK and the router through API authentication between the SDK and the router;
step 4, after the API authentication is successful, the mobile client is connected with the game server, and under the condition of performing service logic processing, the SDK reads the newly-built network connection of the current client and acquires the network connection of communication between the mobile client and the server; if the acquisition fails, the QoS guarantee of the router fails;
and step 5, if the network connection is successfully acquired, the SDK carries out private communication through an API (application program interface) of the router and reports the quintuple information to the router. And the router performs priority forwarding guarantee on the QOS strategy according to the acquired quintuple information.
As an optional scheme, after sending the session information to the target router, the method further includes:
s1, the target router receives the session information;
s2, the target router responds to the indication of the session information to detect whether the received data carries the session information;
and S3, the target router forwards the data carrying the session information with the highest priority.
Optionally, in this embodiment, after receiving the session information, the target router may consider that the data carrying the session information is the data transmitted between the target client and the target server, and detect the data carrying the session information from the received data, so as to forward the data carrying the session information with the highest priority, so as to ensure the forwarding efficiency of the data of the target client.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
According to another aspect of the embodiments of the present invention, there is also provided a session information transmission apparatus for implementing the above session information transmission method, as shown in fig. 5, the apparatus includes:
a detecting module 52, configured to detect a target operation performed on a target client, where the target operation is used to establish a target session between the target client and a target server corresponding to the target client through a target router;
an obtaining module 54, configured to obtain session information of the target session;
and a sending module 56, configured to send session information to the target router, where the session information is used to instruct the target router to preferentially forward the data carrying the session information.
Alternatively, in this embodiment, the above-mentioned transmission apparatus of session information may be applied in a hardware environment formed by thetarget client 202, thetarget router 204 and thetarget server 206 shown in fig. 2. As shown in fig. 2, atarget client 202 is connected to atarget server 206 through atarget router 204, thetarget client 202 detects a target operation performed on thetarget client 202, where the target operation is used to establish a target session between thetarget client 202 and thetarget server 206 through thetarget router 204, thetarget client 202 obtains session information of the target session, and thetarget client 202 sends the session information to thetarget router 204, where the session information is used to instruct thetarget router 204 to preferentially forward data carrying the session information.
Optionally, in this embodiment, the above-mentioned transmission apparatus for session information may be, but is not limited to, applied in a scenario where a client transmits session information to a router. The client may be, but not limited to, various types of applications, such as an online education application, an instant messaging application, a community space application, a game application, a shopping application, a browser application, a financial application, a multimedia application, a live application, and the like. In particular, but not limited to, the method may be applied to a scenario in which the client of the game application transmits session information to the router, or may also be applied to a scenario in which the client of the multimedia application transmits session information to the router, so as to improve the accuracy of identifying traffic flow. The above is only an example, and this is not limited in this embodiment.
Alternatively, in this embodiment, the above-mentioned transmission means of the session information may be, but is not limited to, performed by an SDK embedded in the target client. The SDK communicates with the target router via a proprietary protocol negotiated with the target router.
Sdk (software Development kit) is a software Development kit, typically a collection of Development tools used by some software engineers to build application software for a particular software package, software framework, hardware platform, operating system, etc.
Optionally, in this embodiment, the SDK embedded in the target client obtains session information of the session connection each time the target client establishes a session connection with the target server, and sends the session information to the target router, so as to instruct the target router to perform QoS forwarding on data carrying the session information.
QoS (Quality of Service) refers to a network that can provide better Service capability for specified network communication by using various basic technologies, and is a security mechanism of the network, which is a technology for solving the problems of network delay and congestion. Under normal circumstances, if the network is only used for a specific application system without time limitation, no QoS is required, such as Web application, or E-mail settings, etc. But is essential for critical and multimedia applications. When the network is overloaded or congested, QoS can ensure that important traffic is not delayed or dropped while ensuring efficient operation of the network. In this embodiment, the session information is used to enable the router to perform QoS forwarding on data transmitted between the target client and the target server, so that the service of the target client is not affected by delay and is not discarded, and efficient operation of the target client is ensured.
Optionally, in this embodiment, the target operation is used to establish a target session between the target client and the target server through the target router. Such as: starting operation executed on the target client, triggering operation executed on information such as resources or icons in the target client, and the like.
Optionally, in this embodiment, the target router may include, but is not limited to, a home router, and the like.
In an optional implementation manner, taking a target client as a game client as an example, as shown in fig. 3, an SDK embedded in the game client detects a target operation performed on the game client, where the target operation is used to establish a target session between the game client and a game server corresponding to the game client through a target router, acquire session information of the target session, and send the session information to the target router, where the session information is used to instruct the target router to preferentially forward game data carrying the session information.
Therefore, by the device, when the target operation executed on the target client is detected, the acquired session information of the target session is sent to the target router, and the target router can accurately and preferentially forward the data carrying the session information, so that the accuracy of the target router in identifying the data transmitted between the target client and the target server can be improved, the technical effect of improving the identification accuracy of the service traffic is realized, and the technical problem of low identification accuracy of the service traffic in the related technology is solved.
As an optional solution, the apparatus further includes: the establishing module is used for establishing connection with the target router through an application program API (application program interface) provided by the target router;
the sending module is used for: and sending the session information to the target router through the API interface.
Optionally, in this embodiment, the target router may provide, but is not limited to, an API interface for the SDK embedded in the target client, and the SDK embedded in the target client communicates with the target router through the API interface.
As an optional scheme, the obtaining module includes:
the first obtaining unit is used for obtaining the version information of the target router through the API;
the verification unit is used for verifying the legality of the API interface under the condition that the version information is used for indicating that the target router supports the priority forwarding strategy;
and the second acquisition unit is used for acquiring the session information of the target session under the condition that the legality of the API is verified to be legal.
Optionally, in this embodiment, the SDK embedded in the target client may first verify version information of the target router, verify whether the target router supports the online forwarding policy, if so, continue to verify the validity of the API interface provided by the target router, and if so, obtain session information of the target session.
Optionally, in this embodiment, if the target router does not support the preferential forwarding policy, or the API provided by the target router is not legal, the data between the target client and the target server is transmitted in the original data transmission form, or the data between the target client and the target server is identified in the original data identification manner, without performing preferential forwarding conforming to the preferential forwarding policy on the data transmitted between the target client and the target server.
As an optional scheme, the obtaining module includes:
the reading unit is used for reading the network connection corresponding to the target session;
a third obtaining unit, configured to obtain quintuple information of the network connection, where the quintuple information includes: a source IP address of the network connection, a source port number of the network connection, a destination IP address of the network connection, a destination port number of the network connection, and a transmission protocol used by the network connection;
and a determining unit for determining the quintuple information as the session information.
Optionally, in this embodiment, five tuple information of the network connection established between the target client and the target server is sent to the target router as session information of the target session.
Quintuple is a communication term. Typically a source IP address, a source port, a destination IP address, a destination port, and a transport layer protocol.
Optionally, in this embodiment, the SDK embedded in the target client sends five-tuple information of the network connection to the target router, and the target router may regard the data carrying the five-tuple information as data transmitted between the target client and the target server, and identify the data of the target client from the received data, so as to forward the data of the target client preferentially.
The application environment of the embodiment of the present invention may refer to the application environment in the above embodiments, but is not described herein again. The embodiment of the invention provides an optional specific application example of the connection method for implementing the real-time communication.
As an alternative embodiment, the above-mentioned transmission method of session information can be applied, but not limited to, in the scenario of implementing router QOS based on SDK identification game traffic as shown in fig. 6. In this scenario, it is necessary to perform a priority forwarding process on the game traffic, that is, perform a QOS priority process on the game traffic on the router. If this requirement is to be fulfilled, the requirement to be solved first: that is, the flow of the hand trip needs to be identified in the router, and the priority forwarding process of the router QOS is carried out.
In this embodiment, the function of identifying the traffic of the hand trip is realized by the router in a manner based on the communication between the hand trip SDK and the router. By embedding a customized SDK into a game client and communicating the SDK with a router, the SDK identifies quintuple information (SrcIP + SrcPort + DstIP + DstPort + Protocol) of game flow when session connection is established each time, the quintuple information is transmitted to the router through a private Protocol negotiated by the SDK and the router, the router is enabled to carry out QOS through the quintuple information, and the router can identify the communication flow between the game client and a server.
In the embodiment, the private communication between the mobile client and the API on the home router is mainly involved. When the mobile client side is connected with the server, the SDK only needs to be initialized, and then the quintuple connection information of the current mobile client side and the server side is obtained. And reporting the quintuple information to the router through a client SDK and a router API communication interface. After the router acquires the quintuple information of the mobile client and the server, the router performs the highest priority forwarding according to the quintuple in the QOS strategy of the router. Therefore, the game flow of the hand game is optimally ensured to reach the server.
According to still another aspect of the embodiments of the present invention, there is also provided an electronic apparatus for implementing the transmission of the session information, as shown in fig. 7, the electronic apparatus including: one or more processors 702 (only one of which is shown in the figure), in which a computer program is stored, amemory 704, in which asensor 706, anencoder 708 and a transmission means 710 are arranged to carry out the steps of any of the above-described method embodiments by means of the computer program.
Optionally, in this embodiment, the electronic apparatus may be located in at least one network device of a plurality of network devices of a computer network.
Optionally, in this embodiment, the processor may be configured to execute the following steps by a computer program:
s1, detecting a target operation executed on the target client, wherein the target operation is used for establishing a target session between the target client and a target server corresponding to the target client through the target router;
s2, acquiring the session information of the target session;
and S3, sending the session information to the target router, wherein the session information is used for indicating the target router to preferentially forward the data carrying the session information.
Alternatively, it can be understood by those skilled in the art that the structure shown in fig. 7 is only an illustration, and the electronic device may also be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 7 is a diagram illustrating a structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 7, or have a different configuration than shown in FIG. 7.
Thememory 702 may be used to store software programs and modules, such as program instructions/modules corresponding to the session information transmission method and apparatus in the embodiments of the present invention, and theprocessor 704 executes various functional applications and data processing by running the software programs and modules stored in thememory 702, that is, implementing the control method of the target component described above. Thememory 702 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, thememory 702 can further include memory located remotely from theprocessor 704, which can be connected to the terminal over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Thetransmission device 710 is used for receiving or transmitting data via a network. Examples of the network may include a wired network and a wireless network. In one example, thetransmission device 710 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, thetransmission device 710 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
In particular, thememory 702 is used for storing application programs.
Embodiments of the present invention also provide a storage medium having a computer program stored therein, wherein the computer program is arranged to perform the steps of any of the above method embodiments when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store a computer program for executing the steps of:
s1, detecting a target operation executed on the target client, wherein the target operation is used for establishing a target session between the target client and a target server corresponding to the target client through the target router;
s2, acquiring the session information of the target session;
and S3, sending the session information to the target router, wherein the session information is used for indicating the target router to preferentially forward the data carrying the session information.
Optionally, the storage medium is further configured to store a computer program for executing the steps included in the method in the foregoing embodiment, which is not described in detail in this embodiment.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.