A method and electronic device for accessing the network

By periodically updating the domain name information and IP address stored locally on electronic devices, the problem of slow network speed caused by the Domain Name System server querying IP addresses is solved, thereby improving network access speed and user experience.

CN119182768BActive Publication Date: 2026-01-30HONOR DEVICE CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310746680.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-06-21
Publication Date
2026-01-30
Estimated Expiration
2043-06-21

AI Technical Summary

Technical Problem

When electronic devices access the network, the delay caused by the Domain Name System (DNS) server querying the IP address results in slow network speeds and affects the user experience.

Method used

Electronic devices periodically update the domain name information stored locally, including domain names and IP addresses, reducing queries to the Domain Name System server and quickly obtaining IP addresses through local storage.

Benefits of technology

It improves network access speed, reduces processor resource consumption, and enhances user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119182768B_ABST
    Figure CN119182768B_ABST
Patent Text Reader

Abstract

This application provides a method and electronic device for accessing a network. In this method, the electronic device stores M sets of domain name information in a first file. The M sets of domain name information include a first domain name and its corresponding first IP address, where M is a positive integer. The device periodically requests the current IP addresses of the M domain names from a Domain Name System (DNS) server. After receiving the current IP addresses of the M domain names, the device replaces the initial IP addresses corresponding to the M domain names with their current IP addresses. When a first application requests access to the server corresponding to the first domain name, the device queries the first file for the IP address corresponding to the first domain name to obtain a second IP address. The device then accesses the server corresponding to the first domain name based on the second IP address. This method can improve the speed of network access.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of electronics, and particularly relates to a network access method and an electronic device. BACKGROUND

[0002] Application software (APP) in electronic devices such as mobile phones and notebooks can be connected to a cellular network or Wi-Fi and then access Internet information.

[0003] In the process of network access by an electronic device, delay at any link will cause slow networking and poor user experience. How to improve the speed of network access by an electronic device is a problem that needs to be solved in the industry. SUMMARY

[0004] The present application provides a network access method and an electronic device. In the method, the electronic device can periodically update domain name information in a local storage, wherein the domain name information includes a domain name and an IP address corresponding to the domain name. The method can avoid the problem of slow networking caused by querying an IP address from a domain name system server, and can effectively improve the speed of network access.

[0005] In a first aspect, the present application provides a network access method, which includes:

[0006] The electronic device stores M groups of domain name information in a first file, each group of domain name information in the M groups of domain name information includes one domain name and one initial IP address; the M groups of domain name information include first domain name information, the first domain name information includes a first domain name and a first IP address, and M is a positive integer;

[0007] The electronic device periodically sends a first acquisition request to a domain name system (DNS) server, the first acquisition request includes M domain names in the M groups of domain name information, and the M domain names include the first domain name; the first acquisition request is used to request to acquire current IP addresses of the M domain names;

[0008] The electronic device receives the current IP addresses of the M domain names sent by the DNS server; the current IP address of the first domain name is a second IP address;

[0009] The electronic device replaces the initial IP addresses corresponding to the M domain names in the first file with the current IP addresses of the M domain names; the first domain name information in the current first file includes the first domain name and the second IP address;

[0010] When a first application requests to access a server corresponding to the first domain name, the electronic device queries the IP address corresponding to the first domain name from the first file and obtains a second IP address;

[0011] The electronic device accesses a server corresponding to the first domain name based on the second IP address.

[0012] In the embodiments of the present application, considering that the IP address corresponding to the domain name may be updated, causing the domain name information in the local storage to be unable to access the network, the electronic device can periodically request the DNS server for the IP address in the local storage to update the domain name information in the local storage, wherein the domain name information includes the domain name and the IP address corresponding to the domain name. Since the access to the DNS server to query the IP address may be affected by the network speed and the like, the speed of accessing the DNS server to query the IP address is much slower than the speed of local query, and therefore, the embodiments of the present application can avoid the slow network access speed caused by querying the IP address from the DNS server, and effectively improve the speed of accessing the network.

[0013] In combination with the first aspect, in some embodiments, the M pieces of domain name information are domain name information corresponding to servers accessed by the electronic device within a first preset time.

[0014] In the embodiments of the present application, the electronic device can save all the domain name information corresponding to the servers accessed by the electronic device, and the method can reduce the access to the DNS server. Since the local storage query is faster than the access to the DNS server, the method can effectively improve the speed of accessing the network.

[0015] Optionally, the first preset time can be the time from when the electronic device is used to the current time, or a time period from a certain time in the past to the current time.

[0016] In combination with the first aspect, in some embodiments, before the electronic device stores the M sets of domain name information in the first file, the method comprises:

[0017] The electronic device records the domain name information corresponding to the servers accessed within a second preset time to obtain a first set;

[0018] The electronic device sorts the domain name information in the first set according to the number of accesses from more to less;

[0019] The electronic device determines the domain name information located in the first M as the M pieces of domain name information.

[0020] In the embodiments of the present application, the electronic device can store the domain name information with more accesses, and the method can reduce the amount of stored data. In addition, since the stored domain name information is less, the speed of querying the IP address corresponding to the domain name by the electronic device can also be improved, thereby improving the speed of accessing the network.

[0021] Optionally, the first preset time and the second preset time can be the same or different.

[0022] In some embodiments of the first aspect, the electronic device periodically sends a first acquisition request to a domain name system (DNS) server, including:

[0023] The electronic device sends the first acquisition request to the DNS server when the electronic device is in a charging state after a preset time period after the last time the first file is changed.

[0024] The last time the first file is changed can be the last time the electronic device performs the operation of replacing the initial IP addresses corresponding to the M domain names in the first file with the current IP addresses of the M domain names. The electronic device can start timing after performing the operation of replacing the initial IP addresses corresponding to the M domain names in the first file with the current IP addresses of the M domain names. When the timing reaches the preset time period, the electronic device identifies whether the electronic device is in a charging state. If the electronic device is in a charging state, the electronic device sends the first acquisition request to the DNS server again, and then updates the first file based on the domain name information returned by the DNS server. If the electronic device is not in a charging state, the electronic device monitors the state of the electronic device and sends the first acquisition request to the DNS server when the electronic device is in a charging state to update the first file.

[0025] In the embodiments of the present application, the electronic device updates the data of the first file when the electronic device is in a charging state, which can avoid occupying the processor resources of the electronic device and affecting the user experience.

[0026] In some other embodiments, the electronic device can also identify whether at least one of the following conditions is met after a preset time period: the electronic device is in a charging state and the user is in a sleep state. Then, when at least one of the above conditions is met, the electronic device sends an acquisition request to the DNS server.

[0027] It should be noted that the present application does not limit the timing of the electronic device selecting the data update of the first file. In the embodiments of the present application, the electronic device updates the data of the first file when the electronic device is in a charging state and / or the user is in a sleep state, which can avoid occupying the processor resources of the electronic device and affecting the user experience.

[0028] In the embodiments of the present application, the period means that the update is performed every preset time period. The length of the period can be variable, that is, the preset time period can be variable.

[0029] For example, the electronic device can start updating the first file at 24:00 every day, that is, start sending the first acquisition request to the DNS server, at this time, the preset time period is 24 hours; the electronic device can also start identifying whether the user is in a sleep state and / or whether the current is in a charging state after 24:00 every day, and start updating the first file when the user is in a sleep state and / or the current is in a charging state, that is, start sending the first acquisition request to the DNS server, at this time, the time interval between two updates is related to the state of the electronic device and other factors, and the time interval between each update is not necessarily the same.

[0030] With reference to the first aspect, in some embodiments, the first file is stored in a non-volatile memory.

[0031] In the embodiments of the present application, the electronic device can store the above-mentioned M groups of domain name information in the non-volatile memory, and the method can ensure that the above-mentioned M groups of domain name information will not be cleared when the electronic device is restarted, thereby avoiding the situation that the electronic device needs to reacquire the IP address from the domain name system server after restarting, resulting in slow Internet speed.

[0032] With reference to the first aspect, in some embodiments, the method further comprises:

[0033] The electronic device queries the IP address corresponding to the second domain name from the first file when the second application requests to access the server corresponding to the second domain name;

[0034] The electronic device sends a second acquisition request to the DNS server when the second domain name is not queried in the first file, and the second acquisition request is used to request the IP address corresponding to the second domain name;

[0035] The electronic device receives the third IP address sent by the DNS server; the third IP address is the IP address corresponding to the second domain name acquired by the DNS server;

[0036] The electronic device accesses the server corresponding to the second domain name based on the third IP address.

[0037] The first application and the second application can be the same application or different applications.

[0038] In the embodiments of the present application, the electronic device can initiate a query to the DNS server when the IP address corresponding to the domain name cannot be queried in the local storage, and the method can avoid the situation that the IP address cannot be queried and the Internet cannot be accessed.

[0039] With reference to the first aspect, in some embodiments, the method further comprises:

[0040] The electronic device stores the third IP address and the second domain name as a group of domain name information in the first file.

[0041] In the embodiments of the present application, the electronic device adds domain name information that is not stored in the local storage but accessed by the electronic device into the first file to increase the domain name information of the first file, so as to improve the speed of subsequent network access.

[0042] In combination with the first aspect, in some embodiments, before the electronic device stores the M groups of domain name information in the first file, the method further includes:

[0043] The third application of the electronic device requests the IP address corresponding to the first domain name from the DNS query agent module of the electronic device; the DNS query agent module of the electronic device is located in the application program framework layer;

