Access method of application server, chip module, terminal and storage medium

By detecting the network quality of IPv6 addresses and switching to different IPv6 addresses or prioritizing IPv4 addresses when the quality falls below a set level, the problem of connection anomalies and inefficiency caused by poor IPv6 network quality is solved, thereby improving the success rate of terminal access to application servers and the user experience.

CN119697153BActive Publication Date: 2026-07-10HUAWEI TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2023-09-25
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

When the network quality of the IPv6 address between the terminal and the application server is poor, the user's Internet experience is poor. Existing technologies repeatedly use the IPv6 address to access the application server, resulting in connection abnormalities and low efficiency.

Method used

By detecting network quality, if the access quality of an IPv6 address is lower than the set level, the terminal switches to a different IPv6 address or prioritizes using an IPv4 address to access the application server, thus avoiding repeated use of abnormal IPv6 addresses and improving connection success rate and efficiency.

Benefits of technology

By dynamically adjusting IPv4/IPv6 address access policies, the success rate and efficiency of terminal access to application servers are improved, thus enhancing the user's online experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119697153B_ABST
    Figure CN119697153B_ABST
Patent Text Reader

Abstract

The embodiment of the present specification provides an application server access method, a chip module, a terminal and a storage medium, and relates to the technical field of communication. The application server access method comprises the following steps: detecting that a first domain name is accessed for a target application; sending a first domain name resolution request to a domain name system server, so as to request a plurality of first IPv4 addresses and a plurality of first IPv6 addresses corresponding to the first domain name; sending a first connection request to the application server, wherein the first connection request comprises a first target IPv6 address in the plurality of first IPv6 addresses; in response to the network quality being lower than a set quality level when the application server is accessed based on the first target IPv6 address, and detecting that the target application accesses the first domain name again; sending a second domain name resolution request to the domain name system server, so as to request a plurality of second IPv4 addresses and a plurality of second IPv6 addresses corresponding to the first domain name; and sending a second connection request to the application server, wherein the second connection request comprises a second target IPv6 address in the plurality of second IPv6 addresses.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field]

[0001] This specification relates to the field of communication technology, and in particular to an application server access method, chip module, terminal and storage medium. [Background Technology]

[0002] Currently, with the transition from Internet Protocol version 4 (IPv4) to Internet Protocol version 6 (IPv6), most terminals support dual-stack functionality by default, meaning they can access application servers using either IPv4 or IPv6 addresses. Considering that deploying IPv6 is the future direction of network development, terminals typically prioritize using IPv6 addresses to access application servers.

[0003] When an application on a terminal needs to access a large website, the domain name of that large website may correspond to multiple IPv4 addresses and multiple IPv6 addresses. In this case, the application on the terminal can prioritize accessing the application server corresponding to the large website based on one of the multiple IPv6 addresses. However, due to network fluctuations where the IPv6 address is located, the network quality between the terminal and the corresponding application server may be poor, resulting in a poor internet experience for the user. [Summary of the Invention]

[0004] This specification provides an application server access method, chip module, terminal, and storage medium. When the network quality of a network containing an IPv6 address is poor, it avoids repeatedly using that IPv6 address to access the application server, thereby improving the success rate and efficiency of the terminal accessing the application server based on the IPv6 address, and ultimately enhancing the user's internet experience.

[0005] Firstly, embodiments of this specification provide a method for accessing an application server, the method comprising:

[0006] A first operation targeting the target application is detected, the first operation instructing the target application to access a first domain name;

[0007] In response to the first operation, a first domain name resolution request is sent to the domain name system server. The first domain name resolution request is used to request multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name.

[0008] Receive the plurality of first IPv4 addresses and the plurality of first IPv6 addresses sent by the Domain Name System server, and send a first connection request to the first application server, wherein the first connection request includes a first target IPv6 address among the plurality of first IPv6 addresses;

[0009] In response to determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than a first preset network quality level, and detecting a second operation for the target application, the second operation instructing the target application to access the first domain name again;

[0010] In response to the second operation, a second domain name resolution request is sent to the domain name system server. The second domain name resolution request is used to request multiple second Pv4 addresses and multiple second IPv6 addresses corresponding to the first domain name.

[0011] The system receives the plurality of second IPv4 addresses and the plurality of second IPv6 addresses sent by the Domain Name System server, and sends a second connection request to the second application server. The second connection request includes a second target IPv6 address among the plurality of second IPv6 addresses, and the second target IPv6 address is different from the first target IPv6 address.

[0012] In the embodiments described in this specification, when a target application on the terminal needs to access a first domain name, the terminal by default requests multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name from the Domain Name System server simultaneously. After obtaining the multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name, based on the principle of prioritizing the use of IPv6 addresses, the terminal can select a specific IPv6 address from the multiple first IPv6 addresses, such as the first target IPv6 address, to initiate a connection request to the corresponding first application server. If the terminal determines that the network quality is poor during the process of accessing the first application server based on the first target IPv6 address, it can be assumed that the network where the first target IPv6 address is located is fluctuating. At this time, if the target application is detected to access the first domain name again, the terminal will request and receive multiple second IPv4 addresses and multiple second IPv6 addresses corresponding to the first domain name from the Domain Name System server again. Then, it will select the second target IPv6 address from the multiple second IPv6 addresses to access the corresponding second application server, instead of continuing to access the corresponding first application server based on the first target IPv6 address. This avoids the repeated access anomalies caused by repeatedly using the first target IPv6 address to access the application server, thereby improving the success rate and efficiency of the terminal accessing the application server based on the IPv6 address, which is beneficial to improving the user's Internet experience.

[0013] Optionally, determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than a first preset network quality level includes:

[0014] The single-address connection anomaly rate is determined based on the number of IPv6 sockets whose target address is the first application server created within the first preset time period, and the number of IPv6 sockets that are not responded to by the first application server.

[0015] The single-address data transmission anomaly rate is determined based on the number of data packets sent by the first application server received within the first preset time period and the number of abnormal data packets in the data packets.

[0016] Based on the single-address connection anomaly rate, the single-address data transmission anomaly rate, and the first preset duration, a first network anomaly rate within a unit duration is obtained;

[0017] In response to the first network anomaly rate being higher than a first preset threshold, it is determined that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first preset network quality level.

[0018] In this embodiment of the specification, on the one hand, the terminal creates an IPv6 socket with the target address of the first application server to establish a connection with the first application server. Therefore, by counting the number of IPv6 sockets created and the number of IPv6 sockets that were not responded to by the first application server, the terminal can determine the single-address connection anomaly rate during the connection establishment process based on a single IPv6 address. A higher single-address connection anomaly rate indicates a higher probability of anomalies occurring during the connection establishment process between the target application in the terminal and the first application server based on the first target IPv6 address; conversely, a lower single-address connection anomaly rate indicates a lower probability of anomalies occurring during the connection establishment process. On the other hand, after establishing a connection with the first application server based on the first target IPv6 address, the terminal can determine the single-address data transmission anomaly rate during the data transmission process after establishing a connection based on a single IPv6 address by counting the number of data packets received from the first application server and the number of abnormal data packets among these packets. A higher single-address data transmission anomaly rate indicates a higher probability of data transmission anomalies after the terminal establishes a connection with the first application server based on the first target IPv6 address. Conversely, a lower single-address data transmission anomaly rate indicates a lower probability of data transmission anomalies after the terminal establishes a connection with the first application server based on the first target IPv6 address. Therefore, by combining the single-address connection anomaly rate with the single-address data transmission anomaly rate within the first preset time period, the network quality when the terminal accesses the first application server based on the first target IPv6 address within a unit of time can be assessed more accurately. This provides a basis for determining whether to switch the IPv6 address when accessing the first domain name again.

[0019] Optionally, after determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first set network quality level, the method further includes:

[0020] Set the target application to disable the first target IPv6 address.

[0021] In the embodiments of this specification, if the terminal determines that the network quality is poor when the target application accesses the corresponding first application server based on the first target IPv6 address, the terminal can set the target application to disable the first target IPv6 address, thereby avoiding repeated access anomalies caused by repeatedly using the first target IPv6 address to access the first application server when the target application accesses the first domain name again.

[0022] Optionally, a second connection request is sent to the second application server, including:

[0023] In response to the presence of a first target IPv6 address that is disabled by the target application among the plurality of second IPv6 addresses, the first target IPv6 address that is disabled by the target application is filtered out from the plurality of second IPv6 addresses, and the second target IPv6 address is determined from the remaining second IPv6 addresses;

[0024] The second connection request is sent to the second application server based on the second target IPv6 address.

[0025] In the embodiments of this specification, if the target application in the terminal accesses the first domain name again, and among the multiple second IPv6 addresses requested and received from the Domain Name System server includes a first target IPv6 address that has been historically used by the target application and has been disabled, then the aforementioned first target IPv6 address can be directly filtered out from the multiple second IPv6 addresses, and the second target IPv6 address can be determined from the remaining IPv6 addresses, thereby ensuring that the second target IPv6 address is different from the aforementioned disabled first target IPv6 address. Based on this, compared to reusing the first target IPv6 address to connect to the corresponding first application server, connecting to the corresponding second application server based on the second target IPv6 address can improve the connection success rate and reduce the abnormal rate of data transmission after the connection is established.

[0026] Optionally, after detecting the second operation targeting the target application, the method further includes:

[0027] In response to the second operation, a third connection request is sent to a third application server. The third connection request includes a third target IPv6 address among the plurality of first IPv6 addresses, and the third target IPv6 address is different from the first target IPv6 address.

[0028] In the embodiments of this specification, if the terminal determines that the network quality is poor during the process of accessing the first application server based on the first target IPv6 address, and detects that the target application accesses the first domain name again, the terminal can directly determine other IPv6 addresses that are different from the first target IPv6, such as a second target IPv6 address, from among multiple first IPv6 addresses to access the corresponding third application server, instead of continuing to access the corresponding first application server based on the first target IPv6. This avoids the repeated access anomalies caused by repeatedly using the first target IPv6 address to access the application server, thereby improving the success rate and efficiency of the terminal accessing the application server based on the IPv6 address, which is beneficial to improving the user's Internet experience.

[0029] Optionally, after setting the first target IPv6 address of the target application to a disabled state, the method further includes:

[0030] In response to meeting a first preset condition, the blocking status of the first target IPv6 address by the target application is lifted, wherein the first preset condition includes the blocking duration of the first target IPv6 address by the target application reaching a second preset duration, or the detection of a carrier switching event, or the detection of a network switching event.

[0031] In the embodiments of this specification, when the target application disables the first target IPv6 address for a period of time equal to a second preset period, or when it is detected that the user identity card used by the terminal has switched operators, or when it is detected that the network type used by the terminal has changed, it can be considered that the network fluctuations affecting the network quality when the terminal accesses the first application server based on the first target IPv6 address have been eliminated. At this time, the target application can lift the disable status of the first target IPv6 address so that the first target IPv6 address can be used normally when accessing the first domain name again.

[0032] Optionally, the method further includes:

[0033] In response to determining that the network quality of the IPv6 network of the target application is lower than a second preset network quality level, and detecting a third operation for the target application, the third operation instructing the target application to access a second domain name;

[0034] In response to the third operation, a third domain name resolution request is sent to the domain name system server. The third domain name resolution request is used to request multiple third IPv4 addresses corresponding to the second domain name.

[0035] A fourth connection request is sent to a fourth application server, the fourth connection request including a first target IPv4 address among the plurality of third IPv4 addresses.

[0036] In the embodiments of this specification, if the terminal determines that the overall network quality of the target application's IPv6 network is poor, and detects that the target application needs to access a second domain name, the terminal can request multiple IPv4 addresses corresponding to the first domain name from the Domain Name System (DNS) server, such as multiple third IPv4 addresses. After receiving the multiple IPv4 addresses returned by the DNS server, the terminal determines one IPv4 address from these multiple third IPv4 addresses, such as the first target IPv4 address, to access the corresponding fourth application server. This avoids repeated access anomalies caused by repeatedly using IPv6 addresses to access the application server when the target application's IPv6 network is poor, thereby improving the success rate and efficiency of the terminal accessing the application server and enhancing the user's internet experience.

[0037] Optionally, in response to determining that the network quality of the IPv6 network of the target application is lower than a second preset network quality level, the following steps are included:

[0038] The multi-address abnormal access rate is determined based on the total number of times the target application accesses the corresponding application server based on multiple target IPv6 addresses within the third preset time period, and the total number of times the target application abnormally accesses the corresponding application server based on the multiple target IPv6 addresses.

[0039] The multi-address connection anomaly rate is determined based on the total number of IPv6 sockets created by the target application when accessing the corresponding application server based on the multiple target IPv6 addresses within the third preset time period, and the total number of IPv6 sockets that are not responded to by the corresponding application server.

[0040] A second network anomaly rate is determined based on the multi-address abnormal access rate and the multi-address connection abnormal rate;

[0041] In response to the second network anomaly rate being higher than a second preset threshold, it is determined that the network quality of the IPv6 network of the target application is lower than the second preset network quality level.

[0042] In this embodiment of the specification, within the third preset time period, the target application may access other domains in addition to the first domain. That is, the target application may access the corresponding application server based on multiple IPv6 addresses within the third preset time period. Therefore, on the one hand, by statistically analyzing the total number of accesses to the corresponding application server based on IPv6 addresses and the total number of abnormal accesses when accessing the corresponding application server based on IPv6 addresses in the above process, the multi-address abnormal access rate of the target application in the terminal when accessing the corresponding application server based on different IPv6 addresses can be determined. A higher multi-address abnormal access rate indicates a higher likelihood of poor overall network quality in the IPv6 network used by the target application on the terminal; conversely, a lower multi-address abnormal access rate indicates a lower likelihood of poor overall network quality in the IPv6 network used by the target application on the terminal. On the other hand, the total number of IPv6 sockets created when the target application accesses the corresponding application server based on different IPv6 addresses, and the total number of IPv6 sockets created when accessing the corresponding application server based on different IPv6 addresses that did not receive a response from the corresponding application server, can be used to determine the multi-address connection anomaly rate during the connection establishment process between the target application on the terminal and the corresponding application server based on different IPv6 addresses. A higher multi-address connection anomaly rate indicates a higher likelihood of poor overall network quality in the IPv6 network used by the target application on the terminal; conversely, a lower multi-address connection anomaly rate indicates a lower likelihood of poor overall network quality in the IPv6 network used by the target application on the terminal. By combining the multi-address access anomaly rate with the multi-address connection anomaly rate within the third preset time period, the network quality of the target application in the terminal when accessing the corresponding application server based on the IPv6 network can be evaluated more accurately. This provides a basis for determining whether to switch to the IPv4 network when accessing any domain name is required.

[0043] Optionally, after determining that the target application is abnormally accessing the corresponding application server via the IPv6 network, the method further includes:

[0044] Configure the target application to disable all IPv6 addresses.

[0045] In the embodiments of this specification, if the terminal determines that the overall network quality is poor when the target application accesses the corresponding application server based on different IPv6 addresses, the terminal can set the target application to disable all IPv6 addresses, thereby avoiding repeated access anomalies caused by repeatedly using IPv6 addresses to access the corresponding application server when the target application accesses any domain name again.

[0046] Optionally, the target application can be configured to disable all IPv6 addresses, including:

[0047] In response to determining that the network quality of the target application's IPv4 network is higher than a third preset network quality level, the target application is set to disable all IPv6 addresses.

[0048] In the embodiments of this specification, if the terminal determines that the network quality of the IPv6 network used by the target application is poor, it needs to further determine the network quality of the IPv4 network used by the target application. If the network quality of the IPv4 network used by the target application is good, the target application will be set to disable all IPv6 addresses, thereby ensuring that the target application has a high success rate and high access efficiency when it can access the corresponding application server based on the IPv4 network.

[0049] Optionally, in response to the third operation, a third domain name resolution request is sent to the Domain Name System server, including:

[0050] In response to the third operation, determine whether all IPv6 addresses of the target application are disabled;

[0051] If so, send the third domain name resolution request to the domain name system server.

[0052] In the embodiments of this specification, if the terminal determines that the overall network quality of the target application's IPv6 network is poor, while the overall network quality of the target application's IPv4 network is good, and if it detects that the target application needs to access the second domain name, the terminal can first determine whether all IPv6 addresses of the target application have been disabled. If so, the strategy of prioritizing the use of the IPv6 network is changed to prioritizing the use of the better-quality IPv4 network. That is, when performing domain name resolution with the Domain Name System server, only the IPv4 address corresponding to the second domain name is requested. This ensures a high success rate and high access efficiency when the target application accesses the corresponding application server based on the IPv4 network, while avoiding resource waste caused by requesting the IPv6 address corresponding to the second domain name when all IPv6 addresses of the target application are disabled.

[0053] Optionally, after detecting a third operation targeting the target application, the method further includes:

[0054] In response to the third operation, a fourth domain name resolution request is sent to the domain name system server. The fourth domain name resolution request is used to request multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name.

