A client domain name switching method and device, electronic equipment and storage medium

By collecting domain connection characteristics on the client side and using a predictive model to assess availability, and dynamically switching to a backup domain, the lag problem when the primary domain is inaccessible is solved, achieving more efficient domain switching and system robustness.

CN122160358APending Publication Date: 2026-06-05BEIJING BAILONG MAYUN TECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING BAILONG MAYUN TECH CO LTD
Filing Date
2026-01-22
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

In existing technologies, there is a lag in the switching of backup domains when the main domain is inaccessible, resulting in excessively high network request latency and affecting data transmission rate and user interaction response speed.

Method used

By collecting domain connection characteristics of the main domain, using a trained domain availability prediction model to assess availability, identifying potential unavailability risks, and resolving candidate domains for health checks, the system dynamically switches to backup domains.

Benefits of technology

It effectively reduces domain name switching latency, improves the accuracy of domain name switching and system robustness, and ensures the continuous availability of application services and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122160358A_ABST
    Figure CN122160358A_ABST
Patent Text Reader

Abstract

The application relates to a client domain name switching method and device, electronic equipment and a storage medium, comprising: collecting domain name connection characteristics of a main domain name when an application program performs network communication between a client and a server through the main domain name; inputting the domain name connection characteristics into a trained domain name availability prediction model to obtain an availability score of the main domain name output by the trained domain name availability prediction model; if it is identified that the main domain name has a potential unavailability risk according to the availability score of the main domain name, resolving all candidate domain names and performing health detection on each candidate domain name based on the resolution result; identifying a backup candidate domain name based on the health detection result; and switching the main domain name of the client to the backup candidate domain name. The above method can actively switch the backup domain name before the main domain name is inaccessible, thereby effectively reducing domain name switching delay, improving domain name switching accuracy and system robustness.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of domain name processing technology, and in particular to a client domain name switching method, apparatus, electronic device, and storage medium. Background Technology

[0002] With the rapid development of mobile internet, numerous applications rely on network communication between clients and servers to provide services. The Domain Name System (DNS), as part of internet infrastructure, plays a crucial role in mapping domain names to IP addresses. Currently, applications commonly employ backup domain name switching mechanisms to improve the availability of domain name access. Specifically, during the configuration phase, the client pre-writes a primary domain name and several backup domain names. When access to the primary domain name fails, the application attempts to use the backup domain names in a preset order to establish a connection with the server. However, in this approach, backup domain name switching is usually passively triggered, exhibiting a lag. It typically only triggers after the primary domain name becomes completely inaccessible, thus allowing users to perceive the failure.

[0003] Therefore, most existing solutions only trigger the switch to the backup domain name when the main domain name is completely inaccessible, which results in the client experiencing multiple timeouts or failed retries, causing excessive network request latency and affecting data transmission rate and user interaction response speed. Summary of the Invention

[0004] Based on this, it is necessary to provide a client domain name switching method, device, electronic device, and storage medium to address the above-mentioned technical problems. This method can proactively switch to a backup domain name before the primary domain name becomes inaccessible, thereby effectively reducing domain name switching latency and improving the accuracy and robustness of domain name switching.

[0005] According to a first aspect of certain exemplary embodiments of this application, a client domain name switching method is provided, comprising: collecting domain name connection features of the main domain name when an application communicates with a server via the main domain name; inputting the domain name connection features into a trained domain name availability prediction model to obtain an availability score of the main domain name output by the trained domain name availability prediction model; if a potential unavailability risk is identified in the main domain name based on the availability score, resolving all candidate domain names and performing health checks on each candidate domain name based on the resolution results; identifying an alternative candidate domain name based on the health check results; and switching the client's main domain name to the alternative candidate domain name.

[0006] Preferably, the domain name availability prediction model is an LSTM-based time series prediction model or a random forest classification model, and the domain name availability prediction model is trained based on the domain name connection features of multiple samples and the availability of the domain names corresponding to the domain name connection features of each sample.

[0007] Preferably, the domain name connection characteristics include one or more of the following: Domain Name System (DNS) resolution latency, DNS resolution success rate, Transmission Control Protocol (TCP) and / or Fast UDP (FDP) Internet connection handshake latency, TCP and / or FDP Internet connection connection failure rate, Hypertext Transfer Protocol (HTTP) request / response code, HTTP request timeout, packet loss rate, network jitter, and user network environment information.