[0044] When the DNS query agent module of the electronic device does not query the IP address corresponding to the first domain name in the first file, the DNS query agent module of the electronic device obtains the IP address of the first domain name from the DNS server to obtain the first IP address;

[0045] The DNS query agent module of the electronic device sends the first IP address to the third application;

[0046] The third application of the electronic device accesses the server corresponding to the first domain name based on the first IP address.

[0047] The first application, the second application and the third application can be the same application or different applications.

[0048] In the embodiments of the present application, the DNS query agent module obtains the IP from the DNS server when the IP is not stored locally.

[0049] In combination with the first aspect, in some embodiments, the electronic device stores the M groups of domain name information in the first file, including:

[0050] The DNS query agent module of the electronic device stores the first domain name and the first IP address as the first domain name information in the first file.

[0051] In the embodiments of the present application, the DNS query agent module undertakes the function of storing domain name information.

[0052] In combination with the first aspect, in some embodiments, the electronic device periodically sends the first acquisition request to the domain name system DNS server, including that the DNS query agent module of the electronic device periodically sends the first acquisition request to the domain name system DNS server.

[0053] The electronic device replaces the initial IP addresses corresponding to the M domain names in the first file with the current IP addresses of the M domain names, including that the DNS query agent module of the electronic device replaces the initial IP addresses corresponding to the M domain names in the first file with the current IP addresses of the M domain names.

[0054] In the embodiments of the present application, the DNS query agent module periodically updates the first file.

[0055] In combination with the first aspect, in some embodiments, the electronic device queries the first file for the IP address corresponding to the first domain name when the first application requests to access the server corresponding to the first domain name, and obtains the second IP address, including:

[0056] The first application of the electronic device requests the IP address corresponding to the first domain name from the DNS query agent module.

[0057] The DNS query agent module of the electronic device queries the first file for the IP address corresponding to the first domain name, and obtains the second IP address.

[0058] The DNS query agent module of the electronic device sends the second IP address to the first application.

[0059] The electronic device accesses the server corresponding to the first domain name based on the second IP address, including that the first application of the electronic device accesses the server corresponding to the first domain name based on the first IP address.

[0060] In the embodiments of the present application, the DNS query agent module sends the IP address to the application requesting to query the IP address when the first file includes the IP address.

[0061] In a second aspect, the present application provides an electronic device, including one or more processors and one or more memories; wherein the one or more memories are coupled with the one or more processors, and the one or more memories are configured to store computer program codes, and the computer program codes include computer instructions, which, when executed by the one or more processors, cause the electronic device to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0062] In a third aspect, the embodiments of the present application provide a chip system applied to an electronic device, including one or more processors, and the processor is configured to invoke computer instructions to cause the electronic device to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0063] In a fourth aspect, the present application provides a computer readable storage medium, including instructions, which, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0064] In a fifth aspect, the present application provides a computer program product including instructions, which, when executed on an electronic device, cause the electronic device to perform the method described in the first aspect and any possible implementation manner of the first aspect.

[0065] It can be understood that the electronic device provided in the second aspect, the chip system provided in the third aspect, the computer storage medium provided in the fourth aspect, and the computer program product provided in the fifth aspect are all used to execute the method provided in the present application. Therefore, the beneficial effects achieved thereby can refer to the beneficial effects in the corresponding method, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0066] Figure 1 is a schematic diagram of acquiring an IP address corresponding to a domain name according to an example of an embodiment of the present application;

[0067] Figure 2 is a system for accessing a network according to an example of an embodiment of the present application;

[0068] Figure 3A is a schematic diagram of a hardware structure of an electronic device 100 according to an example of an embodiment of the present application;

[0069] Figure 3B is a software structure block diagram of an electronic device 100 according to an example of an embodiment of the present application;

[0070] Figure 4 is a flowchart of a method for accessing a network according to an example of an embodiment of the present application;

[0071] Figure 5 is a flowchart of another method for accessing a network according to an example of an embodiment of the present application;

[0072] Figure 6 is a flowchart of still another method for accessing a network according to an example of an embodiment of the present application;

[0073] Figure 7 is a flowchart of still another method for accessing a network according to an example of an embodiment of the present application;

[0074] Figures 8A-8B is a user interface in a scenario according to an example of an embodiment of the present application;

[0075] Figures 9A-9C is another user interface in a scenario according to an example of an embodiment of the present application. DETAILED DESCRIPTION

[0076] The terminology used in the following description of the embodiments herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the description of the embodiments and the appended claims herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It also will be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0077] Currently, in the process of applying networking, an electronic device needs to obtain an Internet Protocol (IP) address based on a domain name, and then uses a networking service based on the IP address.

[0078] However, the inventor found in the implementation of the embodiments of the present application that the electronic device often has the problem of slow acquisition or failure to acquire the IP address in the step of obtaining the IP address, thereby causing the problem of slow application of networking or failure to network.

[0079] For example, the method for the electronic device to obtain the IP address mainly includes the following methods:

[0080] Method 1: Before the electronic device is shipped, the manufacturer can prestore limited domain names and their corresponding Internet Protocol (IP) addresses in the memory of the electronic device, for example, the electronic device prestores a hosts file, which is used to store valid domain names and their corresponding IP addresses. The file can be "file / system / etc / hosts".

[0081] In this method, because the pre-stored domain name information is limited, and the domain name and IP change or addition are many, the pre-stored domain name information often cannot meet the needs of users, thereby causing the problem of failure to network.

[0082] Method 2: The electronic device obtains the IP address and initiates a Domain Name System (DNS) query for the domain name to the DNS server. Then, the DNS server performs a DNS query for the domain name and obtains a DNS query result, and then returns the DNS query result to the electronic device, wherein the DNS query result includes one or more IP addresses of application servers.

[0083] In the method, the application of the electronic device requests an IP address from the DNS server when networking is needed, and the application needs to wait for the reply of the DNS server. Due to network speed problems or DNS server hijacking, the domain name IP return time is prolonged or the query fails, thereby causing slow application networking speed or failure to network. In addition, the method needs to wake up the communication chip in the electronic device. Due to the short-term repeated initiation of DNS query by some applications due to their own settings, random or repeated queries will cause great power consumption of the electronic device.

[0084] Method 3: After the electronic device requests an IP address from the DNS server, the DNS query result can be cached to the Java layer fast cache and the Native C layer cache. The Java layer is located in the application software framework layer, and each cached data (such as the DNS query result) has a valid time to live (TTL) of the cache validity period. The time length is a fixed value, which can be recorded as TTL NANOS, such as 2 seconds, and the Java layer can cache up to 16 addresses. The management mode of the Native C layer cache is as follows: when the number of cached data (such as the DNS query result) reaches the maximum value, the expired cached data is determined from the cached data, and then all expired cached data is cleared at one time. If there is no expired cache, the oldest one is deleted.

[0085] In the method, because the Java layer fast cache and the Native C layer cache are cleared after the electronic device is restarted, the domain name and its corresponding IP address cached are cleaned, and need to be re-queried from the DNS server by method 2.

[0086] Please refer to Figure 1 , Figure 1 is a schematic diagram of obtaining an IP address corresponding to a domain name provided by an embodiment of the present application.

[0087] As shown in Figure 1 , the process of the electronic device obtaining the domain name IP is as follows:

[0088] 1. First, the electronic device can query the IP address corresponding to the domain name from the hosts file (such as the file / system / etc / hosts), and if the query is successful, the process ends.

[0089] 2. If the electronic device fails to query in the hosts file, the electronic device queries the DNS cache (i.e., the Java layer fast cache and the Native C layer cache), as shown in Figure 1 , the electronic device can first query in the Java layer fast cache, and if the query fails, the electronic device can query in the Native C layer cache. If the query in the DNS cache is successful, the process ends.

[0090] 3. If the DNS cache lookup fails, the electronic device can query the DNS server, and start sending a request packet to the DNS server.

[0091] The above method has the following problems: 1. When the IP address cache has been invalidated or cleared, the APP needs to initiate a DNS query packet through method 2; 2. After the electronic device is restarted, the cached domain name IP is cleaned, and needs to be re-queried through method 2; 3. The timing of DNS query of a new domain name address is random, and the APP can be triggered in the foreground, background, or screen-off standby; 4. The application can have the possibility of repeatedly initiating DNS queries in the short term; 5. If the DNS server is hijacked, etc., it can prolong the domain name and IP address return time, or the query fails.

[0092] That is, at present, if the electronic device initiates a DNS query or the DNS query fails, the speed of the APP accessing the network will be prolonged; the DNS query needs to wake up the communication chip, and the random or repeated query will definitely produce redundant power consumption.

[0093] Therefore, the embodiment of the present application provides a method for accessing a network, which can improve the speed of accessing the network.

[0094] In the embodiment of the present application, the electronic device can save a plurality of sets of domain name information, and each set of domain name information includes a domain name and an IP address corresponding to the domain name; and the electronic device can periodically update the plurality of sets of domain name information. In the method, the electronic device can obtain the IP address corresponding to the domain name from the saved plurality of sets of domain name information when an application requests to access a server of the domain name. Since the IP address is periodically updated, the reliability and effectiveness of the IP address can be ensured, so that the electronic device can effectively access the network, the speed of accessing the network of the electronic device can be improved, and the user experience can be improved.