[0055] The system receives the plurality of fourth IPv4 addresses and the plurality of fourth IPv6 addresses sent by the Domain Name System server, and sends a fifth connection request to the fifth application server, wherein the fifth connection request includes a second target IPv4 address among the plurality of fourth IPv4 addresses.

[0056] In the embodiments of this specification, when the terminal determines that the overall network quality of the target application's IPv6 network is poor, while the overall network quality of the target application's IPv4 network is good, if it detects that the target application needs to access a second domain name, it can simultaneously request multiple IPv4 addresses and multiple IPv6 addresses corresponding to the second domain name from the Domain Name System server. For example, multiple fourth IPv4 addresses and multiple fourth IPv6 addresses. Then, it prioritizes selecting one IPv4 address from the multiple fourth IPv4 addresses, such as the second target IPv4 address, to access the corresponding fifth application server. Thus, even when the target application's IPv6 network is poor, it can utilize the better IPv4 network to access the corresponding application server, avoiding repeated access anomalies caused by repeatedly using IPv6 addresses to access the application server. This ensures a high success rate and high access efficiency when the terminal accesses the application server, which is beneficial for improving the user's internet experience.

[0057] Optionally, a fifth connection request is sent to the fifth application server, including:

[0058] Determine whether all IPv6 addresses of the target application are disabled;

[0059] If so, determine the second target IPv4 address from the plurality of fourth IPv4 addresses;

[0060] The fifth connection request is sent to the fifth application server based on the second target IPv4 address.

[0061] In the embodiments of this specification, when the terminal simultaneously obtains multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name, the terminal can determine whether all IPv6 addresses of the target application are disabled. If so, the terminal determines the second target IPv4 address from the multiple fourth IPv4 addresses to access the corresponding fifth application server. In other words, when the IPv6 network of the target application is poor, by determining that all IPv6 addresses of the target application are disabled, the strategy of prioritizing the use of the IPv6 network is changed to prioritizing the use of the IPv4 network with better network quality to access the corresponding application server. This avoids repeated access anomalies caused by repeatedly accessing the application server based on the IPv6 network, thereby ensuring a high success rate and high access efficiency when the terminal accesses the application server, which is beneficial to improving the user's Internet experience.

[0062] Optionally, determining that the network quality of the target application's IPv4 network is higher than a third preset network quality level includes:

[0063] The multi-address packet anomaly rate is determined based on the number of data packets received by the target application when it accesses the corresponding application server based on multiple target IPv4 addresses within the third preset time period, and the number of abnormal data packets in the data packets.

[0064] Based on the third preset duration and the multi-address data packet anomaly rate, the third network anomaly rate within a unit duration is obtained;

[0065] If the third network anomaly rate is less than the third set threshold, it is determined that the network quality of the IPv4 network of the target application is higher than the third set network quality level.

[0066] In this embodiment of the specification, within a third preset time period, the target application may access the corresponding application server based on different IPv4 addresses. Therefore, the total number of data packets received by the terminal from the IPv4 application server during this process, as well as the total number of abnormal data packets among the received packets, can be statistically analyzed to determine the multi-address data transmission anomaly rate. A higher multi-address data transmission anomaly rate indicates a lower probability that the overall network quality of the IPv4 network used by the target application is good, and correspondingly, a higher network anomaly rate per unit time period. Conversely, a lower multi-address data transmission anomaly rate indicates a higher probability that the overall network quality of the IPv4 network used by the target application is good, and correspondingly, a lower network anomaly rate per unit time period. This allows for a more accurate assessment of the overall network quality of the IPv4 network used by the target application within the third preset time period.

[0067] Optionally, after setting the target application to disable all IPv6 addresses, the method further includes:

[0068] In response to the fulfillment of a second preset condition, the blocking status of the target application on all IPv6 addresses is lifted, wherein the second preset condition includes the blocking duration of the target application blocking all IPv6 addresses reaching a fourth preset duration, or the detection of a carrier switching event, or the detection of a network switching event.

[0069] In the embodiments of this specification, when the target application disables all IPv6 addresses for a period of time equal to a fourth preset period, or when it is detected that the user identity card used by the terminal has switched operators, or when it is detected that the network type used by the terminal has changed, it can be considered that the network fluctuations affecting the network quality when the terminal accesses the application server based on the IPv6 network have been eliminated. At this time, the target application can be unbanned from disabling all IPv6 addresses so that when accessing any domain name again in the future, the IPv6 address can be used preferentially.

[0070] Secondly, embodiments of this specification provide an access device for an application server, the device comprising:

[0071] A detection unit is configured to detect a first operation targeting a target application, wherein the first operation instructs the target application to access a first domain name;

[0072] The sending unit is configured to respond to the first operation by sending a first domain name resolution request to the domain name system server. The first domain name resolution request is used to request multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name.

[0073] The processing unit is configured to receive the plurality of first IPv4 addresses and the plurality of first IPv6 addresses sent by the Domain Name System server, and send a first connection request to the first application server, wherein the first connection request includes a first target IPv6 address among the plurality of first IPv6 addresses.

[0074] The processing unit is further configured to respond to determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than a first preset network quality level, and detecting a second operation for the target application, the second operation instructing the target application to access the first domain name again;

[0075] The sending unit is further configured to respond to the second operation by sending a second domain name resolution request to the domain name system server. The second domain name resolution request is used to request multiple second Pv4 addresses and multiple second IPv6 addresses corresponding to the first domain name.

[0076] The processing unit is further configured to receive the plurality of second IPv4 addresses and the plurality of second IPv6 addresses sent by the Domain Name System server, and send a second connection request to the second application server. The second connection request includes a second target IPv6 address among the plurality of second IPv6 addresses, and the second target IPv6 address is different from the first target IPv6 address.

[0077] Optionally, the processing unit includes a first network quality assessment unit;

[0078] The first network quality assessment unit is specifically used for:

[0079] The single-address connection anomaly rate is determined based on the number of IPv6 sockets whose target address is the first application server created within the first preset time period, and the number of IPv6 sockets that are not responded to by the first application server.

[0080] The single-address data transmission anomaly rate is determined based on the number of data packets sent by the first application server received within the first preset time period and the number of abnormal data packets in the data packets.

[0081] Based on the single-address connection anomaly rate, the single-address data transmission anomaly rate, and the first preset duration, a first network anomaly rate within a unit duration is obtained;

[0082] In response to the first network anomaly rate being higher than a first preset threshold, it is determined that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first preset network quality level.

[0083] Optionally, the processing unit is further configured to: set the target application to disable the first target IPv6 address.

[0084] Optionally, the processing unit includes: a filtering unit, a determining unit, and a first connection request sending unit;

[0085] The filtering unit is configured to filter out the first target IPv6 address that is disabled by the target application from the plurality of second IPv6 addresses in response to the existence of the first target IPv6 address that is disabled by the target application among the plurality of second IPv6 addresses;

[0086] The determining unit is used to determine the second target IPv6 address from the remaining second IPv6 addresses;

[0087] The connection request sending unit is used to send the second connection request to the second application server based on the second target IPv6 address.

[0088] Optionally, the sending unit is further configured to, in response to the second operation, send a third connection request to a third application server, the third connection request including a third target IPv6 address among the plurality of first IPv6 addresses, the third target IPv6 address being different from the first target IPv6 address.

[0089] Optionally, the processing unit is further configured to, in response to satisfying a first preset condition, release the target application from the disabled state of the first target IPv6 address, wherein the first preset condition includes the target application disabling the first target IPv6 address for a duration of a second preset duration, or detecting a carrier switching event, or detecting a network switching event.

[0090] Optionally, the processing unit is further configured to respond to determining that the network quality of the IPv6 network of the target application is lower than a second preset network quality level, and detecting a third operation for the target application, the third operation instructing the target application to access a second domain name;

[0091] The sending unit is further configured to respond to the third operation by sending a third domain name resolution request to the domain name system server, wherein the third domain name resolution request is used to request multiple third IPv4 addresses corresponding to the second domain name;

[0092] The sending unit is further configured to send a fourth connection request to a fourth application server, the fourth connection request including a first target IPv4 address among the plurality of third IPv4 addresses.

[0093] Optionally, the processing unit includes a second network quality assessment unit;

[0094] The second network quality assessment unit is specifically used for:

[0095] The multi-address abnormal access rate is determined based on the total number of times the target application accesses the corresponding application server based on multiple target IPv6 addresses within the third preset time period, and the total number of times the target application abnormally accesses the corresponding application server based on the multiple target IPv6 addresses.

[0096] The multi-address connection anomaly rate is determined based on the total number of IPv6 sockets created by the target application when accessing the corresponding application server based on the multiple target IPv6 addresses within the third preset time period, and the total number of IPv6 sockets that are not responded to by the corresponding application server.

[0097] A second network anomaly rate is determined based on the multi-address abnormal access rate and the multi-address connection abnormal rate;

[0098] In response to the second network anomaly rate being higher than a second preset threshold, it is determined that the network quality of the IPv6 network of the target application is lower than the second preset network quality level.

[0099] Optionally, the processing unit is further configured to set the target application to disable all IPv6 addresses.

[0100] Optionally, the processing unit includes: a third network quality assessment unit and a disabling unit;

[0101] The third network quality assessment unit is used to determine that the network quality of the IPv4 network of the target application is higher than the third set network quality level.

[0102] The disabling unit is used to set the target application to disable all IPv6 addresses.

[0103] Optionally, the sending unit is further configured to, in response to the third operation, send a fourth domain name resolution request to the domain name system server, wherein the fourth domain name resolution request is used to request multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name;

[0104] The processing unit is further configured to receive the plurality of fourth IPv4 addresses and the plurality of fourth IPv6 addresses sent by the Domain Name System server, and send a fifth connection request to the fifth application server, wherein the fifth connection request includes a second target IPv4 address among the plurality of fourth IPv4 addresses.

[0105] Optionally, the processing unit includes: a second connection request sending unit;

[0106] The second connection request sending unit is specifically used for:

[0107] Determine whether all IPv6 addresses of the target application are disabled;

[0108] If so, determine the second target IPv4 address from the plurality of fourth IPv4 addresses;

[0109] The fifth connection request is sent to the fifth application server based on the second target IPv4 address.

[0110] Optionally, the third network quality assessment unit is specifically used for:

[0111] Based on the number of data packets received by the target application from the application server corresponding to multiple target IPv4 addresses within the third preset time period, and the number of abnormal data packets in the data packets, the multi-address data packet abnormality rate is determined.

[0112] Based on the third preset duration and the multi-address data packet anomaly rate, the third network anomaly rate within a unit duration is obtained;

[0113] If the third network anomaly rate is less than the third set threshold, it is determined that the network quality of the IPv4 network of the target application is higher than the third set network quality level.

[0114] Optionally, the processing unit is further configured to release the target application's blocking status of all IPv6 addresses in response to satisfying a second preset condition, wherein the second preset condition includes the target application blocking all IPv6 addresses for a duration of a fourth preset duration, or detecting a carrier switching event, or detecting a network switching event.

[0115] Thirdly, embodiments of this specification provide a chip module, the chip module including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the chip module is triggered to perform the steps of the method as described in any of the first aspects.

[0116] Fourthly, embodiments of this specification provide a terminal, the terminal including a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the terminal is triggered to perform the steps of the method as described in any embodiment of the first aspect.

[0117] Fifthly, embodiments of this specification provide a computer-readable storage medium for storing computer instructions that, when a computer is run, cause the computer to perform the steps of the method as described in any embodiment of the first or second aspect.

[0118] Sixthly, embodiments of this specification provide a computer program product, the computer program product including computer instructions, which, when executed in a computer, cause the computer to perform the steps of the method as described in any embodiment of the first or second aspect.

[0119] It should be understood that the second to sixth aspects of the embodiments of the present invention are consistent with the technical solutions of the first aspect of the embodiments of the present invention, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be described again. [Attached Image Description]

[0120] To more clearly illustrate the technical solutions of the embodiments of this specification, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0121] Figure 1 This specification provides a schematic diagram of the architecture of a communication system as illustrated in an embodiment.

[0122] Figure 2 This is a schematic diagram of the structure of a terminal provided in an embodiment of this specification;

[0123] Figure 3 A software structure block diagram of a terminal provided in an embodiment of this specification;

[0124] Figure 4 A flowchart illustrating an application server access method provided in an embodiment of this specification;

[0125] Figure 5 This is a schematic diagram illustrating the implementation of a first operation on a target application according to an embodiment of this description;

[0126] Figure 6 This is a flowchart illustrating a domain name resolution method provided in an embodiment of this specification.

[0127] Figure 7 This is a flowchart illustrating the process of establishing a connection between a terminal and an application server, as provided in an embodiment of this specification.

[0128] Figure 8 A flowchart illustrating a method for evaluating the network quality of a network containing a first IPv6 address, provided as an embodiment of this specification;

[0129] Figure 9 A flowchart illustrating an application server access method provided in an embodiment of this specification;

[0130] Figure 10 A flowchart illustrating an application server access method provided in an embodiment of this specification;

[0131] Figure 11 A flowchart illustrating an application server access method provided in an embodiment of this specification;

[0132] Figure 12 A flowchart illustrating a method for connecting to a second application server based on a second target IPv6 address, provided as an embodiment of this specification;

[0133] Figure 13A flowchart illustrating a method for connecting to a third application server based on a third target IPv6 address, provided as an embodiment of this specification;

[0134] Figure 14 A flowchart illustrating an application server access method provided in an embodiment of this specification;

[0135] Figure 15 A flowchart illustrating an application server access method provided in an embodiment of this specification;

[0136] Figure 16 A flowchart illustrating a method for accessing an application server based on an IPv4 address, provided as an embodiment of this specification;

[0137] Figure 17 A flowchart illustrating a method for evaluating the network quality of an IPv6 network for a target application, provided in an embodiment of this application;

[0138] Figure 18 A flowchart illustrating a method for accessing an application server based on an IPv4 address, provided as an embodiment of this application;

[0139] Figure 19 A flowchart illustrating a method for accessing an application server based on an IPv4 address, provided as an embodiment of this specification;

[0140] Figure 20 A flowchart illustrating a method for accessing an application server based on an IPv4 address, provided as an embodiment of this specification;

[0141] Figure 21 A flowchart illustrating a method for restricting a target application's use of IPv6 addresses, provided as an embodiment of this specification;

[0142] Figure 22 A flowchart illustrating a method for evaluating the network quality of a target application using an IPv4 network, provided as an embodiment of this specification;

[0143] Figure 23 A flowchart illustrating a method for sending a domain name resolution request provided in an embodiment of this application;

[0144] Figure 24 A flowchart illustrating a method for connecting to a fifth application server based on a second target IPv4 address, provided in an embodiment of this application;

[0145] Figure 25 A flowchart illustrating a method for accessing an application server based on an IPv4 address, provided as an embodiment of this specification;

[0146] Figure 26A flowchart illustrating a method for accessing an application server based on an IPv4 address, provided as an embodiment of this specification;

[0147] Figure 27 This is a flowchart illustrating the entire process of a target application accessing a corresponding application server based on a single address, as provided in the embodiments of this specification.

[0148] Figure 28 This is a flowchart illustrating the entire process of a target application accessing a corresponding application server based on multiple addresses, as provided in the embodiments of this specification.

[0149] Figure 29 A schematic diagram of the structure of an application server access device provided in an embodiment of this specification;

[0150] Figure 30 This is a schematic diagram of the structure of a chip module provided in an embodiment of this specification.

Detailed Implementation Methods

[0151] To better understand the technical solutions in this specification, the embodiments of this specification will be described in detail below with reference to the accompanying drawings.

[0152] It should be understood that the described embodiments are merely some, not all, of the embodiments in this specification. All other embodiments obtained by those skilled in the art based on the embodiments in this specification without inventive effort are within the scope of protection of this specification.

[0153] The terminology used in the embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of this specification. The singular forms “a,” “the,” and “the” as used in the embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0154] Currently, due to the exhaustion of IPv4 addresses, service providers need to transition from deploying IPv4 to deploying IPv6 application servers. Therefore, service providers have begun deploying IPv6 application servers or dual-stack application servers. Dual-stack application servers support both IPv4 and IPv6 protocol stacks simultaneously. This means that during the transition from IPv4 to IPv6 application servers, both IPv4 and IPv6 application servers exist in the network. Most terminals support dual-stack functionality by default, meaning that terminals can access application servers using either IPv4 or IPv6 addresses. Considering that deploying IPv6 is the future direction of network development, terminals typically prioritize using IPv6 addresses to access application servers.

[0155] Please see Figure 1 This is an architecture diagram of a communication system provided in an embodiment of this specification. Figure 1 As shown, the communication system includes one or more terminals 101, one or more Domain Name System (DNS) servers 102, and one or more application servers 103. The terminal 101 can be a smartphone, tablet, smart wearable device, personal computer (PC), personal digital assistant (PDA), virtual reality (VR), augmented reality (AR), in-vehicle device, smart speaker, robot, etc. No particular restrictions are placed on the type of device 101.