[0008] Preferably, resolving all candidate domain names and performing health checks on each candidate domain name based on the resolution results includes: resolving all candidate domain names using parallel resolution; performing health checks on each resolution result, including round-trip time tests of data packets and connection attempt tests; determining the real-time network metrics and historical success rates of each candidate domain name based on the health check results; and identifying backup candidate domain names based on the health check results, including: identifying backup candidate domain names based on the real-time network metrics and historical success rates of each candidate domain name.

[0009] Preferably, all candidate domain names are resolved in parallel, including: resolving all candidate domain names in a multi-channel parallel manner using the system domain name system, the hypertext transfer protocol domain name system, the domain name system based on the hypertext transfer protocol, and the domain name system based on the transport layer security protocol.

[0010] Preferably, the primary domain name and all candidate domain names come from a stored domain name pool, which is obtained through synchronous distribution from the cloud. A client domain name switching method further includes: uploading the switching success rate, latency changes and / or failure logs when the client communicates with the server through the primary domain name and / or backup candidate domain names to the cloud. The cloud updates the domain name pool periodically or when an event is triggered based on the switching success rate, latency changes and / or failure logs, and synchronously distributes the updated domain name pool to the client.

[0011] Preferably, a client domain name switching method further includes: determining that the main domain name has a potential unavailability risk when the availability score of the main domain name is less than a set score threshold; determining that the main domain name is available when the availability score of the main domain name is greater than or equal to the set score threshold, and continuing to conduct network communication between the client and the server through the main domain name.

[0012] According to a second aspect of certain exemplary embodiments of this application, a client domain name switching device is provided, comprising: a collection module, configured to collect domain name connection features of a primary domain name when an application communicates with a server via a primary domain name; an availability score acquisition module, configured to input the domain name connection features into a trained domain name availability prediction model to obtain an availability score of the primary domain name output by the trained domain name availability prediction model; a health detection module, configured to parse all candidate domain names and perform health checks on each candidate domain name based on the resolution results if a potential unavailability risk of the primary domain name is identified based on the availability score of the primary domain name; a candidate domain name identification module, configured to identify an alternative candidate domain name based on the health detection results; and a domain name switching module, configured to switch the client's primary domain name to an alternative candidate domain name.

[0013] According to a third aspect of certain exemplary embodiments of this application, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any of the above methods.

[0014] According to a fourth aspect of certain exemplary embodiments of this application, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the methods described above.

[0015] The aforementioned client domain name switching method, apparatus, electronic device, and storage medium include: collecting domain name connectivity features of the main domain name when an application communicates with the server via the main domain name; inputting the domain name connectivity features into a trained domain name availability prediction model to obtain the availability score of the main domain name output by the trained domain name availability prediction model; if a potential unavailability risk is identified based on the availability score of the main domain name, resolving all candidate domain names and performing health checks on each candidate domain name based on the resolution results; identifying a backup candidate domain name based on the health check results; and switching the client's main domain name to the backup candidate domain name. Therefore, when communicating with the server via the main domain name, the trained domain name availability prediction model analyzes the domain name connectivity features to identify the availability of the main domain name. Furthermore, when a potential unavailability risk is identified, the system proactively switches to a backup candidate domain name, thus enabling proactive switching of the backup domain name before the main domain becomes inaccessible. This effectively reduces domain name switching latency and improves domain name switching accuracy and system robustness. Attached Figure Description

[0016] Figure 1 This is a flowchart illustrating a client domain name switching method according to some exemplary embodiments of this application; Figure 2This is a schematic diagram of the system framework of a client domain name switching method according to some exemplary embodiments of this application; Figure 3 This is a schematic diagram illustrating the overall process of a client domain name switching method in some exemplary embodiments of this application; Figure 4 This is a structural block diagram of a client domain name switching device in some other exemplary embodiments of this application; Figure 5 This is a diagram of the internal structure of an electronic device in some other exemplary embodiments of this application. Detailed Implementation

