VPN communication method and device and computer readable storage medium

By obtaining the mapping relationship between the terminal device application and VPN type and starting the target tunnel, the problem of different types of VPN transmission requirements is solved, and the user experience and the stability of VPN applications are improved.

CN119232524APending Publication Date: 2024-12-31ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310804557.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-30
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

In the prior art, terminal devices can only communicate through tunnels of a specified type, and cannot meet the transmission needs of different types of VPNs, resulting in poor user experience.

Method used

By obtaining the mapping relationship between the terminal device application and the VPN type, starting a tunnel of the target VPN type, and controlling the target application to use the tunnel for communication to meet the transmission needs of different types of VPNs.

Benefits of technology

It improves the user's experience of using VPN, realizes adaptive communication of different types of VPN applications, meets the transmission needs of various VPN tunnels, and simplifies the router's control process for different VPN applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119232524A_ABST
    Figure CN119232524A_ABST
Patent Text Reader

Abstract

The invention discloses a VPN (Virtual Private Network) communication method and device and a computer readable storage medium, relates to the technical field of communication, and can meet the transmission requirements of different types of VPNs of terminal equipment so as to improve the VPN use experience of a user. The method comprises the steps that under the condition that a target application is started, a first mapping relation is acquired, and the first mapping relation indicates a mapping relation between an application using a virtual private network (VPN) in at least one application of terminal equipment and a VPN type; under the condition that the first mapping relationship indicates that the target VPN type corresponding to the target application exists, starting a target VPN tunnel corresponding to the target VPN type; and controlling the target application to communicate by using the target VPN tunnel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a VPN communication method, device, and computer-readable storage medium. Background Art

[0002] A Virtual Private Network (VPN) is a dedicated virtual network built on a public network. Any two nodes can communicate through a tunnel in a VPN network, which can effectively ensure the security of communication.

[0003] Currently, terminal devices can only communicate through specified types of tunnels, but different types of VPNs may have different transmission requirements. If the above method is used, the transmission requirements of applications using different types of VPNs cannot be met, resulting in a poor user experience when using VPN. Summary of the invention

[0004] The embodiments of the present application provide a VPN communication method, device, and computer-readable storage medium, which can meet the transmission requirements of different types of VPNs of terminal devices, thereby improving the user experience of using VPN.

[0005] On the one hand, a VPN communication method is provided, comprising: when a target application is started, obtaining a first mapping relationship, the first mapping relationship indicating a mapping relationship between an application using a virtual private network VPN and a VPN type in at least one application of a terminal device; when the first mapping relationship indicates that there is a target VPN type corresponding to the target application, starting a target VPN tunnel corresponding to the target VPN type; and controlling the target application to communicate using the target VPN tunnel.

[0006] On the other hand, a communication node is provided, comprising: one or more memories and one or more processors; the memories and the processors are coupled; the one or more memories are used to store computer programs; and the one or more processors implement the VPN communication method of any of the above embodiments when executing the computer programs.

[0007] On the other hand, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the VPN communication method of any of the above embodiments is implemented.

[0008] In an embodiment of the present application, when a target application is started, a mapping relationship between an application using a VPN and a VPN type in at least one application of a terminal device is obtained through a first mapping relationship, and when the first mapping relationship indicates that there is a target VPN type corresponding to the target application, a target VPN tunnel corresponding to the target VPN type is started, and the target application is controlled to communicate using the target VPN tunnel corresponding to the target VPN type, so that applications using different types of VPNs can adaptively use the VPN tunnel corresponding to the application to communicate, so as to meet the transmission requirements of applications using different types of VPNs for the VPN tunnel, thereby improving the user experience of using VPN. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solution in the present application, the drawings required for use in some embodiments of the present application will be briefly introduced below. Obviously, the drawings described below are only drawings of some embodiments of the present application. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0010] Figure 1 A schematic diagram of the structure of a communication system provided in some embodiments of the present application;

[0011] Figure 2 A schematic diagram of the structure of a terminal device provided in some embodiments of the present application;

[0012] Figure 3 A flowchart of a VPN communication method provided in some embodiments of the present application;

[0013] Figure 4 A flowchart of another VPN communication method provided in some embodiments of the present application;

[0014] Figure 5 A flowchart of another VPN communication method provided in some embodiments of the present application;

[0015] Figure 6 A flowchart of another VPN communication method provided in some embodiments of the present application;

[0016] Figure 7 A flowchart of another VPN communication method provided in some embodiments of the present application;

[0017] Figure 8 A schematic diagram of the structure of a communication device provided in some embodiments of the present application;

[0018] Fig. 9 A schematic diagram of the structure of another communication device provided for some embodiments of the present application. DETAILED DESCRIPTION

[0019] The following will be combined with the drawings in this application to clearly and completely describe the technical solutions in this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0020] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0021] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features.

[0022] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more.

[0023] A VPN network is a functional network built on the basis of a public basic network. The tunnel between any two nodes of a VPN network is a dedicated logical link built on the basis of a network platform (e.g., the Internet, asynchronous transfer mode (ATM), frame relay) provided by a service provider of the public basic network, and the above logical link is carried on an end-to-end physical link in the above network platform. In a VPN network, when any two nodes communicate based on a tunnel, the above data needs to be processed securely to ensure the integrity, authenticity, and privacy of the data, thus overcoming the weakness of the public network's lack of confidentiality. In addition, since the VPN network is built on the basis of a public basic network, the deployment cost of the VPN network is also relatively low.