[0156] Applications running on terminal 101 can access the corresponding application server 103 via domain names. First, terminal 101 sends a domain name resolution request to DNS server 102. This request includes at least the domain name to be resolved, the request type, and the DNS server address. There are no specific restrictions on the information carried in the domain name resolution request. The domain name to be resolved represents a specific website or network service. For example, the domain name to be resolved could be www.example.com. Request types are mainly divided into two types. For example, when the request type includes an A record, it indicates that only the IPv4 address corresponding to the domain name is being queried; when the request type includes both an A record and an AAAA record, it indicates that both the IPv4 address and IPv6 address corresponding to the domain name are being queried. Typically, for terminal 101, which supports both IPv4 and IPv6 dual-stack functionality, the domain name resolution request sent must include both an A record and an AAAA record. Regarding the DNS server address, if no DNS server address is provided, the default local DNS server is used. Then, after receiving the domain name resolution request, DNS server 102 resolves the domain name according to the request type to obtain the IP address corresponding to the domain name. It is worth noting that when the request type in the domain name resolution request includes both A records and AAAA records, the obtained IP address corresponding to the domain name includes both IPv4 and IPv6 addresses. If www.example.com refers to a large website, the obtained IP address may include multiple IPv4 addresses and multiple IPv6 addresses. Finally, terminal 101 can preferentially use one of the multiple IPv6 addresses mentioned above to initiate a connection request to the corresponding application server 103. It should be understood that multiple IPv4 addresses resolved from the same domain name may correspond to the same application server or different application servers; similarly, multiple IPv6 addresses resolved from the same domain name may correspond to the same application server or different application servers; multiple IPv4 addresses and multiple IPv6 addresses resolved from the same domain name may correspond to the same application server (i.e., the application server is a dual-stack server) or different application servers.

[0157] In the above scenario, when terminal 101 prioritizes accessing the corresponding application server 103 based on one of the multiple IPv6 addresses, network fluctuations in the network where that IPv6 address is located may cause poor network quality between terminal 101 and the corresponding application server 103. As a result, terminal 101 may not receive a response from application server 103, or the waiting time for receiving a response from application server 103 may be too long, leading to a poor user internet experience.

[0158] Therefore, this specification provides an application server access method. In this method, when a target application first accesses a domain name, it can request multiple IPv6 addresses corresponding to that domain name from a DNS server. Then, it determines an IPv6 address from these multiple IPv6 addresses to access the corresponding application server. If the network quality is poor when the terminal accesses the application server using that IPv6 address, and the target application is detected accessing the same domain name again, it can request multiple IPv6 addresses corresponding to that domain name from the DNS server again. Then, it selects an IPv6 address that is different from the one previously obtained to access the application server. This avoids repeatedly using IPv6 addresses that have caused abnormal access in the past, thus improving the success rate and efficiency of the terminal accessing the application server based on the IPv6 address, and ultimately enhancing the user's internet experience.

[0159] Please see Figure 2 This is a schematic diagram of the structure of a terminal 101 provided in an embodiment of this specification. The terminal 101 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, a sensor module 180, buttons 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an accelerometer sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

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

[0161] Processor 110 may include one or more processing units, such as application processors (APs), modem processors, graphics processing units (GPUs), image signal processors (ISPs), controllers, video codecs, digital signal processors (DSPs), baseband processors, and / or neural network processing units (NPUs). These different processing units may be independent devices or integrated into one or more processors.

[0162] The controller can generate operation control signals based on the instruction opcode and timing signals to complete the control of instruction fetching and execution.

[0163] The processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory can store instructions or data that the processor 110 has just used or that are used repeatedly. If the processor 110 needs to use the instruction or data again, it can retrieve it directly from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0164] In some embodiments, the processor 110 may include one or more interfaces. Interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0165] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C buses. The processor 110 can couple to the touch sensor 180K, charger, flash, camera 193, etc., through different I2C bus interfaces. For example, the processor 110 can couple to the touch sensor 180K through the I2C interface, enabling the processor 110 and the touch sensor 180K to communicate through the I2C bus interface, thereby realizing the touch function of the terminal 101.

[0166] The I2S interface can be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses. The processor 110 can be coupled to the audio module 170 via the I2S bus to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the I2S interface to enable the function of answering phone calls through a Bluetooth headset.

[0167] The PCM interface can also be used for audio communication, sampling, quantizing, and encoding analog signals. In some embodiments, the audio module 170 and the wireless communication module 160 can be coupled via the PCM bus interface. In some embodiments, the audio module 170 can also transmit audio signals to the wireless communication module 160 via the PCM interface, enabling the function of answering phone calls through a Bluetooth headset. Both the I2S interface and the PCM interface can be used for audio communication.

[0168] The UART interface is a universal serial data bus used for asynchronous communication. This bus can be a bidirectional communication bus. It converts the data to be transmitted between serial and parallel communication. In some embodiments, the UART interface is typically used to connect the processor 110 and the wireless communication module 160. For example, the processor 110 communicates with the Bluetooth module in the wireless communication module 160 via the UART interface to implement Bluetooth functionality. In some embodiments, the audio module 170 can transmit audio signals to the wireless communication module 160 via the UART interface to enable music playback through Bluetooth headphones.

[0169] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI) and a display serial interface (DSI). In some embodiments, the processor 110 and the camera 193 communicate via the CSI interface to enable the shooting function of the terminal 101. The processor 110 and the display screen 194 communicate via the DSI interface to enable the display function of the terminal 101.

[0170] The GPIO interface can be configured via software. It can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to a camera 193, a display screen 194, a wireless communication module 160, an audio module 170, a sensor module 180, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0171] USB port 130 is a USB standard compliant interface, specifically a Mini USB port, Micro USB port, USB Type-C port, etc. USB port 130 can be used to connect a charger to charge terminal 101, and can also be used for data transfer between terminal 101 and peripheral devices. It can also be used to connect headphones for audio playback. This interface can also be used to connect other electronic devices, such as AR devices.

[0172] It is understood that the interface connection relationships between the modules illustrated in the embodiments of the present invention are merely illustrative and do not constitute a structural limitation on the terminal 101. In other embodiments of this application, the terminal 101 may also adopt different interface connection methods or a combination of multiple interface connection methods as described in the above embodiments.

[0173] The charging management module 140 receives charging input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 receives charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 receives wireless charging input via the wireless charging coil of the terminal 101. While charging the battery 142, the charging management module 140 can also supply power to the terminal 101 via the power management module 141.

[0174] The power management module 141 connects the battery 142, the charging management module 140, and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, providing power to the processor 110, internal memory 121, display screen 194, camera 193, and wireless communication module 160, etc. The power management module 141 can also monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage current, impedance). In some other embodiments, the power management module 141 may also be located within the processor 110. In other embodiments, the power management module 141 and the charging management module 140 may be located in the same device.

[0175] The wireless communication function of terminal 101 can be implemented through antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modem processor and baseband processor, etc.

[0176] Antennas 1 and 2 are used to transmit and receive electromagnetic wave signals. Each antenna in terminal 101 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.

[0177] The mobile communication module 150 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the terminal 101. The mobile communication module 150 may include at least one filter, switch, power amplifier, low-noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves via the antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves for radiation via the antenna 1. In some embodiments, at least some functional modules of the mobile communication module 150 may be housed in the processor 110. In some embodiments, at least some functional modules of the mobile communication module 150 and at least some modules of the processor 110 may be housed in the same device.

[0178] The modem processor may include a modulator and a demodulator. The modulator modulates the low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to the application processor. The application processor outputs sound signals through an audio device (not limited to speaker 170A, receiver 170B, etc.) or displays images or videos through the display screen 194. In some embodiments, the modem processor may be a separate device. In other embodiments, the modem processor may be independent of the processor 110 and may be housed in the same device as the mobile communication module 150 or other functional modules.

[0179] In some embodiments, terminal 101 can establish a communication connection with the operator's mobile communication network through mobile communication module 150 and access the Internet through the mobile communication network. For example, terminal 101 communicates with DNS server 102 and application server 103 through mobile communication module 150.

[0180] The wireless communication module 160 can provide solutions for wireless communication applications on the terminal 101, 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. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 110. The wireless communication module 160 can also receive signals to be transmitted from processor 110, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.

[0181] In some embodiments, terminal 101 can establish a communication connection with the Internet through wireless communication module 160 to access the Internet. For example, terminal 101 communicates with DNS server 102 and application server 103 through wireless communication module 160.

[0182] In some embodiments, antenna 1 of terminal 101 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, enabling terminal 101 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may include Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division Code Division Multiple Access (TD-SCDMA), Long Term Evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).

[0183] Terminal 101 implements display functions through a GPU, display screen 194, and application processor. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations and for graphics rendering. Processor 110 may include one or more GPUs, which execute program instructions to generate or modify display information.

[0184] Display screen 194 is used to display images, videos, etc. Display screen 194 includes a display panel. The display panel can 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 miniature LED, a microLED, a quantum dot light-emitting diode (QLED), etc. In some embodiments, terminal 101 may include one or N displays 194, where N is a positive integer greater than 1.

[0185] Terminal 101 can perform shooting functions through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0186] The ISP (Image Signal Processor) is used to process data fed back from the camera 193. For example, when taking a picture, the shutter is opened, and light is transmitted through the lens to the camera's photosensitive element. The light signal is converted into an electrical signal, and the camera's photosensitive element transmits the electrical signal to the ISP for processing, transforming it into an image visible to the naked eye. The ISP can also perform algorithmic optimization of image noise, brightness, and skin tone. The ISP can also optimize parameters such as exposure and color temperature of the shooting scene. In some embodiments, the ISP can be set in the camera 193.

[0187] Camera 193 is used to capture still images or videos. An object is projected onto a photosensitive element by generating an optical image through the lens. The photosensitive element can be a charge-coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the light signal into an electrical signal, which is then passed to an ISP for conversion into a digital image signal. The ISP outputs the digital image signal to a DSP for processing. The DSP converts the digital image signal into image signals in standard RGB, YUV, or other formats. In some embodiments, terminal 101 may include one or N cameras 193, where N is a positive integer greater than 1.

[0188] A digital signal processor (DSP) is used to process digital signals. Besides digital image signals, it can also process other digital signals. For example, when terminal 101 selects a frequency point, the DSP can perform Fourier transforms on the frequency energy.

[0189] Video codecs are used to compress or decompress digital video. Terminal 101 may support one or more video codecs. Thus, terminal 101 can play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0190] NPU stands for Neural Network (NN) Computing Processor. By borrowing the structure of biological neural networks, such as the transmission patterns between neurons in the human brain, it can rapidly process input information and continuously learn on its own. NPUs enable intelligent cognitive applications in terminals such as image recognition, facial recognition, speech recognition, and text understanding.

[0191] The external storage interface 120 can be used to connect an external storage card, such as a Micro SD card, to expand the storage capacity of the terminal 101. The external storage card communicates with the processor 110 through the external storage interface 120 to perform data storage functions. For example, music, video, and other files can be saved on the external storage card.

[0192] Internal memory 121 can be used to store computer executable program code, which includes instructions. Internal memory 121 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback, image playback, etc.), etc. The data storage area may store data created during the use of terminal 101 (such as audio data, phonebook, etc.). Furthermore, internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. Processor 110 executes various functional applications and data processing of terminal 101 by running instructions stored in internal memory 121 and / or instructions stored in memory located in the processor.

[0193] Terminal 101 can implement audio functions, such as music playback and recording, through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone jack 170D, and an application processor.

[0194] The audio module 170 is used to convert digital audio information into analog audio signals for output, and also to 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 may be located in the processor 110, or some functional modules of the audio module 170 may be located in the processor 110.

[0195] The speaker 170A, also known as a "loudspeaker," is used to convert audio electrical signals into sound signals. Terminal 101 can listen to music or make hands-free calls through the speaker 170A.

[0196] The receiver 170B, also known as the "earpiece," is used to convert audio electrical signals into sound signals. When the terminal 101 receives a phone call or voice message, the receiver 170B can be brought close to the ear to hear the voice.

[0197] Microphone 170C, also known as a "microphone" or "voice transducer," is used to convert sound signals into electrical signals. When making a phone call or sending a voice message, the user can speak by bringing their mouth close to microphone 170C, inputting the sound signal into microphone 170C. Terminal 101 may be equipped with at least one microphone 170C. In some embodiments, terminal 101 may be equipped with two microphones 170C, which, in addition to collecting sound signals, can also perform noise reduction. In other embodiments, terminal 101 may be equipped with three, four, or more microphones 170C, which can collect sound signals, reduce noise, identify the sound source, and perform directional recording, etc.

[0198] The 170D headphone jack is used to connect wired headphones. The 170D headphone jack can be a USB 130 interface or a 3.5mm Open Mobile Terminal Platform (OMTP) standard interface, a CTIA (Cellular Telecommunications Industry Association of the USA) standard interface.

[0199] Pressure sensor 180A is used to sense pressure signals and convert them into electrical signals. In some embodiments, pressure sensor 180A can be disposed on display screen 194. There are many types of pressure sensors 180A, such as resistive pressure sensors, inductive pressure sensors, and capacitive pressure sensors. A capacitive pressure sensor may include at least two parallel plates with conductive material. When force is applied to pressure sensor 180A, the capacitance between the electrodes changes. Terminal 101 determines the pressure intensity based on the change in capacitance. When a touch operation is applied to display screen 194, terminal 101 detects the intensity of the touch operation based on pressure sensor 180A. Terminal 101 can also calculate the touch position based on the detection signal from pressure sensor 180A. In some embodiments, touch operations applied to the same touch position but with different touch operation intensities can correspond to different operation commands. For example: when a touch operation with an intensity less than a first pressure threshold is applied to the SMS application icon, a command to view an SMS is executed. When a touch operation with an intensity greater than or equal to the first pressure threshold is applied to the SMS application icon, a command to create a new SMS is executed.

[0200] The gyroscope sensor 180B can be used to determine the motion attitude of the terminal 101. In some embodiments, the gyroscope sensor 180B can determine the angular velocity of the terminal 101 around three axes (i.e., the x, y, and z axes). The gyroscope sensor 180B can be used for image stabilization. For example, when the shutter is pressed, the gyroscope sensor 180B detects the angle of the terminal 101's shake, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to counteract the shake of the terminal 101 through reverse movement, thus achieving image stabilization. The gyroscope sensor 180B can also be used in navigation and motion-sensing game scenarios.

[0201] The barometric pressure sensor 180C is used to measure air pressure. In some embodiments, the terminal 101 calculates altitude using the air pressure value measured by the barometric pressure sensor 180C to assist in positioning and navigation.

[0202] The magnetic sensor 180D includes a Hall sensor. The terminal 101 can use the magnetic sensor 180D to detect the opening and closing of the flip cover. In some embodiments, when the terminal 101 is a flip phone, the terminal 101 can detect the opening and closing of the flip cover using the magnetic sensor 180D. Then, based on the detected opening and closing state of the cover or the flip cover, features such as automatic flip unlocking can be set.

[0203] The accelerometer 180E can detect the magnitude of acceleration of terminal 101 in various directions (generally three axes). When terminal 101 is stationary, it can detect the magnitude and direction of gravity. It can also be used to identify the attitude of terminal 101, and can be applied to applications such as landscape / portrait switching and pedometers.

[0204] A distance sensor 180F is used to measure distance. Terminal 101 can measure distance via infrared or laser. In some embodiments, during a shooting scene, terminal 101 can utilize the distance sensor 180F to measure distance for rapid focusing.

[0205] The proximity sensor 180G may include, for example, a light-emitting diode (LED) and a light detector, such as a photodiode. The LED may be an infrared LED. Terminal 101 emits infrared light outward through the LED. Terminal 101 uses the photodiode to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near terminal 101. When insufficient reflected light is detected, terminal 101 can determine that there is no object near terminal 101. Terminal 101 can use the proximity sensor 180G to detect when a user holds terminal 101 close to their ear for a call, so as to automatically turn off the screen to save power. The proximity sensor 180G can also be used in holster mode and pocket mode for automatic unlocking and screen locking.

[0206] The ambient light sensor 180L is used to sense the ambient light intensity. The terminal 101 can adaptively adjust the brightness of the display screen 194 based on the sensed ambient light intensity. The ambient light sensor 180L can also be used to automatically adjust the white balance when taking photos. The ambient light sensor 180L can also work in conjunction with the proximity sensor 180G to detect whether the terminal 101 is in a pocket, preventing accidental touches.

[0207] The fingerprint sensor 180H is used to collect fingerprints. The terminal 101 can use the characteristics of the collected fingerprints to unlock the device, access application locks, take photos with the fingerprint, and answer calls with the fingerprint.