[0095] In the embodiment of the present application, the electronic device can also store the plurality of sets of domain name information into a non-volatile memory, which can ensure that the plurality of sets of domain name information will not be cleared when the electronic device is restarted, thereby avoiding the situation that the electronic device needs to re-obtain the IP address from the domain name system server after the restart, resulting in slow network access.

[0096] Please refer to Figure 2 , Figure 2 A system for accessing a network is exemplarily provided in the embodiment of the present application.

[0097] As shown in Figure 2 , the scenario includes an electronic device 100 and a DNS server 200. The DNS server 200 is configured to implement conversion between a domain name and an IP address.

[0098] In some embodiments, the DNS server 200 can be a distributed host information database that provides mapping and conversion between domain names and IP addresses, and the electronic device 100 can resolve domain names to corresponding IP addresses through the DNS server.

[0099] For example, electronic device 100 and DNS server 200 can establish a communication connection; electronic device 100 can send a query request to DNS server 200 to query the IP address corresponding to the first domain name; correspondingly, after receiving the query request, DNS server 200 can obtain the IP address corresponding to the first domain name; then, DNS server 200 sends the IP address corresponding to the first domain name to electronic device 100.

[0100] Among them, electronic devices can be equipped with Or other operating system terminal devices, such as mobile phones, tablets, desktop computers, laptops, handheld computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, as well as cellular phones, personal digital assistants (PDAs), augmented reality (AR) devices, virtual reality (VR) devices, artificial intelligence (AI) devices, wearable devices, in-vehicle devices, smart home devices and / or smart city devices, etc.

[0101] It should be noted that, Figure 2 The system shown is merely an example provided by the embodiments of this application. The system may also include other devices, which are not limited in this application.

[0102] For example, Figure 2 The system shown may also include other servers, such as the application server corresponding to the application in the electronic device 100. The electronic device 100 can obtain the IP address corresponding to the application server from the DNS server 200 and access the application server based on the IP address.

[0103] Next, the hardware and software architecture of the electronic device 100 provided in the embodiments of this application will be introduced.

[0104] The following example is illustrated using electronic device 100. Figure 3A A schematic diagram of the hardware structure of the electronic device 100 is shown.

[0105] The embodiments will be described below with the electronic device 100 as an example. It should be understood that the electronic device 100 can have more or fewer components than those shown in the figures, two or more components can be combined, or different component configurations can be used. Figure 3A The various components shown in the figures can be implemented in hardware, software, or a combination of both hardware and software, including one or more signal processing and / or application-specific integrated circuits. Figure 3A The various components shown in the figures can be implemented in hardware, software, or a combination of both hardware and software, including one or more signal processing and / or application-specific integrated circuits.

[0106] The electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charge 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 headset interface 170D, a sensor module 180, a key 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc.

[0107] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0108] The processor 110 can include one or more processing units, for example: the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units can be independent devices, or can be integrated in one or more processors.

[0109] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.

[0110] The processor 110 can also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory. This avoids repeated access and reduces the waiting time of the processor 110, thereby improving the efficiency of the system.

[0111] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can 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.

[0112] 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 can contain multiple sets of I2C buses. The processor 110 can be coupled to the touch sensor 180K, the charger, the flash, the camera 193, etc. through different I2C bus interfaces, respectively. For example: the processor 110 can be coupled to the touch sensor 180K through the I2C interface, so that the processor 110 and the touch sensor 180K communicate through the I2C bus interface, realizing the touch function of the electronic device 100.

[0113] The I2S interface can be used for audio communication. In some embodiments, the processor 110 can include multiple sets of I2S buses. The processor 110 can be coupled with the audio module 170 through the I2S buses to enable communication between the processor 110 and the audio module 170. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the I2S interface to enable the function of answering a phone call through a Bluetooth earphone.

[0114] The PCM interface can also be used for audio communication to sample, quantize, and encode analog signals. In some embodiments, the audio module 170 can be coupled with the wireless communication module 160 through a PCM bus interface. In some embodiments, the audio module 170 can also deliver audio signals to the wireless communication module 160 through the PCM interface to enable the function of playing music through a Bluetooth earphone. Both the I2S interface and the PCM interface can be used for audio communication.

[0115] The UART interface is a universal serial bus for asynchronous communication. The bus can be a bidirectional communication bus. It converts data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is usually 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 through the UART interface to enable Bluetooth functionality. In some embodiments, the audio module 170 can deliver audio signals to the wireless communication module 160 through the UART interface to enable the function of playing music through a Bluetooth earphone.

[0116] The MIPI interface can be used to connect the processor 110 and peripheral devices such as the display screen 194 and the camera 193. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), and the like. In some embodiments, the processor 110 and the camera 193 communicate through the CSI interface to enable the camera function of the electronic device 100. The processor 110 and the display screen 194 communicate through the DSI interface to enable the display function of the electronic device 100.

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

[0118] The SIM card interface can be used to communicate with the SIM card interface 195 to achieve the function of transmitting data to the SIM card or reading data in the SIM card.

[0119] The USB interface 130 is an interface conforming to the USB standard specification, which can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the electronic device 100, and can also be used to transmit data between the electronic device 100 and a peripheral device. It can also be used to connect a headset to play audio through the headset. The interface can also be used to connect other electronic devices, such as AR devices, etc.

[0120] It can be understood that the interface connection relationship between the modules shown in the embodiments of the present application is only illustrative and does not constitute a structural limitation of the electronic device 100. In some other embodiments of the present application, the electronic device 100 can also use different interface connection methods or combinations of multiple interface connection methods in the above embodiments.

[0121] The charging management module 140 is used to receive charging input from the charger. The charger can be a wireless charger or a wired charger.

[0122] The power management module 141 is used to connect the battery 142 and the charging management module 140 to the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140 to power the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160, etc.

[0123] The wireless communication function of the electronic device 100 can be realized through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.

[0124] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0125] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G, etc. wireless communication applied to the electronic device 100. The mobile communication module 150 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic waves, and transfer to a modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor, and radiate as electromagnetic waves through the antenna 1. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the processor 110. In some embodiments, at least part of the function modules of the mobile communication module 150 can be disposed in the same device as at least part of the modules of the processor 110.

[0126] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a 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. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the microphone 170B, etc.), or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and disposed in the same device as the mobile communication module 150 or other function modules.

[0127] The wireless communication module 160 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives an electromagnetic wave via the antenna 2, frequency-modulates and filters the electromagnetic wave signal, and transmits the processed signal to the processor 110. The wireless communication module 160 can also receive a signal to be transmitted from the processor 110, frequency-modulate it, amplify it, and radiate it as an electromagnetic wave via the antenna 2.

[0128] In some embodiments, the antenna 1 and the mobile communication module 150 of the electronic device 100 are coupled, and the antenna 2 and the wireless communication module 160 are coupled, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can 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 technology, etc. The GNSS can include a global positioning system (GPS), a global navigation satellite system (GLONASS), a beidu navigation satellite system (BDS), a quasi-zenith satellite system (QZSS), and / or a satellite based augmentation systems (SBAS).

[0129] The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, which is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 can include one or more GPUs, which execute program instructions to generate or change display information.

[0130] The display screen 194 is configured to display images, videos, and the like. The 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 flex light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light emitting diodes (QLED), or the like. In some embodiments, the electronic device 100 can include one or N display screens 194, where N is a positive integer greater than 1.

[0131] The electronic device 100 can implement the photographing function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.

[0132] The ISP is configured to process the data fed back by the camera 193. For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing to convert it into an image visible to the naked eye. The ISP can also optimize the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature, and other parameters of the shooting scene. In some embodiments, the ISP can be disposed in the camera 193.

[0133] The camera 193 is configured to capture still images or videos. An object generates an optical image through a lens and projects it onto a photosensitive element. 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 transmitted to the ISP to convert it into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV, or the like format. In some embodiments, the electronic device 100 can include one or N cameras 193, where N is a positive integer greater than 1.

[0134] The digital signal processor is used to process digital signals, in addition to being able to process digital image signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy, etc.

[0135] The video codec is used to compress or decompress digital video. The electronic device 100 can support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as: moving picture experts group (MPEG) 1, MPEG 2, MPEG 3, MPEG 4, etc.

[0136] The NPU is a neural-network (NN) computing processor, which can quickly process input information by drawing on the structure of a biological neural network, such as drawing on the transmission mode between human brain neurons, and can also continuously self-learn. Through the NPU, the electronic device 100 can realize intelligent cognitive applications such as image recognition, face recognition, voice recognition, and text understanding.

[0137] The electronic device 100 can realize audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor, etc. For example, music playing, recording, etc.

[0138] The audio module 170 is used to convert digital audio information into analog audio signals for output, and is also used to convert analog audio input into digital audio signals. The audio module 170 can also be used to encode and decode audio signals. In some embodiments, the audio module 170 can be disposed in the processor 110, or some functional modules of the audio module 170 can be disposed in the processor 110.

[0139] The speaker 170A, also known as a "loudspeaker", is used to convert audio electrical signals into sound signals. The electronic device 100 can listen to music or listen to a hands-free call through the speaker 170A.

[0140] The receiver 170B, also known as a "earpiece", is used to convert audio electrical signals into sound signals. When the electronic device 100 answers a call or a voice message, the receiver 170B can be held close to the ear to listen to the voice.