[0017] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0018] The following detailed descriptions are provided to aid the reader in gaining a comprehensive understanding of the methods, apparatus, electronic devices, storage media, and / or computer program products described herein. However, after understanding the disclosure of this application, various changes, modifications, and equivalents of the methods, apparatus, storage media, and / or computer program products described herein will become apparent. For example, the order of operations described herein is merely illustrative and is not limited to those orders set forth herein, but may be changed as will become clear after understanding the disclosure of this application, except for operations that must occur in a specific order. Furthermore, for clarity and conciseness, descriptions of features known in the art may be omitted.

[0019] The features described herein may be implemented in different forms and should not be construed as limited to the examples described herein. Rather, the examples described herein are provided only to illustrate some of the many feasible ways of implementing the methods, electronic devices, and / or storage media described herein, many of which will become clear upon understanding this application.

[0020] The terminology used herein is for the purpose of describing various examples only and is not intended to limit disclosure. Unless the context clearly indicates otherwise, the singular form is intended to include the plural form as well. The terms “comprising,” “including,” and “having” indicate the presence of the described features, quantities, operations, components, elements, and / or combinations thereof, but do not exclude the presence or addition of one or more other features, quantities, operations, components, elements, and / or combinations thereof. Unless otherwise stated, “ / ” means “or,” for example, A / B can mean A or B; “and / or” in the text is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can mean: A alone, A and B simultaneously, and B alone. Furthermore, in the description of embodiments of the invention, “multiple” means two or more.

[0021] Unless otherwise defined, all terms used herein (including technical and scientific terms) shall have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains upon understanding this application. Unless expressly defined herein, terms (such as those defined in a general dictionary) shall be interpreted as having a meaning consistent with their meaning in the context of the relevant field and in this application, and shall not be interpreted in an idealized or overly formalistic manner.

[0022] It should be noted that the terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. The embodiments described in some of the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0023] Furthermore, in the description of the examples, detailed descriptions of well-known related structures or functions will be omitted when it is believed that such detailed descriptions would lead to a vague interpretation of this application.

[0024] In the following description, embodiments will be described in detail with reference to the accompanying drawings. However, embodiments may be implemented in various forms and are not limited to the examples described herein.

[0025] Definitions of abbreviations and key terms: Definition of abbreviations: APK: Android Package Kit, an Android application installation package.

[0026] DNS: Domain Name System, used to resolve domain names into IP addresses.

[0027] HTTPDNS: A DNS resolution service based on the HTTP protocol that bypasses the local ISP's DNS.

[0028] DoH: DNS over HTTPS, a domain name resolution method that uses HTTPS for encryption.

[0029] AI: Artificial Intelligence.

[0030] ML: Machine Learning, is one way to implement AI.

[0031] CDN: Content Delivery Network, used to improve access speed and stability.

[0032] QoS: Quality of Service, a performance metric used to measure network communication.

[0033] Keyword definition: Domain Escape: This refers to the process by which an application automatically switches to a backup domain, IP address, or CDN node when the primary domain becomes inaccessible, in order to ensure business continuity.

[0034] Backup Domain: A pre-configured or dynamically acquired alternative domain when the primary domain is unavailable.

[0035] Dynamic Configuration Center: A server-side component used to send domain name lists, switching strategies, and AI models to clients.

[0036] AI Prediction Module: An embedded module in the client that predicts domain availability based on historical access data and network characteristics, and selects the optimal backup domain.

[0037] AI Training Module: A training system deployed on the server side that trains and optimizes a global AI model based on aggregated user access data and then distributes updates.

[0038] Domain Switching Policy: Defines the switching order, selection logic, and triggering conditions when the primary domain becomes invalid.

[0039] Federated Learning: A distributed machine learning approach that allows clients to train models locally and only upload parameter updates to protect user privacy.

[0040] In some exemplary embodiments of this application, a method for switching client domain names is provided. For example... Figure 1 As shown, a method for switching client domain names includes the following steps: Step S101: When the application communicates with the server via the main domain, the domain name connection characteristics of the main domain are collected.

[0041] In this embodiment, the primary domain name can come from a locally cached candidate domain name pool or a candidate domain name pool pulled from the cloud. The application obtains the primary domain name from the candidate domain name pool and then uses the primary domain name to suggest network communication between the client and the server.

[0042] In one example of this embodiment, the domain name connection features include one or more of the following: Domain Name System (DNS) resolution latency, DNS resolution success rate, Transmission Control Protocol / Fast UDP (VDP) Internet connection handshake latency, VDP Internet connection failure rate, Hypertext Transfer Protocol (HTTP) request / response code, HTTP request timeout, packet loss rate, network jitter, and user network environment information.

