CN117278542A - Resource access method and terminal equipment - Google Patents

Resource access method and terminal equipment Download PDF

Info

Publication number
CN117278542A
CN117278542A CN202311119199.5A CN202311119199A CN117278542A CN 117278542 A CN117278542 A CN 117278542A CN 202311119199 A CN202311119199 A CN 202311119199A CN 117278542 A CN117278542 A CN 117278542A
Authority
CN
China
Prior art keywords
network
domain name
browser
name resolution
resource access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311119199.5A
Other languages
Chinese (zh)
Inventor
王辉
刘耀明
姜辉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Petal Cloud Technology Co Ltd
Original Assignee
Petal Cloud Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Petal Cloud Technology Co Ltd filed Critical Petal Cloud Technology Co Ltd
Priority claimed from CN202110451641.9A external-priority patent/CN114765605B/en
Publication of CN117278542A publication Critical patent/CN117278542A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/52Network services specially adapted for the location of the user terminal

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application provides a resource access method and terminal equipment, and relates to the technical field of communication, wherein the method comprises the following steps: the terminal equipment responds to the operation of accessing the target webpage on the browser by a user, and acquires a resource access result corresponding to a Uniform Resource Locator (URL) request of the target webpage; judging whether domain name resolution errors or network connection errors occur according to the resource access result under the condition that network errors occur; if the domain name resolution error occurs, regenerating a URL request, and performing domain name resolution by adopting a Domain Name System (DNS) server preset in a browser; if the network connection error occurs, the first network used by the browser is switched to the second network, and the URL request is regenerated under the condition that the switching is successful. The technical scheme provided by the application can improve the success rate of webpage resource access, thereby improving the browsing experience of users.

Description