[0141] Microphone 170C, also called "microphone", "sound pickup", is used to convert sound signal into electrical signal. When making a call or sending voice message, the user can speak into the microphone 170C by putting the mouth close to the microphone 170C, and input the sound signal into the microphone 170C. The electronic device 100 can be provided with at least one microphone 170C. In some other embodiments, the electronic device 100 can be provided with two microphones 170C, in addition to collecting sound signals, noise reduction function can also be realized. In some other embodiments, the electronic device 100 can also be provided with three, four or more microphones 170C, in addition to collecting sound signals, noise reduction, it can also identify the source of the sound, and realize the function of directional recording, etc.

[0142] The earphone interface 170D is used to connect the wired earphone. The earphone interface 170D can be a USB interface 130, or a 3.5mm open mobile terminal platform (OMTP) standard interface, a cellular telecommunications industry association of the USA (CTIA) standard interface.

[0143] The key 190 includes the power-on key, the volume key, etc. The key 190 can be a mechanical key. It can also be a touch key. The electronic device 100 can receive the key input, and generate the key signal input related to the user settings and function control of the electronic device 100.

[0144] The motor 191 can generate vibration prompt. The motor 191 can be used for incoming call vibration prompt, and also can be used for touch vibration feedback. For example, the touch operation acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The touch operation acting on different regions of the display screen 194, the motor 191 can also correspond to different vibration feedback effects. Different application scenarios (such as time reminder, receiving information, alarm, game, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0145] The indicator 192 can be an indicator light, which can be used to indicate the charging state, the power change, and also can be used to synthesize the request, the missed call, the notification, etc.

[0146] The SIM card interface 195 is configured to connect a SIM card. The SIM card can be inserted into or removed from the SIM card interface 195 to achieve contact and separation with the electronic device 100. The electronic device 100 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, and the like. Multiple cards can be inserted into the same SIM card interface 195 at the same time. The types of the multiple cards can be the same or different. The SIM card interface 195 can be compatible with different types of SIM cards. The SIM card interface 195 can also be compatible with external storage cards. The electronic device 100 interacts with a network through the SIM card to achieve functions such as call and data communication.

[0147] The external memory interface 120 can be configured to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to achieve data storage functions. For example, files such as music and videos can be saved in the external memory card.

[0148] The internal memory 121 can be configured to store computer executable program codes including instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application required by a function (such as a face recognition function, a fingerprint recognition function, a mobile payment function, and the like), and the like. The data storage area can store data created during use of the electronic device 100 (such as face information template data, fingerprint information template, and the like).

[0149] The internal memory 121 can include one or more random access memories (RAMs) and one or more non-volatile memories (NVMs).

[0150] The random access memory can include static random-access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM, such as the fifth generation of DDR SDRAM commonly referred to as DDR5 SDRAM), and the like.

[0151] The non-volatile memory can include a magnetic disk storage device, flash memory.

[0152] The flash memory can include NOR FLASH, NAND FLASH, 3D NAND FLASH, and the like according to the operating principle, single-level cell (SLC), multi-level cell (MLC), triple-level cell (TLC), quad-level cell (QLC), and the like according to the storage unit potential order, and universal flash storage (UFS), embedded multi media Card (eMMC), and the like according to the storage specification.

[0153] The random access memory can be directly read and written by the processor 110, and can be used to store executable programs (such as machine instructions) of an operating system or other programs running, and can also be used to store data of users and application programs, and the like.

[0154] The non-volatile memory can also store executable programs and store data of users and application programs, and the like, which can be loaded in advance into the random access memory for direct reading and writing by the processor 110.

[0155] The external memory interface 120 can be used to connect an external non-volatile memory to realize the expansion of the storage capacity of the electronic device. The external non-volatile memory communicates with the processor 110 through the external memory interface 120 to realize the data storage function. For example, music, video, and the like are saved in the external non-volatile memory.

[0156] The structure illustrated in the embodiments of the present application does not constitute a specific limitation on the electronic device. In other embodiments of the present application, the electronic device can include more or fewer components than illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware. For example, the sensor module 180 can further include a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a fingerprint sensor, a temperature sensor, a bone conduction sensor, and the like.

[0157] In the embodiments of the present application, the electronic device 100 at least includes a non-volatile memory, and the electronic device can store the domain name and the IP address corresponding to the domain name into the non-volatile memory by executing the method of accessing the network by the processor 110, and query the IP address corresponding to the domain name from the non-volatile memory to realize fast networking.

[0158] Figure 3B The software structure block diagram of the electronic device 100 is exemplarily provided in the embodiments of the present application.

[0159] The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, from top to bottom, the application program layer, the application program framework layer, the runtime and system library, and the kernel layer.

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

[0161] As shown in Figure 3B , the application program package can include browser, camera, calendar, gallery, call, WLAN, music, video and other application programs (also referred to as applications), and can also include Figure 3B map, navigation, Bluetooth, short message and other applications not shown.

[0162] In the embodiments of the present application, the electronic device can access the network through the above-mentioned application, that is, access the server.

[0163] The application program framework layer provides the application program of the application program layer with an application programming interface (application programming interface, API) and a programming framework. The application program framework layer includes some pre-defined functions.

[0164] As shown in Figure 3B , the application program framework layer can include a DNS query agent module, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0165] In the embodiments of the present application, the DNS query proxy module is configured to save and update domain name information, which includes at least one domain name and an IP address corresponding to the domain name.

[0166] Optionally, the DNS query proxy module can save the domain name information in a non-volatile memory of the electronic device, such as a UFS. In this way, the domain name information will not be cleared when the electronic device is restarted, which can avoid domain name address invalidation and reduce the number of DNS queries initiated to the network; in the event of a DNS server failure, the DNS query proxy module can query the IP address from the local storage, which can avoid the situation that the network cannot be accessed due to DNS query failure.

[0167] In the embodiments of the present application, the DNS query proxy module is configured to save and update domain name information, which can reduce the DNS query time before networking and make the networking faster by at least one Round-Trip Time (RTT).

[0168] In the embodiments of the present application, the electronic device can periodically perform unified DNS query before the application is connected to the network, which can reduce the number of wake-ups of at least one of the mobile communication module 150 and the wireless communication module 160 shown in FIG. 1, and can save the power consumption of the electronic device. Figure 3A

[0169] The window manager is configured to manage window programs. The window manager can acquire the size of a display screen, determine whether there is a status bar, lock a screen, and capture a screen.

[0170] The content provider is configured to store and acquire data, and make the data accessible to application programs. The data can include videos, images, audios, dialed and received calls, browsing history and bookmarks, phone books, and the like.

[0171] The view system includes visual controls, such as a control for displaying text and a control for displaying pictures. The view system can be used to build application programs. A display interface can be composed of one or more views. For example, a display interface including a short message notification icon can include a view for displaying text and a view for displaying pictures.

[0172] The telephony manager is configured to provide communication functions of the electronic device 100. For example, management of a call state (including call connection and call hang-up).

[0173] The resource manager is configured to provide various resources for application programs, such as localized strings, icons, pictures, layout files, video files, and the like.

[0174] ​The notification manager enables an application to display notification information in a status bar, which can be used to convey a message of an informing type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform of a download completion, a message reminder, etc. The notification manager can also be a notification appearing in the form of a figure or a scroll bar text in the top status bar of the system, such as a notification of an application running in the background, and can also be a notification appearing in the form of a dialogue interface on the screen. For example, a text information is prompted in the status bar, a prompt sound is emitted, the electronic device vibrates, an indicator light flashes, etc.

[0175] The runtime includes a core library and a virtual machine. The runtime is responsible for the scheduling and management of the system.

[0176] The core library includes two parts: one part is a function function required to be called by a programming language (for example, a java language), and the other part is a core library of the system.

[0177] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the programming files (for example, java files) of the application layer and the application framework layer into binary files. The virtual machine is used to perform functions such as management of the object life cycle, stack management, thread management, security and exception management, and garbage collection.

[0178] The system library can include multiple function modules. For example: a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a two-dimensional graphics engine (for example: SGL), etc.

[0179] The surface manager is used to manage a display subsystem, and provides a fusion of two-dimensional (2-Dimensional, 2D) and three-dimensional (3-Dimensional, 3D) layers for multiple applications.

[0180] The media library supports playback and recording of multiple commonly used audio, video formats, and static image files, etc. The media library can support multiple audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0181] The three-dimensional graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0182] The 2D graphics engine is a drawing engine for 2D drawing.

[0183] The kernel layer is a layer between hardware and software. The kernel layer can include a display driver, a camera driver, an audio driver, a sensor driver, and Figure 3B a virtual card driver not shown, etc.

[0184] The following describes the workflow of the software and hardware of the electronic device 100 in connection with a capture photographing scenario.

[0185] When the touch sensor 180K receives a touch operation, a corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into a raw input event (including touch coordinates, a timestamp of the touch operation, and the like). The raw input event is stored in the kernel layer. The application framework layer obtains the raw input event from the kernel layer, and identifies a control corresponding to the input event. Taking an example in which the touch operation is a touch single-click operation, and the control corresponding to the single-click operation is a control of the camera application icon, the camera application invokes an interface of the application framework layer, starts the camera application, and then starts the camera driver by invoking the kernel layer, to capture a still image or a video by the camera 193.

[0186] The software architecture can further include a hardware abstract layer (HAL) that is not shown in FIG. 1. The hardware abstract layer is an interface layer between the application framework layer and the kernel layer, and provides a virtual hardware platform for the operating system. Figure 3B