[0043] In this embodiment, the client application relies on network communication between the client and the server to provide services. Specifically, the application establishes network communication between the client and the server through the main domain name. Furthermore, the client collects domain name connection characteristics during application runtime through the client SDK.

[0044] The process of collecting domain connection characteristics is as follows: During application runtime, the client SDK collects the following characteristics for each network request: (1) DNS resolution latency and resolution success rate; (2) TCP / QUIC handshake delay and connection failure rate; (3) HTTP request and response codes, and timeout information; (4) Packet loss rate and network jitter; (5) User network environment (operator, geographical location, network type 4G / 5G / WiFi).

[0045] Step S102: Input the domain name connection features into the trained domain name availability prediction model to obtain the availability score of the main domain name output by the trained domain name availability prediction model.

[0046] In this embodiment, the collected domain name connectivity features can be normalized and preprocessed to form feature vectors, which are then input into a trained domain name availability prediction model. In one example of this embodiment, the domain name availability prediction model is an LSTM-based time-series prediction model or a random forest classification model, and the model is trained based on multiple sample domain name connectivity features and the availability of the domains corresponding to each sample domain name connectivity feature.

[0047] Specifically, the feature vector is input into a lightweight domain availability prediction model. This model can be an LSTM-based time-series prediction model or a random forest classification model. The domain availability prediction model is trained using sample data. This sample data includes multiple sample domain connection features and the availability score of the domain corresponding to each feature. The model is trained using this sample data. Specifically, the sample data can be collected by gathering sample domain connection features from client-server network communications using various domains, and then collecting the domain availability score for each of these connection features. The collected sample data is then input into the domain availability prediction model for training. Therefore, when determining the availability score of the main domain, inputting the domain connection features of the main domain into the trained domain availability prediction model yields the model's output availability score S for the main domain.

[0048] In one embodiment, after step S102, the method further includes: determining that the main domain name has a potential unavailability risk when the availability score of the main domain name is less than a set score threshold; determining that the main domain name is available when the availability score of the main domain name is greater than or equal to the set score threshold, and continuing to conduct network communication between the client and the server through the main domain name.

[0049] Specifically, a scoring threshold is pre-set based on the domain availability prediction model and its sample data. If the availability score of the main domain is less than the set threshold, it indicates that the main domain is at risk of becoming unavailable. Conversely, if the score is higher than the threshold, it indicates that the main domain is not at risk of becoming unavailable, and the main domain can continue to be used for network communication between the client and the server.

[0050] Step S103: If the main domain name is identified as having a potential unavailability risk based on its availability score, resolve all candidate domain names and perform a health check on each candidate domain name based on the resolution results.

[0051] In this embodiment, the availability score of the main domain name can be used to identify whether the main domain name has a potential unavailability risk. Specifically, if the availability score S of the main domain name output by the model is lower than a set score threshold, the main domain name is judged to have a high risk, and the backup domain name switching logic is initiated in advance. All candidate domains can come from a locally cached candidate domain name pool or a candidate domain name pool pulled from the cloud.

[0052] The backup domain name switching logic is as follows: All candidate domain names are resolved, and health checks are performed on each candidate domain name based on the resolution results. Backup candidate domain names are then identified based on the health check results, and the primary domain name is switched to the backup candidate domain name. Resolving all candidate domain names can be done by resolving all candidate domain names corresponding to the primary domain name from the domain name pool based on the domain name configuration information. Performing health checks on each candidate domain name can involve availability checks, performance checks, and / or security checks. Availability checks can include network layer checks, transport layer checks, and / or application layer checks. Network layer checks: Node connectivity is tested using ICMP Ping to determine if the link is unobstructed. Transport layer checks: TCP / UDP port probing is performed on the business ports to confirm if the ports are in a listening state. Application layer checks: Real business requests (such as HTTP GET / HEAD requests, HTTPS TLS handshakes) are initiated to verify if the nodes can return expected responses. Performance checks include latency checks, stability checks, and / or throughput checks. Latency testing: Measure the RTT (Round Trip Time) from the local machine to the target IP. Stability testing: Through multiple continuous probes, analyze packet loss rate and jitter rate, and eliminate nodes with high packet loss rate and large latency fluctuations. Throughput testing: For high-traffic services, conduct small-traffic throughput tests to evaluate the node's data transmission capacity. Security testing includes consistency verification and compliance verification. Consistency verification: Compare the service response content (such as website certificate and page signature values) corresponding to the IP resolved by multiple channels (system DNS, HTTPDNS, DoH / DoT). If there are significant differences, the node is identified as abnormal. Compliance verification: Verify the validity of the node's service certificate and whether there is a risk of man-in-the-middle attacks.

