Network access method, storage medium, program product and electronic device

By testing the encrypted DNS function and trying various conversion methods in an IPv6-only network environment, the problem of mismatch between IPv4 and IPv6 addresses was solved, improving the success rate of terminal devices accessing IPv4 networks and enhancing user experience.

CN116962344BActive Publication Date: 2026-05-19HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2022-04-19
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

When a terminal device is connected to an IPv6 network by a network service provider, and the terminal device needs to convert its IPv4 address to an IPv6 address to access an IPv4 network domain, the incompatibility of the conversion method often leads to the inability to access or access to the wrong IPv4 domain, affecting the user experience.

Method used

When electronic devices connect to an IPv6-only network, they detect the status of the encrypted DNS function and changes in the network environment, try various conversion methods one by one to convert the IPv4 address to the IPv6 address, and detect the IPv6 address to access the preset network domain. Successful conversion methods are recorded to ensure consistency, or when the encrypted DNS fails, the device switches to a normal DNS query to ensure successful IPv4 network access.

Benefits of technology

It improves the success rate of terminal devices accessing IPv4 networks and enhances user experience. By automatically detecting and recording the correct IPv6 translation method, it ensures the consistency of address translation and reduces the risk of access errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116962344B_ABST
    Figure CN116962344B_ABST
Patent Text Reader

Abstract

The application relates to the technical field of communication, and discloses a network access method, a storage medium, a program product and an electronic device. The method comprises the following steps: connecting an electronic device to a first IPV6 only network; detecting that a current connection state of the electronic device meets conversion mode detection conditions; determining a first conversion mode meeting preset conversion conditions from a plurality of preset conversion modes, wherein the preset conversion conditions comprise: after converting an IPV4 address of a preset network detection domain into an IPV6 address through the conversion mode, the corresponding preset network detection domain can be accessed through the IPV6 address; and converting a target IPV4 address of a network domain to be accessed into a target IPV6 address through the first conversion mode to access the network domain to be accessed. In this way, the situation that an electronic device converts an IPV4 address into an IPV6 address in a manner that does not correspond to a manner in which a network device converts an IPV6 address into an IPV4 address, thereby causing an IPV4 network domain to be inaccessible, can be avoided, the success rate of an electronic device accessing an IPV4 network domain is improved, and user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and in particular to a network access method, storage medium, program product, and electronic device. Background Technology

[0002] With the development of network technology, Internet Protocol Version 6 (IPv6) networks are increasingly widely used in Internet networking, such as in routers and switches that support IPv6. However, some networks are still deployed using Internet Protocol Version 4 (IPv4). When the connection between the terminal device and the network service provider is an IPv6 connection, since the terminal device and the network service provider can only exchange IPv6 addresses, applications on the terminal device need to perform Internet Protocol Address (IP address) conversion if they want to access IPv4 network domains.

[0003] For example, when a terminal device connects to an operator's network device using an IPv6 network, and the terminal device needs to access an IPv4 network domain (e.g., an IPv4 network domain with the IPv4 address 192.0.2.33), it first needs to convert the IPv4 address to an IPv6 address. For example, 113.96.140.33 is converted to 2001:db8:122:344::192.0.2.33. Then, the IPv6 address is sent to the operator's network device, which then converts the IPv6 address back to an IPv4 address before the terminal device can access the IPv4 network domain. However, if the way the terminal device converts the IPv4 address to the IPv6 address does not correspond to the way the operator's network device converts the IPv6 address to the IPv4 address—for example, if the position where the terminal device embeds the IPv4 address into the IPv6 address is different from the position where the operator's network device reads the IPv4 address from the IPv6 address—the operator's network device will obtain an incorrect IPv4 address, causing the terminal device to access the wrong IPv4 domain or be unable to access the IPv4 domain, thus affecting the user experience. Summary of the Invention

[0004] In view of this, embodiments of this application provide a network access method, a storage medium, a program product, and an electronic device. When an electronic device connects to an IPv6-only network, it can automatically detect how network devices in the IPv6-only network translate IPv6 addresses to IPv4 addresses, which helps improve the success rate of electronic devices accessing IPv4 networks and enhances the user experience.

[0005] In a first aspect, this application provides a network access method applied to an electronic device. The method includes: the electronic device connecting to a first IPv6-only network; detecting that the current connection state of the electronic device meets the conversion mode detection conditions; determining a first conversion mode that meets the preset conversion conditions from a plurality of preset conversion modes, wherein the preset conversion conditions include: after converting the IPv4 address of a preset network probe domain to an IPv6 address through the conversion mode, the corresponding preset network probe domain can be accessed through the IPv6 address; converting the target IPv4 address of the network domain to be accessed to a target IPv6 address through the first conversion mode; and accessing the network domain to be accessed through the target IPv6 address.

[0006] In this embodiment, the electronic device can select from a plurality of preset conversion methods (such as conversion methods 01 to 06 below) the conversion method corresponding to the IPv6 address to IPv4 address conversion method of the network device connected to the electronic device. This can avoid the situation where the electronic device cannot access the IPv4 network domain due to the incompatibility between the way the electronic device converts the IPv4 address to IPv6 and the way the network device converts the IPv6 address to IPv4 address. This can improve the success rate of the electronic device accessing the IPv4 network and enhance the user experience.

[0007] In one possible implementation of the first aspect above, the conversion method detection conditions include any one of the following conditions: the encrypted DNS function of the electronic device is detected to have switched from off to on; the encrypted DNS function of the electronic device is detected to be on, and the electronic device fails to access the IPv4 network domain; the encrypted DNS function of the electronic device is detected to be on, and no conversion method for converting the IPv4 address to the IPv6 address is determined from multiple conversion methods in the electronic device; the encrypted DNS function of the electronic device is on, and the IPv6 only network to which the electronic device is connected is switched from a first IPv6 only network to a second IPv6 only network.

[0008] In one possible implementation of the first aspect above, determining a first conversion method that satisfies the preset conversion conditions from a plurality of preset conversion methods includes: selecting one preset conversion method from the plurality of preset conversion methods one by one to convert the IPv4 address of the preset network probe domain to an IPv6 address, wherein the preset conversion method that can access the preset network probe domain through the obtained IPv6 address is the first conversion method that satisfies the preset conversion conditions.

[0009] In one possible implementation of the first aspect above, the step of selecting one preset conversion method from multiple preset conversion methods to convert the IPv4 address of the preset network probe domain to an IPv6 address includes: concatenating the first preset number of bits of the reference IPv6 prefix with the IPv4 address of the preset network probe domain to obtain the IPv6 address of the preset network probe domain, wherein the preset number is the same as the length of the IPv6 prefix corresponding to the selected preset conversion method.

[0010] In this embodiment of the application, the reference IPv6 prefix is ​​an IPv6 prefix that the network device of the IPv6 network to which the mobile phone 1 is connected can recognize. When the network device recognizes the first preset bits (e.g., 32 bits, 40 bits, 48 ​​bits, 56 bits, 64 bits, 96 bits, etc.) of the reference IPv6 prefix, it determines that the IPv6 address is used to access the IPv4 network domain.

[0011] In one possible implementation of the first aspect above, the aforementioned reference IPv6 prefix is ​​obtained by the electronic device from the IPv4only probe domain.

[0012] In this embodiment, the reference IPv6 address is obtained from an IPv4-only probe domain, such as a server with the URL ipv4only.arpa.

[0013] In one possible implementation of the first aspect described above, the IPv4 address of the preset network probe domain is obtained by the electronic device from a first DNS server, wherein the first DNS server supports encrypted DNS functionality.

[0014] In one possible implementation of the first aspect above, converting the target IPv4 address of the network domain to be accessed into a target IPv6 address by means of a first conversion method includes: obtaining the target IPv4 address of the network domain to be accessed from a first DNS server; and converting the target IPv4 address into a target IPv6 address by means of the first conversion method.

[0015] In one possible implementation of the first aspect above, it further includes: corresponding to the fact that none of the preset conversion methods meet the preset conversion conditions, obtaining the target IPv6 address of the network domain to be accessed from the second DNS server, and accessing the network domain to be accessed through the target IPv6 address, wherein the second DNS server does not support encrypted DNS function.

[0016] In this embodiment, if an electronic device cannot access the network domain to be accessed through the encrypted DNS function, it can automatically switch to the normal mode, obtain the target IPv6 address of the network domain to be accessed from a second DNS server (e.g., the DNS server of an operator of an IPv6-only network), and access the network domain to be accessed through the target IPv6 address, thereby improving the success rate of the electronic device accessing the network.

[0017] In one possible implementation of the first aspect mentioned above, the method further includes: disabling the encrypted DNS function of the electronic device when none of the preset conversion methods meet the preset conversion conditions.

[0018] In one possible implementation of the first aspect above, the target IPv4 address of the network domain to be accessed is converted into a target IPv6 address by means of a first conversion method, including: concatenating the front probe length bits of the reference IPv6 prefix with the IPv4 address of the network probe domain to be accessed to obtain the target IPv6 address, wherein the probe length is the same as the IPv6 prefix length corresponding to the first conversion method.

[0019] Obtain the IPv6 prefix corresponding to the first conversion method, and concatenate the obtained IPv6 prefix with the IPv4 address of the preset network probe domain to obtain the target IPv6 address.

[0020] In one possible implementation of the first aspect above, the operating system of the electronic device is an Android system, the application framework layer of the Android system includes a client-side address translation CLAT; and the client-side address translation CLAT determines a first translation method that meets the preset translation conditions from a plurality of preset translation methods; and the client-side address translation CLAT converts the target IPv4 address of the network domain to be accessed into a target IPv6 address through the first translation method.

[0021] Secondly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on an electronic device, cause the electronic device to implement any of the network access methods provided by the first aspect and various possible implementations of the first aspect.

[0022] Thirdly, embodiments of this application provide an electronic device, the electronic device comprising: a memory for storing instructions executed by one or more processors of the electronic device; and a processor, one of the processors of the electronic device, for executing the instructions stored in the memory to implement any of the network access methods provided by the first aspect and various possible implementations of the first aspect.

[0023] Fourthly, embodiments of this application provide a computer program product, which includes a computer program / instruction that, when executed by a processor, implements any of the network access methods provided by the first aspect and various possible implementations of the first aspect. Attached Figure Description

[0024] Figure 1A According to some embodiments of this application, a schematic diagram of an IPv4 address is shown;

[0025] Figure 1B According to some embodiments of this application, a schematic diagram of an IPv6 address is shown;

[0026] Figure 2 According to some embodiments of this application, a schematic diagram of a network access scenario is shown;

[0027] Figure 3 According to some embodiments of this application, a schematic diagram of a process of a mobile phone 1 accessing an IPv4 network domain is shown;

[0028] Figure 4A According to some embodiments of this application, schematic diagrams are shown of several commonly used methods for converting IPv4 addresses to IPv6 addresses;

[0029] Figure 4B According to some embodiments of this application, the use of Figure 4A The diagram illustrates the results of converting the same IPv4 address 192.0.2.53 to an IPv6 address using the six conversion methods shown.

[0030] Figure 5 According to some embodiments of this application, a schematic diagram is shown of a CLAT 12 receiving an incorrect IPv4 address;

[0031] Figure 6 According to some embodiments of this application, a flowchart of a network access method is shown;

[0032] Figures 7A to 7D According to some embodiments of this application, a schematic diagram of the interface displayed on mobile phone 1 during the process of enabling the encrypted DNS function of mobile phone 1 is shown;

[0033] Figure 8 According to some embodiments of this application, a flowchart of another network access method is shown;

[0034] Figure 9 According to some embodiments of this application, a flowchart of yet another network access method is shown;

[0035] Figure 10According to some embodiments of this application, a flowchart of another network access method is shown;

[0036] Figure 11 According to some embodiments of this application, a structural schematic diagram of a mobile phone 1 is shown;

[0037] Figure 12 According to some embodiments of this application, a schematic diagram of the software architecture of a mobile phone 1 is shown. Detailed Implementation

[0038] The illustrative embodiments of this application include, but are not limited to, network access methods, storage media, program products, and electronic devices.

[0039] First, the terminology used in the embodiments of this application will be introduced.

[0040] (1) IPv4

[0041] IPv4 uses 32 bits (4 bytes) to represent an IP address. An IPv4 address can be written in any form representing a 32-bit integer value, but for ease of human reading and analysis, it is usually written in dotted decimal notation, where the four bytes are written separately in decimal, separated by dots. For example, see [reference]. Figure 1A An IPv4 address can be represented in ten-digit form as “xxxx” (where x is an integer from 0 to 255), for example, 255.255.255.255. Each byte can be represented by 8 bits of binary, for example, the binary number corresponding to 255 is 11111111.

[0042] (2) IPv6

[0043] IPv6 uses 128-bit (16-byte) addresses, four times the length of IPv4 addresses. Therefore, the dotted decimal notation of IPv4 is no longer applicable, and hexadecimal representation is used instead. IPv6 addresses can be represented using colon-hexadecimal notation, in the format X:X:X:X:X:X:X:X, where each X represents 16 bits (four hexadecimal digits) in the address, for example... Figure 1BThe given "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff" shows that each hexadecimal number can be represented by 4 bits of binary. To compress the length of IPv6 addresses, they can be abbreviated. For example, the leading zeros of the four hexadecimal digits before each colon can be omitted. For instance, the IPv6 address "ffff:ffff:00ff:0fff:000f:0000:ffff:ffff" with leading zeros can be abbreviated to "ffff:ffff:ff:fff::ffff:ffff".

[0044] (3) IPv6-only network

[0045] An IPv6-only network is a network that can only use IPv6 addresses and not other forms of IP addresses, such as IPv4 addresses, to transmit network access requests. Electronic devices connected through an IPv6-only network can only transmit network access requests using IPv6 addresses.

[0046] (4) Encrypted DNS

[0047] Encrypted DNS is a security mechanism that prevents unauthorized modification of the IPv4 address resolved by the DNS server. When an electronic device sends a domain name resolution request to the DNS server, the DNS server encrypts the received IPv4 address before transmitting it to the electronic device. The encrypted IPv4 address can only be accessed by that specific electronic device, preventing unauthorized modification during transmission and ensuring the security of the device's network access. Generally, encrypted DNS services are provided by third-party DNS servers; ISP-provided DNS servers typically do not have this functionality.

[0048] The technical solutions of the embodiments of this application will be described below with reference to the accompanying drawings.

[0049] Figure 2 According to some embodiments of this application, a schematic diagram of a network access scenario is shown.