[0187] The kernel layer is a layer between hardware and software. The kernel layer includes various hardware drivers, such as a display driver, a camera driver, an audio driver, and a sensor driver. The kernel layer can further include a digital signal processor driver (not shown) and an image processor driver (not shown). The camera driver is configured to drive an image sensor of one or more cameras in the camera module to capture an image, and drive an image signal processor to pre-process the image. The digital signal processor driver is configured to drive a digital signal processor to process the image. The image processor driver is configured to drive a graphics processor to process the image.

[0188] The following describes the function of the DNS query proxy module. Figure 4 The method for accessing a network is shown in FIG. 2. As shown in FIG. 2, the method can include the following steps. Figure 4 Figure 4 S1: The DNS query proxy module learns commonly used domain names of applications, and obtains an address set A.

[0189] S1: The DNS query proxy module learns commonly used domain names of applications, and obtains an address set A.

[0190] In some embodiments, the DNS query proxy module of the electronic device can record domain names queried by applications on the electronic device within a preset time period, and store the queried domain names and IP corresponding to the domain names into the address set A. The address set A can also be referred to as a first set.

[0191] ​​Optionally, the electronic device can add domain name information accessed by the newly installed application in the address set A after the electronic device newly installs the application, and the domain name information includes at least one domain name and IP address corresponding to the domain name. For example, the electronic device can record the domain name information accessed by the application when the application runs after the new application is installed.

[0192] Optionally, the electronic device can store the domain name queried by the application in the address set A in real time, or can filter part of the domain name to store in the address set A.

[0193] Optionally, the electronic device can sort the domain name information in the address set A according to the query times from more to less, save the domain name information in the first N positions, and delete the domain name information after the Nth position from the address set A, where N is a positive integer.

[0194] Optionally, the address set A can also include an identifier of a DNS server corresponding to each domain name. The DNS server corresponding to the domain name can be a DNS server corresponding to the application, or a DNS server of an operator (such as a DNS server of an operator of a SIM card of the electronic device), which is not limited in the embodiments of the present application.

[0195] For example, the DNS query agent module can not record the identifier of the DNS server corresponding to the domain name of the operator, so that the electronic device queries the IP address corresponding to the domain name through the DNS server of the operator when it is determined that the domain name does not have the identifier of the DNS server; if the domain name corresponds to an identifier of a DNS server of an application, the electronic device establishes a connection with the DNS server of the application based on the identifier and queries the IP address corresponding to the domain name from the DNS server of the application. The identifier of the DNS server can be an address of the DNS server.

[0196] S2: The DNS query agent module periodically updates the DNS query of the address set A.

[0197] The DNS query refers to querying the IP address corresponding to the domain name from the DNS server.

[0198] Optionally, the period can be once a day or once every two days, which is not limited in the embodiments of the present application.

[0199] Optionally, the DNS query agent module can perform the DNS query update when the electronic device is charging, so that the normal use of the user can be avoided when the DNS query update is performed.

[0200] It should be understood that the IP address corresponding to the domain name can be updated. If the IP address corresponding to the domain name is changed, the electronic device cannot realize networking through the locally stored IP address corresponding to the domain name.

[0201] In the embodiments of the present application, the DNS query agent module can periodically query the IP address corresponding to each domain name in the address set A through the DNS server, and update the IP address corresponding to the domain name after querying the data in the address set A.

[0202] For example, the address set A includes domain name 1, domain name 2 and domain name 3, and the IP address corresponding to the domain name, that is, IP1 corresponding to domain name 1, IP2 corresponding to domain name 2 and IP3 corresponding to domain name 3. The DNS query agent module can query the IP address corresponding to domain name 1, domain name 2 and domain name 3 through the DNS server every two days when the electronic device is in the charging state. If the IP address corresponding to domain name 2 is IP2', and the others do not change, the DNS query agent module can delete IP2, associate domain name 2 with IP2', and then the address set A includes domain name 1, domain name 2 and domain name 3, wherein domain name 1 corresponds to IP1, domain name 2 corresponds to IP2', and domain name 3 corresponds to IP3.

[0203] S3: The DNS query agent module periodically stores the address set A in the system file B.

[0204] The system file B can be a file located in the non-volatile memory, and can also be referred to as a first file.

[0205] Optionally, the DNS query agent module can replace the data in the system file B with the updated address set A after each execution of the above step S2.

[0206] S4: Before the application initiates the DNS query, the DNS query agent module queries in the system file B.

[0207] S51: If the query is successful, the DNS query agent module returns the IP address to the application.

[0208] In some embodiments, when the DNS query agent module queries the IP address corresponding to the first domain name in the system file B, the DNS query agent module can return the IP address corresponding to the first domain name to the application, and the application can perform networking based on the IP address corresponding to the first domain name.

[0209] S52: If the query fails, the application initiates a DNS query to the DNS server.

[0210] In some embodiments, when the DNS query agent module cannot query the IP address corresponding to the first domain name in the system file B, the DNS query agent module can initiate a DNS query to the DNS server and send the query result to the application.

[0211] S6: If the application fails to access the network through the queried IP address, the application initiates a DNS query to the DNS server.

[0212] In some embodiments, if an application fails to access the network using the IP address returned by the DNS query proxy module, the application can initiate a DNS query to the DNS server through the DNS query proxy module.

[0213] The following is through Figure 5 This application describes a method for accessing a network provided by an embodiment.

[0214] This application example illustrates the situation by changing the IP address corresponding to the first domain name from the first IP address to the second IP address. Before the change, the electronic device could access the server corresponding to the first domain name through the first IP address. After the change, the electronic device could not successfully access the server corresponding to the first domain name through the first IP address and needed to access the server corresponding to the first domain name through the second IP address.

[0215] In this embodiment, the electronic device periodically updates the domain name information in its local storage. This ensures that when the IP address corresponding to the first domain name is updated, the IP address in the local storage is replaced with a second IP address. Therefore, even after the IP address corresponding to the first domain name changes, the electronic device can still access the network through the second IP address corresponding to the first domain name in its local storage. This method pre-stores valid domain name information locally when the application needs to connect to the network, avoiding the latency caused by DNS queries from the DNS server when the application needs to connect, thus effectively improving the application's network connection speed.

[0216] like Figure 5 As shown, the method may include some or all of the following steps:

[0217] S501: The electronic device stores M sets of domain name information in the first file. Each set of domain name information in the M sets includes a domain name and the initial IP address corresponding to that domain name. The M sets of domain name information include the first domain name and the first IP address corresponding to the first domain name. M is a positive integer.

[0218] Among them, the domain name information in group M can include a domain name and the IP address corresponding to the domain name, and can also include the identifier of the DNS server corresponding to the domain name, which is used to obtain the IP address corresponding to the domain name.

[0219] In some embodiments, the electronic device can store information about the domain names accessed by the application in a first file in real time.

[0220] For example, the application of the electronic device obtains the IP address corresponding to the domain name through the DNS proxy query module before accessing the network, and the DNS proxy query module stores the domain name and the IP address corresponding to the domain name as a group of domain name information into the first file each time the IP address corresponding to the domain name is queried from the DNS server.

[0221] In some embodiments, the electronic device can periodically store the partial domain name information accessed by the application in the first file in real time. The partial domain name information can be the domain name information corresponding to the server accessed by the electronic device more than a preset number of times, or the domain name information determined based on other rules.

[0222] For example, the DNS query proxy module of the electronic device can record the queried domain name, and record the queried domain name and the IP address corresponding to the domain name as a group of domain name information into the address set A. Then, every first preset time (for example, one week), the domain name information in the address set A is sorted according to the query times from more to less, and the domain name information after Nth is deleted from the address set A, where N is a positive integer. Then, every second preset time (for example, two days), the domain name information in the address set A is stored into the first file.

[0223] The first preset time can be equal to the second preset time, for example, the electronic device can store the first N domain name information into the first file after sorting the domain name information in the address set A. The first preset time can be equal to or not equal to the second preset time, which is not limited in the embodiments of the present application.

[0224] Optionally, the first file can be stored in a non-volatile memory, such as UFS.

[0225] S502: The electronic device queries the IP address corresponding to the first domain name from the first file when the first application requests to access the server corresponding to the first domain name, and obtains the first IP address.

[0226] In some embodiments, the first application of the electronic device can query the IP address corresponding to the first domain name in the first file through the DNS query proxy module, and obtain the first IP address. The DNS query proxy module returns the first IP address to the application.

[0227] S503: The first application of the electronic device accesses the server corresponding to the first domain name based on the first IP address.

[0228] In some embodiments, the first application can perform networking based on the first IP address corresponding to the first domain name after receiving the first IP address returned by the DNS query proxy module, that is, access the server corresponding to the first domain name.

[0229] S504: The electronic device periodically sends an acquisition request to the DNS server, the acquisition request comprising M domain names in the M-group domain name information, the M domain names comprising the first domain name.

[0230] Correspondingly, the DNS server receives the acquisition request sent by the electronic device. The acquisition request is used to acquire IP addresses corresponding to the M domain names.

[0231] In some embodiments, the DNS server is one DNS server, and the electronic device periodically sends an acquisition request to the DNS server, the acquisition request comprising M domain names in the M-group domain name information.

[0232] In other embodiments, the DNS server can comprise a plurality of DNS servers, and the acquisition request comprises a plurality of acquisition requests, the sum of domain name information in the plurality of acquisition requests being the M-group domain name information.