[0053] Step S104: Identify alternative candidate domain names based on health test results.

[0054] In this embodiment, the health check results can be availability check results, performance check results, and / or security check results. The health check results directly characterize the quality of each candidate domain name in client-server network communication. Backup candidate domain names can be selected from multiple candidate domain names based on the health check results.

[0055] In one example of this embodiment, resolving all candidate domain names and performing health checks on each candidate domain name based on the resolution results includes: resolving all candidate domain names using parallel resolution; performing health checks on each resolution result, including round-trip time tests and connection attempt tests; determining the real-time network metrics and historical success rates of each candidate domain name based on the health check results; and identifying backup candidate domain names based on the health check results, including: identifying backup candidate domain names based on the real-time network metrics and historical success rates of each candidate domain name.

[0056] Among them, parallel resolution is used to resolve all candidate domain names, including: multi-channel parallel resolution of all candidate domain names constructed using the System Domain Name System, Hypertext Transfer Protocol Domain Name System, Hypertext Transfer Protocol-based Domain Name System, and Transport Layer Security Protocol-based Domain Name System.

[0057] Specifically, when it is confirmed that the backup domain name switching logic needs to be entered, the client SDK performs the following operations: 1. Parallel resolution of all candidate domain names is achieved through multiple channels, including System DNS (Domain Name System), HTTPDNS (Hypertext Transfer Protocol Domain Name System), DoH (DNS over HTTPS) / DoT (DNS over TLS).

[0058] 2. Perform health checks on the parsing results, such as RTT (Round-Trip Time) testing and connection attempts; 3. Prioritize domain names based on a comprehensive prediction score, real-time network metrics, and historical success rate; 4. Select the best candidate domain name and replace the primary domain name in the network requests sent by the application; 5. If the best candidate domain name fails, the next candidate domain name will be tried automatically.

[0059] Step S105: Switch the client's primary domain name to the backup candidate domain name.

[0060] In this embodiment, the primary domain name is switched to a backup candidate domain name, and the application establishes network communication between the client and the server through the backup candidate domain name.

[0061] In one implementation, the primary domain name and all candidate domain names come from a stored domain name pool, which is obtained through synchronous distribution from the cloud. After step S105 above, the following steps are also included: uploading the success rate of switching, latency changes and / or failure logs when the client communicates with the server through the primary domain name and / or backup candidate domain names to the cloud. The cloud updates the domain name pool periodically or when an event is triggered based on the success rate of switching, latency changes and / or failure logs, and synchronously distributes the updated domain name pool to the client.

[0062] Specifically, the client SDK uploads switch success rates, latency changes, failure logs, and other data to the cloud. The cloud aggregates this data to update the weights and rankings of the primary domain and candidate domains in the domain pool, and then synchronizes the updated domain pool to the client.

[0063] The aforementioned client domain name switching method includes: collecting domain name connection features of the main domain name when the application communicates with the server via the main domain name; inputting the domain name connection features into a trained domain name availability prediction model to obtain the availability score of the main domain name output by the trained domain name availability prediction model; if the availability score of the main domain name indicates a potential risk of unavailability, resolving all candidate domain names and performing health checks on each candidate domain name based on the resolution results; identifying backup candidate domain names based on the health check results; and switching the client's main domain name to the backup candidate domain name. Therefore, when communicating with the server via the main domain name, the trained domain name availability prediction model analyzes the domain name connection features to identify the availability of the main domain name. Furthermore, when a potential risk of unavailability is identified, the system proactively switches to a backup candidate domain name, thus proactively switching to a backup domain name before the main domain name becomes inaccessible. This effectively reduces domain name switching latency and improves the accuracy and robustness of domain name switching.