[0024] As VPN networks mature, the number of terminal devices that support VPNs also increases. For example, in order to ensure data security, terminal devices can communicate through VPN networks. However, in general technologies, terminal devices can only choose to activate one type of VPN tunnel, so that the business data of all applications using VPN in the terminal device are communicated based on the VPN type tunnel. As the demand for terminal devices to use VPN increases, different types of VPNs may have different requirements. If the above method is used, the business data of applications of different VPNs will be transmitted through the same VPN type tunnel, and the requirements cannot be met, resulting in a poor user experience when using VPN.

[0025] In addition, since the actual application is not downloaded to the router, the actual application is controlled by other connected devices. Therefore, if the router wants to control applications using different types of VPNs separately, the router may not be able to directly control applications using different types of VPNs separately by adding additional rules. The router can only achieve separate control of applications using different types of VPNs through the allocation of ports (or network segments, or MAC addresses), making the process of separately controlling applications using different types of VPNs more cumbersome and difficult to implement, which not only affects the user experience of using VPN, but also causes a certain degree of communication burden on the communication system.

[0026] In an embodiment of the present application, when the target application is started, the terminal device can obtain the mapping relationship between the application using VPN and the VPN type in at least one application of the terminal device through the first mapping relationship, and when the first mapping relationship indicates that there is a target VPN type corresponding to the target application, start the target VPN tunnel corresponding to the target VPN type, and control the target application to communicate using the target VPN tunnel corresponding to the target VPN type, so that applications using different types of VPNs can adaptively use the VPN tunnel corresponding to the application to communicate, so as to meet the transmission requirements of applications using different types of VPNs for the VPN tunnel, thereby improving the user experience of using VPN.

[0027] The technical solution provided in the embodiments of the present application can be applied to various communication systems, for example, a new radio (NR) communication system using the fifth generation mobile communication technology (5G), a future evolution system, or a multi-communication fusion system.

[0028] For example, Figure 1 A schematic diagram of the structure of a communication system provided by an embodiment of the present application is shown in FIG. The communication system may include at least one terminal device 101 and at least one server 102 . Figure 1 Only one terminal device 101 and one server 102 are shown.

[0029] The terminal device 101 can be used to obtain a first mapping relationship when a target application is started, and when the first mapping relationship indicates that there is a target VPN type corresponding to the target application, start a target VPN tunnel corresponding to the target VPN type, and control the target application to communicate using the target VPN tunnel.

[0030] The first mapping relationship indicates a mapping relationship between an application using a VPN in at least one application of the terminal device and a VPN type.

[0031] The terminal devices 101 can communicate with each other through the VPN tunnel, and the terminal device 101 and the server 102 can also communicate with the terminal device 101 through the VPN tunnel.

[0032] As an example, Figure 2 As shown, the terminal device 101 may include a VPN application package name management module 1011 , a VPN tunnel management module 1012 , and a VPN firewall routing rule processing and matching module 1013 .

[0033] The VPN application package name management module 1011 is used to obtain the identification of the application using the VPN, and is also used to determine the first mapping relationship when the terminal device 101 is powered on and initialized, and is also used to configure the index and / or code for the type of VPN used by the application to obtain a VPN type code table. The identification of the above application may include: an application package name and / or a user identity document (UID).

[0034] In some implementations, the VPN application package name management module 1011 may determine the identification of the application using the VPN from the indication information input by the user, and the VPN application package name management module 1011 may also obtain the identification of the application using the VPN from the server 102 side.

[0035] The VPN tunnel management module 1012 is used to establish and manage VPN tunnels, and is also used to determine the mapping relationship between VPN tunnels and transmission interfaces when the terminal device includes multiple transmission interfaces.

[0036] In one implementation, the implementation process of the VPN tunnel management module 1012 establishing the VPN tunnel may be: the VPN tunnel management module 1012 determines the configuration parameters corresponding to the VPN type of the VPN tunnel to be established, and establishes the VPN tunnel based on the configuration parameters.

[0037] In one implementation, the implementation process of the VPN tunnel management module 1012 managing the VPN tunnel may be: the VPN tunnel management module 1012 manages the status of the VPN tunnel (eg, an open status and / or a closed status), and deletes an established VPN tunnel.

[0038] It should be noted that, for a dual-SIM dual-standby terminal device, the terminal device generally includes multiple transmission interfaces, for example, the multiple transmission interfaces include at least one of the following: a wireless fidelity (WiFi) interface, a registered jack (RJ) 45 network cable interface, a universal serial bus (USB) interface, and a Bluetooth interface. In view of this, the terminal device 101 can be applied to a communication system that supports communication via a transmission interface.

[0039] The VPN firewall routing rule processing matching module 1013 is used to generate a second mapping relationship based on the first mapping relationship and the VPN tunnel corresponding to each VPN type in at least one VPN type, so that the terminal device can determine the VPN tunnel corresponding to the application based on the above second mapping relationship.

[0040] In some examples, the terminal device 101 may be a terminal (terminal equipment) or a user equipment (UE) or a mobile station (MS) or a mobile terminal (MT), etc. Specifically, the terminal device 101 may be a mobile phone, a tablet computer or a computer with a wireless transceiver function, or a virtual reality (VR) terminal, an augmented reality (AR) terminal, a wireless terminal in industrial control, a wireless terminal in unmanned driving, a wireless terminal in telemedicine, a wireless terminal in a smart grid, a wireless terminal in a smart city, a smart home, a vehicle-mounted terminal, etc. In the embodiment of the present application, the device for realizing the function of the terminal device 101 may be the terminal device 101, or may be a device capable of supporting the terminal device 101 to realize the function, such as a chip system.

[0041] It should be noted that Figure 1 This is just an exemplary framework diagram. Figure 1 The number of devices included in the Figure 1 In addition to the functional devices shown, the communication system may also include other devices (eg, access network devices), and this application does not impose any limitation on this.

[0042] The application scenarios of the embodiments of the present application are not limited. The system architecture and business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. It is known to those skilled in the art that with the evolution of the network architecture and the emergence of new business scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.

[0043] Figure 3 A flowchart of a VPN communication method provided in an embodiment of the present application is shown in FIG. Figure 3 As shown, the method may include:

[0044] S301: The terminal device determines whether the target application is started.

[0045] If the target application is not started, the terminal device may not execute the following S302 to S305.

[0046] If the target application is started, the terminal device executes S302.

[0047] S302: The terminal device obtains a first mapping relationship.

[0048] The first mapping relationship indicates a mapping relationship between an application using a VPN in at least one application of the terminal device and a VPN type.

[0049] In some examples, the VPN type includes at least one of: a point to point tunneling protocol (PPTP) type, a layer 2 tunneling protocol (L2TP) type, an Internet protocol security (IPSEC) type, a generic routing encapsulation (GRE) type, and a virtual extensible local area network (VXLAN) type.

[0050] In some embodiments, the first mapping relationship includes at least one of an index of an application using VPN, an application package name of an application using VPN, a system service name of an application using VPN, or a user identity document (UID) of an application using VPN, and a VPN type corresponding to the application using VPN.

[0051] Exemplarily, the above-mentioned first mapping relationship can be represented by a table. Table 1 gives an example of the first mapping relationship. As shown in Table 1 below, the first mapping relationship may include n applications. Wherein, n is a positive integer greater than 1. The following uses the application package name / system service name to characterize the application: The first mapping relationship may include: application (application, App) 1, App2, ..., and Appn. The following is an exemplary description of App1, App2, and Appn: The index of App1 is 0. The UID of App1 is 1000. The VPN type corresponding to App1 is PPTP. The index of App2 is 1. The UID of App2 is 1002. The VPN type corresponding to App2 is IPSEC. The index of Appn is n-1. The UID of Appn is 100*. The VPN type corresponding to Appn is PPTP.

[0052] The above is only an exemplary description of the first mapping relationship. Applications using VPN may also include other applications (eg, App3) and VPN types of other applications (eg, L2TP), and this application does not impose any limitation on this.

[0053] Table 1

[0054]

[0055]

[0056] S303: The terminal device determines whether the first mapping relationship indicates that there is a target VPN type corresponding to the target application.

[0057] If the first mapping relationship does not indicate a target VPN type corresponding to the target application, the terminal device may determine that the target application is an application that does not use VPN, configure a default transmission interface for the target application, and control the target application to communicate using the default transmission interface.

[0058] In some examples, the above-mentioned default transmission interface can be any transmission interface of the terminal device, and this application does not impose any limitation on this.

[0059] If the first mapping relationship indicates that there is a target VPN type corresponding to the target application, the terminal device executes S304 to S305.

[0060] S304: The terminal device starts a target VPN tunnel corresponding to the target VPN type.

[0061] In some embodiments, the implementation process of the terminal device starting the target VPN tunnel corresponding to the target VPN type may be: the terminal device generates a second mapping relationship according to the first mapping relationship and the VPN tunnel corresponding to each VPN type in at least one VPN type, and starts the target VPN tunnel when the second mapping relationship indicates that there is a target VPN tunnel corresponding to the target application. The second mapping relationship indicates the VPN tunnel corresponding to the application using the VPN.

[0062] It should be noted that the first mapping relationship indicates the mapping relationship between the application using VPN and the VPN type, and there is also a mapping relationship between the VPN type and the VPN tunnel. In this way, the terminal device can use the VPN type as a link to determine the mapping relationship between the application using VPN and the VPN tunnel (i.e., the second mapping relationship).

[0063] In some embodiments, the second mapping relationship includes an identifier of an application using VPN and an identifier (e.g., index) of a VPN tunnel corresponding to the application using VPN, wherein the identifier of the application using VPN is used to identify the application using VPN, and the identifier of the VPN tunnel is used to identify the VPN tunnel.

[0064] Exemplarily, the above-mentioned second mapping relationship can be represented by a table. Table 2 gives an example of the second mapping relationship. As shown in Table 2 below, the identifiers of applications using VPN included in the second mapping relationship may include: App1, App2, and App3. The VPN tunnel index corresponding to App1 is 0. The VPN tunnel index corresponding to App2 is 1. The VPN tunnel index corresponding to App3 is 2. The above is only an exemplary description of the second mapping relationship. Applications using VPN may also include other applications (for example, App4) and VPN tunnel indexes corresponding to other applications (for example, 3), and this application does not impose any restrictions on this.

[0065] Table 2

[0066]

[0067] S305: The terminal device controls the target application to communicate using the target VPN tunnel.

[0068] As an implementation method, when the target application generates business data, the terminal device obtains the business data of the target application and controls the target application to transmit the above business data using the target VPN tunnel.

[0069] As an example, the service data may include at least one of the following: application identification, user identification, service type, service identification, and service index. The above is only an exemplary description of service data, and the service data may also include other data, which is not limited in this application.

[0070] It is understandable that in general technology, if there are both applications using VPN and applications not using VPN in a terminal device, the terminal device can only choose to use VPN tunnels for all applications or not use VPN tunnels for all applications. In the case where the terminal device selects that all applications use VPN tunnels, applications that do not use VPN in the terminal device cannot be used normally. In the case where the terminal device selects that all applications do not use VPN tunnels, applications that use VPN in the terminal device cannot be used normally. In this way, the stability of applications using VPN will be affected, and the stability of applications using VPN is directly related to the user's experience of using VPN. In view of this, the terminal device of the embodiment of the present application distinguishes the transmission interface used by applications using VPN and applications not using VPN, so that when the application using VPN is started, the terminal device can start the VPN type corresponding to the application using VPN, and control the application using VPN to communicate using the VPN tunnel corresponding to the application using VPN, while the application not using VPN can control the application not using VPN to communicate using the default transmission interface, thereby ensuring that both the application using VPN and the application not using VPN are used normally.

[0071] In an embodiment of the present application, when the target application is started, the terminal device can obtain the mapping relationship between the application using VPN and the VPN type in at least one application of the terminal device through the first mapping relationship, and when the first mapping relationship indicates that there is a target VPN type corresponding to the target application, start the target VPN tunnel corresponding to the target VPN type, and control the target application to communicate using the target VPN tunnel corresponding to the target VPN type, so that applications using different types of VPNs can adaptively use the VPN tunnel corresponding to the application to communicate, so as to meet the transmission requirements of applications using different types of VPNs for the VPN tunnel, thereby improving the user experience of using VPN.

[0072] Combination Figure 3 ,like Figure 4 As shown, the embodiment of the present application provides a VPN communication method, which includes the following steps:

[0073] S401. A terminal device determines a first mapping relationship based on VPN configuration information of at least one application.

[0074] The VPN configuration information of at least one application includes whether the at least one application uses a VPN, and a VPN type corresponding to the application when the VPN is used.

[0075] In some implementations, the VPN configuration information of at least one application of the terminal device may be represented by a list. In this implementation, the VPN configuration information of the at least one application may only include a list of applications that use VPN, or the VPN configuration information may include a list of applications that use VPN (also referred to as a whitelist list) and a list of applications that do not use VPN. The list of applications that use VPN includes an identifier of each application that uses VPN in at least one application that uses VPN, and a VPN type of each application that uses VPN. The list of applications that do not use VPN includes an identifier of each application that does not use VPN in at least one application that does not use VPN.

[0076] In some embodiments, the implementation process of S401 may include the following three: Implementation process 1: at least one VPN configuration information is determined by VPN configuration information pre-configured by the system. Implementation process 2: at least one VPN configuration information is determined by a configuration operation of a user. Implementation process 3: at least one VPN configuration information is determined by a modification operation of a user.

[0077] Implementation process 1: at least one VPN configuration information is determined by a configuration operation initiated by a user. Implementation process 1 may include the following steps 1.

[0078] Step 1: When the terminal device is powered on and initialized, the terminal device generates a first mapping relationship based on VPN configuration information of each application configured in the system.

[0079] As some implementations, before the above step 1, the terminal device may obtain a default configuration file preset by the system according to industry requirements or customer requirements before the terminal device leaves the factory from a repository of the terminal device, and determine the VPN configuration information of each application configured by the system from the above default configuration file based on each application identifier. The default configuration file includes VPN configuration information of multiple applications.

[0080] Implementation process 2: VPN configuration information is determined by a configuration operation initiated by a user. Implementation process 2 may include steps 2 to 3 below.

[0081] Step 2: When the terminal device is powered on and initialized, the terminal device displays the application of the VPN to be configured and at least one VPN type.

[0082] In an example, the VPN to be configured and at least one VPN type may be displayed on a user interface (UI).

[0083] Step 3: In response to the configuration operation of the user, the terminal device obtains VPN configuration information of each application to be configured with VPN, and generates a first mapping relationship based on the VPN configuration information of the application to be configured with VPN.

[0084] In some implementations, the configuration operation may be: the application using VPN is manually selected by the user, and the VPN type is configured for the application using VPN. The terminal device determines the VPN configuration information for each application based on the application using VPN manually selected by the user and the VPN type corresponding to each application using VPN.

[0085] Implementation process 3: VPN configuration information is determined by a modification operation of a user. Implementation process 3 may include the following steps 4.

[0086] Step 4: When an application configured with VPN is started, the terminal device obtains the modified VPN configuration information of each application in response to the user's modification operation, and generates the first mapping relationship based on the modified VPN configuration information of each application.

[0087] In some embodiments, the implementation process of the above step 4 may be: when the application is started, a prompt message is displayed, wherein the prompt message is used to prompt the user whether to modify the VPN configuration information of the application. The user modifies the VPN configuration information of the application and generates the user's modification operation. The terminal device obtains the modified VPN configuration information of each application from the user's modification operation, and determines the first mapping relationship based on the modified VPN configuration information of each application.

[0088] In an example, the first mapping relationship may also be displayed on a user interface (UI).

[0089] As some examples, the modification operation may include the identifier of the newly added application using VPN (e.g., index, application package name, and UID), and the VPN type corresponding to the application. The modification operation may also include the identifier of the application using VPN to be deleted in the original first mapping relationship.

[0090] In some embodiments, the terminal device may also display prompt information to the user in response to the user's modification requirement operation, so that the user can modify the first mapping relationship based on his / her own modification requirements at any time through the terminal device.

[0091] It is understandable that the terminal device can also display information (i.e., prompt information) to prompt the user whether to modify the VPN configuration information of the application, and update the first mapping relationship based on the modified VPN configuration information of the application after the user triggers the modification operation, so that the user can modify the first mapping relationship at any time.