[0233] The DNS server can be an operator server or an application corresponding domain name system server, and the embodiments of the present application do not limit this.

[0234] For example, the M-group domain name information is composed of a-group domain name information and b-group domain name information, the a-group domain name information being from a first DNS server and the b-group domain name information being from a second DNS server, wherein a and b are positive integers. The electronic device can periodically send a first acquisition request to the first DNS server, the first acquisition request comprising a domain name in the a-group domain name information, and the electronic device can periodically send a second acquisition request to the first DNS server, the second acquisition request comprising b domain names in the b-group domain name information. The time when the electronic device sends the first acquisition request and the second acquisition request can be the same or different.

[0235] Optionally, the present application does not limit the time when the electronic device sends the acquisition request.

[0236] For example, the electronic device can send an acquisition request to the DNS server every preset time period, the acquisition request comprising M domain names in the M-group domain name information, and the server acquires the current IP addresses of the M domain names after receiving the acquisition request. The length of the preset time period can be one day or two days, and the embodiments of the present application do not limit this.

[0237] For another example, the electronic device can also identify whether the electronic device is in a charging state after a preset time period, and then send an acquisition request to the DNS server when the electronic device is in the charging state, and perform the following step S507 after receiving the response message of the DNS server to complete the data update of the first file.

[0238] For another example, the electronic device can also identify whether at least one of the following conditions is met after a preset time period: the electronic device is in a charging state and the user is in a sleep state. Then, when the at least one condition is met, the electronic device sends a request for acquisition to the DNS server, and after receiving a response message from the DNS server, the electronic device performs the following step S507 to complete the data update of the first file.

[0239] It should be noted that the embodiments of the present application do not limit the timing of the electronic device selecting the data update of the first file. In the embodiments of the present application, the data of the first file is updated when the electronic device is in a charging state and / or the user is in a sleep state, which can avoid occupying the processor resources of the electronic device and affecting the user experience.

[0240] S505: The DNS server acquires the current IP addresses of the M domain names, and the current IP address of the first domain name is the second domain name address.

[0241] In some embodiments, after receiving the request for acquisition, the DNS server acquires the current IP address of each of the M domain names, and obtains the current IP addresses of the M domain names.

[0242] For example, the DNS server can convert a domain name into its corresponding IP address based on the correspondence between the domain name and the IP address. When the DNS server cannot query the correspondence between the domain name and the IP address, the DNS server can also interact with other DNS servers to acquire the IP address corresponding to the domain name. The embodiments of the present application do not limit the method for the DNS server to acquire the current IP addresses of the M domain names.

[0243] It should be noted that the IP address corresponding to the domain name can be updated, and the embodiments of the present application are exemplarily described by taking the IP address corresponding to the first domain name as an example.

[0244] S506: The DNS server sends the current IP addresses of the M domain names to the electronic device.

[0245] In some embodiments, after obtaining the current IP addresses of the M domain names, the DNS server sends the current IP addresses of the M domain names to the electronic device. Correspondingly, the electronic device receives the current IP addresses of the M domain names.

[0246] S507: The electronic device replaces the initial IP addresses corresponding to the M domain names in the first file with the current IP addresses of the M domain names.

[0247] In some embodiments, after receiving the current IP addresses of the M domain names, the electronic device can compare the initial IP addresses of the M domain names in the first file with the current IP addresses of the M domain names, respectively. If the IP of a domain name has changed, the initial IP address of the domain name is replaced by the current IP address of the domain name.

[0248] The embodiments of the present application exemplarily take the IP address corresponding to the first domain name being updated from the first IP address to the second IP address as an example for description. Then, the electronic device replaces the IP address corresponding to the first domain name in the first file with the second IP address.

[0249] For example, M is 3, and the first file includes three groups of domain name information, i.e., first domain name information, second domain name information, and third domain name information. The first domain name information includes a first domain name and a first IP address corresponding to the first domain name. The second domain name information includes a second domain name and an IP address A corresponding to the second domain name. The third domain name information includes a third domain name and an IP address B corresponding to the third domain name. The DNS query agent module can query the IP addresses corresponding to the first domain name, the second domain name, and the third domain name through the DNS server after the electronic device is in the charging state every two days. If the IP address corresponding to the first domain name is the second IP address, and the other IP addresses do not change, the DNS query agent module can replace the first IP address in the first domain name information with the second IP address, and the second domain name information and the third domain name information do not need to be changed.

[0250] S508: When the second application of the electronic device requests to access the server corresponding to the first domain name, the electronic device queries the IP address corresponding to the first domain name from the first file and obtains the second IP address.

[0251] In some embodiments, after performing S505, when the second application requests to access the server corresponding to the first domain name, the electronic device queries the IP address corresponding to the first domain name from the first file and obtains the second IP address.

[0252] In one implementation, the second application of the electronic device can query the IP address corresponding to the first domain name in the first file through the DNS query agent module and obtain the second IP address. The DNS query agent module returns the second IP address to the application.

[0253] The first application and the second application can be the same application or different applications.

[0254] S509: The second application of the electronic device accesses the server corresponding to the first domain name based on the second IP address.

[0255] In some embodiments, when the second application of the electronic device receives the second IP address returned by the DNS query proxy module, it can connect to the network based on the second IP address corresponding to the first domain name, that is, access the server corresponding to the first domain name.

[0256] In other embodiments of this application, when the electronic device requests access to the server corresponding to the second domain name from the second application, it queries the IP address corresponding to the second domain name from the first file; if the electronic device does not find the second domain name in the first file, it sends a second acquisition request to the DNS server, the second acquisition request being used to request the IP address corresponding to the second domain name; the electronic device receives a third IP address sent by the DNS server; the third IP address is the IP address corresponding to the second domain name obtained by the DNS server; the electronic device accesses the server corresponding to the second domain name based on the third IP address.

[0257] Furthermore, the electronic device stores the third IP address and the second domain name as a set of domain name information in the first file. So, assuming that M is 3, after adding a set of domain name information, the M sets of domain name information in the first file will be 4 sets of domain name information.

[0258] Based on the hardware and software architecture of the aforementioned electronic devices, the following will be discussed... Figure 6 and Figure 7 The methods for accessing the network provided in the embodiments of this application are described respectively.

[0259] Figure 6 An embodiment of this application illustrates a method for accessing a network. Figure 6 An exemplary embodiment is shown when the electronic device does not store the IP address corresponding to the first domain name. The method includes some or all of the following steps:

[0260] S601: The first application receives a user operation instructing it to start, and the first application begins to run.

[0261] The first application can be any application in the electronic device, such as Figure 3B The browser, music, video, etc. shown in the application layer are not limited in this embodiment.

[0262] For example, the electronic device may display a user interface as shown in 8A. The electronic device receives a user operation that instructs it to launch a first application, i.e., a user operation that clicks icon 810, and the electronic device starts running the first application.

[0263] S602: The first application sends a request to the DNS query agent module, the request including the first domain name.

[0264] The DNS query agent module can be located in Figure 3B The application framework program layer in the middle.

[0265] In some embodiments, during the running of the first application, the first application can send an acquisition request to the DNS query agent module, the acquisition request comprising the first domain name.

[0266] Wherein, during the running of the first application, the first application can be in a foreground state or a background state (i.e. invisible state) when the first application sends the acquisition request to the DNS query agent module. For example, the foreground state can be that the electronic device displays an application interface of the first application, and the user performs a user operation on the application interface, and accordingly, the first application initiates a query of the domain name of the server corresponding to the user operation to the DNS query agent module.

[0267] For another example, the background state can be that the first application is minimized, and the first application plays music or downloads resources in the background, etc. The first application can automatically query the domain name of the server corresponding to the content to be played or downloaded based on the content, so as to acquire the content based on the server. For example, when the electronic device displays a user interface such as Figure 8B , and receives a click operation of the user on other applications, the electronic device places the video application in the background state, and the video application can initiate a query and access of a preset domain name based on the application setting of the video application every preset time.

[0268] Wherein, the first domain name can be the domain name of the application server corresponding to the first application. For example, when the first application receives the user operation indicating to start the first application, the electronic device requests the IP address corresponding to the first domain name from the DNS query agent module, and the IP address is used for the first application to access the application server corresponding to the first application to acquire the display content of the first interface of the first application. For example, the first application is a news application, and the display content of the first interface of the first application can include the latest hot content, etc.

[0269] S603: The DNS query agent module sends a first query request to the non-volatile memory, and the first query request is used to request the IP address corresponding to the first domain name.

[0270] Wherein, the non-volatile memory comprises a first file, and the first file is used to store the correspondence between the domain name and the IP address.

[0271] Wherein, the first file can be created in the non-volatile memory before the electronic device is shipped, or the DNS query agent module can create the first file in the non-volatile memory after the electronic device is started, and the embodiments of the present application do not limit this.

[0272] For example, the non-volatile memory can be a disk storage device or a flash memory (flash memory), such as UFS, eMMC, etc.

[0273] S604: The non-volatile memory queries the IP address corresponding to the first domain name in the first file.

[0274] S605: If the non-volatile memory does not query the IP address corresponding to the first domain name in the first file, the non-volatile memory notifies the DNS query agent module of a query failure.

[0275] In some embodiments, the non-volatile memory queries the IP address corresponding to the first domain name in the first file. Details can be seen in the embodiments shown below. Figure 6