[0064] Based on the above embodiments, a specific implementation method for switching client domain names is provided below: like Figure 2 As shown, the system for implementing the above-mentioned client domain name switching method mainly includes the following modules: Data acquisition module: responsible for collecting network access-related data during client runtime.

[0065] Predictive analytics module: Uses AI / machine learning models to predict the availability of the main domain name.

[0066] Domain pool maintenance module: Maintains a multi-level candidate pool of primary domains, backup domains, and directly connected IPs, and supports cloud-based distribution and updates.

[0067] The optimization and switching module dynamically selects the optimal domain name and completes the request switching based on the prediction results and real-time detection data.

[0068] Request takeover module: Intercepts network requests at the SDK level and transparently replaces them with the optimal domain name without affecting business logic.

[0069] Feedback optimization module: Collects switching effect data and uploads it to the cloud for model iteration and candidate pool optimization.

[0070] The above-mentioned process for simplifying client domain name switching is as follows: Figure 3 As shown: 1. Initialization phase.

[0071] After the application starts, the SDK loads and initializes: it pulls the latest candidate domain name pool from the local cache or the cloud; it initializes the AI ​​model and threshold parameters; and it registers a network listener to prepare for collecting real-time data.

[0072] 2. Data acquisition and feature processing.

[0073] During application runtime, the SDK collects the following characteristics for each network request: DNS resolution latency and success rate; TCP / QUIC handshake latency and connection failure rate; HTTP request and response codes, timeout information; Packet loss rate, network jitter; User network environment (carrier, geographical location, network type 4G / 5G / WiFi).

[0074] The data is normalized and preprocessed to form feature vectors.

[0075] 3. Intelligent prediction: Input the feature vector into a lightweight model, such as a time series prediction model based on LSTM or a random forest classification model; the model outputs a primary domain name availability score S; if S is lower than a preset threshold, it is determined that the primary domain name is at high risk and the backup domain name switching logic is initiated in advance.

[0076] 4. Domain pool management.

[0077] The domain name pool stored locally on the client includes: the primary domain; multiple secondary domains; and direct IPs.

[0078] The cloud will update the domain name pool periodically or when an event is triggered (such as a large-scale outage), and the client will automatically synchronize.

[0079] 5. Dynamic optimization and switching.

[0080] When a domain name switch is required, the client SDK performs the following operations: All candidate domain names are resolved in parallel (through multiple channels such as system DNS, HTTPDNS, DoH / DoT, etc.). Perform health checks on the parsed results (RTT test, connection attempt); Domain name priority is calculated based on a comprehensive prediction score, real-time network metrics, and historical success rate. Select the optimal candidate domain name and replace the network requests sent by the application; If the optimal domain name fails, the next candidate will be tried automatically.

[0081] 6. Request transparent takeover.

[0082] The client SDK hooks requests at the network layer, for example, based on OkHttp Interceptor: The application sends a request → the SDK checks the availability of the current domain name → if it is unavailable, it replaces it with the best candidate domain name → and returns a new request result.

[0083] The entire process is transparent to the business logic and does not require developers to modify the code.

[0084] 7. Feedback and Adaptive Optimization The client SDK uploads switch success rate, latency changes, failure logs, etc. to the cloud; After data is aggregated in the cloud, it is used for: updating domain pool weights and rankings; iterating AI model parameters; issuing new strategies and domain configurations; and the client can obtain the optimization effect after the next update, achieving an adaptive closed loop.

[0085] In summary, the client domain name switching method of this application achieves the following beneficial effects by introducing a multi-domain escape mechanism, a backup domain name dynamic update mechanism, and an AI intelligent selection strategy: Enhanced availability: When the main domain becomes inaccessible due to network fluctuations, DNS pollution, or sudden failures, the client can automatically switch to the backup domain or the direct IP address, ensuring the continuous availability of application services and reducing interruptions caused by domain unavailability.

[0086] Reduced access latency: By performing multi-domain health checks and optimization on the client side, the target address with the fastest response and best stability can be dynamically selected, thereby reducing access latency and improving data transmission rate.

[0087] Enhanced Intelligent Adaptability: By leveraging AI / policy engines to score domain availability in real time and analyze historical data, the system can adaptively adjust domain priority, enabling intelligent and dynamic escape strategies and improving robustness in complex network environments.

[0088] Communication security assurance: Certificate verification, whitelist matching and signature verification mechanisms are introduced during domain name switching to prevent malicious hijacking or forgery and improve the overall communication security level of the system.

[0089] Improved Operation and Management Efficiency: Through automated domain name health monitoring and dynamic switching, the need for manual intervention caused by domain name unavailability has been significantly reduced, alleviating operation and maintenance pressure and enhancing the system's self-healing capabilities.

[0090] User experience optimization: The domain name switching process on the user side is completely transparent, without any noticeable service interruption or lag, thus ensuring the stability and continuity of the application during use.

[0091] In summary, the client domain name switching method proposed in this application can significantly improve the availability, transmission efficiency, security, and user experience of APK applications in complex network environments under the premise of legality and compliance, and has obvious technological progress and practical value.

[0092] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowchart may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.

[0093] In some exemplary embodiments of this application, such as Figure 4 As shown, a client domain name switching device includes a data acquisition module 401, an availability score acquisition module 402, a health detection module 403, a candidate domain name identification module 404, and a domain name switching module 405. The data acquisition module 401 is used to collect the domain name connection characteristics of the main domain name when the application communicates with the server via the main domain name. The availability score acquisition module 402 is used to input the domain name connection characteristics into a trained domain name availability prediction model to obtain the availability score of the main domain name output by the trained domain name availability prediction model. The health detection module 403 is used to parse all candidate domain names and perform health checks on each candidate domain name based on the resolution results if the main domain name is identified as potentially unavailable according to its availability score. The candidate domain name identification module 404 is used to identify backup candidate domain names based on the health detection results. The domain name switching module 405 is used to switch the client's main domain name to a backup candidate domain name.

[0094] Preferably, the domain name availability prediction model is an LSTM-based time series prediction model or a random forest classification model, and the domain name availability prediction model is trained based on the domain name connection features of multiple samples and the availability of the domain names corresponding to the domain name connection features of each sample.

[0095] Preferably, the domain name connection characteristics include one or more of the following: Domain Name System (DNS) resolution latency, DNS resolution success rate, Transmission Control Protocol (TCP) and / or Fast UDP (FDP) Internet connection handshake latency, TCP and / or FDP Internet connection connection failure rate, Hypertext Transfer Protocol (HTTP) request / response code, HTTP request timeout, packet loss rate, network jitter, and user network environment information.

[0096] Preferably, resolving all candidate domain names and performing health checks on each candidate domain name based on the resolution results includes: resolving all candidate domain names using parallel resolution; performing health checks on each resolution result, including round-trip time tests of data packets and connection attempt tests; determining the real-time network metrics and historical success rates of each candidate domain name based on the health check results; and identifying backup candidate domain names based on the health check results, including: identifying backup candidate domain names based on the real-time network metrics and historical success rates of each candidate domain name.

[0097] Preferably, all candidate domain names are resolved in parallel, including: resolving all candidate domain names in a multi-channel parallel manner using the system domain name system, the hypertext transfer protocol domain name system, the domain name system based on the hypertext transfer protocol, and the domain name system based on the transport layer security protocol.

[0098] Preferably, the primary domain name and all candidate domain names come from a stored domain name pool, which is obtained through synchronous distribution from the cloud. A client domain name switching device further includes an upload module for uploading the switching success rate, latency changes, and / or failure logs when the client communicates with the server through the primary domain name and / or backup candidate domain names to the cloud. The cloud periodically or when an event is triggered, updates the domain name pool based on the switching success rate, latency changes, and / or failure logs, and synchronously distributes the updated domain name pool to the client.

[0099] Preferably, a client domain name switching device further includes a determination module, used to determine that the main domain name has a potential unavailability risk when the availability score of the main domain name is less than a set score threshold; and to determine that the main domain name is available when the availability score of the main domain name is greater than or equal to the set score threshold, and to continue network communication between the client and the server through the main domain name.

[0100] For specific limitations regarding a client domain name switching device, please refer to the limitations of a client domain name switching method described above, which will not be repeated here. Each module in the aforementioned client domain name switching device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in an electronic device, or stored in the memory of an electronic device in software form, so that the processor can call and execute the corresponding operations of each module.

[0101] In some exemplary embodiments of this application, an electronic device is provided, which may be, but is not limited to, various personal computers, laptops, smartphones, tablets, and portable wearable devices, and its internal structure diagram may be as follows: Figure 5 As shown, the electronic device includes a processor, memory, network interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements a client domain name switching method. The display screen can be a liquid crystal display (LCD) or an e-ink display. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the device's casing, or an external keyboard, touchpad, or mouse.

[0102] Those skilled in the art will understand that Figure 5 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the electronic device to which the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.

[0103] In some exemplary embodiments of this disclosure, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of a client domain name switching method in any of the above exemplary embodiments.

[0104] In some exemplary embodiments of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps of a client domain name switching method in any of the exemplary embodiments described above.

[0105] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0106] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0107] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

Claims

1. A method for switching client domain names, characterized in that, The method includes: When the application communicates with the server via the main domain, the domain name connection characteristics of the main domain are collected. The domain name connection features are input into a trained domain name availability prediction model to obtain the availability score of the main domain name output by the trained domain name availability prediction model. If the availability score of the main domain indicates that the main domain has a potential risk of unavailability, all candidate domains are resolved and a health check is performed on each candidate domain based on the resolution results; Alternative candidate domain names were identified based on health test results; Switch the client's main domain name to the backup candidate domain name.

2. The method according to claim 1, characterized in that, The domain name availability prediction model is a time-series prediction model based on LSTM or a random forest classification model. The domain name availability prediction model is trained based on the domain name connection features of multiple samples and the availability of the domain names corresponding to each domain name connection feature.

3. The method according to claim 1, characterized in that, The domain name connection characteristics include one or more of the following: Domain Name System (DNS) resolution latency, DNS resolution success rate, Transmission Control Protocol (TCP) and / or Fast UDP (FDP) Internet connection handshake latency, TCP and / or FDP Internet connection connection failure rate, Hypertext Transfer Protocol (HTTP) request / response code, HTTP request timeout, packet loss rate, network jitter, and user network environment information.

4. The method according to claim 1, characterized in that, The process of resolving all candidate domain names and performing health checks on each candidate domain name based on the resolution results includes: All candidate domain names are resolved using a parallel resolution method; Perform round-trip time tests on the data packets and health checks on the connection attempt tests for each parsed result; Based on the health monitoring results, determine the real-time network metrics and historical success rate of each candidate domain name; The process of identifying alternative candidate domain names based on health detection results includes: identifying alternative candidate domain names based on real-time network metrics and historical success rates of each candidate domain name.

5. The method according to claim 4, characterized in that, The method of resolving all candidate domain names using parallel resolution includes: A multi-channel parallel resolution of all candidate domain names is constructed using the System Domain Name System, Hypertext Transfer Protocol Domain Name System, Hypertext Transfer Protocol-based Domain Name System, and Transport Layer Security Protocol-based Domain Name System.

6. The method according to claim 1, characterized in that, The main domain name and all candidate domain names come from a stored domain name pool, which is obtained through synchronous distribution from the cloud. The method further includes: The success rate of switching, latency changes, and / or failure logs when the client communicates with the server via the primary domain name and / or backup candidate domain names are uploaded to the cloud. The cloud periodically or when an event is triggered, updates the domain name pool based on the success rate of switching, the latency changes, and / or the failure logs, and synchronously distributes the updated domain name pool to the client.

7. The method according to claim 1, characterized in that, The method further includes: When the availability score of the main domain is less than a set score threshold, it is determined that the main domain has a potential risk of becoming unavailable. When the availability score of the main domain is greater than or equal to a set score threshold, the main domain is determined to be available, and network communication between the client and the server continues through the main domain.

8. A client domain name switching device, characterized in that, The device includes: The data collection module is used to collect the domain name connection characteristics of the main domain name when the application communicates with the server via the main domain name. The availability score acquisition module is used to input the domain name connection features into a trained domain name availability prediction model to obtain the availability score of the main domain name output by the trained domain name availability prediction model. The health detection module is used to resolve all candidate domains and perform health checks on each candidate domain based on the resolution results when the main domain is identified as having a potential unavailability risk according to the availability score of the main domain. The candidate domain name identification module is used to identify alternative candidate domain names based on health detection results; The domain name switching module is used to switch the client's main domain name to the backup candidate domain name.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.