[0208] Temperature sensor 180J is used to detect temperature. In some embodiments, terminal 101 uses the temperature detected by temperature sensor 180J to execute a temperature processing strategy. For example, when the temperature reported by temperature sensor 180J exceeds a threshold, terminal 101 reduces the performance of the processor located near temperature sensor 180J to reduce power consumption and implement thermal protection. In other embodiments, when the temperature is below another threshold, terminal 101 heats battery 142 to prevent abnormal shutdown of terminal 101 due to low temperature. In still other embodiments, when the temperature is below yet another threshold, terminal 101 boosts the output voltage of battery 142 to prevent abnormal shutdown due to low temperature.

[0209] Touch sensor 180K, also known as a "touch device," can be located on display screen 194. The touch sensor 180K and display screen 194 together form a touchscreen, also known as a "touchscreen." Touch sensor 180K detects touch operations applied to or near it. The touch sensor can transmit the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through display screen 194. In other embodiments, touch sensor 180K may also be located on the surface of terminal 101, in a different position than display screen 194.

[0210] The bone conduction sensor 180M can acquire vibration signals. In some embodiments, the bone conduction sensor 180M can acquire vibration signals from the vibrating bone segments of the human vocal cords. The bone conduction sensor 180M can also contact the human pulse to receive blood pressure signals. In some embodiments, the bone conduction sensor 180M can also be incorporated into headphones to form bone conduction headphones. The audio module 170 can parse the voice signals based on the vibration signals from the vibrating bone segments of the vocal cords acquired by the bone conduction sensor 180M to realize voice functionality. The application processor can parse heart rate information based on the blood pressure signals acquired by the bone conduction sensor 180M to realize heart rate detection functionality.

[0211] Buttons 190 include a power button, volume buttons, etc. Buttons 190 can be mechanical buttons or touch-sensitive buttons. Terminal 101 can receive button input and generate key signal inputs related to user settings and function control of terminal 101.

[0212] Motor 191 can generate vibration alerts. Motor 191 can be used for incoming call vibration alerts or for touch vibration feedback. For example, different vibration feedback effects can correspond to touch operations performed on different applications (such as taking photos, playing audio, etc.). Motor 191 can also correspond to different vibration feedback effects for touch operations performed on different areas of the display screen 194. Different application scenarios (such as time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also be customized.

[0213] Indicator 192 can be an indicator light, used to indicate charging status, power changes, or to indicate messages, missed calls, notifications, etc.

[0214] The SIM card interface 195 is used to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to make contact with and separate from the terminal 101. The terminal 101 can support one or N SIM card interfaces, where N is a positive integer greater than 1. The SIM card interface 195 can support Nano SIM cards, Micro SIM cards, SIM cards, etc. Multiple cards can be inserted into the same SIM card interface 195 simultaneously. The multiple cards can be of the same or different types. The SIM card interface 195 is also compatible with different types of SIM cards. The SIM card interface 195 is also compatible with external memory cards. The terminal 101 interacts with the network through the SIM card to realize functions such as calls and data communication. In some embodiments, the terminal 101 uses an eSIM, i.e., an embedded SIM card. The eSIM card can be embedded in the terminal 101 and cannot be separated from the terminal 101.

[0215] The software system of terminal 101 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This embodiment of the invention uses a layered Android system as an example to illustrate the software structure of terminal 101.

[0216] Figure 3 This is a software structure block diagram of terminal 101 according to an embodiment of the present invention.

[0217] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0218] The application layer can include a series of application packages.

[0219] like Figure 3 As shown, the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, SMS, and browser (only a portion is shown in the figure). Most of these applications require internet access, such as navigation, browser, video, and music.

[0220] The application framework layer provides application programming interfaces (APIs) and a programming framework for applications in the application layer. The application framework layer includes some predefined functions.

[0221] like Figure 3As shown, the application framework layer can include a DNS protocol stack and a status notification module. Applications in the application layer can send domain name resolution requests to the DNS server through the DNS protocol stack. The DNS protocol stack can cache domain names and their corresponding IP addresses, including IPv4 and IPv6 addresses.

[0222] In some embodiments, the status notification module can send the disabled information received from the kernel layer to the DNS protocol stack, and then the DNS protocol stack can maintain the disabled information, including but not limited to the DNS protocol stack maintaining a single IPv6 address or all IPv6 addresses disabled by a single application.

[0223] For example, the DNS protocol stack, based on the domain name resolution request sent by the application, determines whether the application has all IPv6 addresses disabled. If not, the domain name resolution request sent to the DNS server includes both A records and AAAA records. Subsequently, after receiving multiple IPv4 addresses and multiple IPv6 addresses from the DNS server, the DNS protocol stack determines whether any of these IPv6 addresses are disabled by the same application. If so, the disabled IPv6 address is filtered out from the multiple IPv6 addresses, and then an IPv6 address is selected from the remaining IPv6 addresses and sent to the application. In other words, the DNS protocol stack sends an IPv6 address that is not disabled to the application. The application then establishes a communication connection with the application server based on the disabled IPv6 address and begins communication.

[0224] For example, the DNS protocol stack, based on the domain name resolution request sent by the application, sends a domain name resolution request to the DNS server, and this request includes both A records and AAAA records. Subsequently, after receiving multiple IPv4 addresses and multiple IPv6 addresses from the DNS server, the DNS protocol stack determines whether the application has all IPv6 addresses disabled. If so, it selects one IPv4 address from the multiple IPv4 addresses and sends it to the application. The application then establishes a communication connection with the application server based on the selected IPv4 address and begins communication.

[0225] For example, the DNS protocol stack determines whether the application has all IPv6 addresses disabled based on the domain name resolution request sent by the application. If so, the domain name resolution request sent to the DNS server only includes A records. Subsequently, after receiving multiple IPv4 addresses from the DNS server, the DNS protocol stack selects one IPv4 address from these addresses and sends it to the application. The application then establishes a communication connection with the application server based on the selected IPv4 address and begins communication.

[0226] For example, if the DNS protocol stack determines that the duration of the disabling of a single IPv6 address of a single application has reached a preset duration, or determines that a carrier switching event has occurred, or determines that a network switching event has occurred, then it will lift the disabling status of the single IPv6 address or all IPv6 addresses of the aforementioned single application.

[0227] The application framework layer may also include a window manager, content provider, view system, phone manager, resource manager, notification manager, etc.

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

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

[0230] 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, the display interface of a control panel may include views for displaying text and views for displaying images.

[0231] The phone manager is used to provide communication functions for terminal 101. For example, it manages call status (including connection, hang-up, etc.).

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

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

[0234] The Android Runtime consists of core libraries and a virtual machine. The Android runtime is responsible for the scheduling and management of the Android system.

[0235] The core library consists of two parts: one part is the functionalities that need to be called by the Java language, and the other part is the Android core library.

[0236] The application layer and application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0237] System libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (e.g., OpenGL ES), 2D graphics engines (e.g., SGL), etc.

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

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

[0240] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

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

[0242] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.

[0243] In the embodiments described in this specification, the kernel layer includes a TCP / IP protocol stack, used to encapsulate messages generated by upper-layer applications, generating messages that conform to relevant inter-network communication protocols (such as IPv4 or IPv6), so as to transmit them to the corresponding servers over the network. Correspondingly, it is also used to parse messages received from the network and sent by servers, generating messages that upper-layer applications can parse, and sending them to the upper-layer applications for further processing.

[0244] The kernel layer also includes a network monitoring module, which monitors the network quality of the IPv4 and IPv6 networks of the foreground applications in the terminal and determines whether to disable a single IPv6 address or all IPv6 addresses of the foreground applications.

[0245] The kernel layer also includes a Wi-Fi driver and a Modem driver. The Wi-Fi driver can be used to establish and disconnect a Wi-Fi link between terminal 101 and DNS server 102 or application server 103, and to transmit messages using the Wi-Fi link. The Modem driver can be used to establish and disconnect a mobile communication link between terminal 101 and base station, and to communicate with DNS server 102 or application server 103 through a mobile communication network using the mobile communication link.

[0246] The technical solutions provided in the embodiments of this specification are described below with reference to the accompanying drawings. The technical solutions involved in the following embodiments can all be implemented as follows: Figure 2 The hardware architecture shown and as Figure 3 The software architecture shown is implemented in terminal 101.

[0247] Please see Figure 4 This is a flowchart illustrating an application server access method provided in an embodiment of this specification. The process is described as follows:

[0248] Step 201: The terminal detects a first operation targeting the target application, which instructs the target application to access the first domain name.

[0249] In the embodiments of this specification, the target application can be considered as an application with internet access capability that runs in the foreground, such as a browser, news application, or video application; no particular limitation is made here. When the user performs a first operation on the target application, the terminal can know that the user wants to access the first domain name through the target application. It should be understood that the above-mentioned first operation can be a single operation or a combination of multiple operations; no particular limitation is made here.

[0250] Please see Figure 5 This is a schematic diagram illustrating the implementation of a first operation on a target application according to an embodiment of this description. Figure 5 As shown in (a), if the target application is a browser, when the terminal detects that the browser is launched for the first time after power-on, or detects that a browser running in the background is switched to the foreground, the terminal can display the browser's main interface 301. Then, the user's first operation on the browser to access the first domain name can include: entering the URL or keywords corresponding to the first domain name in the address bar 302 of the main interface 301, and then selecting the "search" control 503. Alternatively, it could be the user clicking the text link 504 or image link 505 corresponding to the first domain name on the browser's main interface 301.

[0251] like Figure 5As shown in (b), if the target application is a news application, the first operation performed by the user on the news application to access the first domain name may include: launching the news application 507 on the terminal main interface 506. In some embodiments, such as Figure 5 As shown in (c), the news application can preload the content of the main interface 508. Then, the first operation performed by the user on the news application to access the first domain name may also include: the user's selection operation on the control 509 corresponding to a certain news item, such as news 1, on the main interface 508 of the news application.

[0252] It should be understood that during the first operation described above, the input of relevant information and the selection of a control can be done manually by the user, or by the user using voice input and voice selection. No special restrictions are placed here.

[0253] Step 202: In response to the first operation, the terminal sends a first domain name resolution request to the domain name system server. The first domain name resolution request is used to request multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name.

[0254] In the embodiments described in this specification, after the target application in the terminal detects the first operation representing access to the first domain name, the target application can look up the IP address corresponding to the first domain name through the DNS protocol stack in the framework layer. If the DNS protocol stack caches the IP address corresponding to the first domain name, for example, if it finds both the IPv4 address and the IPv6 address corresponding to the first domain name, then it will preferentially use the IPv6 address to request a connection to the corresponding application server.

[0255] If the DNS protocol stack in the target application's framework layer does not find the IP address corresponding to the first domain name (i.e., neither the IPv4 nor the IPv6 address), the terminal sends a first domain name resolution request to the DNS server through the DNS protocol stack. This first domain name resolution request includes both A and AAAA records to request the DNS server to return multiple IPv4 and IPv6 addresses. Alternatively, in another embodiment, the first domain name resolution request may not specify any records; that is, it may not include either A or AAAA records, in order to request the DNS server to return multiple IPv4 and IPv6 addresses.

[0256] Step 203: The DNS server responds to the first domain name resolution request, resolves the first domain name, and obtains multiple first IPv4 addresses and multiple first IPv6 addresses.

[0257] In the embodiments described in this specification, after receiving a first domain name resolution request, the DNS server resolves the first domain name based on the domain name to be resolved and the type of network address to be resolved carried in the first domain name resolution request, thereby obtaining multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name. It should be understood that the specific number of IPv4 addresses and IPv6 addresses corresponding to the first domain name that the DNS server can resolve depends on the specific configuration adopted by the service provider of the target application, and this application does not impose any special limitations.

[0258] Please see Figure 6 This is a flowchart illustrating a domain name resolution method provided in an embodiment of this specification. Figure 6 As shown, the DNS resolution process is explained using the first domain name www.example.com as an example.

[0259] Step 301: The DNS server sends a query request to the root name server, requesting the IP address of the top-level domain server for the .com domain.

[0260] It should be understood that the top-level domains managed by root name servers include, but are not limited to, .com, .cn, .net, .org, .edu, .gov, etc.

[0261] Step 302: The root name server sends a response message to the DNS server, which carries the IP address of the top-level domain server for the .com domain.

[0262] Step 303: The DNS server sends a query request to the top-level name server of the .com domain based on the IP address of the top-level name server of the .com domain, requesting to find the IP address of the authoritative name server of the example.com domain.

[0263] Step 304: The top-level name server of the .com domain sends a response message to the DNS server, which carries the IP address of the authoritative name server for the example.com domain.

[0264] Step 305: The DNS server sends a query request to the authoritative name server of the example.com domain based on the IP address of the authoritative name server of the example.com domain, requesting a query for the IP address of www.example.com.

[0265] Step 306: The authoritative name server of the example.com domain sends a response message to the DNS server. This response message carries the IP address corresponding to www.example.com. This network address includes multiple IPv4 addresses and multiple IPv6 addresses.

[0266] It should be understood that when the top-level domain to which the first domain belongs is of another type, the resolution process for the first domain is similar, and will not be elaborated here.

[0267] Step 204: The DNS server sends a first domain name resolution response to the terminal. The first domain name resolution response carries multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name.

[0268] In the embodiments of this specification, after the DNS server obtains the domain name resolution result of the first domain name, that is, after obtaining the multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name, it can, on the one hand, save the domain name resolution result corresponding to the first domain name; on the other hand, it can send the domain name resolution result of the first domain name to the terminal so that the terminal can access the corresponding application server according to the domain name resolution result.

[0269] Step 205: The terminal sends a first connection request to the first application server. The first connection request includes the first target IPv6 address among a plurality of first IPv6 addresses.

[0270] In this embodiment of the specification, after obtaining multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name, the terminal can select a first target IPv6 address from the multiple first IPv6 addresses based on the principle of prioritizing the use of IPv6 addresses. For example, the first target IPv6 address can be the first IPv6 address among the multiple first IPv6 addresses, or the first target IPv6 address can be any IPv6 address randomly selected from the multiple first IPv6 addresses. Then, based on the first target IPv6 address, a first connection request is initiated to the corresponding first application server.

[0271] Please see Figure 7 This is a flowchart illustrating the process of establishing a connection between a terminal and an application server, as provided in an embodiment of this specification. Figure 7 As shown, the process of establishing a connection between the terminal and the first application service is described as follows:

[0272] Step 401: The terminal creates an IPv6 socket and binds it to the terminal's IPv6 address and port number.

[0273] Step 402: The terminal sends a SYN-flagged IPv6 segment to the first application server. The IPv6 segment carries the source IPv6 address (terminal IPv6 address) and source port number (terminal port number), as well as the destination IPv6 address (i.e., the first destination IPv6 address) and destination port number (first application server port number). The SYN-flagged IPv6 segment is used to request the terminal to establish a connection with the first application server.

[0274] Step 403: The first application server creates a new IPv6 socket and binds the source IPv6 address (i.e., the first target IPv6 address) and the source port number (the first application server port number).

[0275] Step 404: The first application server sends an IPv6 segment carrying the SYN-ACK flag to the terminal. The IPv6 segment carries the source IPv6 address (i.e., the first destination IPv6 address) and source port number (the first application server port number), as well as the destination IPv6 address (the terminal IPv6 address) and destination port number (the terminal port number). The IPv6 segment carrying the SYN-ACK flag is used to inform the terminal that the connection request has been successfully received.

[0276] Step 405: The terminal creates a new IPv6 socket and binds the source IPv6 address (terminal IPv6 address) and the source port number (terminal port number).

[0277] Step 406: The terminal sends an IPv6 segment carrying the ACK flag to the first application server. The IPv6 segment carries the source IPv6 address (terminal IPv6 address) and source port number (terminal port number), as well as the destination IPv6 address (i.e., the first destination IPv6 address) and destination port number (first application server port number). The IPv6 segment carrying the ACK flag is used to inform the first server that the terminal has received the IPv6 segment carrying the SYN-ACK flag and to notify the first application server that data transmission can proceed.

[0278] It should be understood that after the terminal establishes a connection with the first application server, they can use their respective sockets to transmit data.

[0279] Step 206: The terminal determines that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first set network quality level.

[0280] In the embodiments of this specification, the network where the first IPv6 address is located may experience network fluctuations, or the first application server may experience congestion, resulting in poor network quality when the terminal accesses the first application server based on the first target IPv6 address. In the embodiments of this specification, the situation where the terminal accesses any application server with poor network quality is referred to as an access anomaly. For the terminal, this manifests as: the terminal is unable to receive a response from the first application server for a relatively long time, or the waiting time for the terminal to receive a response from the first application server is relatively long.

[0281] The following section provides a detailed explanation of how a terminal determines the network quality between itself and the first application server.

[0282] Please see Figure 8 This is a flowchart illustrating a method for evaluating the network quality of a network containing a first IPv6 address, as provided in an embodiment of this specification. Step 206 can be specifically implemented by executing sub-steps 2061 to 2062:

[0283] Step 2061: Determine the single-address connection anomaly rate based on the number of IPv6 sockets with the target address of the first application server created within the first preset time period, and the number of IPv6 sockets that were not responded to by the first application server.

[0284] In this embodiment of the specification, the terminal creates an IPv6 socket with the target address of the first application server to establish a connection with the first application server. Therefore, by counting the number of IPv6 sockets with the target address of the first application server created within a first preset time period, and the number of IPv6 sockets created that did not receive a response from the first application server, the terminal can determine the single-address connection failure rate when establishing a connection based on the first IPv6 address.

[0285] For example, the single-address connection failure rate when establishing a connection to the first target IPv6 address can be determined by calculating the ratio of the number of IPv6 sockets created within the first preset time period that did not receive a response from the first application server to the total number of IPv6 sockets created within the first preset time period that also have the target address of the first application server. The formula for calculating the single-address connection failure rate is shown in formula (1):

[0286]

[0287] Wherein, V6SockErr represents the single-address connection failure rate, V6SockNum represents the number of IPv6 sockets with the target address of the first application server created within the first preset time period, and V6SockErrNum represents the number of IPv6 sockets with the target address of the first application server created within the first preset time period that were not responded to by the first application server.

[0288] It should be understood that the above embodiments evaluate the network quality between the terminal and the first application server from the perspective of establishing a connection. If the single address anomaly rate is higher, it indicates that the network quality is more likely to be poor when the terminal accesses the first application server based on the first target IPv6 address; conversely, if the single address anomaly rate is lower, it indicates that the network quality is less likely to be poor when the terminal accesses the first application server based on the first target IPv6 address.

[0289] Step 2062: Determine the single-address data transmission anomaly rate based on the number of data packets received from the first application server within the first preset time period and the number of abnormal data packets in the data packets.

[0290] In the embodiments of this specification, after the terminal establishes a connection with the first application server, data transmission occurs between the terminal and the first application server, and the carrier of data transmission is data packets. The terminal can count the number of data packets sent by the first application server received within a first preset time period, as well as the number of abnormal data packets among the data packets sent by the first application server received within the first preset time period, and thus determine the single-address data transmission anomaly rate during the data transmission process after the connection is established based on the first target IPv6 address.

[0291] For example, the single-address data transmission anomaly rate during data transmission after establishing a connection based on the first target IPv6 address can be determined by calculating the number of abnormal data packets in the data packets sent by the first application server and the number of data packets sent by the first application server to the terminal within the first preset time period. The formula for calculating the single-address data transmission anomaly rate is shown in formula (2):

[0292]

[0293] Wherein, V6SkbErr represents the single-address data transmission anomaly rate, V6SkbNum represents the number of data packets sent by the first application server received by the terminal within the first preset time period, and V6SkbErrNum represents the number of abnormal data packets among the data packets sent by the first application server received by the terminal within the first preset time period.

[0294] It should be understood that the above embodiments evaluate the network quality between the terminal and the first application server from the perspective of data transmission. If the single-address data transmission anomaly rate is higher, it indicates that the network quality is more likely to be poor when the terminal accesses the first application server based on the first target IPv6 address; conversely, if the single-address data transmission anomaly rate is lower, it indicates that the network quality is less likely to be poor when the terminal accesses the first application server based on the first target IPv6 address.

[0295] Step 2063: Obtain the first network anomaly rate within a unit time period based on the single address connection anomaly rate, the single address data transmission anomaly rate, and the first preset time period.

[0296] In the embodiments of this specification, after obtaining the single-address connection failure rate when the terminal connects to the first application server based on the first target IPv6 address within the first preset time period, and the single-address data transmission failure rate when the terminal transmits data with the first application server, the first network failure rate within a unit time period can be determined based on the single-address connection failure rate, the single-address data transmission failure rate, and the first preset time period.

[0297] For example, the single-address connection anomaly rate and its corresponding weight can be calculated, as well as the single-address data transmission anomaly rate and its corresponding weight. Then, the ratio of this weighted sum to the first preset duration can be calculated to determine the first network anomaly rate within a unit duration. The formula for calculating the first network anomaly rate is shown in formula (3):

[0298] QualV6=(V6SockErr*W1+V6SkbErr*W2) / T1 (3)

[0299] Wherein, QualV6 represents the first network anomaly rate, V6SockErr represents the single-address connection anomaly rate, W1 represents the weight corresponding to the single-address connection anomaly rate, V6SkbErr represents the single-address data transmission anomaly rate, and W2 represents the weight corresponding to the single-address data transmission anomaly rate. The sum of W1 and W2 is 1. In one possible embodiment, considering that connection process anomalies have a greater impact on whether network quality problems occur between the final terminal and the first application server than data transmission process anomalies, W1 can be set to be greater than W2. Of course, other settings can also be used according to actual conditions, and no special restrictions are imposed here.

[0300] Step 2064: In response to the first network anomaly rate being higher than the first preset threshold, determine that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first preset network quality level.

[0301] In the embodiments of this specification, if the first network anomaly rate between the terminal and the first application server determined based on the connection establishment process and data transmission process is high, it can be determined more accurately that the network quality of the terminal accessing the first application server based on the first target IPv6 address is poor.

[0302] Step 207: The terminal detects a second operation targeting the target application, which instructs the target application to access the first domain name again.

[0303] In the embodiments of this specification, when the network quality is poor when the terminal determines that it is accessing the first application server based on the first target IPv6 address, the terminal will either be unable to obtain a response from the first application server or experience a long waiting time for obtaining a response. In this case, the user may perform a second operation on the target application, thereby causing the target application to access the first domain name again. It should be understood that the second operation that triggers the target application to access the first domain name again can be the same operation as the first operation that triggers the target application to access the first domain name for the first time, as described in step 201, or it can be a different operation, such as a refresh operation.

[0304] Step 208: The terminal responds to the second operation by sending a second domain name resolution request to the Domain Name System server. The second domain name resolution request is used to request multiple second Pv4 addresses and multiple second IPv6 addresses corresponding to the first domain name.

[0305] In the embodiments of this specification, after the target application in the terminal detects the second operation representing the re-access of the first domain name, the DNS protocol stack in the target application framework layer sends a second domain name resolution request to the DNS server, requesting the DNS server to return multiple second IPv4 addresses and multiple second IPv6 addresses corresponding to the first domain name. Please refer to the relevant description of step 202, which will not be repeated here.

[0306] Step 209: The DNS server responds to the second domain name resolution request, resolves the first domain name, and obtains multiple second IPv4 addresses and multiple second IPv6 addresses.

[0307] In this embodiment of the specification, the process of the DNS server resolving the first domain name can be referred to the relevant description of step 203, which will not be repeated here. It is worth noting that the multiple second IPv4 addresses obtained by resolving the first domain name again here may be completely identical or partially identical to the multiple first IPv4 addresses obtained during the initial resolution of the first domain name in step 203. Similarly, the multiple second IPv6 addresses obtained by resolving the first domain name again here may be completely identical or partially identical to the multiple first IPv6 addresses obtained during the initial resolution of the first domain name in step 203.

[0308] Step 210: The DNS server sends a second domain name resolution response to the terminal. The second domain name resolution response carries multiple second IPv4 addresses and multiple second IPv6 addresses corresponding to the first domain name.

[0309] In the embodiments of this specification, after the DNS server obtains the domain name resolution result of the first domain name again, that is, after obtaining the multiple second IPv4 addresses and multiple second IPv6 addresses corresponding to the first domain name, on the one hand, it can save the domain name resolution result corresponding to the first domain name obtained again; on the other hand, it can send the domain name resolution result of the first domain name obtained again to the terminal so that the terminal can access the corresponding application server according to the domain name resolution result.

[0310] Step 211: The terminal sends a second connection request to the second application server. The second connection request includes the second target IPv6 address among a plurality of second IPv6 addresses.

[0311] In the embodiments of this specification, after obtaining multiple second IPv4 addresses and multiple second IPv6 addresses corresponding to the first domain name, the terminal selects one IPv6 address from the multiple second IPv6 addresses, such as the second target IPv6 address, based on the principle of prioritizing the use of IPv6 addresses, to initiate a connection request to the corresponding second application server. It is worth noting that, historically, network quality has been poor when accessing the first application server based on the first target IPv6 address. Therefore, to avoid repeated access anomalies caused by repeatedly using the first target IPv6 address, the aforementioned second target IPv6 address is different from the first target IPv6 address. This improves the success rate and efficiency of the terminal accessing the application server based on the IPv6 address, thus enhancing the user's internet experience.

[0312] It should be understood that the first application server corresponding to the first target IPv6 address and the second application server corresponding to the second target IPv6 address may be the same application server or different application servers; no special restrictions are imposed here.

[0313] In some embodiments, considering that the network quality of the terminal is poor when accessing the first application server based on the first target IPv6 address due to fluctuations in the network where the first target IPv6 address is located, but the network where other IPv6 addresses among the multiple first IPv6 addresses are located may not fluctuate, therefore, in the embodiments of this specification, other IPv6 addresses besides the first target IPv6 address can be directly selected from the multiple first IPv6 addresses to access the corresponding application server.

[0314] Please see Figure 9 This is a flowchart illustrating an application server access method provided in an embodiment of this specification. After step 207, step 212 can be executed further:

[0315] Step 212: In response to the second operation, the terminal sends a third connection request to the third application server. The third connection request carries the third target IPv6 address from among the multiple first target IPv6 addresses.

[0316] In the embodiments of this specification, when the network quality of the terminal accessing the first application server based on the first IPv6 address is poor, and it is detected that the target application is accessing the first domain name again, the terminal can select a third target IPv6 address, which is different from the first target IPv6 address, from among the multiple first IPv6 addresses obtained when initially accessing and resolving the first domain name. This third target IPv6 address is then used to access the corresponding third application server. This avoids repeated access anomalies caused by repeatedly using the first target IPv6 address, thereby improving the success rate and efficiency of the terminal accessing the application server based on the IPv6 address, and ultimately enhancing the user's internet experience. It should be understood that the first application server corresponding to the first target IPv6 address and the third application server corresponding to the third target IPv6 address may be the same application server or different application servers; no particular limitation is made here.

[0317] In some embodiments, if the target application in the terminal has poor network quality when accessing the first application server based on the first IPv6 address, the use of the first target IPv6 address by the target application can be further restricted.

[0318] Please see Figure 10 and Figure 11 This is a flowchart illustrating an application server access method provided in this specification. After executing step 206, step 213 can be further executed:

[0319] Step 213: Set the target application to disable the first target IPv6 address.

[0320] In the embodiments of this specification, if the terminal determines that the network quality is poor when the target application accesses the corresponding first application server based on the first target IPv6 address, the terminal can set the target application to disable the first target IPv6 address, thereby avoiding repeated access anomalies caused by repeatedly using the first target IPv6 address to access the first application server when the target application accesses the first domain name again.

[0321] For example, if the target application has a corresponding address blacklist, the first target IPv6 address can be added to the target application's address blacklist to achieve the effect of the target application disabling the first target IPv6 address. Of course, there are other possible methods, which are not specifically limited here.

[0322] The following sections provide detailed explanations of how a terminal connects to the corresponding application server using other IPv6 addresses after the target application is set to disable the first target IPv6 address.

[0323] Please see Figure 12 This is a flowchart illustrating a method for connecting to a second application server based on a second target IPv6 address, as provided in an embodiment of this specification. Step 211 can be specifically implemented through sub-steps 2111 to 2112:

[0324] Step 2111: In response to the existence of a first target IPv6 address that is disabled by the target application among the multiple second IPv6 addresses, the first target IPv6 address that is disabled by the target application is filtered out from the multiple second IPv6 addresses, and the second target IPv6 address is determined from the remaining second IPv6 addresses.

[0325] In the embodiments of this specification, after receiving multiple second IPv4 addresses and multiple second IPv6 addresses, the terminal, based on the principle of prioritizing the use of IPv6 addresses, first determines whether a first target IPv6 address, which is disabled by the target application, exists among the multiple second IPv6 addresses. If not, the second target IPv6 address is directly determined from the multiple second IPv6 addresses. For example, if the multiple second IPv6 addresses are presented in a list, the first second IPv6 address can be selected as the second target IPv6 address from the list containing multiple second IPv6 addresses, or a second IPv6 address can be randomly selected from the multiple second IPv6 addresses. If a first target IPv6 address, which is disabled by the target application, exists among the multiple second IPv6 addresses, the first target IPv6 address is filtered out from the multiple second IPv6 addresses, and then the second target IPv6 address is determined from the remaining second IPv6 addresses. Here, the method of determining the second target IPv6 address from the remaining second IPv6 addresses is similar to the method of directly determining the second target IPv6 address from multiple second IPv6 addresses, and will not be repeated here.

[0326] Step 2112: Send a second connection request to the second application server based on the second target IPv6 address.

[0327] In the embodiments of this specification, after determining a second target IPv6 address that is different from the first target IPv6 address from a plurality of second IPv6 addresses, the corresponding second application server can be accessed based on the second target IPv6 address.

[0328] Please see Figure 13This is a flowchart illustrating a method for connecting to a third application server based on a third target IPv6 address, as provided in an embodiment of this specification. Step 212 can be specifically implemented by executing sub-steps 2121 to 2122:

[0329] Step 2121: In response to the second operation, the first target IPv6 address that will be disabled by the target application is filtered out from a plurality of first IPv6 addresses, and a third target IPv6 address is determined from the remaining first IPv6 addresses.

[0330] In the embodiments of this specification, when the terminal determines that the target application needs to access the first domain name again, the terminal first determines whether the first target IPv6 address is disabled by the target application. If so, the first target IPv6 address is filtered out from multiple first IPv6 addresses, and then the third target IPv6 address is determined from the remaining first IPv6 addresses. Here, the method of determining the third target IPv6 address from the remaining first IPv6 addresses is similar to the method of directly determining the second target IPv6 address from multiple second IPv6 addresses, and will not be described again here.

[0331] Step 2122: Send a third connection request to the third application server based on the third target IPv6 address.

[0332] In the embodiments of this specification, after determining a third target IPv6 address that is different from the first target IPv6 address from a plurality of first IPv6 addresses, the corresponding third application server can be accessed based on the third target IPv6 address.

[0333] In some embodiments, when the target application in the terminal accesses the first application server based on the first target IPv6 address, the network quality is poor, which may be due to fluctuations in the network where the first target IPv6 address is located. Therefore, as long as the network returns to normal, the target application can no longer be restricted from using the first target IPv6 address.

[0334] Please see Figure 14 and Figure 15 This is a flowchart illustrating an application server access method provided in an embodiment of this specification. After step 213, step 214 can be executed further:

[0335] Step 214: In response to the fulfillment of the first preset condition, remove the blocking status of the first target IPv6 address by the target application.

[0336] In the embodiments of this specification, network fluctuations in the networks where the first and first target IPv6 addresses reside can be considered short-term. Therefore, the first preset condition can be: the duration for which the target application disables the first target IPv6 address reaches a second preset duration. After the second preset duration, it can be considered that the short-term network fluctuations in the networks where the first target IPv6 address resides have been eliminated, and at this time, the target application can lift the ban on the first target IPv6 address. For example, the ban on the first target IPv6 address can be lifted 24 hours after the target application disables it. It should be understood that the second preset duration can be set according to the average duration of network fluctuations in actual applications, and no special restrictions are imposed here.

[0337] Second, network fluctuations in the network where the first target IPv6 address is located may be caused by the use of a specific operator's network. Therefore, the first preset condition can be: detecting an operator switching event. After detecting an operator switching event, it can be considered that the network fluctuations in the network where the first target IPv6 address is located have been eliminated, and at this time, the target application can unblock the first target IPv6 address. For example, when using the first target IPv6 address to access the first application server, if the terminal detects that the operator of the user identity module (SIM) used is China Telecom, it is considered that the short-term network fluctuations in the network where the first target IPv6 address is located are caused by the use of the China Telecom network. After setting the target application to disable the first target IPv6 address, if the terminal detects that the operator of the SIM card used has switched from China Telecom to China Mobile, it can be considered that the network fluctuations in the network where the first target IPv6 address is located have been eliminated, and at this time, the blocking status of the first target IPv6 address can be lifted.

[0338] Third, the network fluctuations in the network where the first target IPv6 address is located are caused by the use of a specific network type. Therefore, the first preset condition can be: a network switching event is detected. After detecting a network switching event, it can be considered that the network fluctuations in the network where the first target IPv6 address is located have been eliminated, and at this time, the target application can unblock the first target IPv6 address. For example, when using the first target IPv6 address to access the first application server, if the terminal detects that the network type used is a cellular network, it is considered that the network fluctuations in the network where the first target IPv6 address is located are caused by the use of a cellular network. After setting the target application to disable the first target IPv6 address, if the terminal detects that the network type used has switched from a cellular network to a Wireless Fidelity (WIFI) network, it can be considered that the network fluctuations in the network where the first target IPv6 address is located have been eliminated, and at this time, the target application can unblock the first target IPv6 address.