[0276] S606: The DNS query agent module sends a second query request to the DNS server, where the second query request is used to request the IP address corresponding to the first domain name.

[0277] In some embodiments, after receiving the notification of the query failure of the non-volatile memory, the DNS query agent module can send the second query request to the DNS server, where the second query request is used to request the IP address corresponding to the first domain name.

[0278] S607: The DNS server queries the IP address corresponding to the first domain name and obtains a first IP address.

[0279] S608: The DNS server sends the first IP address to the DNS query agent module.

[0280] In some embodiments, after querying the first IP address, the DNS server can send the first IP address to the electronic device.

[0281] S609: The DNS query agent module sends the first IP address to the first application.

[0282] In some embodiments, after receiving the first IP address sent by the DNS server, the DNS query agent module of the electronic device can send the first IP address to the first application.

[0283] S610: The first application accesses the server corresponding to the first IP address.

[0284] In some embodiments, after receiving the first IP address sent by the DNS query agent module, the first application can access the server corresponding to the first IP address. Furthermore, the first application can also obtain data from the server and display the obtained data on the application interface of the first application.

[0285] S611: The DNS query agent module records the first domain name and the first IP address in the first set.

[0286] ​The first set is used to record the domain names and IP addresses accessed by electronic devices.

[0287] S612: The DNS query agent module stores the first domain name and the first IP address in the first file.

[0288] In some embodiments, the DNS query proxy module obtains the domain name and its corresponding IP address from the DNS server and stores the domain name and its corresponding IP address in a first file. Optionally, the DNS query proxy module may skip step S611 and directly store the first domain name and the first IP address in the first file.

[0289] In other embodiments, when the DNS query proxy module obtains domain name information from the DNS server, which includes the domain name and the IP address corresponding to the domain name, it records the domain name information in a first set and records the access count of the domain name information as 1. In subsequent processes, if there is a need to query the domain name, the DNS query proxy module can update the access count of the domain name information.

[0290] Optionally, the DNS query proxy module may store the domain name information in the first file when the number of queries for the domain name information exceeds a preset number. That is, after executing S611, the electronic device will not immediately execute step S612, but will only store the first domain name and the first IP address in the first file when the number of times the application queries the DNS query proxy module for the address corresponding to the first domain name exceeds a preset number.

[0291] Optionally, the DNS query proxy module can periodically sort the domain name information in the first set according to the number of queries from most to least, and store the top N domain name information in the first file, where N is a positive integer. That is, after executing S611, the electronic device will not immediately execute step S612, but will only store the first domain name and the first IP address in the first file if the domain name information corresponding to the first domain name is among the top N when the DNS query proxy module periodically sorts the domain name information.

[0292] Figure 7 This application illustrates another method for accessing a network provided by an embodiment of the present application. Figure 7 An exemplary embodiment is shown when the electronic device stores the IP address corresponding to the first domain name. The method includes some or all of the following steps:

[0293] S701: The first application receives a user operation instructing it to start, and the first application begins to run.

[0294] S702: The first application sends a request to the DNS query agent module, the request including the first domain name.

[0295] The obtaining request is used to request an IP address corresponding to the first domain name.

[0296] S703: The DNS query agent module sends a first query request to the nonvolatile memory, the first query request being used to request an IP address corresponding to the first domain name.

[0297] In some embodiments, the DNS query agent module sends the first query request to the nonvolatile memory upon receiving the obtaining request sent by the first application.

[0298] S704: The nonvolatile memory queries the IP address corresponding to the first domain name in the first file, and obtains a first IP address.

[0299] S705: The nonvolatile memory sends the first IP address to the DNS query agent module.

[0300] In some embodiments, the nonvolatile memory can send the first IP address to the DNS query agent module upon querying the IP address corresponding to the first domain name in the first file.

[0301] S706: The DNS query agent module sends the first IP address to the first application.

[0302] In some embodiments, the DNS query agent module can send the first IP address to the first application upon receiving the first IP address sent by the nonvolatile memory.

[0303] S707: The first application accesses a server corresponding to the first IP address.

[0304] In some embodiments, the first application can access the server corresponding to the first IP address upon receiving the first IP address sent by the DNS query agent module.

[0305] S708: The DNS query agent module adds one to the number of queries of the first domain name in the first set.

[0306] In some embodiments, the DNS query agent module can add one to the number of queries of the first domain name in the first set upon receiving the first IP address sent by the nonvolatile memory. For example, the number of queries of the first domain name in the first set is 3, and the DNS query agent module can add one to the number of queries of the first domain name in the first set upon receiving the first IP address corresponding to the first domain name sent by the nonvolatile memory.

[0307] In some other embodiments, the DNS query agent module adds one to the number of queries of the first domain name in the first set upon receiving the obtaining request sent by the first application.

[0308] S709: The DNS query proxy module stores the top N domain name information in the first set in the first file, and the top N domain name information includes the first domain name and the first IP address.

[0309] N is a positive integer.

[0310] In some embodiments, the electronic device can not perform S709 if the DNS query proxy module stores the first domain name and the first IP address in the first file when the first IP address corresponding to the first domain name is obtained from the DNS server for the first time.

[0311] The following user interface displayed on the electronic device exemplarily introduces the application scenario of the above-mentioned network access method.

[0312] It should be noted that in the embodiments of the present application, the user operation can be a touch operation (such as a click operation, a long press operation, an up-slip operation, a down-slip operation, or a side-slip operation) of the user, or a non-touch operation (such as a hovering gesture), or a voice instruction of the user, and the embodiments of the present application do not make specific limitations thereon. It should be noted that in the embodiments of the present application, the user operation can be a touch operation (such as a click operation, a long press operation, an up-slip operation, a down-slip operation, or a side-slip operation) of the user, or a non-touch operation (such as a hovering gesture), or a voice instruction of the user, and the embodiments of the present application do not make specific limitations thereon.

[0313] In some embodiments, when the electronic device opens an application, the electronic device can obtain the IP address of the application server by the above-mentioned network access method, and then obtain application data from the application server based on the application data, and display an application interface based on the application data. The following takes a video as an example for illustration.

[0314] Figure 8A An example user interface 81 for displaying installed applications on an electronic device is shown. The user interface 81 displays a status bar, an icon 810 of a video application, an icon of a gallery application, and icons of other applications, etc. The status bar can include one or more signal strength indicators of a mobile communication signal (also referred to as a cellular signal), one or more signal strength indicators of a Wi-Fi signal, a battery status indicator, a time indicator, etc.

[0315] As shown in FIG. 8A, a user can click the icon 810 of the video application, and accordingly, the electronic device responds to the user operation and performs the network access method shown in FIG. 8B to 8D, and is connected to the application server of the video, so as to obtain video data from the application server, and display the video based on the obtained video data. Figure 8A Figures 5-7 As shown in FIG. 8A, a user can click the icon 810 of the video application, and accordingly, the electronic device responds to the user operation and performs the network access method shown in FIG. 8B to 8D, and is connected to the application server of the video, so as to obtain video data from the application server, and display the video based on the obtained video data. Figure 8B ​The user interface 82 shown. It should be understood that the user interface 82 is an exemplary application interface of a video application and should not be construed as limiting the embodiments of the present application.

[0316] In some other embodiments, the electronic device can receive a domain name input by a user on an application, obtain an IP address corresponding to the domain name through the above-mentioned method of accessing a network, and then obtain data from a server corresponding to the IP address based on the IP address, and display an interface corresponding to the server based on the data. The following takes inputting a domain name in a browser as an example for illustration.

[0317] Figure 9A The user interface 91 of the browser application is exemplarily provided by the embodiments of the present application, which can include an input box 910, a search control 911, and a display area 912.

[0318] The input box 910 is used to input a search term or a domain name; the search control 911 is used to instruct to perform a search; and the display area 912 is used to display preset content of the browser. It should be understood that the content in the display area 912 is an example provided by the embodiments of the present application for convenience of understanding and should not be construed as limiting the embodiments of the present application; in actual applications, the display area 912 can be updated in real time by the browser application, and the embodiments of the present application do not limit the display area 912.

[0319] For example, the user can input a domain name in the input box 910, and correspondingly, the electronic device can display a user interface 92 as shown in Figure 9B The user interface 92 includes an input box 920, a search control 921, and a display area 922, wherein the input box 920 displays a domain name "https: www.hihonor.com.."(not completely shown due to interface size limitation); the search control 911 is used to instruct to perform a search; and the display area 922 is used to display display content of the browser. It should be noted that the content of the display area 912 and the display area 922 can be the same or different and can be determined by the browser itself.

[0320] As shown in Figure 9B The electronic device can touch the search control 911, and correspondingly, the terminal device can respond to the user operation to obtain an IP address corresponding to the domain name in the input box 920 through the above-mentioned method of accessing a network, and then obtain data from a server corresponding to the IP address based on the IP address, and display an interface corresponding to the server based on the data, such as a user interface 93 as shown in Figure 9C It should be understood that the user interface 93 is an exemplary display interface corresponding to the domain name and should not be construed as limiting the embodiments of the present application.