Resource access method and terminal equipment
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a resource access method and a terminal device.
Background
Accessing web page resources through a browser is a common means for people to obtain information. With the popularization of terminal devices such as mobile phones, users access web page resources through a browser on the mobile phone more and more.
In practical applications, when a user accesses a web resource using a browser, there may be a case where the resource access fails. For this situation, some current browsers perform some repair operations, such as: the domain name system (domain name system, DNS) server can return a plurality of Internet interconnection protocol (internet protocol, IP) addresses when performing domain name resolution, the browser adopts a timeout mechanism for a plurality of IP addresses returned by the DNS server, if the connection attempt by adopting the first IP address fails, other IP addresses are sequentially selected for connection attempt within a preset time period until the connection is successful, the timeout (i.e. exceeds the preset time period) or all the connection fails; and opening a corresponding webpage under the condition of successful connection, and displaying an error page to a user under the condition of connection failure (namely overtime or total connection failure).
However, for some network anomalies, the automatic repair operation described above cannot be well solved, and thus, there are still some situations where the connection cannot be successfully made.
Disclosure of Invention
In view of this, the present application provides a resource access method and a terminal device, which are used for improving the success rate of web resource access, so as to improve the browsing experience of a user.
In order to achieve the above object, in a first aspect, an embodiment of the present application provides a resource access method, applied to a terminal device, where the method includes:
responding to the operation of accessing a target webpage on a browser by a user, and acquiring a resource access result corresponding to a Uniform Resource Locator (URL) request of the target webpage;
judging whether domain name resolution errors or network connection errors occur according to the resource access result under the condition that network errors occur;
if the domain name resolution error occurs, regenerating the URL request, and performing domain name resolution by adopting a Domain Name System (DNS) server preset in a browser;
if the network connection error occurs, the first network used by the browser is switched to the second network, and the URL request is regenerated under the condition that the switching is successful.
According to the resource access method provided by the embodiment, after the web resource of the target web page fails to be acquired, the type of network errors can be automatically identified, and when the domain name resolution errors are found, the method is switched to a DNS server preset by a browser and the web resource is tried to be accessed again; when the network connection error is found, the web page resource is accessed again after the network switching is carried out, so that the success rate of web page resource access can be improved, and the browsing experience of a user is further improved.
In a possible implementation manner of the first aspect, the preset DNS server includes a plurality of preset DNS servers, and the performing domain name resolution using a preset domain name system DNS server in the browser includes:
selecting a target DNS server from the preset DNS servers according to user information, webpage information of the target webpage and/or geographical position information of the terminal equipment;
and carrying out domain name resolution by adopting the target DNS server.
In the above embodiment, the target DNS server is selected from the preset DNS servers according to the user information, the web page information of the target web page, and/or the geographical location information of the terminal device, so that the selected target DNS server is more suitable for the user, and thus the user experience can be improved.
In a possible implementation manner of the first aspect, the switching the first network used by the browser to the second network includes:
and switching the network used by the browser into a mobile data network under the condition that the first network used by the browser is a wireless fidelity Wi-Fi network.
When the terminal equipment is provided with a connectable Wi-Fi network around, the terminal equipment can be automatically switched to the Wi-Fi network; when the terminal device uses a mobile data network, there is typically no Wi-Fi network available around or the Wi-Fi network signal strength is too low. In the above embodiment, the network switching is performed again when the Wi-Fi network is used by the browser, so that the situation of network switching failure caused by that other available networks are not available around can be avoided, and processing resources can be saved.
In a possible implementation manner of the first aspect, the method further includes:
and if the resource access result of the regenerated URL request is not obtained within the preset time, displaying an error page.
Through the embodiment, the waiting time of the user can be reduced, so that the user experience can be improved.
In a possible implementation manner of the first aspect, after the performing domain name resolution with a DNS server preset in the browser, the method further includes:
and after the browser leaves the target webpage, performing domain name resolution by adopting a DNS server configured by a system.
When the DNS server configured by the system is adopted to perform domain name resolution, domain name resolution errors may only occur on a part of domain names, and in general, the network access process of the DNS server configured by the system is faster.
In a possible implementation manner of the first aspect, after the regenerating the URL request in case of successful handover, the method further includes:
And switching the second network used by the browser back to the first network after the browser leaves the target webpage.
When the browser adopts the first network, network connection errors may only occur to part of websites, in the above embodiment, after the browser leaves the target webpage, the network used by the browser is switched back to the first network, so that data traffic of the second network can be saved.
In a possible implementation manner of the first aspect, the URL request is used to request a main web page resource of the target web page.
In the above embodiment, the network error repair is performed only for the URL request of the main web page resource for requesting the target web page, so that the processing resource can be saved while the user demand is satisfied.
In a second aspect, an embodiment of the present application provides a resource access device, applied to a terminal device, where the device includes:
the input module is used for receiving the operation of accessing the target webpage on the browser by the user;
the communication module is used for responding to the operation of a user and acquiring a resource access result corresponding to the URL request of the target webpage;
the processing module is used for judging whether domain name resolution errors or network connection errors occur according to the resource access result under the condition that network errors occur;
The communication module is further configured to: regenerating the URL request under the condition that the processing module determines that domain name resolution errors occur, and performing domain name resolution by adopting a Domain Name System (DNS) server preset in a browser; and under the condition that the processing module determines that the network connection error occurs, switching the first network used by the browser into the second network, and under the condition that the switching is successful, regenerating the URL request.
In a possible implementation manner of the second aspect, the preset DNS server includes a plurality of preset DNS servers, and the communication module is specifically configured to:
selecting a target DNS server from the preset DNS servers according to user information, webpage information of the target webpage and/or geographical position information of the terminal equipment;
and carrying out domain name resolution by adopting the target DNS server.
In a possible implementation manner of the second aspect, the communication module is specifically configured to:
and switching the network used by the browser into a mobile data network under the condition that the first network used by the browser is a wireless fidelity Wi-Fi network.
In a possible implementation manner of the second aspect, the apparatus further includes: the display module, the processing module is further used for: and if the resource access result of the regenerated URL request is not obtained within the preset time, indicating the display module to display an error page.
In a possible implementation manner of the second aspect, the processing module is further configured to: and after the browser is determined to leave the target webpage, the communication module is instructed to conduct domain name resolution by adopting a DNS server configured by a system.
In a possible implementation manner of the second aspect, the processing module is further configured to: after determining that the browser leaves the target webpage, the communication module is instructed to switch the second network used by the browser back to the first network.
In a possible implementation manner of the second aspect, the URL request is used to request a main web page resource of the target web page.
In a third aspect, an embodiment of the present application provides a terminal device, including: a memory and a processor, the memory for storing a computer program; the processor is configured to perform the method of the first aspect or any implementation of the first aspect when the computer program is invoked.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of the first aspect or any implementation of the first aspect.
In a fifth aspect, embodiments of the present application provide a computer program product, which, when run on a terminal device, causes the terminal device to perform the method of the first aspect or any implementation of the first aspect.
In a sixth aspect, an embodiment of the present application provides a chip system, including a processor, where the processor is coupled to a memory, and the processor executes a computer program stored in the memory, to implement the method according to the first aspect or any implementation manner of the first aspect. The chip system can be a single chip or a chip module formed by a plurality of chips.
It will be appreciated that the advantages of the second to sixth aspects may be found in the relevant description of the first aspect, and are not described here again.
Drawings
Fig. 1 is a schematic diagram of a system architecture provided in an embodiment of the present application;
FIG. 2 is a schematic diagram of a user interface according to an embodiment of the present application;
FIG. 3 is a schematic diagram of another user interface provided by an embodiment of the present application;
fig. 4 is a software architecture block diagram of a terminal device provided in an embodiment of the present application;
fig. 5 is a schematic functional structural diagram of a browser according to an embodiment of the present application;
Fig. 6 is a schematic flow chart of a resource access method provided in an embodiment of the present application;
FIG. 7 is a schematic block diagram of a resource access method according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of yet another user interface provided by an embodiment of the present application;
fig. 9 is a schematic structural diagram of a resource access device according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application are described below with reference to the accompanying drawings in the embodiments of the present application. The terminology used in the description of the embodiments of the application is for the purpose of describing particular embodiments of the application only and is not intended to be limiting of the application.
Fig. 1 is a schematic diagram of a system architecture provided in an embodiment of the present application, as shown in fig. 1, the system may include: terminal device 100, DNS server 200, and Web page (Web) server 300.
One or more browsers may be installed on the terminal device 100, and the terminal device 100 may communicate with the DNS server 200 and the Web server 300 through the browsers to implement access to Web resources.
The terminal device 100 may specifically be a mobile phone, a tablet, an intelligent wearable device (such as a watch, a bracelet, etc.), a personal computer (personal computer, PC), a vehicle-mounted device, an intelligent home device, etc., and in this embodiment, the mobile phone is taken as an example for illustration.
When a user accesses a web page, in order to conveniently memorize a domain name, which is usually input, a browser may receive the domain name input by the user, and then search for an IP address corresponding to the domain name based on a local DNS cache and a hosts file, or send a domain name resolution request to DNS server 200, and acquire the IP address corresponding to the domain name from DNS server 200. After the browser acquires the IP address, the browser can access the corresponding Web server 300 according to the IP address to acquire the webpage resource; and the corresponding page can be displayed according to the acquired webpage resources under the condition that the webpage resources are successfully acquired, so that the user can browse the page.
The main function of DNS server 200 is to perform domain name resolution, i.e. find the IP address corresponding to the domain name according to the domain name. The DNS server 200 may receive the domain name resolution request sent by the browser, find a corresponding IP address according to the domain name carried in the domain name resolution request, and then may return a domain name resolution result to the browser.
The Web server 300 is a server that provides Web resources, and a browser can connect to the Web server 300 by resolving the obtained IP address to download the Web resources.
The browser on the terminal device 100 may communicate with the DNS server 200 and the Web server 300 using various network connection methods, for example, the browser may communicate with the DNS server 200 and the Web server 300 through a mobile data network or a wireless local area network (wireless local area networks, WLAN) (e.g., a wireless fidelity (wireless fidelity, wi-Fi) network) for access to Web pages. The following describes a process in which a user accesses a web page through a browser.
A user may click on a web portal on a browser or enter a uniform resource locator (uniform resource locator, URL) to trigger a URL request to access a web resource of a target web page, where the request includes domain name information, and for convenience of explanation, a domain name a is exemplified below.
After detecting the URL request triggered by the user, the browser performs domain name resolution, and converts the domain name a in the URL request into the IP address of the Web server 300.
When the domain name resolution is specifically performed, the browser firstly searches a local DNS cache and a hosts file, confirms whether an IP address corresponding to the domain name A exists in the local DNS cache and the hosts file, and completes the domain name resolution if the IP address corresponding to the domain name A exists in the local DNS cache and the hosts file; if not, a domain name resolution request is sent to the DNS server 200 (i.e., the local DNS server 200) configured by the system to obtain the IP address corresponding to the domain name a. The domain name resolution request may use a user datagram protocol (user datagram protocol, UDP) to increase resolution speed. The DNS server 200 of the system configuration may be acquired when the terminal device 100 establishes a network connection, or may be manually specified by a user.
After the browser obtains the IP address corresponding to the domain name a, a transmission control protocol (transmission control protocol, TCP) connection is established with the Web server 300 through three-way handshake according to the IP address, and then a resource access request is sent to the Web server 300 based on the established TCP connection, so as to obtain the Web page resource of the target Web page. Wherein the resource access request is generated based on a URL request, in particular a hypertext transfer protocol (HyperText transfer protocol, HTTP) request.
After receiving the Web page resource returned by the Web server 300, the browser can analyze, render and display the target Web page according to the Web page resource.
In the above web page resource access process, a resource access failure may occur. For this situation, a feasible repair scheme is that multiple IP addresses can be returned when domain name resolution is performed, for these IP addresses, a timeout mechanism can be adopted, if a first IP address is adopted to attempt connection failure, other IP addresses can be sequentially selected to perform connection attempt within a preset period of time until connection is successful, timeout or all connection failures; and opening a corresponding webpage under the condition of successful connection, and displaying an error page to a user under the condition of connection failure (namely overtime or total connection failure), wherein the error page can comprise the reason and possible solution of resource access failure. An exemplary case of web resource access failure is described below.
Fig. 2 is a schematic diagram of a user interface provided in the embodiment of the present application, as shown in fig. 2, in which a mobile phone switches a connected network from a mobile data network to a Wi-Fi network, where network connection between the mobile phone and Web servers of some websites (referred to herein as abnormal websites) is abnormal in the Wi-Fi network, for example, network connection errors may occur in the process of connecting the websites (i.e., TCP connection cannot be normally established) due to a routing problem or a DNS server not updating an IP address of a Web server of the websites in time; the connection between the mobile phone and the websites under the mobile data network is normal. Assume that the Web server of the website with the domain name www.huawei.com belongs to the abnormal website described above.
As shown in fig. 2 (a), after the user inputs www.huawei.com in the search box of the browser a, clicks the "search" control to access the Web resource with URL of http:// www.huawei.com, the above network connection error occurs in the process that the browser a accesses the Web under the Wi-Fi network, and based on the above repair scheme, the browser a cannot be successfully connected to the Web server, so that the resource access fails. As shown in fig. 2 (b), the browser a displays an error page, where the hint information is: "the station does not respond for a long time"; and provides a possible solution: an option is provided in the wrong page to "switch networks" by which the user can switch networks in an attempt to solve the problem of page access errors.
For a website with a URL of http:// www.huawei.com, although browser A is abnormal when accessing the website under a Wi-Fi network, the website can be normally accessed under a mobile data network, and the browser A is not finally shown to a page which a user wants to see. In addition, although an option of "switching networks" is provided, a manual operation by the user is required. Moreover, under Wi-Fi network, the browser only has abnormal links with Web servers of individual websites and normal links with other Web servers, so that the browser only makes errors when accessing individual webpages, and can normally access most other webpages. In this case, if the web page is accessed incorrectly, the user will not consider the network to be problematic, and will not select to switch network attempts, resulting in an unresolved problem. These all affect the browsing experience of the user.
In order to improve the success rate of webpage resource access and improve the browsing experience of users, the embodiment of the application provides a repairing scheme which can automatically identify network errors before error page display and perform corresponding network error repairing operation according to the identified network errors so as to improve the success rate of webpage resource access.
Continuing with the above network connection scenario shown in fig. 2 as an example, fig. 3 is a schematic diagram of another user interface provided in the embodiment of the present application, and as shown in (a) in fig. 3, after the user inputs www.huawei.com in the search box of the browser B, the user clicks the "search" control to access the web page resource with URL of http:// www.huawei.com. When the resource access fails, the browser B firstly analyzes the network error and can find that the network connection is wrong, at the moment, the network can be automatically switched, the network of the browser B is switched from the Wi-Fi network to the mobile data network, and then the access to the webpage resource is tried again. Since the mobile data network is normal, it is possible to successfully connect to the Web server 300, acquire the above Web page resources, and then open the corresponding Web page (see (b) of fig. 3).
Compared with the browser A, when the access of the webpage resources fails, the browser B can automatically try to access the webpage resources again according to the type of network errors under the condition that the user does not feel, the problem that some webpage resources are failed to access is solved, and the whole process does not need manual participation of the user, so that the browsing experience of the user can be improved.
This technical scheme will be described in detail below.
The software system of the terminal device 100 to which the scheme relates will first be described.
The software system of the terminal device 100 may employ a layered architecture, an event driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. In this embodiment, taking an Android (Android) system with a layered architecture as an example, a software structure of the terminal device 100 is illustrated. Fig. 4 is a software structural block diagram of the terminal device 100 provided in the embodiment of the present application.
The layered architecture divides the software into several layers, each with distinct roles and branches. The layers communicate with each other through a software interface. In some embodiments, the Android system is divided into four layers, from top to bottom, an application layer, an application framework layer, an Zhuoyun row (Android run) and system libraries, and a kernel layer, respectively.
The application layer may include a series of application packages. The browser and the network switching application for performing the network switching described in this embodiment are located in an application layer. The network switching application may perform network switching on a network connected to the terminal device 100 or a network used by an application program on the terminal device 100, for example, the terminal device 100 is currently connected to a Wi-Fi network, and when the terminal device 100 cannot keep normal connection with the Wi-Fi network or a Wi-Fi signal is too weak, the network switching application may be invoked to automatically switch the connected network to a mobile data network; when the Wi-Fi signal returns to normal, the terminal device 100 may invoke a network switching application to automatically switch the connected network to the Wi-Fi network. The terminal device 100 may also control some applications to use Wi-Fi networks and other applications to use mobile data networks through network switching applications. It is understood that the network switching application refers to an application program with a network switching function, and other application names may be adopted in specific implementation, for example, a "HiData" application of the state of the art limited company.
As shown in fig. 4, the application package may further include applications such as cameras, gallery, calendar, talk, WLAN, bluetooth, music, video, short messages, etc.
The application framework layer provides an application programming interface (application programming interface, API) and programming framework for application programs of the application layer. The application framework layer includes a number of predefined functions.
As shown in fig. 4, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
The window manager is used for managing window programs. The window manager can acquire the size of the display screen, judge whether a status bar exists, lock the screen, intercept the screen and the like.
The content provider is used to store and retrieve data and make such data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phonebooks, etc.
The view system includes visual controls, such as controls to display text, controls to display pictures, and the like. The view system may be used to build applications. The display interface may be composed of one or more views. For example, a display interface including a text message notification icon may include a view displaying text and a view displaying a picture.
The telephony manager is used to provide the communication functions of the terminal device 100. Such as the management of call status (including on, hung-up, etc.).
The resource manager provides various resources for the application program, such as localization strings, icons, pictures, layout files, video files, and the like.
The notification manager allows the application to display notification information in a status bar, can be used to communicate notification type messages, can automatically disappear after a short dwell, and does not require user interaction. Such as notification manager is used to inform that the download is complete, message alerts, etc. The notification manager may also be a notification in the form of a chart or scroll bar text that appears on the system top status bar, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialog window. For example, a text message is prompted in a status bar, a prompt tone is emitted, the electronic device vibrates, and an indicator light blinks, etc.
Android run time includes a core library and virtual machines. Android run time is responsible for scheduling and management of the Android system.
The core library consists of two parts: one part is a function which needs to be called by java language, and the other part is a core library of android.
The application layer and the application framework layer run in a virtual machine. The virtual machine executes java files of the application program layer and the application program framework layer as binary files. The virtual machine is used for executing the functions of object life cycle management, stack management, thread management, security and exception management, garbage collection and the like.
The system library may include a plurality of functional modules. For example: surface manager (surface manager), media Libraries (Media Libraries), three-dimensional graphics processing Libraries (e.g., openGL ES), 2D graphics engines (e.g., SGL), etc.
The surface manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
Media libraries support a variety of commonly used audio, video format playback and recording, still image files, and the like. The media library may support a variety of audio and video encoding formats, such as MPEG4, h.264, MP3, AAC, AMR, JPG, PNG, etc.
The three-dimensional graphic processing library is used for realizing three-dimensional graphic drawing, image rendering, synthesis, layer processing and the like.
The 2D graphics engine is a drawing engine for 2D drawing.
The kernel layer is a layer between hardware and software and is used for providing core system services for an Android kernel, such as security services, network services, memory management services, detection management services, driving models and the like. The inner core layer at least comprises a display driver, a camera driver, an audio driver and a sensor driver.
Fig. 5 is a functional structural schematic diagram of a browser provided in an embodiment of the present application, and as shown in fig. 5, the browser may include: the system comprises a main frame module, a network module and a rendering engine, wherein the main frame module is used for realizing interface interaction, forward and backward stack, multi-process architecture and the like; the network module is used for carrying out network interaction and acquiring page resources; the rendering engine is mainly responsible for the analytic rendering of page resources.
For example, in the webpage access process, the browser can receive the operation of the user through the main frame module, respond to the operation, start loading the webpage and inform the network module to download the webpage resource; the network module can initiate a URL request and start at least one of the following processes of domain name resolution, TCP connection and resource acquisition; after the network module acquires the webpage resources or after the webpage resources are failed to acquire, the network module can feed back a resource access result to the main frame module; the main frame module can inform the rendering engine to analyze and render the error page when the web page resource acquisition fails, and then display the error page; and when the webpage resources are successfully acquired, informing a rendering engine to analyze and render the webpage resources, and then displaying the rendered target webpage (namely the correct webpage).
In this embodiment, a network error repair function is added to the main frame module, so that the main frame module can perform a corresponding network error repair operation (after switching DNS servers or networks, reloading pages) based on the resolved network error type before displaying the error page, thereby improving the success rate of web page resource access.
The following describes a web resource access procedure according to an embodiment of the present application.
Fig. 6 is a flowchart of a resource access method provided in an embodiment of the present application, as shown in fig. 6, the method may include the following steps:
s100, responding to the operation of accessing the target webpage on the browser by the user, and acquiring a resource access result corresponding to the URL request of the target webpage.
Specifically, the user may click on a web page entry, enter a domain name or URL of the target web page on the browser to access the target web page.
As shown in fig. 7, after the browser receives the operation of accessing the target web page by the user, the main frame module may generate a corresponding URL in response to the operation of the user, and then may forward the URL to the network module (step S101) to notify the network module to acquire the web page resource of the target web page.
After receiving the URL forwarded by the main frame module, the network module initiates a URL request and starts domain name resolution. As described above, the network module searches the local DNS cache and the hosts file for the IP address corresponding to the domain name in the URL request (step S102), and if the search fails, sends a domain name resolution request to the DNS server configured by the system (step S103).
In the process of performing domain name resolution, a domain name resolution failure may occur (i.e., a domain name resolution error occurs). Several common cases of domain name resolution failure are illustrated below.
First kind: the user may configure the local DNS server, and if the user sets up an incorrect DNS server, a domain name resolution failure may occur.
Second kind: the local DNS servers in different network environments are generally different, and if the local DNS server in a certain network environment does not store IP address information of certain domain names, a domain name resolution failure may also occur.
Third kind: if a user enters from one region to another, for example from home to abroad, a DNS server connection failure may occur, resulting in a domain name resolution failure.
It will be appreciated that the above is merely illustrative of a few cases of failure in domain name resolution, and that in particular applications there are other reasons for domain name resolution errors.
If the DNS server receives the domain name resolution request sent by the network module, a domain name resolution result may be returned to the network module (step S104). The domain name resolution request can adopt UDP protocol; the domain name resolution result may include an IP address successfully resolved by the DNS server, or may include indication information corresponding to the resolution failure of the DNS server.
After the network module issues the domain name resolution request, it is determined whether the domain name resolution is successful (step S105). If the network module can successfully receive the response message (comprising the domain name resolution result) of the DNS server and successfully resolve the message to obtain the IP address resolved by the DNS server, the domain name resolution is successful; otherwise, to indicate that the domain name resolution fails, the network module may return a resource access result containing error information to the main frame module (step S106).
If the domain name resolution is successful, the network module may establish a TCP connection with the Web server through a three-way handshake according to the returned IP address (step S107). The three-way handshake process between the network module and the Web server comprises the following steps: the network module firstly sends a connection establishment request to the Web server according to the IP address; the Web server returns a message containing connection request information and confirmation information after receiving the connection request information; and after receiving the reply of the Web server, the network module returns a confirmation message to the Web server.
During the process of establishing a TCP connection, a network connection failure may occur (i.e., a network connection error occurs). Several common cases of network connection failure are illustrated below.
First kind: as described above, the user may configure the local DNS server, and if the user sets an incorrect DNS server, the DNS server may return an incorrect IP address, so that the network module cannot connect to the correct Web server according to the IP address, that is, a network connection failure occurs.
Second kind: the IP address corresponding to the domain name may also change, and the local DNS servers in different network environments are generally different, if the local DNS server in a certain network environment fails to update the IP address information of certain domain names in time, the returned IP address is also wrong when resolving the domain names, so that the network connection failure occurs.
Third kind: when a user modifies a routing table on a router, if a routing setting is wrong, an IP address is not reachable, so that a TCP connection cannot be established, namely, a network connection error occurs.
It will be appreciated that the above is merely illustrative of a few cases of network connection failure, and that in particular applications there are other causes of network connection errors.
After the network module issues the connection establishment request, it is determined whether the TCP connection is successfully established (step S108). If the network module and the Web server handshake succeed, the TCP connection is successful; otherwise, indicating that the TCP connection fails, the network module may return a resource access result containing error information to the main frame module (step S106).
If the TCP connection is successfully established, the network module may send an HTTP request to the Web server through the established connection channel (step S109) to obtain the Web page resource of the target Web page. The HTTP request may include information such as a request method, a URL of the request, and an HTTP version protocol.
Correspondingly, after receiving the HTTP request, the Web server may return response data (step S110). The response data may include a web resource of the target web page, and may also include indication information corresponding to the failure of obtaining the resource. After receiving the response data of the Web server, the network module may return a resource access result including response result indication information to the main frame module according to the response data (step S111), where the response result indication information may be success indication information or error information.
S200, judging whether a network error occurs according to a resource access result, and if so, executing a step S300; if not, step S600 is performed.
Specifically, after the main frame module of the browser obtains the resource access result, whether a network error occurs can be judged according to the indication information in the resource access result (step S112), if the network error occurs, an error page is not displayed first, and a subsequent network repair operation can be performed; if no network error occurs, the display process of the target webpage can be performed.
As previously described, the resource access result may include success indication information or error information. The information may be embodied in a state value or a result code, and in this embodiment, the result code is taken as an example for illustration.
For example, in the case of successful resource access, the result code may be "OK" or other identification code that may indicate that the resource access was successful; in the case of a resource access failure, the result code may be a corresponding error code, where different network errors may be indicated by different error codes, and the correspondence between the network errors and the error codes may be predefined.
After receiving the resource access result returned by the network module, the main frame module can check the result code, and if the result code is OK, the main frame module can perform the subsequent display process of the target webpage; if the error code is the error code, the network error type can be determined according to the returned error code and the corresponding relation.
S300, judging whether domain name resolution errors or network connection errors occur, if so, executing step S400; if not, step S500 is performed.
Specifically, as shown in fig. 7, after determining that a network error (i.e., a resource access failure) occurs, the main frame module of the browser may determine whether the network error is a domain name resolution error (step S113) or a network connection error (step S116) according to the error code, and if the network error is the domain name resolution error or the network connection error, may perform a corresponding network error repair operation, and reload the target webpage; if the domain name resolution error or the network connection error is not found, a flow of displaying the error page can be performed.
The process of determining domain name resolution errors and network connection errors is illustrated below.
For example, domain name resolution errors include: network errors with error codes in the range 800-899, such as domain name resolution timeout (dns_timeout_out, error code 802), SERVER access failure (dns_server_failure, error code 803), and returned content resolution failure (dns_malformed_response, error code 800). The main frame module can check if the error code is in the range of 800-899 when the resource access fails, and if so, the main frame module can consider that the domain name resolution error occurs.
The network connection errors include: network errors with error codes in the range of 100-199, such as CONNECTION-reject (error code 102) and disconnection (error code 103). The main frame module can check if the error code is in the range of 100-199 when the resource access fails, and if so, can consider that the network connection error occurs.
It will be appreciated that the above-mentioned correspondence between error codes and network errors is only an example, and is not intended to limit the present application, and such correspondence may be defined as needed in a specific implementation.
In addition, there is no strict timing execution relationship between step S113 and step S116, and fig. 7 is merely an exemplary illustration of executing step S113 first and then executing step S116, and is not intended to limit the present application.
In order to save processing resources, in this embodiment, the network error repair operation may be performed only for a specific URL request.
Specifically, a web page includes a main web page resource (main_frame) and a sub-web page resource, wherein the main web page resource is used for describing the frame and layout of the web page; the sub-web page resources are sub-elements constituting the web page, including pictures, streaming media, javaScript script files, cascading style sheets (cascading style sheets, CSS), and the like. Generally, when a browser downloads a web page, the main web page resource of the web page is downloaded first, then the main web page resource of the web page is analyzed, and when the URL of the sub web page resource contained in the main web page resource is analyzed, the sub web page resource corresponding to the URL is started to be downloaded.
The sub-web resources are relatively large in resource quantity, and under the condition that the network condition is not good, the loading of the main web resources is successful, and the loading of the sub-web resources is failed, in this case, a user can generally acquire the desired information through the loaded main web resources, so that the network error repair operation of the sub-web resources can be omitted, and the processing resources are saved. That is, in this embodiment, the network error repair may be performed only for the URL request of the main web page resource for requesting the target web page, and if the network error occurs in the resource access process corresponding to the URL request of the sub web page resource, the error page may be displayed based on the acquired main web page resource, that is, the error page includes the main web page resource.
The URL request usually carries a resource identifier, and the URL request for requesting the main web page resource can be identified according to the resource identifier. For example, the resource identifier corresponding to the main web page resource is main_frame, and can be identified according to the identifier.
S400, if the domain name resolution error occurs, regenerating a URL request of the target webpage, and performing domain name resolution by adopting a DNS server preset in a browser; if the network connection error occurs, the first network used by the browser is switched to the second network, and the URL request of the target webpage is regenerated under the condition that the switching is successful.
Specifically, as shown in fig. 7, if the main frame module determines that the type of the network error is a domain name resolution error, the main frame module may notify the network module to create a new URL request, and instruct the network module to switch the DNS server to a DNS server built in the browser (step S114). Correspondingly, the network module reinitiates the URL request and adopts the DNS server built in the browser to perform domain name resolution (step S115).
The browser may preset a DNS server with higher reliability, where the preset DNS server may include one or more DNS servers, and for a plurality of cases, one DNS server (called a target DNS server) may be selected randomly to perform domain name resolution, or a preset policy may be adopted to select one target DNS server to perform domain name resolution, so as to determine a more suitable DNS server.
In particular implementations, the target DNS server that is currently more suitable for the user may be selected based on user information, web page information for the target web page, geographic location information for the terminal device, and/or the like.
For example, the user can select DNS server 1 (IP address 114.114.114.114) in home (home), and can select DNS server 2 (IP address 8.8.8.8) or DNS server 3 (IP address 1.1.1.1) in abroad.
For another example, the user belongs to a child user, and in order to protect the child from pornography, a DNS server having a pornography interception function may be selected, for example: DNS server with IP address 114.114.114.110.
For another example, if the target web page accessed by the user belongs to a banking website, a DNS server may be selected that has the capability of intercepting phishing virus trojans, for example: DNS server with IP address 114.114.114.119.
It can be understood that, for the regenerated URL request, multiple target DNS servers may be selected to perform domain name resolution, specifically, a domain name resolution request may be sent to multiple target DNS servers at the same time, or one of the target DNS servers may be selected to perform domain name resolution, and in case of resolution failure, another target DNS server may be selected to perform domain name resolution until resolution is successful or all resolution fails.
As previously described, if the following occurs: the user configures the wrong DNS server, the local DNS server in the current network environment does not store the IP address information of some domain names, the user goes from home to abroad, and the like, so that the domain name resolution failure is easy to occur. In this embodiment, when domain name resolution fails, a URL request is reinitiated, and domain name resolution is performed by using a DNS server preset in a browser, so that the success rate of DNS resolution can be effectively improved, the success rate of resource access can be improved, and the browsing experience of a user is improved.
Considering that when domain name resolution is performed by using a DNS server configured by a system, domain name resolution errors may only occur for a part of domain names, in general, a network access process of the DNS server configured by the system is faster.
As shown in fig. 7, if the main frame module determines that the type of the network error is a network connection error, the network switching application may be invoked to perform network switching on the network used by the browser (step S117), and then notify the network module to reinitiate the URL request (step S118). Correspondingly, the network module reinitiates the URL request (step S119).
The main frame module can acquire the system authority required by calling the network switching application in advance so as to call the network switching application and receive the broadcast of the network switching application.
Specifically, the first network may be, for example, wi-Fi, and the second network may be a mobile data network, or the first network and the second network may be other networks besides the mobile data network and the Wi-Fi network, and in this embodiment, the first network is taken as Wi-Fi, and the second network is taken as a mobile data network for example for illustration.
As described above, when the terminal device has a connectable Wi-Fi network around, the terminal device will automatically switch to the Wi-Fi network; when the terminal device uses a mobile data network, there is typically no Wi-Fi network available around or the Wi-Fi network signal strength is too low. Based on this, in this embodiment, when performing network switching, the main frame module may first determine whether the current use of the browser is Wi-Fi network, and if so, may invoke the network switching application to switch the network used by the browser to the mobile data network; if not, a flow of displaying the error page may be performed.
After the network switching application is successful in switching the network, broadcasting can be sent, and prompt information can be popped up to prompt the user that the network switching is successful.
Continuing with the example shown in fig. 3, as shown in (a) of fig. 8, the user accesses the web resource with URL of http:// www.huawei.com (i.e. the target web page) on the browser, and the main frame module of the browser responds to the access request of the user to load the page and notifies the network module to download the web resource. After receiving the notification, the network module generates a corresponding URL request, performs at least one of the following domain name resolution, TCP connection and resource acquisition processes, and then feeds back a resource access result to the main frame module. After receiving the resource access result fed back by the network module, the main frame module can analyze the network error type under the condition of resource access failure. As described above, if the Wi-Fi network connection is abnormal, the main frame module may find that the network connection is wrong, and at this time, call the network switching application to switch the network used by the browser from the Wi-Fi network to the mobile data network; after the switching is successful, the network switching application sends out a broadcast and pops up a prompt message: "WLAN and mobile data are being used simultaneously". The main frame module reloads the target webpage after receiving the broadcast; the network module correspondingly generates a new URL request. Since the mobile data network is normal, the network module can be successfully connected to the Web server to acquire the Web page resources, and after the Web page resources are successfully acquired, the main frame module can analyze and render the Web page resources through the rendering engine, and then the rendered target Web page is displayed as shown in (b) of fig. 8.
As previously described, if the following occurs: the user configures the wrong DNS server, the local DNS server in the current network environment does not update the IP address information of some domain names in time, the user sets the wrong route, and the like, so that a network connection error condition may occur. In this embodiment, when a network connection error occurs, after the first network used by the browser is switched to the second network, the URL request is reinitiated, the route of the DNS server and/or the terminal device for accessing the server is changed by changing the network environment, and then page loading is performed again, so that the success rate of network connection can be effectively improved, the success rate of resource access can be improved, and the browsing experience of the user is improved.
When the browser uses the first network, network connection errors may only occur to part of websites, similar to domain name resolution errors, and in this embodiment, when the browser leaves the target webpage, the network switching application may be notified to switch the network used by the browser from the mobile data network back to the Wi-Fi network, so as to save mobile data traffic. The network switching application generally also has an automatic switching function: after the network is switched, if the preset duration is reached, the Wi-Fi network is switched back under the condition that the Wi-Fi network is judged to be normal. In this case, the above-described process of notifying the network switching application to switch back to the network may not be performed.
Considering that the network error repair operation may fail, for example, after the DNS server is switched, the HTTP request result is not obtained for a long time due to poor communication link or other reasons; as another example, a network handover application may have a handover failure, which may also result in a resource access failure. In order to improve user experience, in this embodiment, after receiving the error code, the main frame module may set a timer, and if a new resource access result requested by the URL is not obtained within a timeout period (i.e., a preset period), the network error repair operation may be stopped, a flow of displaying an error page is performed, and an error page is displayed to the user.
The preset duration may be a period of time (for example, 3 seconds) after the resource access result corresponding to the initial URL request is obtained, or other starting times may be adopted, and correspondingly, different durations may be set, for example, the preset duration may also be a period of time (for example, 5 seconds) after the operation of the user to access the target webpage is received. The specific time period may be set as needed, and this embodiment is not particularly limited.
In addition, for the URL request re-initiated by the network module, the request process is similar to the URL request process described above, except that if the same network error occurs, the new URL request is not continuously initiated, but the process of displaying the error page is performed, so as to save processing resources.
For example, after the user inputs an access operation on the browser, the network module initiates a first URL request, and a domain name resolution error occurs in the resource access process; based on the network error repair strategy, the network module initiates a second URL request and adopts a built-in DNS server to carry out domain name resolution; assuming that network connection errors occur after the domain name resolution is successful, the browser uses a Wi-Fi network, based on the network repair strategy, the main framework module invokes a network switching application to switch the network used by the browser into a mobile data network, and then the network module initiates a third URL request; if the network connection error occurs again, the main frame module can directly perform the subsequent flow of displaying the error page without processing the error.
S500, displaying an error page.
As described above, if a domain name resolution error and other network errors other than a network connection error occur in the resource access process or a network error repair operation fails, an error page may be displayed.
In particular, as shown in fig. 7, the main frame module may send a notification message of the rendering error web page to the rendering engine (step S120); after receiving the notification, the rendering engine may acquire error information from the network module, parse the rendering error page according to the error information (step S121), and then may return a drawing message to the main frame module after the rendering is completed (step S122); after receiving the drawing message, the main frame module may display an error page according to the page content rendered by the rendering engine (step S123).
And S600, displaying the target webpage according to the resource access result.
As described above, if a network error does not occur in the URL request process, that is, the web page resource is successfully acquired, the target web page may be displayed.
In particular, as shown in fig. 7, the main frame module may send a notification message of the rendering target web page to the rendering engine (step S124); after receiving the notification, the rendering engine may acquire the web page resources of the target web page from the network module, parse the rendering target web page according to the web page resources (step S125), and then may return a drawing message to the main frame module after the rendering is completed (step S126); after receiving the drawing message, the main frame module may display the target page according to the page content rendered by the rendering engine (step S127).
Those skilled in the art will appreciate that the above embodiments are exemplary and not intended to limit the present application. The order of execution of one or more of the above steps may be modified, if possible, or may be combined selectively to yield one or more other embodiments. Those skilled in the art can select any combination from the above steps according to the need, and all the steps do not depart from the spirit of the scheme of the present application.
According to the resource access method provided by the embodiment, after the web resource of the target web page fails to be acquired, the type of network errors can be automatically identified, and when the domain name resolution errors are found, the method is switched to a DNS server preset by a browser and the web resource is tried to be accessed again; when the network connection error is found, the web page resource is accessed again after the network switching is carried out, so that the success rate of web page resource access can be improved, and the browsing experience of a user is further improved.
Based on the same inventive concept, as an implementation of the above method, the embodiment of the present application provides a resource access device, where the embodiment of the device corresponds to the embodiment of the foregoing method, and for convenience of reading, the embodiment of the present application does not describe details of the embodiment of the foregoing method one by one, but it should be clear that the device in the present embodiment can correspondingly implement all the details of the embodiment of the foregoing method.
Fig. 9 is a schematic structural diagram of a resource access device provided in the embodiment of the present application, and as shown in fig. 9, the device provided in the embodiment may include: a display module 210, an input module 220, a processing module 230, and a communication module 240.
Wherein the display module 210 is configured to support the terminal device to perform the interface display operations in the above embodiments and/or other processes for the techniques described herein. The display module may be a touch screen or other hardware or a combination of hardware and software.
The input module 220 is configured to receive user input on a display interface of the terminal device, such as touch input, voice input, gesture input, etc., and is configured to support the terminal device to perform the steps of receiving a web page access operation of the user and/or other processes for the techniques described herein in the above embodiments. The input module may be a touch screen or other hardware or a combination of hardware and software.
The processing module 230 is configured to support the terminal device to perform the processing operations in S110-S150 in the above embodiments and/or other processes for the techniques described herein.
The communication module 240 is used to support the terminal device to perform operations related to the communication process between the DNS server and the Web server in the above embodiments and/or other processes for the techniques described herein.
The resource access device provided in this embodiment may execute the above method embodiment, and its implementation principle is similar to that of the technical effect, and will not be described herein again.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-described division of the functional units and modules is illustrated, and in practical application, the above-described functional distribution may be performed by different functional units and modules according to needs, i.e. the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-described functions. The functional units and modules in the embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit, where the integrated units may be implemented in a form of hardware or a form of a software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working process of the units and modules in the above system may refer to the corresponding process in the foregoing method embodiment, which is not described herein again.
Based on the same inventive concept, the embodiment of the present application further provides a terminal device, referring to fig. 10, and fig. 10 is a schematic structural diagram of the terminal device provided in the embodiment of the present application.
The terminal device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (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, an earphone interface 170D, a sensor module 180, keys 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identity module (subscriber identification module, SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, and the like.
It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the terminal device 100. In other embodiments of the present application, terminal device 100 may include more or less components than illustrated, or certain components may be combined, or certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The processor 110 may include one or more processing units, such as: the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processor (sraphics processing unit, GPU), an image signal processor (image signal processor, ISP), a controller, a memory, a video codec, a digital signal processor (digital signal processor, DSP), a baseband processor, and/or a neural network processor (neural-network processing unit, NPU), etc. Wherein the different processing units may be separate devices or may be integrated in one or more processors.
The controller may be a neural center and a command center of the terminal device 100. The controller can generate operation control signals according to the instruction operation codes and the time sequence signals to finish the control of instruction fetching and instruction execution.
A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may hold instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to reuse the instruction or data, it can be called directly from the memory. Repeated accesses are avoided and the latency of the processor 110 is reduced, thereby improving the efficiency of the system.
In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I2S) interface, a pulse code modulation (pulse code modulation, PCM) interface, a universal asynchronous receiver transmitter (universal asynchronous receiver/transmitter, UART) interface, a mobile industry processor interface (mobile industry processor interface, MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (subscriber identity module, SIM) interface, and/or a universal serial bus (universal serial bus, USB) interface, among others.
The charge management module 140 is configured to receive a charge input from a charger. The charger can be a wireless charger or a wired charger. In some wired charging embodiments, the charge management module 140 may receive a charging input of a wired charger through the USB interface 130. In some wireless charging embodiments, the charge management module 140 may receive wireless charging input through a wireless charging coil of the terminal device 100. The charging management module 140 may also supply power to the terminal device through the power management module 141 while charging the battery 142.
The power management module 141 is used for connecting the battery 142, and the charge management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charge management module 140 and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, the wireless communication module 160, and the like. The power management module 141 may also be configured to monitor battery capacity, battery cycle number, battery health (leakage, impedance) and other parameters. In other embodiments, the power management module 141 may also be provided in the processor 110. In other embodiments, the power management module 141 and the charge management module 140 may be disposed in the same device.
The wireless communication function of the terminal device 100 can be implemented by the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, a modem processor, a baseband processor, and the like.
The antennas 1 and 2 are used for transmitting and receiving electromagnetic wave signals. Each antenna in the terminal device 100 may be used to cover a single or multiple communication bands. Different antennas may also be multiplexed to improve the utilization of the antennas. For example: the antenna 1 may be multiplexed into a diversity antenna of a wireless local area network. In other embodiments, the antenna may be used in conjunction with a tuning switch.
The mobile communication module 150 may provide a solution including 2G/3G/4G/5G wireless communication applied to the terminal device 100. The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (low noise amplifier, LNA), etc. The mobile communication module 150 may receive electromagnetic waves from the antenna 1, perform processes such as filtering, amplifying, and the like on the received electromagnetic waves, and transmit the processed electromagnetic waves to the modem processor for demodulation. The mobile communication module 150 can amplify the signal modulated by the modem processor, and convert the signal into electromagnetic waves through the antenna 1 to radiate. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be disposed in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 may be provided in the same device as at least some of the modules of the processor 110.
The modem processor may include a modulator and a demodulator. The modulator is used for modulating the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used for demodulating the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and then transferred to the application processor. The application processor outputs sound signals through an audio device (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or video through the display screen 194. In some embodiments, the modem processor may be a stand-alone device. In other embodiments, the modem processor may be provided in the same device as the mobile communication module 150 or other functional module, independent of the processor 110.
The wireless communication module 160 may provide solutions for wireless communication including wireless local area network (wireless local area networks, WLAN) (e.g., wireless fidelity (wireless fidelity, wi-Fi) network), bluetooth (BT), global navigation satellite system (global navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (IR), etc. applied on the terminal device 100. The wireless communication module 160 may be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the electromagnetic wave signals, filters the electromagnetic wave signals, and transmits the processed signals to the processor 110. The wireless communication module 160 may also receive a signal to be transmitted from the processor 110, frequency modulate it, amplify it, and convert it to electromagnetic waves for radiation via the antenna 2.
In some embodiments, antenna 1 and mobile communication module 150 of terminal device 100 are coupled, and antenna 2 and wireless communication module 160 are coupled, such that terminal device 100 may communicate with a network and other devices via wireless communication techniques. The wireless communication techniques may include the Global System for Mobile communications (global system for mobile communications, GSM), general packet radio service (general packet radio service, GPRS), code division multiple access (code division multiple access, CDMA), wideband code division multiple access (wideband code division multiple access, WCDMA), time division synchronous code division multiple access (TD-synchronous code division multiple access, TD-SCDMA), long term evolution (long term evolution, LTE), BT, GNSS, WLAN, NFC, FM, and/or IR techniques, among others. The GNSS may include a global satellite positioning system (global positioning system, GPS), a global navigation satellite system (global navigation satellite system, GNSS), a beidou satellite navigation system (beidou navigation satellite system, BDS), a quasi zenith satellite system (quasi-zenith satellite system, QZSS) and/or a satellite based augmentation system (satellite based augmentation systems, SBAS).
The terminal device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or change display information.
The display screen 194 is used to display images, videos, and the like. The display 194 includes a display panel. The display panel may employ a liquid crystal display (liquid crystal display, LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED) or an active-matrix organic light-emitting diode (matrix organic light emitting diode), a flexible light-emitting diode (flex), a Mini LED, a Micro LED, a quantum dot light-emitting diode (quantum dot light emitting diodes, QLED), or the like. In some embodiments, the terminal device 100 may include 1 or N display screens 194, N being a positive integer greater than 1.
The terminal device 100 may implement a photographing function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like.
The ISP is used to process data fed back by the camera 193. For example, when photographing, the shutter is opened, light is transmitted to the camera photosensitive element through the lens, the optical signal is converted into an electric signal, and the camera photosensitive element transmits the electric signal to the ISP for processing and is converted into an image visible to naked eyes. ISP can also optimize the noise, brightness and skin color of the image. The ISP can also optimize parameters such as exposure, color temperature and the like of a shooting scene. In some embodiments, the ISP may be provided in the camera 193.
The camera 193 is used to capture still images or video. The object generates an optical image through the lens and projects the optical image onto the photosensitive element. The photosensitive element may be a charge coupled device (charge coupled device, CCD) or a Complementary Metal Oxide Semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, which is then transferred to the ISP to be converted 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 terminal device 100 may include 1 or N cameras 193, N being a positive integer greater than 1.
The digital signal processor is used for processing digital signals, and can process other digital signals besides digital image signals. For example, when the terminal device 100 selects a frequency bin, the digital signal processor is used to fourier transform the frequency bin energy, or the like.
Video codecs are used to compress or decompress digital video. The terminal device 100 may support one or more video codecs. In this way, the terminal device 100 can play or record video in various encoding formats, for example: dynamic picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
The external memory interface 120 may be used to connect an external memory card, such as a Micro SD card, to realize expansion of the memory capability of the terminal device 100. The external memory card communicates with the processor 110 through an external memory interface 120 to implement data storage functions. For example, files such as music, video, etc. are stored in an external memory card.
The internal memory 121 may be used to store computer executable program code including instructions. The processor 110 executes various functional applications of the terminal device 100 and data processing by executing instructions stored in the internal memory 121. The internal memory 121 may include a storage program area and a storage data area. The storage program area may store an application program (such as a sound playing function, an image playing function, etc.) required for at least one function of the operating system, etc. The storage data area may store data (such as audio data, phonebook, etc.) created during use of the terminal device 100, and the like. In addition, the internal memory 121 may include a high-speed random access memory, and may further include a nonvolatile memory such as at least one magnetic disk storage device, a flash memory device, a universal flash memory (universal flash storage, UFS), and the like.
The terminal device 100 may implement audio functions through an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, an application processor, and the like. Such as music playing, recording, etc.
The terminal device provided in this embodiment may execute the above method embodiment, and its implementation principle is similar to that of the technical effect, and will not be described herein again.
The embodiment of the application also provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method described in the above method embodiment.
The embodiment of the application also provides a computer program product, which when run on a terminal device, causes the terminal device to execute the method described in the embodiment of the method.
The embodiment of the application also provides a chip system, which comprises a processor, wherein the processor is coupled with the memory, and the processor executes a computer program stored in the memory to realize the method described in the embodiment of the method. The chip system can be a single chip or a chip module formed by a plurality of chips.
In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, produces a flow or function in accordance with embodiments of the present application, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatus. The computer instructions may be stored in or transmitted across a computer-readable storage medium. The computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by a wired (e.g., coaxial cable, fiber optic, digital subscriber line), or wireless (e.g., infrared, wireless, microwave, etc.). The computer readable storage medium may be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. that contains an integration of one or more available media. The usable medium may be a magnetic medium (e.g., a floppy Disk, hard Disk, or magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), or the like.
Those of ordinary skill in the art will appreciate that implementing all or part of the above-described method embodiments may be accomplished by a computer program to instruct related hardware, the program may be stored in a computer readable storage medium, and the program may include the above-described method embodiments when executed. And the aforementioned storage medium may include: ROM or random access memory RAM, magnetic or optical disk, etc.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and in part, not described or illustrated in any particular embodiment, reference is made to the related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/device and method may be implemented in other manners. For example, the apparatus/device embodiments described above are merely illustrative, e.g., the division of the modules or units is merely a logical functional division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection via interfaces, devices or units, which may be in electrical, mechanical or other forms.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
In the description of the present application, unless otherwise indicated, "/" means that the associated object is an "or" relationship, e.g., a/B may represent a or B; the term "and/or" in this application is merely an association relation describing an association object, and means that three kinds of relations may exist, for example, a and/or B may mean: there are three cases, a alone, a and B together, and B alone, wherein a, B may be singular or plural.
Also, in the description of the present application, unless otherwise indicated, "a plurality" means two or more than two. "at least one of the following" or similar expressions thereof, means any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or plural.
As used in this specification and the appended claims, the term "if" may be interpreted as "when..once" or "in response to a determination" or "in response to detection" depending on the context. Similarly, the phrase "if a determination" or "if a [ described condition or event ] is detected" may be interpreted in the context of meaning "upon determination" or "in response to determination" or "upon detection of a [ described condition or event ]" or "in response to detection of a [ described condition or event ]".
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
Reference in the specification to "one embodiment" or "some embodiments" or the like means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," and the like in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments" unless expressly specified otherwise.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present application.

Claims (12)

1. A resource access method applied to a terminal device, comprising:
responding to the operation of accessing a target webpage on a browser by a user, and acquiring a resource access result corresponding to a Uniform Resource Locator (URL) request of the target webpage;
judging whether domain name resolution errors or network connection errors occur according to the resource access result under the condition that network errors occur;
if the domain name resolution error occurs, regenerating the URL request, and performing domain name resolution by adopting a Domain Name System (DNS) server preset in a browser;
if the network connection error occurs, the first network used by the browser is switched to the second network, and the URL request is regenerated under the condition that the switching is successful.
2. The method according to claim 1, wherein the preset DNS servers include a plurality of DNS servers, and the performing domain name resolution using a preset domain name system DNS server in the browser includes:
selecting a target DNS server from the preset DNS servers according to user information, webpage information of the target webpage and/or geographical position information of the terminal equipment;
and carrying out domain name resolution by adopting the target DNS server.
3. The method according to claim 1 or 2, wherein switching the first network used by the browser to the second network comprises:
and switching the network used by the browser into a mobile data network under the condition that the first network used by the browser is a wireless fidelity Wi-Fi network.
4. A method according to any one of claims 1-3, wherein the method further comprises:
and if the resource access result of the regenerated URL request is not obtained within the preset time, displaying an error page.
5. The method according to any one of claims 1-4, wherein after said domain name resolution using a DNS server preset in the browser, the method further comprises:
And after the browser leaves the target webpage, performing domain name resolution by adopting a DNS server configured by a system.
6. The method according to any of claims 1-5, wherein after the regenerating the URL request if the handover is successful, the method further comprises:
and switching the second network used by the browser back to the first network after the browser leaves the target webpage.
7. The method of any of claims 1-6, wherein the URL request is for a primary web page resource requesting the target web page.
8. A resource access device applied to a terminal device, comprising:
the input module is used for receiving the operation of accessing the target webpage on the browser by the user;
the communication module is used for responding to the operation of the user and acquiring a resource access result corresponding to the URL request of the target webpage;
the processing module is used for judging whether domain name resolution errors or network connection errors occur according to the resource access result under the condition that network errors occur;
the communication module is further configured to: regenerating the URL request under the condition that the processing module determines that domain name resolution errors occur, and performing domain name resolution by adopting a Domain Name System (DNS) server preset in a browser; and under the condition that the processing module determines that the network connection error occurs, switching the first network used by the browser into the second network, and under the condition that the switching is successful, regenerating the URL request.
9. A terminal device, comprising: a memory and a processor, the memory for storing a computer program; the processor is configured to perform the method of any of claims 1-7 when the computer program is invoked.
10. A computer readable storage medium, on which a computer program is stored, which computer program, when being executed by a processor, implements the method according to any of claims 1-7.
11. A computer program product, characterized in that the computer program product, when run on an electronic device, causes the electronic device to perform the method of any of claims 1-7.
12. A chip system comprising a processor coupled to a memory, the processor executing a computer program stored in the memory to implement the method of any of claims 1-7.
CN202311119199.5A 2020-12-30 2021-04-26 Resource access method and terminal equipment Pending CN117278542A (en)

Applications Claiming Priority (3)

Application Number Priority Date Filing Date Title
CN202011630959 2020-12-30
CN2020116309595 2020-12-30
CN202110451641.9A CN114765605B (en) 2020-12-30 2021-04-26 Resource access method and terminal equipment

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
CN202110451641.9A Division CN114765605B (en) 2020-12-30 2021-04-26 Resource access method and terminal equipment

Publications (1)

Publication Number Publication Date
CN117278542A true CN117278542A (en) 2023-12-22

Family

ID=82258655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311119199.5A Pending CN117278542A (en) 2020-12-30 2021-04-26 Resource access method and terminal equipment

Country Status (2)

Country Link
CN (1) CN117278542A (en)
WO (1) WO2022143155A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116662270B (en) * 2022-09-09 2024-05-10 荣耀终端有限公司 File analysis method and related device
CN115577200B (en) * 2022-09-28 2024-04-23 北京百度网讯科技有限公司 Page loading method, device, equipment and storage medium
CN117715150A (en) * 2023-05-31 2024-03-15 荣耀终端有限公司 Network connection method and related device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103327135A (en) * 2013-06-27 2013-09-25 贝壳网际(北京)安全技术有限公司 Domain name resolution method, device and client
CN103561121B (en) * 2013-10-11 2017-04-12 北京奇虎科技有限公司 Method and device for analyzing DNS and browser
CN104639672B (en) * 2015-02-12 2018-06-15 广州华多网络科技有限公司 The method and apparatus for carrying out domain name mapping
US10320740B2 (en) * 2015-05-15 2019-06-11 Citrix Systems, Inc. Systems and methods for performing dual DNS lookup to detect public versus intranet
CN106790768B (en) * 2017-02-27 2019-05-17 维沃移动通信有限公司 A kind of dns server setting method and mobile terminal

Also Published As

Publication number Publication date
WO2022143155A1 (en) 2022-07-07

Similar Documents

Publication Publication Date Title
CN112291764B (en) Content connection system
JP2022525284A (en) Device control page display method, related equipment, and system
WO2022143155A1 (en) Resource access method and terminal device
CN110602686B (en) Method for using remote SIM module and electronic equipment
US20230122238A1 (en) Account binding method, device, and system
WO2021179990A1 (en) Application server access method and terminal
CN115514882B (en) Distributed shooting method, electronic equipment and medium
EP4287048A1 (en) Login authentication method and electronic device
CN109005096A (en) Using exchange method and device
CN111615694B (en) Method for selecting server node and terminal equipment
JP2022515446A (en) Connection establishment method and terminal device
CN117687880A (en) Log processing method and device
CN114765605B (en) Resource access method and terminal equipment
CN115080941B (en) Account login method and electronic equipment
WO2022111529A1 (en) Application program debugging method and electronic device
CN117348894A (en) Software upgrading method, terminal equipment and system
CN117425227A (en) Method and device for establishing session based on WiFi direct connection
CN115767602B (en) Automatic error correction method for equipment protocol subsystem abnormality and electronic equipment
WO2024093795A1 (en) Device replacement configuration method and apparatus
WO2023045876A1 (en) Application installation method and related devices
CN115460445B (en) Screen projection method of electronic equipment and electronic equipment
CN117688262B (en) Data processing method, device and storage medium
WO2023274026A1 (en) Interaction method and apparatus for electronic device
EP4387210A1 (en) Screen identification method for distributed display, medium and electronic device
EP4310646A1 (en) Device discovery method and system and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination