VPN communication method and apparatus, and computer-readable storage medium

By obtaining the mapping relationship between applications and VPN types in terminal devices and starting the corresponding tunnel, the problem that terminal devices can only activate one VPN type tunnel is solved, and flexible tunnel usage and user experience improvement of different types of VPN applications is achieved.

WO2025001759A1PCT designated stage expired Publication Date: 2025-01-02ZTE CORP
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/097037
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-06-30
Filing Date
2024-06-03
Publication Date
2025-01-02

AI Technical Summary

Technical Problem

In the prior art, terminal devices can only activate one VPN-type tunnel, which cannot meet the transmission needs of different types of VPN applications, resulting in poor user experience, and it is difficult for routers to directly control different types of VPN applications, and the control process is cumbersome and difficult to implement.

Method used

By obtaining the mapping relationship between the application and the VPN type in the terminal device, the corresponding VPN type tunnel is started when the target application is started, allowing different types of applications to adapt to use the appropriate VPN tunnel for communication, improving the user experience.

Benefits of technology

It realizes flexible tunnel usage of different types of VPN applications, meets multiple VPN transmission needs, improves user experience, and simplifies the router's control process for different VPN applications, reducing the communication burden.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024097037_02012025_PF_FP_ABST
    Figure CN2024097037_02012025_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a VPN communication method and apparatus, and a computer-readable storage medium. The VPN communication method comprises: if a target application is started, acquiring a first mapping relationship, the first mapping relationship indicating a mapping relationship between an application, among at least one application of a terminal device, using a virtual private network (VPN) and a VPN type; if 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 use the target VPN tunnel to communicate.
Need to check novelty before this filing date? Find Prior Art

Description

VPN communication method, device, and computer-readable storage medium

[0001] This disclosure claims priority to Chinese patent application No. 202310804557.X, filed on June 30, 2023, the entire contents of which are incorporated by reference into this application. Technical Field

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

[0003] 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, effectively ensuring communication security.

[0004] Summary of the Invention

[0005] In one aspect, embodiments of the present disclosure provide a VPN communication method. The VPN communication method includes: upon activation of a target application, 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; upon the first mapping relationship indicating a target VPN type corresponding to the target application, activating a target VPN tunnel corresponding to the target VPN type; and controlling the target application to communicate using the target VPN tunnel.

[0006] In another aspect, embodiments of the present disclosure provide a communication node. The communication node includes: one or more memories and one or more processors; the one or more memories are coupled to the one or more processors; the one or more memories are configured to store a computer program; and the one or more processors implement the VPN communication method of any of the above embodiments when executing the computer program.

[0007] In another aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the VPN communication method of any of the above embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0009] FIG1 is a schematic structural diagram of a communication system according to some embodiments.

[0010] FIG2 is a schematic structural diagram of a terminal device according to some embodiments.

[0011] FIG3 is a flow chart of a VPN communication method according to some embodiments.

[0012] FIG4 is a flow chart of another VPN communication method according to some embodiments.

[0013] FIG5 is a flow chart of another VPN communication method provided according to some embodiments.

[0014] FIG6 is a flow chart of another VPN communication method provided according to some embodiments.

[0015] FIG7 is a flow chart of yet another VPN communication method according to some embodiments.

[0016] FIG8 is a schematic structural diagram of a communication device according to some embodiments.

[0017] FIG9 is a schematic structural diagram of another communication device provided according to some embodiments. DETAILED DESCRIPTION

[0018] The following will clearly and completely describe the technical solutions of this disclosure in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of this disclosure, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0019] It should be noted that in this disclosure, expressions such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this disclosure as "exemplarily" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of expressions such as "exemplarily" or "for example" is intended to present the relevant concepts in a detailed manner.

[0020] In the following, the terms "first," "second," etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of technical features indicated. Therefore, a feature specified as "first," "second," etc. may explicitly or implicitly include one or more of the features.

[0021] In the description of this disclosure, unless otherwise specified, " / " means "or." For example, A / B can mean A or B. "And / or" herein is simply a description of an association relationship between associated objects, indicating that three possible relationships exist. For example, A and / or B can mean: only A, only B, and A and B. Furthermore, "at least one" means one or more, and "a plurality" means two or more.

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

[0023] As VPN networks mature, the number of VPN-capable terminal devices is also increasing. For example, to ensure data security, terminal devices can communicate through VPN networks. However, in common technologies, terminal devices can only choose to activate one type of VPN tunnel, so that the service data of all VPN-using applications on the terminal device is communicated through this VPN-type tunnel. As the demand for VPN use by terminal devices increases, different types of VPNs may have different requirements. If the above method is used, the service data of applications in different VPNs will all be transmitted through the same VPN-type tunnel, which will not meet the user's needs and result in a poor VPN experience.

[0024] In addition, since the actual application is not downloaded to the router but the actual application is controlled by other connected devices, 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. Instead, the router can only achieve separate control of applications using different types of VPNs by allocating ports (or network segments, or MAC addresses). This makes 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.

[0025] In an embodiment of the present disclosure, 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, the terminal device starts the target VPN tunnel corresponding to the target VPN type, and controls the target application to communicate using the target VPN tunnel corresponding to the target VPN type. In this way, 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.

[0026] The technical solutions provided by the embodiments of the present disclosure can be applied to various communication systems, for example, new radio (NR) communication systems using fifth-generation mobile communication technology (5G technology), future evolution systems, or multiple communication convergence systems.

[0027] For example, a schematic structural diagram of a communication system provided by an embodiment of the present disclosure is shown in Figure 1. The communication system may include at least one terminal device 101 and at least one server 102. Figure 1 only shows one terminal device 101 and one server 102.

[0028] The terminal device 101 can be used to obtain a first mapping relationship when the target application is started, 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.

[0029] 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.

[0030] 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.

[0031] As an example, as shown in FIG. 2 , 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 .

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

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

[0034] 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.

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

[0036] In one implementation, the VPN tunnel management module 1012 may manage the VPN tunnel by: managing the VPN tunnel status (eg, open status and / or closed status) and deleting an established VPN tunnel.

[0037] It should be noted that, for a dual-SIM dual-standby terminal device, the terminal device typically 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 used in a communication system that supports communication via a transmission interface.

[0038] The VPN firewall routing rule processing and 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.

[0039] In some examples, the terminal device 101 may be a terminal device (terminal equipment) or a user equipment (UE) or a mobile station (MS) or a mobile terminal (MT), etc. For example, the terminal device 101 may be a mobile phone, a tablet computer or a computer with 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 embodiments of the present disclosure, the device for implementing the function of the terminal device 101 may be the terminal device 101, or it may be a device (such as a chip system) that can support the terminal device 101 to implement the function.

[0040] It should be noted that Figure 1 is only an exemplary framework diagram. The number of devices included in Figure 1 and the names of each device are not restricted. In addition to the functional devices shown in Figure 1, the communication system may also include other devices (for example, access network devices). This disclosure does not impose any restrictions on this.

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

[0042] Figure 3 is a flow chart of a VPN communication method provided by an embodiment of the present disclosure. As shown in Figure 3, the method may include the following steps.

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

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

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

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

[0047] 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.

[0048] 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.

[0049] 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.

[0050] 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. n is a positive integer greater than 1. The application is characterized below by the application package name / system service name. The first mapping relationship may include: application (application, App) 1, App2, ..., and App n. The following is an exemplary description of App1, App2, and App n. 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 App n is n-1. The UID of App n is 100*. The VPN type corresponding to App n is PPTP.

[0051] 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). This disclosure does not impose any limitation on this.

[0052] Table 1

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

[0054] If the first mapping relationship does not indicate a target VPN type corresponding to the target application, the terminal device can 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.

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

[0056] 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.

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

[0058] In some embodiments, the terminal device may initiate a target VPN tunnel corresponding to a target VPN type by generating a second mapping relationship based on the first mapping relationship and the VPN tunnel corresponding to each of the at least one VPN type, and initiating the target VPN tunnel if the second mapping relationship indicates that there is a target VPN tunnel corresponding to the target application. The second mapping relationship indicates a VPN tunnel corresponding to an application using a VPN.

[0059] 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).

[0060] In some embodiments, the second mapping relationship includes an identifier of an application using VPN and an identifier (eg, index) of a VPN tunnel corresponding to the application using VPN. 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.

[0061] 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 the present disclosure does not impose any restrictions on this.

[0062] Table 2

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

[0064] 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.

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

[0066] It is understood that in some technologies, if a terminal device contains both applications that use a VPN and applications that do not use a VPN, the terminal device can only choose to use the VPN tunnel for all applications or not use the VPN tunnel for all applications. If the terminal device chooses to use the VPN tunnel for all applications, applications that do not use the VPN on the terminal device will not function properly. If the terminal device chooses to not use the VPN tunnel for all applications, applications that use the VPN on the terminal device will not function properly. This can affect the stability of applications that use the VPN, and the stability of applications that use the VPN is directly related to the user's VPN experience. In view of this, the terminal device of an embodiment of the present disclosure distinguishes the transmission interfaces used by applications that use the VPN and those that do not use the VPN. In this way, when an application that uses the VPN is activated, the terminal device can activate the VPN type corresponding to the application that uses the VPN and control the application that uses the VPN to communicate using the VPN tunnel corresponding to the application that uses the VPN. Applications that do not use the VPN can control the application that does not use the VPN to communicate using the default transmission interface, thereby ensuring that both applications that use the VPN and those that do not use the VPN function normally.