[0092] In some examples, the above implementation processes 1 to 3 may also be executed during the installation of each of the above applications, or after each of the above applications is installed. The above is only an exemplary description of the execution scenario of the implementation processes 1 to 3. The above implementation processes 1 to 3 may also be executed in other scenarios, and this application does not impose any limitation on this.

[0093] In some implementations, the terminal device may also configure an index and type code for the VPN type, and based on the configured index and type code, establish a mapping relationship between the VPN type, the index of the VPN type, and the type code of the VPN type to facilitate the management of the VPN type.

[0094] Exemplarily, the mapping relationship between the above VPN types, the index of VPN types, and the type codes of VPN types can be represented by a table. Table 3 gives an example of the mapping relationship between VPN types, the index of VPN types, and the type codes of VPN types. As shown in Table 2 below, the VPN types in the mapping relationship between VPN types, the index of VPN types, and the type codes of VPN types may include: PPTP type, L2TP type, and IPSEC type. The index of PPTP type is 0, and the type code of PPTP type is 1. The index of IPSEC type is 1, and the type code of IPSEC type is 2. The index of L2TP type is 2, and the type code of L2TP type is 3.

[0095] The above is only an exemplary description of the mapping relationship between VPN type, VPN type index, and VPN type type code. The mapping relationship between VPN type, VPN type index, and VPN type type code may also include other VPN types (for example, GRE type and VXLAN type), indexes of the above other VPN types, and type codes of the above other VPN types. This application does not impose any limitation on this.

[0096] Table 3

[0097]

[0098] In an embodiment of the present application, the terminal device may determine a first mapping relationship based on VPN configuration information of each application of at least one application, thereby providing a data basis for the terminal device to subsequently determine a target VPN type corresponding to a target application.

[0099] Combination Figure 4 ,like Figure 5 As shown, the embodiment of the present application provides a VPN communication method, which includes the following steps:

[0100] S501. The terminal device establishes a VPN tunnel corresponding to the VPN type based on the VPN type.

[0101] In one embodiment, the implementation process of S501 may be: the terminal device obtains configuration parameters corresponding to the VPN type based on the VPN type corresponding to the application, and establishes a VPN tunnel corresponding to the application based on the configuration parameters. The configuration parameters include at least one of the following: VPN type, password, server address, and encryption method.

[0102] As an implementation method, the implementation process of the above S501 can be: the terminal device determines the virtual network interface of the VPN tunnel based on the VPN type, and establishes a VPN tunnel corresponding to the application based on the virtual network interface and the password, server address, and encryption method in the configuration parameters.

[0103] In some implementations, the terminal device may obtain configuration parameters corresponding to the VPN type from user input information, and may also receive configuration parameters corresponding to the VPN type from a server.

[0104] In an embodiment of the present application, a terminal device may establish a VPN tunnel corresponding to a VPN type based on the VPN type, thereby providing a basis for subsequent terminal devices to communicate using the VPN tunnel.

[0105] Combination Figure 5 ,like Figure 6 As shown, the embodiment of the present application provides a VPN communication method, which includes the following steps:

[0106] S601. The terminal device determines the transmission interface corresponding to the VPN tunnel.

[0107] As an implementation manner, the implementation process of the above S601 may be: the terminal device may determine the virtual network interface of the VPN tunnel, and determine the transmission interface corresponding to the VPN tunnel from the mapping relationship between the virtual network interface of the VPN tunnel and the transmission interface.

[0108] As another implementation method, the implementation process of the above S601 can be: the terminal device can determine the business data volume of the application corresponding to the VPN tunnel, and determine the transmission interface among multiple transmission interfaces that can carry the above business data volume as the transmission interface corresponding to the VPN tunnel.

[0109] As another implementation, the implementation process of S601 may be: when the data volume of the transmission interface with a higher priority meets the data volume requirement, the terminal device may preferentially configure the transmission interface with a higher priority for the VPN tunnel. When the data volume of the transmission interface with a higher priority does not meet the data volume requirement, the terminal device may configure a transmission interface with a lower priority for the VPN tunnel and whose data volume meets the data volume requirement.

[0110] As an example, the transmission interface may be a wide area network (WAN) interface.

[0111] S602: The terminal device establishes a third mapping relationship.

[0112] The third mapping relationship indicates the VPN tunnel and the transmission interface corresponding to the VPN tunnel.

[0113] In an embodiment, the third mapping relationship may include an index of the VPN tunnel and an identifier of a transmission interface of the VPN tunnel, wherein the identifier of the transmission interface is used to identify the transmission interface.

[0114] In another embodiment, the third mapping relationship may include an index of the VPN tunnel, a type of the VPN tunnel, and an identifier of a transmission interface of the VPN tunnel.

[0115] In one example, the third mapping relationship indicates that the mapping relationship between the VPN tunnel and the transmission interface can be one-to-one. For example, as shown in Table 4 below, the index of the VPN tunnel indicated by the third mapping relationship may include: 0, 1, ..., n. The following is an exemplary description of VPN tunnel indexes 0, 1, and n: the type of the VPN tunnel with a VPN tunnel index of 0 may be a PPTP type, and the transmission interface corresponding to the VPN tunnel with a VPN tunnel index of 0 may be a cellular interface. The type of the VPN tunnel with a VPN tunnel index of 1 may be an L2TP type, and the transmission interface corresponding to the VPN tunnel with a VPN tunnel index of 1 may be a WiFi interface. The type of the VPN tunnel with a VPN tunnel index of n may be an IPSEC type, and the transmission interface corresponding to the VPN tunnel with a VPN tunnel index of n may be a USB interface.