[0321] The term "user interface (UI)" in the specification and claims of the present application and the accompanying drawings is a medium interface for interaction and information exchange between an application or an operating system and a user, which realizes the conversion between the internal form of information and the form acceptable to the user. The user interface of an application is source code written in a specific computer language such as Java, extensible markup language (XML), etc. The interface source code is parsed, rendered, and finally presented as content recognizable by the user, such as pictures, text, buttons, etc. controls on the electronic device. Controls, also known as widgets, are the basic elements of the user interface. Typical controls include toolbars, menu bars, text boxes, buttons, scrollbars, pictures, and text. The properties and content of the controls in the interface are defined by tags or nodes, such as XML <textview> 、 <imgview> 、 <videoview>The interface is defined by nodes that specify the controls contained in the interface. One node corresponds to one control or property in the interface, and the nodes are parsed and rendered to present the content visible to the user. In addition, many applications, such as hybrid applications, also contain web pages in the interface. A web page, also referred to as a page, can be understood as a special control embedded in the interface of an application. The web page is a source code written in a specific computer language, such as hyper text markup language (HTML), cascading style sheets (CSS), JavaScript (JS), etc. The web page source code can be loaded and displayed by a browser or a web page display component similar to the function of a browser to present content recognizable to the user. The specific content contained in the web page is also defined by tags or nodes in the web page source code, such as HTML defines the content of the web page by tags such as 、 、 <video> 、 <canvas>to define the elements and attributes of a web page.

[0322] A common form of user interface is a graphic user interface (GUI), which refers to a user interface that displays in a graphical manner. It can be an icon, window, control, etc. interface element displayed in the display screen of an electronic device, wherein the control can include an icon, button, menu, tab, text box, dialog box, status bar, navigation bar, Widget, and other visible interface elements.

[0323] It should be understood that each step in the above method embodiments provided by the present application can be completed by integrated logic circuits of hardware in the processor or instructions in the form of software. The method steps disclosed in combination with the embodiments of the present application can be directly embodied as hardware processor execution or executed by a combination of hardware and software modules in the processor.

[0324] The present application also provides an electronic device, which can include a memory and a processor. The memory can be used to store a computer program, and the processor can be used to call the computer program in the memory to enable the electronic device to execute the method in any one of the above embodiments.

[0325] The present application also provides a chip system, which includes at least one processor for realizing the functions involved in the method executed by the electronic device in any one of the above embodiments. In a possible design, the chip system further includes a memory for storing program instructions and data, and the memory is located in the processor or outside the processor. The chip system can be composed of a chip, or can include a chip and other discrete devices.

[0326] Optionally, the processor in the chip system can be one or more. The processor can be realized by hardware or software. When realized by hardware, the processor can be a logic circuit, an integrated circuit, etc. When realized by software, the processor can be a general-purpose processor, which realizes by reading software codes stored in the memory.

[0327] Optionally, the memory in the chip system can also be one or more. The memory can be integrated with the processor, or can be separately arranged from the processor, and the embodiments of the present application are not limited in this regard. Exemplarily, the memory can be a non-transient processor, for example, a read-only memory (ROM), which can be integrated on the same chip as the processor, or can be separately arranged on different chips. The embodiments of the present application do not make specific limitations on the type of memory and the arrangement of the memory and the processor.

[0328] Exemplarily, the chip system can be a field programmable gate array (FPGA), can be an application specific integrated circuit (ASIC), can also be a system on chip (SoC), can also be a central processor unit (CPU), can also be a network processor (NP), can also be a digital signal processor (DSP), can also be a micro controller unit (MCU), can also be a programmable logic device (PLD) or other integrated chip.

[0329] The present application also provides a computer program product, which comprises a computer program (also referred to as code or instruction), which, when executed, causes a computer to perform the method performed by the electronic device in any one of the above embodiments.

[0330] The present application also provides a computer readable storage medium, which stores a computer program (also referred to as code or instruction). When the computer program is executed, it causes a computer to perform the method performed by the electronic device in any one of the above embodiments.

[0331] The embodiments of the present application can be combined in any manner to achieve different technical effects.

[0332] In the above embodiments, all or part of the methods can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the methods can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the present application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatus. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transferred from one website, computer, server, or data center to another website, computer, server, or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that includes one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk), etc.

[0333] A person of ordinary skill in the art can understand that all or part of the processes in the above embodiments can be instructed by a computer program to complete the relevant hardware, and the program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the above method embodiments. The aforementioned storage medium includes ROM or random access memory (RAM), a magnetic disk or an optical disk, and various media that can store program codes.

[0334] In summary, the above is only an embodiment of the technical scheme of the present application, and is not used to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made according to the disclosure of the present application shall be included in the protection scope of the present application.< / canvas> < / video> < / videoview> < / imgview> < / textview>

Claims

1. A method of accessing a network, characterized by, The method comprises: The electronic device stores M sets of domain name information in a first file, each set of domain name information in the M sets of domain name information comprising a domain name and an initial Internet Protocol (IP) address; the first file comprises first domain name information, the first domain name information comprising a first domain name and a first IP address, M being an integer greater than 1; The electronic device periodically sends a first acquisition request to a Domain Name System (DNS) server, the first acquisition request comprising M domain names in the M sets of domain name information, the M domain names comprising the first domain name; the first acquisition request is used to request the current IP addresses of the M domain names; The electronic device receives the current IP addresses of the M domain names sent by the DNS server; the current IP address of the first domain name is a second IP address; The electronic device replaces the initial IP addresses corresponding to the M domain names in the first file with the current IP addresses of the M domain names; the first domain name information in the current first file comprises the first domain name and the second IP address; The electronic device queries the IP address corresponding to the first domain name from the first file when a first application requests to access a server corresponding to the first domain name, and obtains the second IP address; The electronic device accesses the server corresponding to the first domain name based on the second IP address.

2. The method of claim 1, wherein, The M sets of domain name information are domain name information corresponding to servers accessed by the electronic device within a first preset time.

3. The method of claim 1, wherein, Before the electronic device stores the M sets of domain name information in the first file, the method comprises: The electronic device records domain name information corresponding to servers accessed within a second preset time to obtain a first set; The electronic device sorts the domain name information in the first set from more to less according to the number of accesses; The electronic device determines the domain name information located in the first M positions in the sorting as the M sets of domain name information.

4. The method according to any one of claims 1 to 3, characterized in that, The electronic device periodically sends a first acquisition request to a Domain Name System (DNS) server, comprising: The electronic device sends the first acquisition request to the DNS server when the electronic device is in a charging state after a preset time interval after the last change of the first file.

5. The method according to any one of claims 1 to 4, characterized in that, The first file is stored in a non-volatile memory.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises: The electronic device queries the IP address corresponding to the second domain name from the first file when a second application requests to access a server corresponding to the second domain name; When the electronic device does not query the second domain name in the first file, the electronic device sends a second acquisition request to the DNS server, the second acquisition request being used to request the IP address corresponding to the second domain name; The electronic device receives a third IP address sent by the DNS server; the third IP address is the IP address corresponding to the second domain name obtained by the DNS server; The electronic device accesses the server corresponding to the second domain name based on the third IP address.

7. The method of claim 6, wherein, The method further comprises: The electronic device stores the third IP address and the second domain name as a set of domain name information in the first file.

8. The method according to any one of claims 1 to 7, characterized in that, The electronic device stores M sets of domain name information in a first file before storing the M sets of domain name information in the first file, and the method further comprises: The third application of the electronic device requests the IP address corresponding to the first domain name from the DNS query agent module of the electronic device; the DNS query agent module of the electronic device is located in the application program framework layer; The DNS query agent module of the electronic device obtains the IP address of the first domain name from the DNS server when the IP address corresponding to the first domain name is not queried in the first file, to obtain the first IP address; The DNS query agent module of the electronic device sends the first IP address to the third application; The third application of the electronic device accesses the server corresponding to the first domain name based on the first IP address.

9. The method of claim 8, wherein, The electronic device stores M sets of domain name information in a first file, and the method further comprises: The DNS query agent module of the electronic device stores the first domain name and the first IP address as the first domain name information in the first file.

10. The method according to claim 8 or 9, characterized in that, The DNS query agent module of the electronic device periodically sends a first acquisition request to the domain name system DNS server; The DNS query agent module of the electronic device replaces the initial IP address corresponding to the M domain names in the first file with the current IP address of the M domain names.

11. The method according to any one of claims 8-10, characterized in that, The electronic device queries the IP address corresponding to the first domain name from the first file when the first application requests to access the server corresponding to the first domain name, to obtain the second IP address, and the method further comprises: The first application of the electronic device requests the IP address corresponding to the first domain name from the DNS query agent module; The DNS query agent module of the electronic device queries the IP address corresponding to the first domain name in the first file, to obtain the second IP address; The DNS query agent module of the electronic device sends the second IP address to the first application; The electronic device accesses the server corresponding to the first domain name based on the second IP address, and the method further comprises: the first application of the electronic device accesses the server corresponding to the first domain name based on the first IP address.

12. An electronic device, comprising: The electronic device comprises one or more processors and one or more memories; wherein the one or more memories are coupled with the one or more processors, and the one or more memories are used to store computer program codes, the computer program codes comprising computer instructions, when the one or more processors execute the computer instructions, the method of any one of claims 1-11 is executed.

13. A chip system for use in an electronic device, the chip system comprising one or more processors, characterized in that The processor is used to call the computer instructions to execute the method of any one of claims 1-11.

14. A computer-readable storage medium comprising instructions, wherein: When the instructions are run on the electronic device, the method of any one of claims 1-11 is executed.

Citation Information

Patent Citations

  • Domain name resolution method and device

    CN108462759A

  • Domain name resolution method and device and electronic equipment

    CN111541798A