[0050] like Figure 2 As shown, mobile phone 1 connects to operator network equipment 2 via an IPv6-only network. After mobile phone 1 enables encrypted DNS, due to the support of third-party DNS servers (such as Google) that support encrypted DNS... TMThe IP address returned to mobile phone 1 by the DNS server (e.g., 8.8.8.8) is an IPv4 address, such as 192.0.2.33. Mobile phone 1 needs to use the customer-side translator (CLAT) 12 set in the phone to convert the IPv4 address 192.0.2.33 into the IPv6 address 2001:db8:122:344::192.0.2.33, and then send the obtained IPv6 address to the operator's network device 2. After receiving the IPv6 address, the operator's network device 2 uses the provider-side translator (PLAT) 21 to convert the IPv6 address into the IPv4 address 192.0.2.33 before accessing the target IPv4 network domain, such as the server 3 corresponding to the IPv4 address.

[0051] It is understandable that CLAT 12 is a client-side address translation service set up in the system software of mobile phone 1, used to convert IPv4 addresses to IPv6 addresses. PLAT 21 is an application set up in the operator's network equipment, used to convert IPv6 addresses to IPv4 addresses.

[0052] Specifically, Figure 3 According to some embodiments of this application, a schematic diagram of a process for a mobile phone 1 to access an IPv4 network domain is shown. Figure 3 As shown, this process is executed by mobile phone 1 and includes the following steps:

[0053] S301: An IPv4 access request was detected.

[0054] For example, after an application in mobile phone 1 initiates a request to access an IPv4 address, the IPv4 access request can be detected. As another example, when mobile phone 1 receives an IPv4 address returned by a DNS server, it can detect an IPv4 request. In other embodiments, mobile phone 1 may also detect IPv4 access requests in other circumstances, which are not limited here.

[0055] It is understandable that an IPv4 access request can include an IPv4 address, such as 192.0.2.33.

[0056] S302: Obtain the default unique IPv6 prefix and / or suffix.

[0057] In some embodiments, the system software of mobile phone 1 presets a unique IPv6 prefix and / or suffix, and mobile phone 1 can obtain this preset unique IPv6 prefix and / or suffix when it detects an IPv4 access request. For example, Android TMThe system's default unique IPv6 address has a 96-bit prefix, such as 2001:db8:122:344::.

[0058] S303: Obtain the IPv6 address based on the preset unique IPv6 prefix and / or suffix and the IPv4 address in the IPv4 access request.

[0059] For example, mobile phone 1 can concatenate the aforementioned 96-bit prefix 2001:db8:122:344:: with the IPv4 address 192.0.2.33 to obtain the IPv6 address 2001:db8:122:344::192.0.2.33.

[0060] S304: Access the IPv4 network domain using the obtained IPv6 address.

[0061] That is, mobile phone 1 accesses the IPv4 network domain based on the obtained IPv6 address. For example, it accesses the aforementioned IPv4 server 3 by sending the IPv6 address 2001:db8:122:344::192.0.2.33 to the operator's network device 2.

[0062] As mentioned earlier, if the way CLAT 12 converts IPv4 addresses to IPv6 addresses is different from the way PLAT 21 converts IPv6 addresses to IPv4 addresses, the IPv4 address obtained by PLAT 21 based on the IPv6 address will be different from the IPv4 address that mobile phone 1 wants to access. As a result, mobile phone 1 will access the wrong IPv4 network domain or will be unable to access the network.

[0063] Specifically, Figure 4A According to some embodiments of this application, several commonly used methods for converting IPv4 addresses to IPv6 addresses are shown. Figure 4B It shows the use of Figure 4A The six conversion methods described above result in the conversion of the same IPv4 address 192.0.2.53 to an IPv6 address. For example... Figure 4A As shown, different conversion methods use prefixes and suffixes of different lengths. CLAT 12 embeds the IPv4 address into different bits of the IPv6 address. For example, conversion method 05 embeds the IPv4 address into bits 72 to 103 of the IPv6 address, while conversion method 06 embeds the IPv4 address into bits 96 to 127 of the IPv6 address. Figure 4B It is evident that different conversion methods yield different results when converting the same IPv4 address to an IPv6 address.

[0064] refer to Figure 5If PLAT 12 uses conversion method 06 to convert the IPv4 address 192.0.2.53 to the IPv6 address 2001:db8:122:344::192.0.2.33, the IPv4 address is embedded in bits 96 to 127 of the IPv6 address. If PLAT 21 uses conversion method 05 to convert the IPv6 address to an IPv4 address, it will read bits 72 to 103 of the 128-bit IPv6 address, i.e., "00000000.0000000.11000000.00000000", corresponding to the IPv4 address 0.0.192.0 instead of 192.0.2.53. This causes mobile phone 1 to access the network domain corresponding to IPv4 address 0.0.192.0 instead of IPv4 address 192.0.2.53, affecting the user experience.

[0065] Understandable. Figure 4B The specific content of the IPv6 prefix in conversion methods 01 to 06 shown is only an example. In other embodiments, the specific content of the IPv6 prefix of each conversion method may also be other content, such as referring to the IPv6 prefix (see the following text description for details, which will not be repeated here), and is not limited here.

[0066] To address the aforementioned issues, this application provides a network access method. After determining that encrypted DNS functionality is enabled and the phone is connected to an IPv6 network, it accesses the network from a DNS server that supports encrypted DNS functionality (e.g., Baidu). TM Google TM Tencent TM Obtain the preset network domain (e.g., Huawei Cloud, Baidu) from the provided DNS server. TM Google TM Tencent TM The system obtains the IPv4 address of a server (such as a mobile phone), and then converts the IPv4 address to an IPv6 address one by one according to several preset IPv4-to-IPv6 address conversion methods (such as the aforementioned conversion methods 01 to 06). The mobile phone then accesses a preset network domain through this IPv6 address. If the access is successful, the current IPv4-to-IPv6 address conversion method is recorded. In this IPv6 network environment, mobile phone 1 accesses the IPv4 network domain using the recorded IPv4-to-IPv6 address conversion method. In this way, mobile phone 1 can obtain the current network operator's or IPv6 network device's method for converting IPv6 addresses to IPv4 addresses through trial and error, and then use the corresponding method to convert the IPv4 address to IPv6 address to access the IPv4 network domain. This improves the success rate of users accessing IPv4 network domains through IPv6-only networks and enhances the user experience.

[0067] Specifically, Figure 6 According to some embodiments of this application, a flowchart of a network access method is shown.

[0068] like Figure 6 As shown, the execution subject of this method is mobile phone 1, and it includes the following steps:

[0069] S601: IPv6 prefix probe command detected.

[0070] That is, when mobile phone 1 detects the IPv6 prefix probe command, it triggers the network access method provided in this application embodiment.

[0071] For example, when mobile phone 1 detects that its encrypted DNS function is enabled, it can detect the IPv6 prefix probe command.

[0072] In some embodiments, the user can... Figures 7A to 7D The process shown is to enable the encrypted DNS function on phone 1. Specifically, the user can first click... Figure 7A Access the settings app 71 through the settings interface shown. Figure 7B The settings interface shown can be accessed by clicking... Figure 7B The "More Connections" control shown enters Figure 7C The More Connection Settings interface will appear as shown; then click... Figure 7C The "Encrypted DNS" control 73 in the more connection settings interface shown can be accessed. Figure 7D The encrypted DNS settings interface is shown. Users can enable DNS encryption on mobile phone 1 by selecting either the "Automatic" control 74 or the "Specify Encrypted DNS Service" control 75. Once mobile phone 1 detects that the user has selected either the "Automatic" control 74 or the "Specify Encrypted DNS Service" control 75, it can determine that the encrypted DNS function is enabled, allowing mobile phone 1 to detect IPv6 prefix probe commands.