[0116] The above is only an exemplary description of the third mapping relationship. The third mapping relationship may also include other VPN tunnels (for example, a VPN tunnel with an index value of n+1) and transmission interfaces of other VPN tunnels (for example, a Personal Computer Memory Card International Association (PCMCIA) port). This application does not impose any restrictions on this.

[0117] Table 4

[0118]

[0119] In another example, the third mapping relationship indicates that the mapping relationship between the VPN tunnel and the transmission interface can be many-to-one. For example, as shown in Table 5 below, the index of the VPN tunnel indicated by the third mapping relationship may include: 0, 1, ..., n. The following is an exemplary description of VPN tunnel indexes 0, 1, and n: the transmission interface corresponding to the VPN tunnel with a tunnel index of 0, and the transmission interface corresponding to the VPN tunnel with a tunnel index of 1. The transmission interface corresponding to the VPN tunnel type with a tunnel index of n can be a USB interface. The corresponding description of the index of the VPN tunnel and the type of the VPN tunnel can be understood by referring to the description of the corresponding position above, which will not be repeated here.

[0120] The above is only an exemplary description of the third mapping relationship. The third mapping relationship may also include other VPN tunnels (for example, a VPN tunnel with an index value of n+1) and transmission interfaces of other VPN tunnels (for example, a WiFi interface). This application does not impose any restrictions on this.

[0121] Table 5

[0122]

[0123]

[0124] In this embodiment, the above S303 can be implemented through the following S603 to S604.

[0125] S603: The terminal device queries the third mapping relationship, and determines the transmission interface corresponding to the target VPN tunnel from the third mapping relationship.

[0126] Exemplarily, in combination with Table 3, taking the index of the target VPN tunnel as 0 as an example: the terminal device may determine that the transmission interface of the target VPN tunnel is a cellular interface.

[0127] S604: The terminal device controls the target application to communicate using the target transmission interface.

[0128] In combination with the above example, the implementation process of the above S604 may be: the terminal device may control the target application to communicate using the cellular interface.

[0129] In the embodiment of the present application, the terminal device determines the transmission interface corresponding to the VPN tunnel, and establishes a third mapping relationship based on the mapping relationship between the VPN tunnel and the transmission interface. In this case, the terminal device can query the third mapping relationship, determine the transmission interface of the target VPN tunnel from the third mapping relationship, and control the target application to communicate using the target transmission interface, so that applications using different types of VPNs can adaptively use the VPN tunnel corresponding to the application to communicate, so as to meet the transmission requirements of applications using different types of VPNs for the VPN tunnel, thereby improving the user's experience of using VPN.

[0130] like Figure 7 As shown, the embodiment of the present application provides a VPN communication method, which includes the following steps:

[0131] S701. When the terminal device is powered on and initialized, the terminal device generates a first mapping relationship based on the VPN configuration information of each application configured by the system; or displays the application to be configured with VPN and at least one VPN type, and in response to the user's configuration operation, obtains the VPN configuration information of each application to be configured with VPN, and generates a first mapping relationship based on the VPN configuration information of the application to be configured with VPN.

[0132] The first mapping relationship indicates a mapping relationship between an application using a VPN in at least one application of the terminal device and a VPN type.

[0133] S702: When the target application is started, the terminal device obtains a first mapping relationship.

[0134] In some embodiments, when the application to be configured with VPN is started, the terminal device can also obtain the modified VPN configuration information of each application in response to the user's modification operation, and generate the first mapping relationship based on the modified VPN configuration information of each application.

[0135] S703: The terminal device generates a second mapping relationship according to the first mapping relationship and a VPN tunnel corresponding to each VPN type in at least one VPN type.

[0136] The second mapping relationship indicates a VPN tunnel corresponding to an application using the VPN.

[0137] It should be noted that the embodiment of the present application does not impose any limitation on the execution order of the above S703 and S704.

[0138] S704: When the second mapping relationship indicates that there is a target VPN tunnel corresponding to the target application, the terminal device starts the target VPN tunnel.

[0139] S705: The terminal device determines the transmission interface corresponding to the VPN tunnel.

[0140] S706: The terminal device establishes a third mapping relationship.

[0141] The third mapping relationship indicates the VPN tunnel and the transmission interface corresponding to the VPN tunnel.

[0142] S707: The terminal device queries the third mapping relationship, and determines the target transmission interface corresponding to the target VPN tunnel from the third mapping relationship.

[0143] S708: The terminal device controls the target application to communicate using the target transmission interface.

[0144] It should be noted that the above S701 to S709 can be understood by referring to the description of the above corresponding positions, which will not be repeated here.

[0145] In an embodiment of the present application, the terminal device can determine the first mapping relationship through the VPN configuration information configured by the system, or the configuration operation of the user, or the modification operation of the user, and obtain the first mapping relationship when the target application is started, so that the terminal device can know the mapping relationship between the application using the VPN and the VPN type. In the case where the first mapping relationship indicates that there is a target VPN type corresponding to the target application, the terminal device can generate a second mapping relationship based on the first mapping relationship and the VPN tunnel corresponding to each VPN type in at least one VPN type, and establish a VPN tunnel corresponding to the VPN type based on the VPN type, so that the terminal device can determine and start the target VPN tunnel. The terminal device can query the third mapping relationship, determine the transmission interface of the target VPN tunnel from the third mapping relationship, and control the target application to communicate using the target transmission interface, so that applications using different types of VPNs can adaptively use the VPN tunnel corresponding to the application to communicate, so as to meet the transmission requirements of applications using different types of VPNs for the VPN tunnel, thereby improving the user's experience of using VPN.

[0146] It is understandable that, in order to realize the above functions, the communication device includes a hardware structure and / or software module corresponding to each function. It should be easily appreciated by those skilled in the art that, in conjunction with the algorithm steps of each example described in the embodiments of the present application, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0147] The embodiment of the present application can divide the functional modules of the communication device according to the above method embodiment. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one functional module. The above integrated module can be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.

[0148] Figure 8 1 is a schematic diagram of the structure of a communication device provided in an embodiment of the present application. The communication device can execute the VPN communication method provided in the above method embodiment. Figure 8 As shown, the communication device includes: a communication unit 801 and a processing unit 802.

[0149] When the target application is started, the communication unit is used to obtain a first mapping relationship, where the first mapping relationship indicates a mapping relationship between an application using a virtual private network VPN and a VPN type in at least one application of the terminal device;

[0150] In the case where the first mapping relationship indicates that there is a target VPN type corresponding to the target application, the processing unit is configured to start a target VPN tunnel corresponding to the target VPN type;

[0151] The processing unit is further used to control the target application to communicate using the target VPN tunnel.

[0152] In some embodiments, the processing unit is further used to determine the first mapping relationship based on VPN configuration information of at least one application; the VPN configuration information of at least one application includes whether the at least one application uses VPN, and the VPN type corresponding to the application when VPN is used.

[0153] In some embodiments, when the terminal device is powered on and initialized, the processing unit is further used to generate a first mapping relationship based on the VPN configuration information of each application configured by the system; or, when the terminal device is powered on and initialized, the processing unit is further used to display the application to be configured with VPN and at least one VPN type, and in response to the user's configuration operation, obtain the VPN configuration information of each application to be configured with VPN, and generate the first mapping relationship based on the VPN configuration information of the application to be configured with VPN; or, when the application that has been configured with VPN is started, the processing unit is further used to display the first mapping relationship, and in response to the user's modification operation, update the first mapping relationship based on the modified VPN configuration information of the application.

[0154] In some embodiments, when the first mapping relationship does not indicate a target VPN type corresponding to the target application, the processing unit is further used to determine that the target application is an application that does not use VPN and configure a default transmission interface for the target application; the processing unit is also used to control the target application to communicate using the default transmission interface.

[0155] In some embodiments, the processing unit is also used to generate a second mapping relationship based on the first mapping relationship and the VPN tunnel corresponding to each VPN type in at least one VPN type; the second mapping relationship indicates the VPN tunnel corresponding to the application using the VPN; when the second mapping relationship indicates that there is a target VPN tunnel corresponding to the target application, the target VPN tunnel is started.

[0156] In some embodiments, the second mapping relationship includes an identifier of an application using VPN and an identifier of a VPN tunnel corresponding to the application using VPN; wherein the identifier of the application using VPN is used to identify the application using VPN, and the identifier of the VPN tunnel is used to identify the VPN tunnel.

[0157] In some embodiments, the processing unit is further configured to establish a VPN tunnel corresponding to the VPN type based on the VPN type.

[0158] In some embodiments, the first mapping relationship includes: an index of an application using VPN, an application package name of an application using VPN, a system service name of an application using VPN, or at least one of a user identifier of an application using VPN, and a VPN type corresponding to the application using VPN.

[0159] In some embodiments, the processing unit is further used to determine the transmission interface corresponding to the VPN tunnel; the processing unit is further used to establish a third mapping relationship; wherein the third mapping relationship indicates the VPN tunnel and the transmission interface corresponding to the VPN tunnel.

[0160] In some embodiments, the processing unit is further used to query the third mapping relationship and determine the target transmission interface corresponding to the target VPN tunnel from the third mapping relationship; the processing unit is further used to control the target application to communicate using the target transmission interface.

[0161] In some embodiments, the processing unit is also used to obtain configuration parameters corresponding to the VPN type based on the VPN type; the configuration parameters include at least one of the following: VPN type, password, server address and encryption method; the processing unit is also used to establish a VPN tunnel corresponding to the VPN type based on the configuration parameters.

[0162] In some embodiments, the VPN type includes at least one of the following: Point-to-Point Tunneling Protocol PPTP type, Layer 2 Tunneling Protocol L2TP type, Internet Security Protocol IPSEC type, Generic Routing Encapsulation GRE type, and Virtual Extended Local Area Network VXLAN type.

[0163] When implementing it specifically, Figure 1 The equipment in Fig. 9 The structure shown, or including Fig. 9 Parts shown. Fig. 9 FIG. 9 is a schematic diagram of a communication device 90 provided in an embodiment of the present application. Fig. 9 As shown, the communication device 90 may include a processor 901, a communication line 902, and a communication interface 903. Optionally, the communication device 90 may further include a memory 904. The processor 901, the memory 904, and the communication interface 903 may be connected via a communication line 902.

[0164] The processor 901 is a CPU, a general processor, a network processor (NP), a digital signal processor (DSP), a microprocessor, a microcontroller, a programmable logic device (PLD), or any combination thereof. The processor 901 may also be other devices with processing functions, such as circuits, devices, or software modules, without limitation.

[0165] The communication line 902 is used to transmit information between the components included in the communication device 90.

[0166] The communication interface 903 is used to communicate with other devices or other communication networks. The other communication networks may be Ethernet, radio access network (RAN), wireless local area network (WLAN), etc. The communication interface 903 may be a module, a circuit, a communication interface or any device capable of achieving communication.

[0167] The memory 904 is used to store instructions, where the instructions may be computer programs.