[0339] It should be understood that the above-mentioned removal of the target application's disabled status for the first target IPv6 address can be achieved by removing the first target IPv6 address from the address blacklist corresponding to the target application. Of course, there are other possible implementation methods, which are not specifically limited here.

[0340] Of course, the first preset conditions for lifting the blocking status of the target application on the first target IPv6 address include, but are not limited to, the three mentioned above, and this application does not impose any special restrictions.

[0341] In some embodiments, the target application in the terminal may access other domains in addition to the first domain. If the target application frequently encounters poor network quality when accessing the corresponding application server based on different IPv6 addresses corresponding to different domains, it indicates that the overall network quality of the IPv6 network used by the target application may be poor. In this case, it is advisable to switch to prioritizing the use of the IPv4 network.

[0342] Please see Figure 16 This is a flowchart illustrating a method for accessing an application server based on an IPv4 address, provided in an embodiment of this specification. The method flow is described as follows:

[0343] Step 215: The terminal determines that the network quality of the target application's IPv6 network is lower than the second set network quality level.

[0344] In the embodiments described in this specification, the terminal can assess the overall network quality of the IPv6 network used by the target application based on the overall situation of the target application accessing different application servers using different IPv6 addresses over a period of time. If it is determined that the overall network quality of the IPv6 network used by the target application is poor, the terminal will no longer prioritize using IPv6 addresses to access the corresponding application servers in subsequent processes, but will instead switch to using IPv4 addresses to access the corresponding application servers.

[0345] The following explains how to assess the overall network quality of the IPv6 network used by the target application.

[0346] Please see Figure 17 This is a flowchart illustrating a method for evaluating the network quality of an IPv6 network for a target application, provided in an embodiment of this application. Step 215 can be specifically implemented by executing sub-steps 2151 to 2154:

[0347] Step 2151: Determine the multi-address abnormal access rate based on the total number of accesses of the target application to the corresponding application server based on multiple target IPv6 addresses within the third preset time period, and the total number of abnormal accesses of the target application to the corresponding application server based on multiple target IPv6 addresses.

[0348] In the embodiments of this specification, when a target application in the terminal accesses a first application server based on a first target IPv6 address, it can be counted as one access. Furthermore, if the network quality is poor when accessing the first application server based on the first target IPv6 address, and the target application in the terminal accesses a second application server based on a second target IPv6 address, or accesses a third application server based on a third target IPv6 address, it can also be counted as one access. This process continues. The terminal can count the total number of accesses by the target application to the corresponding application server based on different target IPv6 addresses within a third preset time period, as well as the total number of abnormal accesses to the corresponding application server based on different target IPv6 addresses within the third preset time period. Then, based on the total number of accesses and the total number of abnormal accesses, the multi-address abnormal access rate is calculated.

[0349] For example, the multi-address abnormal access rate can be determined by calculating the ratio of the total number of abnormal accesses to the corresponding application server based on different target IPv6 addresses within a third preset time period to the total number of accesses to the corresponding application server based on different target IPv6 addresses within the third preset time period. The formula for calculating the multi-address abnormal access rate is shown in formula (4):

[0350]

[0351] Wherein, V6AddrErr represents the multi-address abnormal access rate, V6AddrErrCnt represents the total number of abnormal accesses to the corresponding application server based on different target IPv6 addresses within the third preset time period, and V6AddrCnt represents the total number of accesses to the corresponding application server based on different target IPv6 addresses within the third preset time period.

[0352] It should be understood that in the above embodiments, if the multi-address abnormal access rate is higher, it indicates that the overall network quality of the IPv6 network used by the target application in the terminal is more likely to be poor; conversely, if the multi-address abnormal access rate is lower, it indicates that the overall network quality of the IPv6 network used by the target application in the terminal is less likely to be poor.

[0353] Step 2152: Determine the multi-address connection anomaly rate based on the total number of IPv6 sockets created by the target application when accessing the corresponding application server based on multiple target IPv6 addresses within the third preset time period, and the total number of IPv6 sockets that were not responded to by the corresponding application server.

[0354] In the embodiments of this specification, when a target application in the terminal accesses a first application server based on a first target IPv6 address, during the connection establishment phase, it needs to create an IPv6 socket with the target address of the first application server. At this time, the number of IPv6 sockets created during this connection process, as well as the number of IPv6 sockets that were not responded to by the first application server, can be recorded. Based on this, when the network quality is poor when accessing the first application server based on the first target IPv6 address, and the target application in the terminal accesses a second application server based on a second target IPv6 address, during the connection establishment phase, it needs to create an IPv6 socket with the target address of the second application server. At this time, the number of IPv6 sockets created during this connection process, as well as the number of IPv6 sockets that were not responded to by the second application server, can also be recorded. And so on, the terminal can count the total number of IPv6 sockets created by the target application when accessing the corresponding application server based on different IPv6 addresses within a third preset time period, and the total number of IPv6 sockets created when accessing the corresponding application server based on different IPv6 addresses that were not responded to by the corresponding application server. Then, based on the total number of IPv6 sockets created by the target application when accessing the corresponding application server with different IPv6 addresses within the third preset time period, and the total number of IPv6 sockets created when accessing the corresponding application server with different IPv6 addresses that were not responded to by the corresponding application server, the multi-address connection anomaly rate is determined.

[0355] For example, the multi-address connection failure rate can be determined by calculating the ratio of the total number of IPv6 sockets created when accessing the corresponding application server from different IPv6 addresses within a third preset time period that did not receive a response from the corresponding application server, to the total number of IPv6 sockets created when accessing the corresponding application server from different IPv6 addresses within the third preset time period. The formula for calculating the multi-address connection failure rate is shown in formula (5):

[0356]

[0357] Among them, V6SockErr * V6SockErrNum represents the multi-address connection failure rate. * V6SockNum represents the total number of IPv6 sockets created when accessing the corresponding application server from different IPv6 addresses within the third preset time period that did not receive a response from the corresponding application server. * This indicates the total number of IPv6 sockets created when accessing the corresponding application server based on different IPv6 addresses within the third preset time period.

[0358] In the above embodiments, a higher multi-address connection anomaly rate indicates a higher probability that the IPv6 network used by the target application in the terminal has poor overall network quality; conversely, a lower multi-address connection anomaly rate indicates a lower probability that the IPv6 network used by the target application in the terminal has poor overall network quality.

[0359] Step 2153: Determine the second network anomaly rate based on the multi-address abnormal access rate and the multi-address connection abnormal rate.

[0360] In this embodiment, within the third preset time period, when the target application accesses different domains, it may access some domains more often and access others less often. For domains with more accesses, the success rate of access is higher; while for domains with fewer accesses, the failure rate of access is higher. In the above extreme scenario, the failure rate of accessing domains with fewer accesses is higher, thus increasing the multi-address failure rate. However, since the access to these domains is less frequent, even if access is abnormal, the number of IPv6 sockets that are not responded to by the application server is also less. Therefore, in the above scenario, the multi-address connection failure rate is lower. Therefore, by combining the multi-address failure rate with the multi-address connection failure rate, for example, by calculating the average of the multi-address failure rate and the multi-address connection failure rate, a second network failure rate can be obtained, which can more reasonably evaluate the network quality of the target application in the above scenario. The formula for calculating the second network failure rate is shown in formula (6):

[0361] AppQualV6=AVG(V6AddrErr+V6SockErr * (6)

[0362] Among them, AppQualV6 represents the second network anomaly rate, V6AddrEr represents the multi-address abnormal access rate, V6SockErr* represents the multi-address connection anomaly rate, and AVG represents the calculated average.

[0363] It should be understood that the above calculation method can accurately assess the network quality of the IPv6 network used by the target application in the above-mentioned extreme scenarios, so it can also be applied in other scenarios.

[0364] Step 2154: In response to the second network anomaly rate being higher than the second set threshold, determine that the network quality of the target application's IPv6 network is lower than the second set network quality level.

[0365] In the embodiments of this specification, if it is determined from the perspective of overall access and connection establishment that the target application has a high network anomaly rate when using the IPv6 network, then it can be more accurately judged that the network quality of the IPv6 network used by the target application in the terminal is poor.

[0366] For example, within the third preset time period, the target application accessed three domains: domain 1, domain 2, and domain 3. Domain 1 was accessed 30 times (28 successful, 2 unsuccessful), with a total of 90 IPv6 sockets sent during the access to domain 1, and 6 sockets not responded to. Domain 2 and domain 3 were each accessed 5 times, both unsuccessfully. During the access to domain 2 and domain 3, a total of 30 IPv6 sockets were sent, and 10 sockets were not responded to. Therefore, the multi-address abnormal access rate is 0.3, and the multi-address connection abnormal rate is 0.13. If the average of the multi-address abnormal access rate and the multi-address connection abnormal rate is calculated, the second network abnormality rate is 0.215. If the second threshold is 0.25, and only the multi-address anomaly rate is compared with the second threshold, the multi-address anomaly rate is 0.3, which is greater than the second threshold. In this case, the target application will be judged as having poor overall network quality of the IPv6 network it is using, and will then prioritize using the IPv4 network. However, in reality, among the domains accessed by the target application based on the IPv6 network, domain 1, which has the most accesses, has a higher success rate. That is, it can be considered that the network quality of domain 1 is better when accessed based on the IPv6 network. The multi-address anomaly rate is greater than the second threshold mainly because the failure rate of accessing domains with fewer accesses (domains 2 and 3) is higher. Therefore, it is unreasonable to prohibit the use of the IPv6 network when accessing domain 1, given that the success rate of accessing domain 1 based on the IPv6 network is higher, while the failure rate of accessing domains 2 and 3 is higher, and the number of times domain 1 is accessed is much greater than the number of times domains 2 and 3 are accessed. Therefore, after combining the multi-address anomaly rate with the multi-address connection anomaly rate, the resulting second network anomaly is only 0.215, which is less than the second set threshold. This means that when accessing any domain name in the future, it will still prioritize the IPv6 network, including the domain name 1 with the highest number of historical accesses.

[0367] Step 216: The terminal detects a third operation targeting the target application, which instructs the target application to access the second domain name.

[0368] In the embodiments described in this specification, when the terminal determines that the overall quality of the IPv6 network used by the target application is poor, the terminal will frequently fail to receive a response from the corresponding application server when accessing any domain name in the past, or the waiting time for receiving a response from the corresponding application server will be long. If the user performs a third operation on the target application to access a second domain name, then the IP address policy used by the target application needs to be adjusted. It should be understood that the second domain name here can be a domain name that has not been accessed in the past, or a domain name that has been accessed in the past; no particular restriction is placed here.

[0369] Step 217: In response to the third operation, the terminal sends a third domain name resolution request to the Domain Name System server. The third domain name resolution request is used to request multiple third IPv4 addresses corresponding to the second domain name.

[0370] In the embodiments of this specification, after the target application in the terminal detects a third operation representing access to the second domain name, the DNS protocol stack in the target application framework layer sends a third domain name resolution request to the DNS server. Since the overall network quality of the IPv6 network used by the target application is poor, the third domain name resolution request is only used to request multiple third IPv4 addresses corresponding to the second domain name.

[0371] Step 218: The DNS server responds to the third domain name resolution request, resolves the second domain name, and obtains multiple third IPv4 addresses.

[0372] In this manual, the process of the DNS server resolving the third domain name can be referred to the relevant description of the DNS server resolving the first domain name in step 203, and will not be repeated here.

[0373] Step 219: The DNS server sends a domain name resolution response to the terminal, which carries multiple third IPv4 addresses corresponding to the third domain name.

[0374] In the embodiments of this specification, after the DNS server obtains the domain name resolution result of the second domain name, that is, after obtaining multiple third IPv4 addresses corresponding to the third domain name, it can, on the one hand, save the domain name resolution result corresponding to the second domain name; on the other hand, it can send the domain name resolution result corresponding to the second domain name to the terminal so that the target application in the terminal can access the corresponding application server according to the domain name resolution result.

[0375] Step 220: The terminal sends a fourth connection request to the fourth application server. The fourth connection request includes the first target IPv4 address among a plurality of third IPv4 addresses.

[0376] In the embodiments of this specification, after obtaining multiple third IPv4 addresses corresponding to the second domain name, the terminal can select a first target IPv4 address from these addresses. For example, if the multiple third IPv4 addresses are presented as an IPv4 address list, the first IPv4 address in the list can be used as the first target IPv4 address, or an IPv4 address can be randomly selected from the list. No particular restrictions are placed on how the first target IPv4 address is determined from the multiple third IPv4 addresses. After the terminal selects the first target IPv4 address, the target application can initiate a connection request to the corresponding fourth application server based on the first target IPv4 address. This avoids repeated access anomalies caused by repeatedly using IPv6 addresses to access the application server, especially when the target application's IPv6 network is poor. This improves the success rate and efficiency of the terminal's access to the application server, thus enhancing the user's internet experience. It should be understood that if the second domain name is the same as the first domain name, the fourth application server may be the same server as the first application server, or it may be different; no particular restrictions are placed here.

[0377] In some embodiments, after detecting a third operation representing access to the second domain name, the terminal can still simultaneously request the IPv4 address and IPv6 address corresponding to the second domain name from the DNS server. Then, during the connection initiation phase, the terminal preferentially selects the IPv4 address corresponding to the second domain name to initiate a connection to the application server. This avoids repeated access anomalies caused by repeatedly using the IPv6 address to access the application server when the target application's IPv6 network is poor. This ensures that the terminal has a high success rate and high access efficiency when accessing the application server, which is beneficial to improving the user's Internet experience.

[0378] Please see Figure 18 This is a flowchart illustrating a method for accessing an application server based on an IPv4 address, provided in an embodiment of this application. After executing step 216, steps 221 to 224 can continue to be executed:

[0379] Step 221: In response to the third operation, a fourth domain name resolution request is sent to the DNS server. The fourth domain name resolution request is used to request multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name.

[0380] In the embodiments of this specification, after the target application in the terminal detects the third operation representing access to the second domain name, the DNS protocol stack in the target application framework layer sends a fourth domain name resolution request to the DNS server. Although the overall network quality of the IPv6 network used by the target application is poor, the fourth domain name resolution request is still used to request multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name.

[0381] Step 222: The DNS server responds to the fourth domain name resolution request, resolves the second domain name, and obtains multiple fourth IPv4 addresses and multiple fourth IPv6 addresses.

[0382] In this manual, the process of the DNS server resolving the third domain name can be referred to the relevant description of the DNS server resolving the first domain name in step 203, and will not be repeated here.

[0383] Step 223: The DNS server sends a domain name resolution response to the terminal, which carries multiple fourth IPv4 addresses and multiple fourth IPv6 addresses.

[0384] In the embodiments of this specification, after the DNS server obtains the domain name resolution result of the second domain name, that is, after obtaining the multiple third IPv4 addresses corresponding to the second domain name, it can, on the one hand, save the domain name resolution result corresponding to the second domain name; on the other hand, it can send the domain name resolution result corresponding to the second domain name to the terminal so that the target application in the terminal can access the corresponding application server according to the domain name resolution result.

[0385] Step 224: The terminal sends a fifth connection request to the fifth application server. The fifth connection request includes the second target IPv4 address among a plurality of fourth IPv4 addresses.

[0386] In the embodiments of this specification, after obtaining multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name, the terminal selects a second target IPv4 address from the multiple fourth IPv4 addresses, prioritizing the use of IPv4 addresses. For example, if the multiple fourth IPv4 addresses are presented in the form of an IPv4 address list, the first IPv4 address in the list can be used as the second target IPv4 address, or an IPv4 address can be randomly selected from the list. No particular restrictions are placed on how the second target IPv4 address is determined from the multiple fourth IPv4 addresses. After the terminal selects the second target IPv4 address, the target application can initiate a connection request to the corresponding fifth application server based on the second target IPv4 address. This avoids repeated access anomalies caused by repeatedly using IPv6 addresses to access the application server when the target application's IPv6 network is poor, thereby improving the success rate and efficiency of the terminal's access to the application server and enhancing the user's internet experience. It should be understood that if the second domain name is the same as the first domain name, the fifth application server may be the same server as the first application server, or it may be different from the first application server; no special restrictions are imposed here. Similarly, the fifth application server and the fourth application server may be the same application server, or they may be different application servers.

[0387] In some embodiments, if it is determined that the IPv6 network used by the target application in the terminal has poor overall network quality, the IPv6 network used by the target application can be further restricted.

[0388] Please see Figure 19 and Figure 20 This is a flowchart illustrating a method for accessing an application server based on an IPv4 address, as provided in an embodiment of this specification. After executing step 215, step 225 can be executed further:

[0389] Step 225: Configure the target application to disable all IPv6 addresses.

[0390] In the embodiments of this specification, if the terminal determines that the network quality is poor when the target application accesses the corresponding application server based on multiple target IPv6 addresses, the terminal can set the target application to disable all IPv6 addresses, thereby avoiding repeated access anomalies caused by repeatedly using IPv6 addresses to access the corresponding application server when the target application accesses any domain name again.

[0391] For example, if a blacklist of applications is set up in the terminal to disable all IPv6 addresses, adding the target application to this blacklist will achieve the effect of disabling all IPv6 addresses for the target application.

[0392] Furthermore, the above embodiments only evaluated the network quality of the IPv6 network used by the target application. If the network quality of the IPv6 network used by the target application is poor, the network quality of the IPv4 network used by the target application may not be good. Therefore, when setting the target application to disable all IPv6 addresses, it is necessary to consider the network quality of the IPv4 network used by the target application to determine whether it is possible to disable all IPv6 addresses of the target application.

[0393] Please see Figure 21 This is a flowchart illustrating a method for restricting a target application's use of IPv6 addresses, as provided in an embodiment of this specification. Step 225 can be specifically implemented through sub-steps 2251 to 2252:

[0394] Step 2251: Determine that the network quality of the IPv4 network used by the target application is higher than the third set network quality level.

[0395] In the embodiments of this specification, among the multiple domain names accessed by the target application within a third preset time period, only some domain names may have both multiple IPv4 addresses and multiple IPv6 addresses. For these domain names, the principle of prioritizing the use of IPv6 addresses applies when accessing them. However, the remaining domain names may only have multiple IPv4 addresses. For these domain names, the principle of prioritizing the use of IPv6 addresses does not apply when accessing them; instead, only IPv4 addresses can be used. Therefore, the terminal can evaluate the network quality of the IPv4 network used by the target application within the third preset time period.

[0396] Please see Figure 22 This is a flowchart illustrating a method for evaluating the network quality of a target application using an IPv4 network, as provided in an embodiment of this specification. Step 2251 can be specifically implemented by executing sub-steps 22511 to 22513:

[0397] Step 22511: Determine the multi-address packet anomaly rate based on the total number of data packets received from the application server when the target application accesses the corresponding application server based on multiple target IPv4 addresses within the third preset time period, and the total number of abnormal data packets in the data packets.

[0398] In the embodiments of this specification, during the process of a target application in the terminal accessing a corresponding application server based on different target IPv4 addresses, data transmission occurs, and the carrier of this data transmission is a data packet. Therefore, the terminal can count the total number of data packets sent by the application server corresponding to the target IPv4 address received within a third preset time period, and the total number of abnormal data packets sent by the application server corresponding to the target IPv4 address received within the third preset time period. This allows the determination of the multi-address data transmission anomaly rate during the data transmission process after the target application establishes a connection with the corresponding application server based on different target IPv4 addresses.

[0399] For example, the multi-address data transmission anomaly rate can be determined by calculating the ratio of the total number of abnormal data packets received by the target application when accessing the corresponding application server based on different target IPv4 addresses within a third preset time period to the total number of data packets received by the target application when accessing the corresponding application server based on different target IPv4 addresses within the third preset time period. The formula for calculating the multi-address data transmission anomaly rate is shown in formula (7):

[0400]

[0401] Among them, V4SkbErr * V4SkbNum represents the multi-address data transfer anomaly rate. * V4SkbErrNum represents the total number of data packets received by the terminal from the application server when the target application in the terminal accesses the corresponding application server based on different target IPv4 addresses within the third preset time period. * This represents the total number of abnormal data packets received by the application server when the target application in the terminal accesses the corresponding application server based on different target IPv4 addresses within the third preset time period.

[0402] Step 22512: Based on the third preset duration and the multi-address data transmission anomaly rate, obtain the third network anomaly rate within a unit duration.

[0403] In the embodiments of this specification, after calculating the multi-address data transmission anomaly rate when the target application accesses the corresponding application server using different target IPv4 addresses within a third preset time period, the third network anomaly rate within a unit time period is determined based on the third preset time period and the multi-address data transmission anomaly rate.

[0404] For example, the ratio of the multi-address data transmission anomaly rate to the third preset duration can be calculated to determine the third network anomaly rate. The formula for calculating the third network anomaly rate is shown in formula (8):

[0405] AppQualV4=V6SkbErr* / T2 (8)

[0406] Where AppQualV4 represents the third network anomaly rate, and V6SkbErr * T1 represents the multi-address data transmission anomaly rate, and T2 represents the third preset duration.

[0407] Step 22513: If the third network anomaly rate is less than the third set threshold, determine that the network quality of the target application's IPv4 network is higher than the third set network quality level.

[0408] In the embodiments of this specification, from the perspective of data transmission, if it is determined that the network anomaly rate of the target application when using the IPv4 network is high, then it can be accurately judged that the network quality of the IPv4 network used by the target application in the terminal is poor. Conversely, if it is determined that the network anomaly rate of the target application when using the IPv4 network is low, then it can be accurately judged that the network quality of the IPv4 network used by the target application in the terminal is high. It should be understood that since the deployment of application servers corresponding to IPv4 addresses is relatively mature, it can be considered that the possibility of connection failure between the terminal and the application server corresponding to the IPv4 address is low. Therefore, when evaluating the network quality of the IPv4 network used by the target application, it is mainly based on the data transmission process between the terminal and the application server corresponding to the IPv4 address.

[0409] Step 2252: Set the target application to disable all IPv6 addresses.

[0410] In the embodiments described in this specification, if it is determined that the network quality of the IPv4 network used by the target application is good, the target application is then set to disable all IPv6 addresses, thereby ensuring that the target application has a high success rate and high access efficiency when it can access the corresponding application server based on the IPv4 network.

[0411] The following sections provide detailed explanations of how the terminal performs domain name resolution in step 217 and initiates a connection request in step 224 after the target application is configured to disable all IPv6 addresses.

[0412] Please see Figure 23 This is a flowchart illustrating a method for sending a domain name resolution request according to an embodiment of this application. Step 217 can be specifically implemented by executing sub-steps 2171 to 2172:

[0413] Step 2171: In response to the third operation, determine whether all IPv6 addresses of the target application are disabled.

[0414] Step 2172: If yes, send a third-party domain name resolution request to the Domain Name System server.

[0415] In the embodiments of this specification, if the terminal determines that the overall network quality of the target application's IPv6 network is poor, while the overall network quality of the target application's IPv4 network is good, and if it detects that the target application needs to access the second domain name, the terminal can first determine whether all IPv6 addresses of the target application have been disabled. If so, the strategy of prioritizing the use of the IPv6 network is changed to prioritizing the use of the better-quality IPv4 network. That is, when performing domain name resolution with the Domain Name System server, only the IPv4 address corresponding to the second domain name is requested. This ensures a high success rate and high access efficiency when the target application accesses the corresponding application server based on the IPv4 network, while avoiding resource waste caused by requesting the IPv6 address corresponding to the second domain name when all IPv6 addresses of the target application are disabled.

[0416] Please see Figure 24 This is a flowchart illustrating a method for connecting to a fifth application server based on a second target IPv4 address, as provided in an embodiment of this application. Step 224 can be specifically implemented by executing sub-steps 2241 to 2243:

[0417] Step 2241: Determine whether all IPv6 addresses of the target application are disabled.

[0418] Step 2242: If yes, determine the second target IPv4 address from the multiple fourth IPv4 addresses.

[0419] Step 2243: Send a fifth connection request to the fifth application server based on the second target IPv4 address.

[0420] In the embodiments of this specification, when the terminal simultaneously obtains multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name, the terminal can determine whether all IPv6 addresses of the target application are disabled. If so, the strategy of prioritizing the use of IPv6 networks is changed to prioritizing the use of IPv4 networks with better network quality to access the corresponding application server. At this time, the second target IPv4 address can be determined from the multiple fourth IPv4 addresses to access the corresponding fifth application server, avoiding repeated access anomalies caused by repeatedly accessing the application server based on IPv6 networks. This ensures that the terminal has a high success rate and high access efficiency when accessing the application server, which is beneficial to improving the user's Internet experience.

[0421] In some embodiments, when the target application in the terminal accesses the corresponding application server via the IPv6 network, the overall network quality is poor, which may be due to fluctuations in the network where the IPv6 address is located. Therefore, as long as the network returns to normal, the target application can no longer be restricted from using the IPv6 address.

[0422] Please see Figure 25 and 26 This is a flowchart illustrating a method for accessing an application server based on an IPv4 address, as provided in an embodiment of this specification. After step 225, step 226 can be executed further:

[0423] Step 226: In response to the fulfillment of the second preset condition, remove the blocking status of all IPv6 addresses by the target application.

[0424] In the embodiments of this specification, firstly, when the target application accesses the corresponding application server using multiple target IPv6 addresses, the network fluctuations of the networks where the multiple target IPv6 addresses are located can be considered short-term. Therefore, the second preset condition can be: the target application disables all IPv6 addresses for a duration of a fourth preset duration. After the fourth preset duration, it can be considered that the short-term network fluctuations of the networks where the multiple target IPv6 addresses are located have been eliminated, and at this time, the target application can lift the ban on all IPv6 addresses. For example, the target application can lift the ban on all IPv6 addresses 48 hours after disabling them. It should be understood that the third preset duration can be set according to the average duration of network fluctuations in actual applications, and no special restrictions are imposed here.

[0425] Second, when the target application accesses the corresponding application server using multiple target IPv6 addresses, network fluctuations in the networks where these multiple target IPv6 addresses reside may be caused by the use of a specific operator's network. Therefore, the second preset condition can be: detecting an operator switching event. After detecting an operator switching event, it can be considered that the network fluctuations in the networks where the multiple target IPv6 addresses reside have been eliminated, and at this time, the target application's disabling of all IPv6 addresses can be lifted. For example, when accessing the corresponding application server using the multiple target IPv6 addresses, if the terminal detects that the operator of the Subscriber Identity Module (SIM) being used is China Telecom, it is considered that the network fluctuations in the networks where the multiple target IPv6 addresses reside are caused by the use of the China Telecom network. After setting the target application to disable all target IPv6 addresses, if the terminal detects that the operator of the SIM card being used has switched from China Telecom to China Mobile, it can be considered that the network fluctuations in the networks where the multiple target IPv6 addresses reside have been eliminated, and at this time, the target application's disabling of all IPv6 addresses can be lifted.

[0426] Third, when the target application accesses the corresponding application server using multiple target IPv6 addresses, the network fluctuations in the networks where these multiple target IPv6 addresses reside are caused by the use of a specific network type. Therefore, the second preset condition can be: a network switching event is detected. After detecting a network switching event, it can be assumed that the network fluctuations in the networks where the multiple target IPv6 addresses reside have been eliminated, and the target application can then lift the ban on all IPv6 addresses. For example, when accessing the corresponding application server using the multiple target IPv6 addresses, if the terminal detects that the network type being used is a cellular network, it is assumed that the network fluctuations in the networks where the multiple target IPv6 addresses reside are caused by the use of a cellular network. After setting the target application to disable all IPv6 addresses, if the terminal detects that the network type being used has switched from a cellular network to a Wireless Fidelity (WIFI) network, it can be assumed that the network fluctuations in the networks where the multiple target IPv6 addresses reside have been eliminated, and the target application can then lift the ban on the multiple target IPv6 addresses.

[0427] It should be understood that the above-mentioned removal of the target application's ban on all IPv6 addresses could be achieved by removing the target application from the application blacklist that disables all IPv6 addresses. Of course, there are other possible implementation methods, which are not specifically limited here.

[0428] Of course, the second preset conditions for lifting the target application's ban on all IPv6 addresses include, but are not limited to, the three mentioned above, and this application does not impose any special restrictions.

[0429] The following sections provide an overall description of the process of a target application accessing the corresponding server under both single-address and multi-address scenarios.

[0430] Scenario 1: Please refer to Figure 27 This is a flowchart illustrating the entire process of a target application accessing a corresponding application server based on a single address, as provided in an embodiment of this specification.

[0431] Step 1: First visit to the first domain name.

[0432] When a terminal detects that a target application needs to access a primary domain name, it can request multiple primary IPv4 addresses and multiple primary IPv6 addresses corresponding to that primary domain name from a DNS server. After receiving these multiple primary IPv4 addresses and multiple primary IPv6 addresses, the terminal selects a primary target IPv6 address from the multiple primary IPv6 addresses based on the principle of prioritizing the use of IPv6 addresses. Then, the target application accesses the corresponding primary application server based on the primary target IPv6 address. When the target application accesses the first application server based on the first target IPv6 address, on the one hand, the terminal will count the number of IPv6 sockets (V6SockNum) created by the terminal and the first application server with the target address as the first application server during the connection establishment phase, and the number of IPv6 sockets created that were not responded to by the first application server (V6SockErrNum). Then, by calculating the ratio of V6SockErrNum to V6SockNum, the single address connection failure rate (V6SockErr) is obtained. On the other hand, the terminal will count the number of data packets (V6SkbNum) received by the terminal from the first application server during the data transmission phase after the connection is established, and the number of abnormal data packets (V6SkbErrNum) received by the terminal from the first application server. Then, by calculating the ratio of V6SkbErrNum to V6SkbNum, the single address data transmission failure rate (V6SkbErr) is obtained. Finally, the terminal determines the first network anomaly rate (QualV6) within a unit time period based on the single-address connection anomaly rate (V6SockErr), the single-address data transmission anomaly rate (V6SkbErr), and the statistical time period (i.e., the first preset duration). If QualV6 is higher than the first preset threshold, it is considered that the network quality when the terminal accesses the first application service based on the first target IPv6 address is poor, and the target application is set to disable the first target IPv6 address.

[0433] Step 2: Access the first domain name again.

[0434] If the terminal detects that the target application needs to access the first domain name again, there are two possible implementation schemes:

[0435] First, the terminal requests multiple second IPv4 addresses and multiple second IPv6 addresses corresponding to the first domain name from the DNS server. Upon receiving these addresses, the terminal, based on the principle of prioritizing IPv6 addresses, first determines whether the multiple second IPv6 addresses contain the first target IPv6 address that is disabled by the target application. If so, the first target IPv6 address is filtered out from the multiple second IPv6 addresses, and a second target IPv6 address is selected from the remaining addresses. The target application then accesses the corresponding second application server based on the second target IPv6 address. If not, the second target IPv6 address is directly selected from the multiple second IPv6 addresses, and the target application then accesses the corresponding second application server based on the second target IPv6 address.

[0436] Second, the terminal filters out the first target IPv6 address from multiple first IPv6 addresses, selects the third target IPv6 address from the remaining first IPv6 addresses, and then the target application accesses the corresponding third application server based on the third target IPv6 address.

[0437] Based on this, after detecting that the first preset condition has been met, the terminal will remove the target application's ban on the first target IPv6 address.

[0438] Scenario 2: Please refer to Figure 28 This is a flowchart illustrating the entire process of a target application accessing a corresponding application server based on multiple addresses, as provided in the embodiments of this specification.

[0439] Step 1: Determine whether to disable all IPv6 addresses of the target application based on the multi-address access situation.

[0440] The target application on the terminal may access multiple domains within a third preset time period, such as the first domain, the second domain, and the third domain. There is no specific limit on the number of domains accessed by the target application within this third preset time period. The specific process for accessing each of these multiple domains can be referred to in Scenario 1, and will not be repeated here. During the access to multiple domains, the target application will access the corresponding application server based on multiple target IPv6 addresses. On one hand, the terminal can count the total number of accesses (V6AddrCnt) of the target application based on multiple target IPv6 addresses to the corresponding application server, and the total number of abnormal accesses (V6AddrErrCnt) based on these multiple IPv6 addresses to the corresponding application server. Then, the ratio of V6AddrErrCnt to V6AddrCnt is calculated to obtain the multi-address abnormal access rate (V6AddrErr). On the other hand, the terminal can count the total number of IPv6 sockets (V6SockNum) created when the target application accesses the corresponding application server based on multiple target IPv6 addresses. * The total number of IPv6 sockets created that did not receive a response from the corresponding application server (V6SockErrNum). * Then calculate V6SockErrNum. * With V6SockNum * The ratio gives the multi-address connection failure rate (V6SockErr). * The terminal obtains V6AddrErr and V6SockErr. * Then, by calculating V6AddrErr and V6SockErr... * The average value can be used to obtain the second network anomaly rate (AppQualV6). Simultaneously, the terminal can also count the total number of data packets (V4SkbNum) received from the application server when the target application accesses the corresponding application server based on multiple target IPv4 addresses within a third preset time period (T2). * ), and the total number of abnormal data packets in the data packets received from the application server (V4SkbErrNum) * Then calculate V4SkbErrNum * With V4SkbNum *The ratio yields the multi-address transmission anomaly rate (V4SkbErr*). Finally, the terminal calculates the ratio of V4SkbErr* to T2 to obtain the third network anomaly rate (AppQualV4) per unit time. In other words, AppQualV6 is used to evaluate the IPv6 network used by the target application, while AppQualV4 is used to evaluate the IPv4 network used by the target application. If AppQualV6 is higher than the second set threshold and AppQualV4 is lower than the third set threshold, it indicates that the network quality of the IPv6 network used by the target application is poor, while the network quality of the IPv4 network is good. In this case, the target application is set to disable all IPv6 addresses.