[0067] In an embodiment of the present disclosure, 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. In this way, 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.

[0068] 3 , as shown in FIG4 , an embodiment of the present disclosure provides a VPN communication method, which includes the following steps.

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

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

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

[0072] In some embodiments, the implementation process of S401 may include the following three methods: 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 performed by a user; or Implementation process 3: At least one VPN configuration information is determined by a modification operation performed by a user.

[0073] 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.

[0074] 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.

[0075] In some implementations, before step 1, the terminal device may obtain a default configuration file, pre-configured by the system in accordance with industry or customer requirements before the terminal device leaves the factory, from a repository of the terminal device. Based on each application identifier, the terminal device may determine VPN configuration information for each application configured by the system from the default configuration file. The default configuration file includes VPN configuration information for multiple applications.

[0076] 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.

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

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

[0079] Step 3: In response to the user's configuration operation, 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.

[0080] In some implementations, the configuration operation may include manually selecting applications that use a VPN and configuring VPN types for the applications that use a VPN. The terminal device determines VPN configuration information for each application based on the manually selected applications that use a VPN and the VPN types corresponding to the applications that use a VPN.

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

[0082] 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.

[0083] In some embodiments, step 4 may be implemented by displaying a prompt when the application is launched, prompting the user whether to modify the VPN configuration information of the application. The user modifies the VPN configuration information of the application, generating a user modification operation. The terminal device obtains the modified VPN configuration information of each application from the user modification operation, and determines the first mapping relationship based on the modified VPN configuration information of each application.

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

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

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

[0087] 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.

[0088] In some examples, the above implementation processes 1 to 3 may also be performed 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 performed in other scenarios, and this disclosure does not impose any limitations on this.

[0089] 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 VPN type index, and the VPN type type code to facilitate the management of the VPN type.

[0090] For example, the mapping relationship between the VPN type, the VPN type index, and the VPN type type code can be represented by a table. Table 3 shows an example of the mapping relationship between the VPN type, the VPN type index, and the VPN type type code. As shown in Table 2 below, the VPN types in the mapping relationship between the VPN type, the VPN type index, and the VPN type type code can include: PPTP type, L2TP type, and IPSEC type. The PPTP type has an index of 0 and a type code of 1. The IPSEC type has an index of 1 and a type code of 2. The L2TP type has an index of 2 and a type code of 3.

[0091] 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 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. The present disclosure does not impose any restrictions on this.

[0092] Table 3

[0093] In the embodiment of the present disclosure, the terminal device may determine a first mapping relationship based on VPN configuration information of each application in 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.

[0094] 4 , as shown in FIG5 , an embodiment of the present disclosure provides a VPN communication method, which includes the following steps.

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

[0096] 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 the 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.

[0097] 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 the VPN tunnel corresponding to the application based on the virtual network interface and the password, server address, and encryption method in the configuration parameters.

[0098] 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.

[0099] In the embodiment of the present disclosure, the terminal device can establish a VPN tunnel corresponding to the VPN type based on the VPN type, providing a basis for subsequent terminal devices to communicate using the VPN tunnel.

[0100] 5 , as shown in FIG6 , an embodiment of the present disclosure provides a VPN communication method, which includes the following steps.

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

[0102] 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.

[0103] 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.

[0104] As another implementation, the implementation process of S601 may be as follows: if 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. If 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 whose data volume meets the data volume requirement.

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

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

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

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

[0109] 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.

[0110] In one example, the third mapping relationship indicates that the mapping relationship between the VPN tunnel and the transmission interface can be a one-to-one mapping relationship. 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 explanation 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.

[0111] 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). The present disclosure does not impose any restrictions on this.

[0112] Table 4

[0113] 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 VPN tunnel index and the VPN tunnel type can be understood by referring to the description of the corresponding position above, and will not be repeated here.

[0114] 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). The present disclosure does not impose any restrictions on this.

[0115] Table 5

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

[0117] 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.

[0118] Exemplarily, in conjunction 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.

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

[0120] 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.

[0121] In the disclosed embodiment, 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. In this way, applications using different types of VPNs can adaptively use the VPN tunnel corresponding to the application for communication, thereby meeting the transmission requirements of applications using different types of VPNs for the VPN tunnel, thereby improving the user experience of using VPN.

[0122] As shown in FIG. 7 , an embodiment of the present disclosure provides a VPN communication method, which includes the following steps.

[0123] 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.

[0124] 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.

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

[0126] 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.

[0127] S703: The terminal device generates 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.

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

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

[0130] 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.

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

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

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

[0134] 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.

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

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

[0137] In an embodiment of the present disclosure, the terminal device can determine a first mapping relationship through VPN configuration information configured by the system, or a configuration operation by the user, or a modification operation by 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 a 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.