[0168] Among them, the memory 904 can be a read-only memory (ROM) or other types of static storage devices that can store static information and / or instructions, or a random access memory (RAM) or other types of dynamic storage devices that can store information and / or instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage medium or other magnetic storage devices, etc., without limitation.

[0169] It should be noted that the memory 904 can exist independently of the processor 901, or can be integrated with the processor 901. The memory 904 can be used to store instructions or program codes or some data, etc. The memory 904 can be located in the communication device 90, or can be located outside the communication device 90, without limitation. The processor 901 is used to execute the instructions stored in the memory 904 to implement the VPN communication method provided in the following embodiments of the present application.

[0170] In one example, the processor 901 may include one or more CPUs, for example, CPU0 and CPU1.

[0171] As an implementation, the communication device 90 includes multiple processors.

[0172] As an implementation, the communication device 90 further includes an output device and an input device. For example, the input device is a keyboard, a mouse, a microphone, a joystick, and the like, and the output device is a display screen, a speaker, and the like.

[0173] It should be noted that the communication device 90 can be a desktop computer, a portable computer, a network server, a mobile phone, a tablet computer, a wireless terminal, an embedded device, a chip system or a Fig. 9 In addition, Fig. 9 The composition shown in the Figure 1 The limitations of each device in Fig. 9 In addition to the parts shown, Figure 1 The various devices shown may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0174] In the embodiments of the present application, the chip system may be composed of a chip, or may include a chip and other discrete devices. Some embodiments of the present application provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), in which computer program instructions are stored, and when the computer program instructions are executed on a computer, the computer executes the VPN communication method of any of the above embodiments.

[0175] Exemplarily, the above-mentioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks or magnetic tapes, etc.), optical disks (e.g., compact disks (CD), digital versatile disks (DVD), etc.), smart cards and flash memory devices (e.g., erasable programmable read-only memory (EPROM), cards, sticks or key drives, etc.). The various computer-readable storage media described in this application may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing and / or carrying instructions and / or data.

[0176] An embodiment of the present application provides a computer program product including instructions. When the computer program product is run on a computer, the computer is enabled to execute the VPN communication method of any one of the above embodiments.

[0177] The above are only specific implementations of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A VPN communication method, characterized in that: The method comprises: When the target application is started, obtaining a first mapping relationship, wherein the first mapping relationship indicates a mapping relationship between an application using a virtual private network VPN and a VPN type in at least one application of the terminal device; In a case where the first mapping relationship indicates that there is a target VPN type corresponding to the target application, starting a target VPN tunnel corresponding to the target VPN type; The target application is controlled to communicate using the target VPN tunnel.

2. The method according to claim 1, characterized in that The method further comprises: The first mapping relationship is determined based on VPN configuration information of the at least one application; the VPN configuration information of the at least one application includes whether the at least one application uses VPN, and the VPN type corresponding to the application when VPN is used.

3. The method according to claim 2, characterized in that The determining the first mapping relationship based on the VPN configuration information of the at least one application includes: When the terminal device is powered on and initialized, generating the first mapping relationship based on VPN configuration information of each application configured by the system; Alternatively, when the terminal device is powered on and initialized, the application to be configured with VPN and at least one VPN type are displayed, and in response to the configuration operation of the user, the VPN configuration information of each application to be configured with VPN is obtained, and the first mapping relationship is generated based on the VPN configuration information of the application to be configured with VPN; Alternatively, when an application configured with VPN is started, in response to the user's modification operation, the modified VPN configuration information of each application is acquired, and the first mapping relationship is generated based on the modified VPN configuration information of each application.

4. The method according to claim 1, characterized in that: The method further comprises: In a case where the first mapping relationship does not indicate a target VPN type corresponding to the target application, determining that the target application is an application that does not use a VPN, and configuring a default transmission interface for the target application; The target application is controlled to communicate using the default transmission interface.

5. The method according to claim 4, characterized in that The starting of the target VPN tunnel corresponding to the target VPN type includes: Generate a second mapping relationship according to the first mapping relationship and the VPN tunnel corresponding to each VPN type in the at least one VPN type; the second mapping relationship indicates the VPN tunnel corresponding to the application using the VPN; In a case where the second mapping relationship indicates that there is a target VPN tunnel corresponding to the target application, the target VPN tunnel is started.

6. The method according to claim 5, characterized in that The second mapping relationship includes an identifier of an application using VPN and an identifier of a VPN tunnel corresponding to the application using VPN; wherein the identifier of the application using VPN is used to identify the application using VPN, and the identifier of the VPN tunnel is used to identify the VPN tunnel.

7. The method according to claim 1, characterized in that The first mapping relationship includes: at least one of the index of the application using VPN, the application package name of the application using VPN, the system service name of the application using VPN, or the user identifier of the application using VPN, and the VPN type corresponding to the application using VPN.

8. The method according to claim 5, characterized in that The method further comprises: Determine the transmission interface corresponding to the VPN tunnel; Establish a third mapping relationship; wherein the third mapping relationship indicates the VPN tunnel and the transmission interface corresponding to the VPN tunnel.

9. The method according to claim 8, characterized in that The controlling the target application to communicate using the target VPN tunnel includes: Query the third mapping relationship, and determine the target transmission interface corresponding to the target VPN tunnel from the third mapping relationship; The target application is controlled to communicate using the target transmission interface.

10. A communication device, characterized in that: include: one or more processors and one or more memories; The one or more memories store instructions executable by the processor; When the one or more processors are configured to execute the instructions, the communication device implements the VPN communication method according to any one of claims 1 to 9.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on the communication device, the communication device executes the VPN communication method according to any one of claims 1 to 9.