[0073] It is understandable that after the encrypted DNS function of mobile phone 1 is enabled, the network domains accessed by mobile phone 1 (such as www.huawei.com) need to obtain the IPv4 address of the network domain (such as 122.225.83.146) through a DNS server that supports the encrypted DNS function.

[0074] For example, when encrypted DNS is enabled on mobile phone 1 and the IPv6 network environment to which mobile phone 1 is connected changes, such as when mobile phone 1's network is switched from operator 1 to operator 2, the IPv6 prefix probe command can be detected.

[0075] For example, if encrypted DNS is enabled on phone 1 and an access request for an IPv4 network domain is detected, IPv6 prefix probe commands can be detected. If the "Huawei Cloud" application on phone 1 records the IPv4 address of the Huawei Cloud server as 123.125.46.111, then when a user accesses the Huawei Cloud server through the Huawei Cloud application, phone 1 can detect the IPv4 network domain access request.

[0076] For example, if encrypted DNS is enabled on mobile phone 1, the network currently connected to is an IPv6 network, and access to the IPv4 network domain fails, mobile phone 1 can detect the IPv6 prefix probe command. If mobile phone 1 is currently using method 4 (described above) to convert IPv4 addresses to IPv6 addresses, and the network device connected to mobile phone 1 is using method 6 (described above) to convert IPv6 addresses to IPv4 addresses, then after mobile phone 1 fails to access the aforementioned Huawei Cloud server, mobile phone 1 can detect the IPv6 prefix probe command.

[0077] It is understood that in other embodiments, mobile phone 1 may also detect IPv6 probe commands in other circumstances, which is not limited here.

[0078] S602: Traverse the DNS server list of mobile phone 1, select a DNS server to initiate an encrypted DNS function probe.

[0079] After detecting the IPv6 prefix probe command, mobile phone 1 traverses its DNS server list, selects a DNS server to initiate an encrypted DNS function probe, for example, sending a command to the DNS server to confirm whether the DNS server supports the encrypted DNS function. After receiving the command, the DNS server returns a function identifier to mobile phone 1 indicating whether the DNS server supports the encrypted DNS function.

[0080] It is understandable that the DNS server list of mobile phone 1 can be set by the user, or by mobile phone 1 according to the network operator currently connected to mobile phone 1, or by the developer of mobile phone 1 or the application in mobile phone 1, and there are no restrictions here.

[0081] It is understood that in some embodiments, mobile phone 1 can traverse the DNS server list according to the storage order of the DNS servers, or it can traverse the DNS server list according to the usage frequency of the DNS servers, and there is no limitation here.

[0082] S603: Determine whether the currently probed DNS server supports encrypted DNS functionality.

[0083] Based on the detection results, such as the function identifier sent by the DNS server indicating whether the DNS server supports the encrypted DNS function, mobile phone 1 determines whether the current DNS server supports the encrypted DNS function. If it is determined that the currently detected DNS server supports the encrypted DNS function, the process proceeds to step S604; otherwise, if it is determined that the currently detected DNS server does not support the encrypted DNS function, the process proceeds to step S602 to detect the next DNS server.

[0084] It is understood that in other embodiments, mobile phone 1 may also determine whether the currently probed DNS server supports encrypted DNS function through other means, which is not limited here.

[0085] S604: Send a preset network probe domain to a DNS server that supports DNS encryption to initiate a DNS query and obtain an IPv4 address.

[0086] After detecting a DNS server that supports encrypted DNS, mobile phone 1 sends a preset network probe domain to the DNS server that supports DNS encryption to initiate a DNS query. For example, it sends the Uniform Resource Locator (URL) of the preset network probe domain to the DNS server to obtain the IPv4 address of the preset network probe domain.

[0087] It's understandable that the preset network detection domain can be one or multiple, such as Huawei and Baidu. TM Tencent TM Google TM URLs such as ...

[0088] Specifically, for example, mobile phone 1 can send the URL of Huawei's website "www.huawei.com" to a DNS server that supports encrypted DNS function, and then obtain the IPv4 address of Huawei's website 122.225.83.146 from the DNS server.

[0089] It is understandable that when there are multiple preset network detection domains, mobile phone 1 can obtain the IPv4 addresses of multiple preset detection network domains, or it can obtain only the IPv4 address of one preset detection network domain; this is not limited here.

[0090] S605: Select one IPv6 prefix length from a set of preset IPv6 prefix lengths as the probe length, and concatenate the probe length bits of the reference IPv6 prefix with the IPv4 address to obtain the IPv6 address.

[0091] After obtaining the IPv4 address of the preset network probe domain, mobile phone 1 selects one from multiple preset IPv6 prefix lengths as the probe length, and concatenates the first probe length bits of the reference IPv6 prefix with the obtained IPv4 address to obtain the IPv6 address.

[0092] For example, refer to Figure 4A and Figure 4B The preset IPv6 prefix length can include 32 bits, 40 bits, 48 ​​bits, 56 bits, 64 bits, 96 bits, etc., and different prefix lengths indicate the position where the IPv4 address is embedded in the IPv6 address. Mobile phone 1 can select a prefix length from the above prefix lengths, for example, select a 96-bit prefix length, and concatenate the first 96 bits of the reference IPv6 prefix (2001:db8:122:344::) with the IPv4 address 122.225.83.146 to obtain the IPv6 address 2001:db8:122:344::122.225.83.146.

[0093] It is understandable that the reference IPv6 prefix is ​​the IPv6 prefix that the network device connected to the IPv6 network of mobile phone 1 can recognize. When the network device recognizes the first preset bits of the reference IPv6 prefix (e.g., 32 bits, 40 bits, 48 ​​bits, 56 bits, 64 bits, 96 bits, etc.), it determines that the IPv6 address is used to access the IPv4 network domain, and extracts the IPv4 address from the IPv6 address to access the corresponding IPv4 network domain.

[0094] In some embodiments, mobile phone 1 can obtain a reference IPv6 prefix through an IPv4-only probe domain. An IPv4-only probe domain refers to a server that can provide the electronic device (e.g., mobile phone 1) that initiates the access request with a reference IPv6 prefix for the electronic device to access the IPv4 network domain through the IPv6-only network. For example, the IPv4-only probe domain with the URL ipv4only.arpa defined in RFC (Request For Comments) 7050.

[0095] It is understood that the reference IPv6 prefix can also be stored in the memory of mobile phone 1, or sent to mobile phone 1 by the network device connected to mobile phone 1. This application embodiment does not limit the storage / retrieval method of the reference IPv6 prefix.

[0096] It is understood that in other embodiments, the preset IPv6 prefix length may also include other prefix lengths, which are not limited here.

[0097] It is understood that in some embodiments, the prefix length and suffix length corresponding to different conversion methods can also be obtained, and the IPv4 address can be embedded into the IPv6 address according to the corresponding conversion method. This is not limited here.

[0098] It is understood that in some embodiments, mobile phone 1 may select an IPv6 prefix according to the storage order of multiple preset IPv6 prefix lengths, or select an IPv6 prefix length according to the usage frequency of each preset IPv6 prefix length, or randomly select an IPv6 prefix length that has not been used in the current network access process, which is not limited here.

[0099] S606: Determine whether the preset network probe domain can be accessed through the obtained IPv6 address.