[0441] Step 2: The target application accesses the corresponding application server based on the IPv4 address.

[0442] After the terminal sets the target application to disable all IPv6 addresses, if it detects that the target application accesses any domain name, for example, the target application accesses a second domain name, there are two possible implementation schemes:

[0443] First, the terminal determines whether the target application is configured to disable all IPv6 addresses. If so, it requests multiple third IPv4 addresses corresponding to the second domain name from the DNS server. After receiving the multiple third IPv4 addresses, the terminal selects the first target IPv4 address from them, and then the target application can access the corresponding fourth application server based on the first target IPv4 address.

[0444] Second, the terminal requests multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name from the DNS server. After receiving the multiple fourth IPv4 addresses and multiple fourth IPv6 addresses, the terminal determines whether the target application is set to disable all IPv6 addresses and selects the second target IPv4 address from the multiple fourth IPv4 addresses. Then, the target application accesses the corresponding fifth application server based on the second target IPv4 address.

[0445] Please see Figure 29 Based on the same inventive concept, embodiments of this specification also provide an application server access device, which includes: a detection unit 501, a sending unit 502, and a processing unit 503.

[0446] Detection unit 501 is used to detect a first operation targeting the target application, the first operation instructing the target application to access a first domain name;

[0447] The sending unit 502 is configured to respond to the first operation by sending a first domain name resolution request to the domain name system server. The first domain name resolution request is used to request multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name.

[0448] Processing unit 503 is configured to receive multiple first IPv4 addresses and multiple first IPv6 addresses sent by the Domain Name System server, and send a first connection request to the first application server, wherein the first connection request includes a first target IPv6 address among the multiple first IPv6 addresses.

[0449] Processing unit 503 is further configured to respond to determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first set network quality level, and detecting a second operation for the target application, the second operation instructing the target application to access the first domain name again;

[0450] The sending unit 502 is also configured to respond to the second operation by sending a second domain name resolution request to the domain name system server. The second domain name resolution request is used to request multiple second Pv4 addresses and multiple second IPv6 addresses corresponding to the first domain name.

[0451] The processing unit 503 is further configured to receive a second IPv4 address and multiple second IPv6 addresses sent by the Domain Name System server, and send a second connection request to the second application server. The second connection request includes a second target IPv6 address among the multiple second IPv6 addresses, and the second target IPv6 address is different from the first target IPv6 address.

[0452] Optionally, the processing unit 503 includes a first network quality assessment unit;

[0453] The first network quality assessment unit is specifically used for:

[0454] The single-address connection anomaly rate is determined based on the number of IPv6 sockets whose target address is the first application server created within the first preset time period, and the number of IPv6 sockets that are not responded to by the first application server.

[0455] The single-address data transmission anomaly rate is determined based on the number of data packets sent by the first application server received within the first preset time period and the number of abnormal data packets in the data packets.

[0456] Based on the single-address connection failure rate, the single-address data transmission failure rate, and the first preset duration, the first network failure rate within a unit time period is obtained.

[0457] In response to a first network anomaly rate exceeding a first preset threshold, it is determined that the network quality when accessing the first application server based on the first target IPv6 address is lower than a first preset network quality level.

[0458] Optionally, the processing unit 503 is also configured to: set the target application to disable the first target IPv6 address.

[0459] Optionally, the processing unit 503 includes: a filtering unit, a determining unit, and a first connection request sending unit;

[0460] The filtering unit is configured to filter out the first target IPv6 address that is disabled by the target application from the plurality of second IPv6 addresses in response to the existence of a first target IPv6 address that is disabled by the target application among the plurality of second IPv6 addresses;

[0461] A determining unit is used to determine a second target IPv6 address from the remaining second IPv6 addresses;

[0462] The first connection request sending unit is used to send a second connection request to the second application server based on the second target IPv6 address.

[0463] Optionally, the sending unit 502 is further configured to, in response to the second operation, send a third connection request to a third application server, the third connection request including a third target IPv6 address among a plurality of first Pv6 addresses, the third target IPv6 address being different from the first target IPv6 address.

[0464] Optionally, the processing unit 503 is further configured to, in response to satisfying a first preset condition, remove the disabled state of the target application on the first target IPv6 address, wherein the first preset condition includes the target application disabling the first target IPv6 address for a duration of a second preset duration, or detecting an operator switching event, or detecting a network switching event.

[0465] Optionally, the processing unit 503 is further configured to respond to determining that the network quality of the IPv6 network of the target application is lower than a second set network quality level, and detecting a third operation for the target application, the third operation instructing the target application to access a second domain name;

[0466] The sending unit 502 is also used to respond to the third operation by sending a third domain name resolution request to the domain name system server. The third domain name resolution request is used to request multiple third IPv4 addresses corresponding to the second domain name.

[0467] The sending unit is also configured to send a fourth connection request to a fourth application server, the fourth connection request including a first target IPv4 address among a plurality of third IPv4 addresses.

[0468] Optionally, the processing unit 503 includes a second network quality assessment unit;

[0469] The second network quality assessment unit is specifically used for:

[0470] The multi-address abnormal access rate is determined based on the total number of times the target application accesses the corresponding application server based on multiple target IPv6 addresses within the third preset time period, and the total number of times the target application abnormally accesses the corresponding application server based on multiple target IPv6 addresses.

[0471] The multi-address connection anomaly rate is determined based on the total number of IPv6 sockets created by the target application when accessing the corresponding application server based on multiple target IPv6 addresses within the third preset time period, and the total number of IPv6 sockets that are not responded to by the corresponding application server.

[0472] The second network anomaly rate is determined based on the multi-address abnormal access rate and the multi-address connection abnormal rate;

[0473] In response to a second network anomaly rate exceeding a second preset threshold, it is determined that the network quality of the target application's IPv6 network is lower than a second preset network quality level.

[0474] Optionally, the processing unit 503 is also configured to set the target application to disable all IPv6 addresses.

[0475] Optionally, the processing unit 503 includes: a third network quality assessment unit and a disable unit;

[0476] The third network quality assessment unit is used to determine that the network quality of the target application's IPv4 network is higher than the third set network quality level;

[0477] The disable unit is used to disable all IPv6 addresses for a target application.

[0478] Optionally, the sending unit 502 is also configured to respond to the third operation by sending a fourth domain name resolution request to the domain name system server. The fourth domain name resolution request is used to request multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name.

[0479] The processing unit is also configured to receive multiple fourth IPv4 addresses and multiple fourth IPv6 addresses sent by the Domain Name System server, and send a fifth connection request to the fifth application server, wherein the fifth connection request includes a second target IPv4 address among the multiple fourth IPv4 addresses.

[0480] Optionally, the processing unit 503 includes: a second connection request sending unit;

[0481] The second connection request sending unit is specifically used for:

[0482] Determine whether all IPv6 addresses of the target application are disabled;

[0483] If so, determine the second target IPv4 address from among multiple fourth IPv4 addresses;

[0484] A fifth connection request is sent to the fifth application server based on the second target IPv4 address.

[0485] Optionally, the third network quality assessment unit is specifically used for:

[0486] The abnormal rate of multi-address data packets is determined based on the number of data packets sent by the application server and the number of abnormal data packets in the data packets when the target application is based on the application server corresponding to multiple target IPv4 addresses within the third preset time period.

[0487] Based on the third preset duration and the multi-address data packet anomaly rate, the third network anomaly rate within a unit duration is obtained;

[0488] If the third network anomaly rate is less than the third set threshold, it is determined that the network quality of the target application's IPv4 network is higher than the third set network quality level.

[0489] Optionally, the processing unit 503 is further configured to, in response to satisfying a second preset condition, remove the target application's ban on all IPv6 addresses, wherein the second preset condition includes the target application's ban on all IPv6 addresses reaching a fourth preset duration, or the detection of an operator switching event, or the detection of a network switching event.

[0490] Please see Figure 30 This specification also provides a chip module, which includes at least one processor 601. The processor 601 is used to execute a computer program stored in a memory to implement the implementation provided in this application embodiment. Figure 4 , Figures 6-28 The flowchart illustrates the steps of the application server access method.

[0491] Optionally, the processor 601 may be a central processing unit, a specific ASIC, or one or more integrated circuits used to control program execution.

[0492] Optionally, the chip module may further include a memory 602 connected to at least one processor 601. The memory 602 may include ROM, RAM, and disk storage. The memory 602 stores data required for the processor 601 to run, i.e., it stores instructions that can be executed by at least one processor 601. The at least one processor 601 executes instructions stored in the memory 602 to perform tasks such as... Figure 1-7The method is shown. The number of memories 602 is one or more.

[0493] This specification also provides a computer storage medium, wherein the computer storage medium stores computer instructions, which, when executed on a computer, cause the computer to perform actions such as... Figure 4 , Figures 6-28 The method described.

[0494] This specification provides an embodiment of a computer program product, which includes computer instructions that, when executed by a computer, cause the computer to perform actions such as... Figure 4 , Figures 6-28 The method described.

[0495] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented using software, the above embodiments can be implemented, in whole or in part, as a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of this specification are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more sets of available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium. A semiconductor medium can be a solid-state drive (SSD).

[0496] The above description is merely a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of protection of this specification.

Claims

1. A method for accessing an application server, characterized in that, The method includes: A first operation targeting the target application is detected, the first operation instructing the target application to access a first domain name; In response to the first operation, a first domain name resolution request is sent to the domain name system server. The first domain name resolution request is used to request multiple first IPv4 addresses and multiple first IPv6 addresses corresponding to the first domain name. Receive the plurality of first IPv4 addresses and the plurality of first IPv6 addresses sent by the Domain Name System server, and send a first connection request to the first application server, wherein the first connection request includes a first target IPv6 address among the plurality of first IPv6 addresses; In response to determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than a first preset network quality level, and detecting a second operation for the target application, the second operation instructing the target application to access the first domain name again; In response to the second operation, a second domain name resolution request is sent to the domain name system server. The second domain name resolution request is used to request multiple second IPv4 addresses and multiple second IPv6 addresses corresponding to the first domain name. The system receives the plurality of second IPv4 addresses and the plurality of second IPv6 addresses sent by the Domain Name System server, and sends a second connection request to the second application server. The second connection request includes a second target IPv6 address among the plurality of second IPv6 addresses, and the second target IPv6 address is different from the first target IPv6 address.

2. The method according to claim 1, characterized in that, Determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than a first preset network quality level includes: The single-address connection anomaly rate is determined based on the number of IPv6 sockets whose target address is the first application server created within the first preset time period, and the number of IPv6 sockets that are not responded to by the first application server. The single-address data transmission anomaly rate is determined based on the number of data packets sent by the first application server received within the first preset time period and the number of abnormal data packets in the data packets. Based on the single-address connection anomaly rate, the single-address data transmission anomaly rate, and the first preset duration, a first network anomaly rate within a unit duration is obtained; In response to the first network anomaly rate being higher than a first preset threshold, it is determined that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first preset network quality level.

3. The method according to claim 1 or 2, characterized in that, After determining that the network quality when accessing the first application server based on the first target IPv6 address is lower than the first set network quality level, the method further includes: Configure the target application to disable the first target IPv6 address.

4. The method according to claim 3, characterized in that, Send a second connection request to the second application server, including: In response to the presence of a first target IPv6 address that is disabled by the target application among the plurality of second IPv6 addresses, the first target IPv6 address that is disabled by the target application is filtered out from the plurality of second IPv6 addresses, and the second target IPv6 address is determined from the remaining second IPv6 addresses; The second connection request is sent to the second application server based on the second target IPv6 address.

5. The method according to claim 1, characterized in that, After detecting a second operation targeting the target application, the method further includes: In response to the second operation, a third connection request is sent to a third application server. The third connection request includes a third target IPv6 address among the plurality of first IPv6 addresses, and the third target IPv6 address is different from the first target IPv6 address.

6. The method according to claim 3, characterized in that, After setting the first target IPv6 address of the target application to a disabled state, the method further includes: In response to meeting a first preset condition, the blocking status of the first target IPv6 address by the target application is lifted, wherein the first preset condition includes the blocking duration of the first target IPv6 address by the target application reaching a second preset duration, or the detection of a carrier switching event, or the detection of a network switching event.

7. The method according to claim 1 or 5, characterized in that, The method further includes: In response to determining that the network quality of the IPv6 network of the target application is lower than a second preset network quality level, and detecting a third operation for the target application, the third operation instructing the target application to access a second domain name; In response to the third operation, a third domain name resolution request is sent to the domain name system server. The third domain name resolution request is used to request multiple third IPv4 addresses corresponding to the second domain name. A fourth connection request is sent to a fourth application server, the fourth connection request including a first target IPv4 address among the plurality of third IPv4 addresses.

8. The method according to claim 7, characterized in that, In response to determining that the network quality of the IPv6 network of the target application is lower than a second preset network quality level, the following includes: The multi-address abnormal access rate is determined based on the total number of times the target application accesses the corresponding application server based on multiple target IPv6 addresses within the third preset time period, and the total number of times the target application abnormally accesses the corresponding application server based on the multiple target IPv6 addresses. The multi-address connection anomaly rate is determined based on the total number of IPv6 sockets created by the target application when accessing the corresponding application server based on the multiple target IPv6 addresses within the third preset time period, and the total number of IPv6 sockets that are not responded to by the corresponding application server. A second network anomaly rate is determined based on the multi-address abnormal access rate and the multi-address connection abnormal rate; In response to the second network anomaly rate being higher than a second preset threshold, it is determined that the network quality of the IPv6 network of the target application is lower than the second preset network quality level.

9. The method according to claim 8, after determining that the target application's access to the corresponding application server via the IPv6 network is abnormal, the method further includes: Configure the target application to disable all IPv6 addresses.

10. The method according to claim 9, characterized in that, Configure the target application to disable all IPv6 addresses, including: In response to determining that the network quality of the target application's IPv4 network is higher than a third preset network quality level, the target application is set to disable all IPv6 addresses.

11. The method according to claim 10, characterized in that, In response to the third operation, a third domain name resolution request is sent to the Domain Name System server, including: In response to the third operation, determine whether all IPv6 addresses of the target application are disabled; If so, send the third domain name resolution request to the domain name system server.

12. The method according to claim 10, characterized in that, After detecting a third operation targeting the target application, the method further includes: In response to the third operation, a fourth domain name resolution request is sent to the domain name system server. The fourth domain name resolution request is used to request multiple fourth IPv4 addresses and multiple fourth IPv6 addresses corresponding to the second domain name. The system receives the plurality of fourth IPv4 addresses and the plurality of fourth IPv6 addresses sent by the Domain Name System server, and sends a fifth connection request to the fifth application server, wherein the fifth connection request includes a second target IPv4 address among the plurality of fourth IPv4 addresses.

13. The method according to claim 12, characterized in that, Send a fifth connection request to the fifth application server, including: Determine whether all IPv6 addresses of the target application are disabled; If so, determine the second target IPv4 address from the plurality of fourth IPv4 addresses; The fifth connection request is sent to the fifth application server based on the second target IPv4 address.

14. The method according to claim 10, characterized in that, Determining that the network quality of the target application's IPv4 network is higher than a third preset network quality level includes: Based on the number of data packets received by the target application from the application server corresponding to multiple target IPv4 addresses within the third preset time period, and the number of abnormal data packets in the data packets, the multi-address data packet abnormality rate is determined. Based on the third preset duration and the multi-address data packet anomaly rate, the third network anomaly rate within a unit duration is obtained; If the third network anomaly rate is less than the third set threshold, it is determined that the network quality of the IPv4 network of the target application is higher than the third set network quality level.

15. The method according to any one of claims 9-14, characterized in that, After setting the target application to disable all IPv6 addresses, the method further includes: In response to the fulfillment of a second preset condition, the blocking status of the target application on all IPv6 addresses is lifted, wherein the second preset condition includes the blocking duration of the target application blocking all IPv6 addresses reaching a fourth preset duration, or the detection of a carrier switching event, or the detection of a network switching event.

16. A chip module, characterized in that, The chip module includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the chip module is triggered to perform the steps of the method as described in any one of claims 1-15.

17. A terminal, characterized in that, The terminal includes a memory for storing computer program instructions and a processor for executing the program instructions, wherein when the computer program instructions are executed by the processor, the terminal is triggered to perform the steps of the method as described in any one of claims 1-15.

18. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store computer instructions that, when executed in a computer, cause the computer to perform the steps of the method as described in any one of claims 1-15.

19. A computer program product, characterized in that, The computer program product includes computer instructions that, when executed on a computer, cause the computer to perform the steps of the method according to any one of claims 1-15.