[0138] It is understandable that, in order to implement the above functions, the communication device includes hardware structures and / or software modules corresponding to the execution of each function. It should be readily apparent to those skilled in the art that, in conjunction with the algorithmic steps of the various examples described in the embodiments of the present disclosure, the present disclosure 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 disclosure.

[0139] The embodiments of the present disclosure can divide the functional modules of the communication device according to the above-mentioned method embodiments. 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-mentioned integrated modules can be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiments of the present disclosure is schematic and is only a logical functional division. In actual implementation, there may be other division methods. The following is an example of dividing each functional module corresponding to each function.

[0140] FIG8 is a schematic diagram of the structure of a communication device provided by an embodiment of the present disclosure, which can execute the VPN communication method provided by the above method embodiment. As shown in FIG8 , the communication device includes: a communication unit 801 and a processing unit 802.

[0141] When the target application is started, the communication unit 801 is configured 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;

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

[0143] The processing unit 802 is further configured to control the target application to communicate using the target VPN tunnel.

[0144] In some embodiments, the processing unit is further configured 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.

[0145] 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.

[0146] 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.

[0147] In some embodiments, the processing unit is further 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.

[0148] 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.

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

[0150] 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.

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

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

[0153] In some embodiments, the processing unit is further 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 further used to establish a VPN tunnel corresponding to the VPN type based on the configuration parameters.

[0154] 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.

[0155] In specific implementations, the devices in Figure 1 may all adopt the structure shown in Figure 9, or include the components shown in Figure 9. Figure 9 is a schematic diagram of the structure of a communication device 90 provided in an embodiment of the present disclosure. As shown in Figure 9, the communication device 90 may include a processor 901, a communication circuit 902, and a communication interface 903. In some embodiments, the communication device 90 may also include a memory 904. The processor 901, the memory 904, and the communication interface 903 may be connected via a communication circuit 902.

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

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

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

[0159] The memory 904 is used to store instructions, which may be computer programs.

[0160] The memory 904 may be a read-only memory (ROM) or other type of static storage device that can store static information and / or instructions, or a random access memory (RAM) or other type of dynamic storage device 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 compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage media or other magnetic storage devices, etc., without limitation.

[0161] It should be noted that memory 904 can exist independently of processor 901 or be integrated with processor 901. Memory 904 can be used to store instructions, program code, or data. Memory 904 can be located within or outside of communication device 90, without limitation. Processor 901 is configured to execute instructions stored in memory 904 to implement the VPN communication method provided in the following embodiments of the present disclosure.

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

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

[0164] 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, or a joystick, and the output device is a display screen, a speaker, or the like.

[0165] It should be noted that the communication device 90 may 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 device having a structure similar to that shown in FIG9 . Furthermore, the structure shown in FIG9 does not limit the various devices in FIG1 . In addition to the components shown in FIG9 , the various devices in FIG1 may include more or fewer components than shown, or combine certain components, or arrange the components differently.

[0166] In the embodiments of the present disclosure, the chip system can be composed of a chip, or can include a chip and other discrete devices. Some embodiments of the present disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium) that stores computer program instructions. When the computer program instructions are executed on a computer, the computer executes the VPN communication method described in any of the above embodiments.

[0167] 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 (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memories (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in the present disclosure 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.

[0168] An embodiment of the present disclosure 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.

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

Claims

1. A virtual private network (VPN) communication method, comprising: 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 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, further comprising: Determining the first mapping relationship 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 a VPN and, if the VPN is used, a VPN type corresponding to the application.

3. The method according to claim 2, wherein: 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, the first mapping relationship is generated based on VPN configuration information of each application configured by the system; or 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; or When an application configured with VPN is started, in response to the modification operation of the user, the modified VPN configuration information of each application is obtained, and the first mapping relationship is generated based on the modified VPN configuration information of each application.

4. The method according to claim 1, further comprising: 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, wherein: 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, wherein: The second mapping relationship includes an identifier of an application using the VPN and an identifier of a VPN tunnel corresponding to the application using the VPN; The identifier of the application using the VPN is used to identify the application using the VPN, and the identifier of the VPN tunnel is used to identify the VPN tunnel.

7. The method according to claim 1, wherein: 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, further comprising: 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, wherein: 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, comprising: 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, wherein: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a communication device, the communication device is caused to execute the VPN communication method according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Virtual local presence based on l3 virtual mapping of remote network nodes

    CN113994639A

  • Tunnel establishment and data transmission processing method and device, and storage medium

    CN115733586A

  • Dynamic and interoperable generation of stateful VPN connection profiles for computing devices

    US20150263865A1

  • Dynamic virtual private network protocol configuration

    US20230139329A1