[0100] Mobile phone 1 determines whether it can access the preset network probe domain through the obtained IPv6 address. If it is determined that it can access the preset network probe domain through the obtained IPv6 address, it means that the IPv6 prefix length used by mobile phone 1 is the same as the IPv6 prefix length used by the operator's network equipment (that is, the way mobile phone 1 converts IPv4 address to IPv6 address corresponds to the way the operator's network equipment converts IPv6 address to IPv4 address), and proceeds to step S607; otherwise, it means that the IPv6 prefix length used by mobile phone 1 is different from the IPv6 prefix length used by the network operator (that is, the way mobile phone 1 converts IPv4 address to IPv6 address does not correspond to the way the operator's network equipment converts IPv6 address to IPv4 address), and proceeds to step 608.

[0101] In some embodiments, mobile phone 1 can use a packet internet explorer (PING) to explore the aforementioned IPv6 address 2001:db8:122:344::122.225.83.146 to determine whether mobile phone 1 can connect to the preset network probe domain through the obtained IPv6 address. If the delay between mobile phone 1 and the aforementioned IPv6 address is obtained and / or no request timeout message is received, it means that mobile phone 1 can connect to the preset network probe domain through the obtained IPv6 address. For example, if mobile phone 1 obtains through PING that the access delay between mobile phone 1 and IPv6 address 2001:db8:122:344::122.225.83.146 is 20ms, or no request timeout message is received, it means that mobile phone can access the URL "www.huawei.com" of the aforementioned Huawei website through IPv6 address 2001:db8:122:344::122.225.83.146.

[0102] It is understandable that if there are multiple preset network probe domains, and mobile phone 1 can access one of the preset network probe domains, it can be determined that it can access the preset network probe domain through the IPv6 address.

[0103] It is understood that in other embodiments, mobile phone 1 may also determine whether it can access the preset network probe domain through the obtained IPv6 address in other ways, which is not limited here.

[0104] S607: Save probe length and access IPv4 network domains based on the pre-probe length bits of the reference IPv6 prefix.

[0105] Once mobile phone 1 determines that it can access the preset network probe domain through the obtained IPv6 address, it saves the probe length and accesses the IPv4 network domain based on the first probe length bits of the reference IPv6 prefix.

[0106] After probing the length, if mobile phone 1 detects an access request to the IPv4 network domain, it uses the saved probe length, concatenates the first probe length bits of the reference IPv6 prefix with the IPv4 address to obtain the IPv6 address, and then sends the converted IPv6 address to the operator's network equipment to access the IPv4 network domain.

[0107] It is understood that in some embodiments, mobile phone 1 can also record the DNS server that supports encrypted DNS function currently used by mobile phone 1. Mobile phone 1 accesses the network through the DNS server in the current network environment. Therefore, when mobile phone 1 accesses the network, it does not need to detect whether each DNS server set in mobile phone 1 supports DNS encryption function, thereby improving the speed of mobile phone 1 accessing the network.

[0108] S608: Determine whether all preset IPv6 prefix lengths have been selected.

[0109] Mobile phone 1 determines whether all preset IPv6 prefix lengths have been selected (i.e., whether mobile phone 1 has tried all conversion methods). If yes, it means that mobile phone 1 cannot access the preset network probe domain, and proceeds to step S609; if no, proceeds to step S605, and uses another IPv6 prefix length to access the preset network probe domain.

[0110] S609: Determine whether all DNS servers have been selected.

[0111] Mobile phone 1 determines whether all DNS servers have been selected. If so, it means the preset network probe domain is inaccessible or the current network environment does not support access to IPv4 network domains, and the current IPv6 prefix probe ends. Otherwise, it proceeds to step S602 to attempt to access the preset network probe domain through another DNS server. This avoids the possibility of being unable to access the preset network probe domain due to an incorrect IPv4 address resolved by the selected DNS server, increasing the likelihood of mobile phone 1 obtaining the correct IPv6 prefix and thus improving the success rate of mobile phone 1 accessing IPv4 network domains.

[0112] It is understood that in some embodiments, when there are multiple preset network probe domains, mobile phone 1 can also select different preset network probe domains to access, in order to avoid mobile phone 1 being unable to obtain the correct IPv6 prefix due to the inaccessibility of a certain preset network probe domain. In this way, the probability of mobile phone 1 obtaining the correct IPv6 prefix can be increased, thereby increasing the success rate of mobile phone 1 accessing IPv4 network domains.

[0113] The method provided in this application embodiment allows mobile phone 1 to automatically obtain the IPv6 prefix used by the current network operator's network equipment (i.e., the method of converting IPv6 to IPv4) when connected to an IPv6-only network and with encrypted DNS enabled. According to the corresponding method, the IPv4 address in the IPv4 access request of mobile phone 1 is converted to an IPv6 address, ensuring the consistency of the IP address conversion method between mobile phone 1 and the network operator's network equipment, improving the success rate of mobile phone 1 accessing the IPv4 network domain, and enhancing the user experience.

[0114] In the above embodiments, if the preset network probe domain cannot be accessed through encrypted DNS, mobile phone 1 cannot obtain the correct IPv6 prefix, and therefore cannot access the IPv4 network domain. To address this, this application also provides another network access method. After failing to access the preset network probe domain through encrypted DNS, the encrypted DNS function of mobile phone 1 can be disabled, allowing direct access to the IPv4 network domain via the operator's DNS server in a normal manner, thereby further improving the success rate of user network access.

[0115] Specifically, Figure 8 According to some embodiments of this application, a flowchart illustrating another network access method is shown. Figure 8 As shown, the process includes steps S801 to S813. Steps S801 to S809 can be referred to the aforementioned descriptions of steps S601 to S609, and will not be repeated here. The following section discusses... Figure 6 The different steps S810 to S813 of the illustrated embodiment will be described.

[0116] S810: Clear the DNS query results of phone 1 and disable the encrypted DNS function of phone 1.

[0117] If mobile phone 1 cannot access the preset network probe domain through all DNS servers that support encrypted DNS, clear the DNS query results of mobile phone 1 and turn off the encrypted DNS function of mobile phone 1.

[0118] S811: Traverse the DNS service list of mobile phone 1, initiate a normal DNS query, and obtain the IPv6 address of the preset network probe domain.

[0119] After disabling the encrypted DNS function, mobile phone 1 traverses its DNS service list and initiates a normal DNS query (i.e., a query without using encrypted DNS). Servers that support normal DNS queries (such as the operator's DNS server) can determine the IPv4 address of the URL sent by mobile phone 1, convert the IPv4 address to an IPv6 address, and then send it to mobile phone 1.

[0120] S812: Access the preset network probe domain via the IPv6 address and determine whether the IPv6 connection has been successfully established.

[0121] Mobile phone 1 accesses a preset network probe domain via an IPv6 address and determines whether an IPv6 connection can be established with the preset network probe domain. If yes, it means that the current DNS server can access the IPv4 network domain, and proceeds to step S813; otherwise, proceeds to step S811, attempts to perform a normal DNS query through another DNS server that supports normal DNS queries, and determines whether an IPv6 connection can be established with the preset network probe domain.

[0122] S813: Access IPv4 networks via regular DNS queries.

[0123] Once mobile phone 1 confirms that an IPv6 connection has been successfully established, it records the current DNS server and accesses the IPv4 network through that DNS server using a normal query method.

[0124] The method provided in this application allows mobile phone 1 to automatically obtain the IPv6 prefix used by the current network operator's network equipment (i.e., the method of converting IPv6 to IPv4) when connected to an IPv6-only network and with encrypted DNS enabled. It then converts the IPv4 address in mobile phone 1's IPv4 access request to an IPv6 address according to the appropriate method, ensuring consistency in IP address translation between mobile phone 1 and the network operator's network equipment, thus improving the success rate of mobile phone 1 accessing the IPv4 network domain. Furthermore, if encrypted DNS fails to access the IPv4 network domain, mobile phone 1 can automatically switch to a normal query method, utilizing the operator's DNS server to access the IPv4 network domain, further improving the success rate of mobile phone 1 accessing the IPv4 network.

[0125] The network access methods provided in the above embodiments all require obtaining the IPv4 address of a preset network probe domain through an encrypted DNS server, and then using different IPv6 prefixes to combine with the obtained IPv4 address to obtain an IPv6 address to access the preset network probe domain, thereby determining how the network device connected to mobile phone 1 converts the IPv6 address to an IPv4 address, which is time-consuming. Therefore, this application provides another network access method. By storing the IPv4 address of a preset network probe domain in mobile phone 1, mobile phone 1 can directly select an IPv4 address from the stored IPv4 addresses of the preset network probe domain, and use different IPv6 prefixes to combine with the obtained IPv4 address to obtain an IPv6 address to access the preset network probe domain, thereby determining how the network device connected to mobile phone 1 converts the IPv6 address to an IPv4 address. Since it is not necessary to obtain the IPv4 address of the preset network probe domain from an encrypted DNS server, the speed at which mobile phone 1 obtains the method for the network device connected to mobile phone 1 to convert the IPv6 address to an IPv4 address can be improved, thus improving the speed of mobile phone 1 accessing the IPv4 network domain.

[0126] Specifically, Figure 9 According to some embodiments of this application, a flowchart of yet another network access method is shown. The execution entity of this process is mobile phone 1, such as... Figure 9 As shown, the process includes steps S901 to S907. Step S901 can be referred to the relevant description of the preceding step S601, and steps S903 to S906 can be referred to the relevant description of the aforementioned steps S605 to S608, and will not be repeated here. The following section discusses... Figure 6 The different steps S902 and S907 of the illustrated embodiment will be described.

[0127] S902: Obtain the IPv4 address of a preset network probe domain.

[0128] When mobile phone 1 detects an IPv6 prefix probe command, it obtains the IPv4 address of a preset network probe domain.

[0129] It is understandable that mobile phone 1 has at least one preset IPv4 address for a network detection domain, such as Baidu. TM Google TM Huawei TM Tencent TM When a mobile phone 1 detects an IPv6 prefix probe command, it selects an IPv4 address from at least one preset network probe domain's IPv4 address corresponding to the website.

[0130] For example, mobile phone 1 can randomly select one from at least one preset network probe domain IPv4 address, or select it according to the storage order of the IPv4 addresses of each preset network probe domain, or select it according to the usage frequency of the IPv4 addresses of each preset network probe domain, without any limitation.

[0131] S907: Determine whether all preset network probe domain IPv4 addresses have been selected. If yes, it means that mobile phone 1 cannot access the preset network probe domains, and the current IPv6 prefix probe ends; otherwise, proceed to step S902 to select another preset network probe domain IPv4 address to try.

[0132] The method provided in this application embodiment eliminates the need for mobile phone 1 to obtain the IPv4 address of the preset network probe domain from a DNS server that supports encryption. This improves the speed at which mobile phone 1 obtains the IPv6 address converted to IPv4 address by the network device connected to it, thereby increasing the speed at which mobile phone 1 accesses the IPv4 network domain.

[0133] Combination Figures 6 to 9 The embodiments shown in this application also provide another method for network access.

[0134] Specifically, Figure 10 According to some embodiments of this application, a flowchart of another network access method is shown. The execution entity of this process is mobile phone 1, such as... Figure 10 As shown, the process includes the following steps.

[0135] S1001: Mobile phone 1 has been detected to meet the conversion mode detection conditions.

[0136] When mobile phone 1 detects that it meets the conversion mode detection conditions, it triggers the network access method provided in this application embodiment to select one of the preset conversion modes (such as the aforementioned conversion modes 01 to 06) to convert the IPv4 address to the IPv6 address.

[0137] In some embodiments, the conversion mode detection conditions may include any one of the following conditions:

[0138] When mobile phone 1 is connected to an IPv6-only network and encrypted DNS function is enabled on mobile phone 1;

[0139] Mobile phone 1 is connected to an IPv6-only network, encrypted DNS function is enabled, and the IPv6-only network environment to which mobile phone 1 is connected changes (for example, when mobile phone 1's network is switched from operator 1 to operator 2, a conversion detection command can be detected).

[0140] Mobile phone 1 is connected to an IPv6-only network, encrypted DNS is enabled, and access to the IPv4 network domain is failing.

[0141] Mobile phone 1 is connected to an IPv6-only network, encrypted DNS is enabled, and no preset conversion method has been selected to convert the IPv4 address to an IPv6 address.

[0142] It is understood that in other embodiments, the preset conversion conditions may also include other conditions, which are not limited here.

[0143] S1002: Select the target conversion method that meets the preset conversion conditions from multiple preset conversion methods.

[0144] Mobile phone 1 selects the target conversion method that meets the preset conversion conditions from multiple preset conversion methods.

[0145] It is understandable that after converting the IPv4 address of a preset network probe domain to an IPv6 address through a preset conversion method, the preset network probe domain can be accessed through the IPv6 address, and the preset conversion method satisfies the preset conversion condition.

[0146] The specific process of selecting the target conversion method that meets the preset conversion conditions from multiple preset conversion methods can be referred to the relevant descriptions of steps S602 to S607, or steps S802 to S807, or steps S902 to S905 mentioned above, and will not be repeated here.

[0147] S1003: Accessing IPv4 network domains based on target translation method.

[0148] Mobile phone 1 uses a target translation method to convert the IPv4 address of the IPv4 network domain to an IPv6 address in order to access the IPv4 network domain. For details, please refer to the relevant descriptions of steps S607, S807, or S905 above, which will not be repeated here.

[0149] The method provided in this application embodiment allows mobile phone 1 to automatically obtain the IPv6 prefix used by the current network operator's network equipment (i.e., the method of converting IPv6 to IPv4) when connected to an IPv6-only network and with encrypted DNS enabled. Based on the corresponding conversion method, the IPv4 address in mobile phone 1's IPv4 access request is converted to an IPv6 address, ensuring consistency in IP address translation between mobile phone 1 and the network operator's network equipment, thus improving the success rate of mobile phone 1 accessing the IPv4 network domain. Furthermore, if encrypted DNS fails to access the IPv4 network domain, mobile phone 1 can automatically switch to a normal query method, utilizing the operator's DNS server to access the IPv4 network domain, further improving the success rate of mobile phone 1 accessing the IPv4 network.

[0150] further, Figure 11 According to some embodiments of this application, a schematic diagram of the structure of a mobile phone 1 is shown. For example... Figure 3 As shown, mobile phone 1 may include processor 110, power module 120, memory 130, display screen 140, communication module 150, interface module 160, audio module 170, camera module 180, and sensor module 190, etc.

[0151] The processor 110 may include one or more processing units, such as processing modules or circuits of a central processing unit (CPU), a graphics processing unit (GPU), a digital signal processor (DSP), a micro-programmed control unit (MCU), an AI (Artificial Intelligence) processor, or a field-programmable gate array (FPGA). Different processing units may be independent devices or integrated into one or more processors. For example, the processor 110 may be used to execute instructions of the network access methods provided in the foregoing embodiments to obtain the IPv6 prefix used by the network device connected to the mobile phone 1.

[0152] The power module 120 may include a power supply, a power management component, etc. The power supply may be a battery. The power management component manages the charging of the power supply and the supply of power to the processor 110, memory 130, display screen 140, communication module 150, interface module 160, audio module 170, camera module 180, and sensor module 190, etc. The charging management module receives charging input from the charger; the power management module connects to the power supply and is connected to the processor 110.

[0153] The memory 130 can be used to store data, software programs, and modules. It can be volatile memory, such as random-access memory (RAM); or non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid-state drive (SSD); or a combination of the above types of memory; or it can be a removable storage medium, such as a secure digital storage (SD) card. Specifically, in some embodiments of this application, the memory can be used to store instructions for the network access methods provided in the foregoing embodiments, as well as to store the URL of a preset network probe domain, a preset IPv6 prefix, and the IPv6 prefix used by the network device currently connected to the mobile phone 1, obtained through the network access methods of the foregoing embodiments.

[0154] The display screen 140 includes a display panel. The display panel may be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Mini LED, a Micro LED, a Micro OLED, a quantum dot light-emitting diode (QLED), etc.

[0155] The communication module 150 may include a mobile communication unit, a wireless communication unit, and a wired communication unit, etc.

[0156] The mobile communication unit includes, but is not limited to, antennas, power amplifiers, filters, and low-noise amplifiers (LNAs). The mobile communication unit can provide solutions for wireless communication applications such as 2G / 3G / 4G / 5G on mobile phone 1. The mobile communication unit can receive electromagnetic waves via the antenna, filter and amplify the received electromagnetic waves, and transmit them to a modem processor for demodulation. The mobile communication unit can also amplify the signal modulated by the modem processor and radiate it as electromagnetic waves via the antenna. In some embodiments, mobile phone 1 can connect to operator equipment via the mobile communication unit, enabling mobile phone 1 to access the Internet via IPv4 and / or IPv6 addresses.

[0157] The wireless communication unit may include an antenna, and transmits and receives electromagnetic waves via the antenna. The wireless communication unit can provide wireless communication solutions for use on mobile phone 1, including Wireless Local Area Networks (WLAN) (such as Wireless Fidelity (Wi-Fi) networks), Bluetooth (BT), Global Navigation Satellite System (GNSS), Frequency Modulation (FM), Near Field Communication (NFC), and Infrared (IR) technologies. In some embodiments of this application, mobile phone 1 can access other network devices, such as routers supporting IPv6-only networks, through the wireless communication unit, such as WLAN or Wi-Fi.

[0158] The interface module 160 may include an external memory interface, a universal serial bus (USB) interface, etc. The external memory interface can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 10. The external memory card communicates with the processor 110 through the external memory interface to perform data storage. In some embodiments of this application, for example, the universal serial bus interface can be used for communication between the mobile phone 1 and other electronic devices.

[0159] The audio module 170 can convert digital audio information into analog audio signals for output, or convert analog audio input into digital audio signals. The audio module 170 can also be used for encoding and decoding audio signals. In some embodiments, the audio module 170 can be located in the processor 110, or some functional modules of the audio module 170 can be located in the processor 110. The audio module 170 may also include a speaker, earpiece, microphone, and headphone jack. The audio module can realize audio playback and pickup.

[0160] The camera 180 is used to capture still images or videos. An optical image of the scene, generated by the lens, is projected onto a photosensitive element. The photosensitive element converts the light signal into an electrical signal, which is then passed to the ISP (Image Signal Processor) to be converted into a digital image signal. The mobile phone 1 can achieve its shooting function through the ISP, camera 170, video codec, GPU (Graphics Processing Unit), display 140, and processor.

[0161] The sensor module 190 may include proximity sensors, pressure sensors, gyroscope sensors, barometric pressure sensors, magnetic sensors, accelerometers, distance sensors, fingerprint sensors, temperature sensors, touch sensors, ambient light sensors, bone conduction sensors, Hall effect sensors, etc.

[0162] It is understood that the structure of the mobile phone 1 shown in the embodiments of this application does not constitute a specific limitation on the mobile phone 1. In other embodiments of this application, the mobile phone 1 may include more or fewer components than shown, or combine some components, or split some components, or have different component arrangements. The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0163] It is understood that the use of mobile phone 1 in the embodiments of this application is only an example. The technical solutions of the embodiments of this application are also applicable to any other electronic devices, including but not limited to laptop computers, smart TVs, smart speakers, tablet computers, servers, wearable devices, head-mounted displays, mobile email devices, portable game consoles, portable music players, e-reader devices, etc. The embodiments of this application are not limited.

[0164] The software system of mobile phone 1 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses the layered architecture Android system as an example to illustrate the software architecture of mobile phone 1.

[0165] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. Figure 12A schematic diagram of the operating system architecture of a mobile phone 1 is shown according to an embodiment of this application. (Reference) Figure 12 In some embodiments, the Android system is divided into four layers, from top to bottom: application layer 01, application framework layer 02, native library layer 03, and kernel layer 04.

[0166] Application layer 01 can include a series of application packages. These application packages can include applications such as camera, gallery, calendar, call, map, navigation, and Huawei Cloud.

[0167] Application Framework Layer 02 provides an application programming interface (API) and programming framework for the applications in Application Layer 01. The Application Framework Layer includes some predefined functions.

[0168] Application framework layer 02 may include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

[0169] The window manager is used to manage windowed applications. It can retrieve screen size, determine the presence of a status bar, lock the screen, and capture screenshots, among other things.

[0170] Content providers store and retrieve data, making that data accessible to applications. This data can include videos, images, audio, phone calls made and received, browsing history and bookmarks, phone books, etc.

[0171] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.

[0172] The phone manager is used to provide communication functions for mobile phone 1. For example, it manages call status (including call connection, call termination, etc.).

[0173] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.

[0174] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of completed downloads or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating electronic devices, and flashing indicator lights.

[0175] In other embodiments, the application framework layer 02 may also include system services of the mobile phone 1's system software, such as a connectivity service 021 for managing and implementing the network connectivity functions of the mobile phone 1. In some embodiments, the aforementioned CLAT 12 may be integrated into the connectivity service 021, so that after the application of the application layer 01 initiates an access request to the IPv4 network domain, the CLAT 12 in the connectivity service 021 can convert the IPv4 address to an IPv6 address and send it to the network device connected to the mobile phone 1. The instructions of the network access method provided in the embodiments of this application may also be integrated into the connectivity service 021. In cases where the CLAT 12 fails to access the IPv4 network domain, the mobile phone 1 is connected to an IPv6-only network and the encrypted DNS function is enabled, or the IPv6-only network environment of the mobile phone 1 changes, the methods provided in the foregoing embodiments can be used to obtain the method by which the network device connected to the mobile phone 1 converts the IPv6 address to an IPv4 address, such as the IPv6 prefix used.

[0176] Local library 03 may include:

[0177] The Android runtime is responsible for the scheduling and management of the Android system, including the core libraries and the virtual machine. The core libraries consist of two parts: one part contains the functionalities that Java needs to call, and the other part comprises the Android core libraries. Application Layer 01 and Application Framework Layer 02 run within the virtual machine. The virtual machine executes the Java files of Application Layer 01 and Application Framework Layer 02 as binary files. The virtual machine is used for managing object lifecycles, stack management, thread management, security and exception management, and garbage collection, among other functions.

[0178] Multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

[0179] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.

[0180] The media library supports playback and recording of various common audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.

[0181] A 2D graphics engine is a graphics engine for 2D drawing.

[0182] 3D graphics libraries are used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0183] Kernel layer 04 is the layer between hardware and software. Kernel layer 04 includes at least power management, Bluetooth driver, camera driver, and keyboard driver.

[0184] Understandable. Figure 12 The software architecture of mobile phone 1 shown is only an example. In other embodiments, the software architecture of mobile phone 1 may adopt other architectures, which are not limited here.

[0185] The various embodiments of the mechanisms disclosed in this application can be implemented in hardware, software, firmware, or a combination of these implementation methods. Embodiments of this application can be implemented as computer programs or program code executable on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0186] Program code can be applied to input instructions to execute the functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, the processing system includes any system having a processor such as, for example, a digital signal processor (DSP), a microcontroller, an application-specific integrated circuit (ASIC), or a microprocessor.

[0187] The program code can be implemented using a high-level procedural language or an object-oriented programming language to communicate with the processing system. Assembly language or machine language can also be used when needed. In fact, the mechanisms described in this application are not limited to any particular programming language. In either case, the language can be a compiled language or an interpreted language.

[0188] In some cases, the disclosed embodiments may be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments may also be implemented as instructions carried or stored thereon on one or more temporary or non-temporary machine-readable (e.g., computer-readable) storage media, which may be read and executed by one or more processors. For example, the instructions may be distributed via a network or through other computer-readable media. Therefore, machine-readable media may include any mechanism for storing or transmitting information in a machine-readable (e.g., computer-readable) form, including but not limited to floppy disks, optical disks, CD-ROMs, magneto-optical disks, read-only memory (ROM), random access memory (RAM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), magnetic cards or optical cards, flash memory, or tangible machine-readable storage for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) using the Internet in the form of electrical, optical, acoustic, or other propagation signals. Therefore, machine-readable media include any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine-readable (e.g., computer-readable) form.

[0189] In the accompanying drawings, some structural or methodological features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order may not be necessary. Rather, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the illustrative drawings. Furthermore, the inclusion of structural or methodological features in a particular figure does not imply that such features are required in all embodiments, and in some embodiments, these features may be omitted or may be combined with other features.

[0190] It should be noted that all units / modules mentioned in the device embodiments of this application are logical units / modules. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or a combination of multiple physical units / modules. The physical implementation of these logical units / modules themselves is not the most important factor; the combination of functions implemented by these logical units / modules is the key to solving the technical problems proposed in this application. Furthermore, to highlight the innovative aspects of this application, the above-described device embodiments of this application have not introduced units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that the above-described device embodiments do not contain other units / modules.

[0191] It should be noted that in the examples and description of this patent, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one" does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0192] Although this application has been illustrated and described with reference to certain preferred embodiments thereof, those skilled in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.

Claims

1. A network access method, applied to an electronic device, characterized in that, The method includes: The electronic device is connected to a first IPv6-only network; The current connection status of the electronic device is detected to meet the switching mode detection conditions; From multiple preset conversion methods, a first conversion method that meets preset conversion conditions is determined, wherein the preset conversion conditions include: after converting the IPv4 address of the preset network probe domain to an IPv6 address through the conversion method, the corresponding preset network probe domain can be accessed through the IPv6 address; The first conversion method converts the target IPv4 address of the network domain to be accessed into the target IPv6 address. Access the network domain to be accessed via the target IPv6 address.

2. The method according to claim 1, characterized in that, The conversion mode detection conditions include any one of the following conditions: The encrypted DNS function of the electronic device was detected to have switched from off to on; The encrypted DNS function of the electronic device was detected to be enabled, and the electronic device failed to access the IPv4 network domain. The encrypted DNS function of the electronic device was detected to be enabled, and no conversion method for converting IPv4 addresses to IPv6 addresses was determined from the plurality of conversion methods in the electronic device; The encrypted DNS function of the electronic device has been enabled, and the IPv6-only network to which the electronic device is connected has been switched from the first IPv6-only network to the second IPv6-only network.

3. The method according to claim 1, characterized in that, The step of determining a first conversion method that meets the preset conversion conditions from multiple preset conversion methods includes: Select one preset conversion method from multiple preset conversion methods to convert the IPv4 address of the preset network probe domain to an IPv6 address. The preset conversion method that enables access to the preset network probe domain through the obtained IPv6 address is the first conversion method that meets the preset conversion conditions.

4. The method according to claim 3, characterized in that, The step of selecting one preset conversion method from multiple preset conversion methods to convert the IPv4 address of the preset network probe domain to an IPv6 address includes: The IPv6 address of the preset network probe domain is obtained by concatenating the first preset number of bits of the reference IPv6 prefix with the IPv4 address of the preset network probe domain, wherein the preset number is the same as the IPv6 prefix length corresponding to the selected preset conversion method.

5. The method according to claim 4, characterized in that, The reference IPv6 prefix is ​​obtained by the electronic device from the IPv4only probe domain.

6. The method according to claim 1, characterized in that, The IPv4 address of the preset network detection domain is obtained by the electronic device from the first DNS server, wherein the first DNS server supports encrypted DNS functionality.

7. The method according to claim 6, characterized in that, The step of converting the target IPv4 address of the network domain to be accessed into a target IPv6 address using the first conversion method includes: Obtain the target IPv4 address of the network domain to be accessed from the first DNS server; The target IPv4 address is converted to the target IPv6 address using the first conversion method.

8. The method according to claim 7, characterized in that, Also includes: If none of the preset conversion methods meet the preset conversion conditions, the target IPv6 address of the network domain to be accessed is obtained from the second DNS server, and the network domain to be accessed is accessed through the target IPv6 address. The second DNS server does not support encrypted DNS functionality.

9. The method according to claim 8, characterized in that, Also includes: If none of the preset conversion methods meet the preset conversion conditions, the encrypted DNS function of the electronic device is turned off.

10. The method according to claim 4 or 5, characterized in that, The step of converting the target IPv4 address of the network domain to be accessed into a target IPv6 address using the first conversion method includes: The target IPv6 address is obtained by concatenating the front probe length bits of the reference IPv6 prefix with the IPv4 address of the network probe domain to be accessed, wherein the probe length is the same as the IPv6 prefix length corresponding to the first conversion method.

11. The method according to any one of claims 1 to 10, characterized in that, The electronic device operates on the Android system, and the application framework layer of the Android system includes a client-side address translation CLAT; and The client-side address translation CLAT determines the first translation method that meets the preset translation conditions from multiple preset translation methods; And the client-side address translation CLAT converts the target IPv4 address of the network domain to be accessed into the target IPv6 address through the first conversion method.

12. A computer-readable storage medium, characterized in that, The storage medium stores instructions that, when executed on an electronic device, cause the electronic device to implement the network access method according to any one of claims 1 to 11.

13. An electronic device, characterized in that, include: Memory is used to store instructions executed by one or more processors of an electronic device; And a processor, one of the processors of the electronic device, for executing instructions stored in the memory to implement the network access method according to any one of claims 1 to 11.

14. A computer program product, characterized in that, It includes a computer program / instruction that, when executed by a processor, implements the network access method according to any one of claims 1 to 11.