CN111475754B - Page loading method, device, terminal and storage medium - Google Patents

Page loading method, device, terminal and storage medium Download PDF

Info

Publication number
CN111475754B
CN111475754B CN202010265258.XA CN202010265258A CN111475754B CN 111475754 B CN111475754 B CN 111475754B CN 202010265258 A CN202010265258 A CN 202010265258A CN 111475754 B CN111475754 B CN 111475754B
Authority
CN
China
Prior art keywords
resource
domain name
channel
downloading
resources
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.)
Active
Application number
CN202010265258.XA
Other languages
Chinese (zh)
Other versions
CN111475754A (en
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.)
Bigo Technology Singapore Pte Ltd
Original Assignee
Guangzhou Baiguoyuan Information 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 Guangzhou Baiguoyuan Information Technology Co Ltd filed Critical Guangzhou Baiguoyuan Information Technology Co Ltd
Priority to CN202010265258.XA priority Critical patent/CN111475754B/en
Publication of CN111475754A publication Critical patent/CN111475754A/en
Application granted granted Critical
Publication of CN111475754B publication Critical patent/CN111475754B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links

Abstract

The application discloses a page loading method, a page loading device, a page loading terminal and a page loading storage medium, and belongs to the technical field of computers. The method comprises the following steps: and acquiring n resource identifiers carried by the page loading request and domain names respectively corresponding to the n resource identifiers by acquiring the page loading request triggered by the client. If a barred domain name exists in the n domain names, the barred domain name is replaced with a non-barred domain name based on the resource configuration information. Where a barred domain name refers to a domain name that prohibits acquisition of resources from an indicated download source, and a non-barred domain name refers to a domain name that allows acquisition of resources from an indicated download source. Therefore, each domain name carried in the page loading request after the domain name is replaced is guaranteed to be a non-forbidden domain name, when resources are acquired based on the page loading request after the domain name is replaced, the condition that resources are not downloaded due to forbidden domain names is avoided, and the success rate of page loading is improved.

Description

Page loading method, device, terminal and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a page loading method, device, terminal, and storage medium.
Background
Currently, with the development of internet technology, more and more users process daily work through terminal devices such as a computer or a mobile phone. While the user is using the terminal device, the terminal device typically needs to perform page loading. For example, when the terminal device displays a shopping webpage, resources such as each picture and text included in the webpage need to be loaded.
In the related art, when loading any page, the terminal device needs to send an HTTP (HyperText Transfer Protocol ) request to the server, where the HTTP request carries multiple resource identifiers, so as to inform the server of which resources the page needs to load. After the server receives the HTTP request, the server acquires the resources in the data center based on the plurality of resource identifiers, returns the acquired resources to the terminal equipment, and the terminal equipment completes loading of the page based on the resources returned by the server. However, this approach does not guarantee the success rate of page loading.
Disclosure of Invention
The embodiment of the application provides a page loading method, a page loading device, a page loading terminal and a page loading storage medium, which can improve the success rate of page loading. The technical scheme is as follows:
In one aspect, a page loading method is provided, the method including:
acquiring a page loading request triggered by a client, wherein the page loading request carries n resource identifiers and domain names respectively corresponding to the n resource identifiers, the domain name corresponding to the resource identifier is used for indicating a downloading source of a resource indicated by the corresponding resource identifier, and n is a positive integer;
if a first resource identifier of which the corresponding domain name is a forbidden domain name exists in the n resource identifiers, replacing the domain name corresponding to the first resource identifier with a non-forbidden domain name, wherein the forbidden domain name is a domain name for forbidding to acquire resources from the indicated download source, and the non-forbidden domain name is a domain name for allowing to acquire resources from the indicated download source;
and acquiring resources respectively corresponding to the n resource identifiers based on the page loading request after domain name replacement, and loading a page according to the acquired resources.
In another aspect, there is provided a page loading apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a page loading request triggered by a client, wherein the page loading request carries n resource identifiers and domain names respectively corresponding to the n resource identifiers, the domain name corresponding to the resource identifier is used for indicating a downloading source of a resource indicated by the corresponding resource identifier, and n is a positive integer;
A replacing module, configured to replace, if a first resource identifier corresponding to a domain name that is forbidden in the n resource identifiers exists, a domain name corresponding to the first resource identifier with a non-forbidden domain name, where the forbidden domain name is a domain name that forbids acquisition of resources from the indicated download source, and the non-forbidden domain name is a domain name that allows acquisition of resources from the indicated download source;
and the second acquisition module is used for acquiring resources respectively corresponding to the n resource identifiers based on the page loading request after domain name replacement, and loading the page according to the acquired resources.
In another aspect, there is provided a terminal device including a processor and a memory, the memory storing a computer program loaded and executed by the processor to implement the above page loading method.
In another aspect, a non-transitory computer readable storage medium is provided, on which a computer program is stored, which when executed by a processor, implements the above-described page loading method.
In another aspect, a computer program product is provided for implementing the above page loading method when being executed by a processor of a terminal device.
The beneficial effects that technical scheme that this application embodiment provided include at least:
and acquiring n resource identifiers carried by the page loading request and domain names respectively corresponding to the n resource identifiers by acquiring the page loading request triggered by the client. If a forbidden domain name exists in the n domain names, the forbidden domain name is replaced by a non-forbidden domain name. Where a barred domain name refers to a domain name that prohibits acquisition of resources from an indicated download source, and a non-barred domain name refers to a domain name that allows acquisition of resources from an indicated download source. Therefore, each domain name carried in the page loading request after the domain name is replaced is guaranteed to be a non-forbidden domain name, and when resources are acquired based on the page loading request after the domain name is replaced, the condition that the resources are failed to download due to forbidden domain names is avoided, and the success rate of page loading is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block diagram of a page loading system according to an embodiment of the present application;
FIG. 2 is a flowchart of a page loading method according to an embodiment of the present application;
FIG. 3 is a block diagram of a page loader according to an embodiment of the present application;
fig. 4 is a block diagram of a terminal device according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
Before explaining the embodiments of the present application in detail, application scenarios related to the embodiments of the present application are described.
Currently, the resources required for page loading are generally divided into two main categories: static resources and dynamic resources. The static resources are used for loading the static pages, and the dynamic resources are used for loading the dynamic pages. In addition, the static page is used for indicating that the page can be directly loaded to the page displayed on the client browser without compiling through a server. Thus, the page content that anyone sees at any time is the same for a static page. For example, HTML (HyperText Markup Language ) pages are a common static page that is used to indicate pages containing pictures, links, and even non-text elements such as music, programs, and the like. The page loading method provided by the embodiment of the application is applied to the process of loading the page according to the static resource.
Before explaining the embodiments of the present application in detail, a system architecture related to the embodiments of the present application will be described.
Fig. 1 is a block diagram of a page loading system 100 according to an embodiment of the present application. As shown in fig. 1, the system includes one or more terminal devices 101 and one or more servers 102.
For any one of the one or more terminal devices 101, the terminal device 101 may be connected to any one of the one or more servers 102 by wireless or wired means for communication with the server 102. The terminal device 101 transmits a page load request to the server based on a preset operation by the user. When receiving the page loading request of the terminal device, the server 102 acquires the resources required by page loading and sends the resources required by page loading to the terminal device 101, so that the terminal device 101 can perform page loading operation according to the resources.
The terminal device 101 may be a mobile phone or a computer, and the server 102 may be a website (web) server, or may be another type of server, which is not limited in this embodiment of the present application.
The illustration in fig. 1 is only by way of example of 1 terminal device 101 and 1 server 102, and does not limit the page loading system 100 provided in the embodiment of the present application.
The following embodiments are described by taking a terminal device to execute the page loading method provided in the embodiments of the present application as an example.
Fig. 2 is a flowchart of a page method provided in an embodiment of the present application, where the method may be applied to an operating system in a terminal device. Referring to fig. 2, the method includes the following steps.
Step 201: and acquiring a page loading request triggered by the client.
The client may be a client of any application on the terminal device, such as a live broadcast application, a short video application, a news information application, a social application, a browser, etc. The page loading request carries n resource identifiers and domain names respectively corresponding to the n resource identifiers, the domain name corresponding to each resource identifier is used for indicating a download source of the resource indicated by the corresponding resource identifier, and n is a positive integer. The resource identification refers to identification information of page resources, and different page resources have different resource identifications. The page resource refers to elements contained in a web page, such as a picture, JS (JavaScript), CSS (Cascading Style Sheets, cascading style sheet), and the like.
In order to realize the function of loading the page of any website or Application (Application), any client on the terminal device can trigger a page loading request based on the preset operation of the user, and the page loading request can carry a plurality of resource identifiers and a plurality of domain names corresponding to the resource identifiers one by one, so that when the server receives the page loading request, the server can acquire and load a plurality of resources corresponding to the domain names one by one according to the domain names. The preset operation may be a click operation, a slide operation, or the like.
Currently, apps operating overseas often need to face complex network environments in different countries, regions, network providers, etc. For example, due to policies in different countries, some domain names are often blocked, so that the success rate of page loading is very low, which causes great inconvenience to users. In order to solve the problem of page loading failure caused by that some domain names are blocked, the page loading method provided by the embodiment of the application intercepts the page loading request to obtain a plurality of resource identifiers carried by the page loading request and a plurality of domain names corresponding to the resource identifiers one by one. When the forbidden domain name exists in the plurality of domain names, the forbidden domain name is replaced, so that the effect of improving the page loading success rate is achieved.
Thus, in one possible implementation, the possible implementation procedure of step 201 is that an operating system on the terminal device invokes an interception system through an API (Application Programming Interface ) to obtain a page load request triggered by the client. After intercepting and acquiring a page loading request, the operating system determines n resource identifiers and domain names respectively corresponding to the n resource identifiers required in the current page loading process according to the page loading request.
It should be noted that, since the page loading request triggered by the client is sent by webview (a system plug-in for displaying the web page content) deployed in the terminal device, the operating system needs to call other interception systems to acquire the resource information carried in the page loading request. The intercepting system may be a system for intercepting a request to obtain resource information, and the version type of the intercepting system is not limited in the embodiment of the application.
Wherein the domain name of each resource identifier is used to indicate the download source of the resource indicated by the corresponding resource identifier.
For example, the operating system acquires a page loading request sent by webview through an API call interception system, and acquires a plurality of resource identifiers carried by the page loading request and a plurality of domain names corresponding to the resource identifiers one by one. Assume that the plurality of resource identifiers are a, b, c, respectively, a domain name asite.com corresponding to resource a, a domain name bsite.com corresponding to resource b, and a domain name csite.com corresponding to resource c.
In the embodiment of the present application, in order to facilitate the terminal device to determine the forbidden domain name, and when determining the forbidden domain name, the terminal device may replace the forbidden domain name with a corresponding non-forbidden domain name, a domain name replacement list may be preset, so as to facilitate a subsequent determination of whether the domain name required for page loading has the forbidden domain name, and when the domain name required for page loading has the forbidden domain name, the terminal device may perform domain name replacement based on the domain name replacement list. The domain name replacement list may be configured by a server or may be configured by a terminal device, which is not specifically limited in the embodiment of the present application. The description will be made by taking a server configuration domain name replacement list as an example.
In one possible implementation, the process of setting the domain name replacement list possible by the server may include:
in the case that the domain name replacement list includes a non-forbidden domain name corresponding to the forbidden domain name, the server sets at least one forbidden domain name and the non-forbidden domain names corresponding to the at least one forbidden domain name respectively.
It should be noted that, the non-forbidden domain name corresponding to the forbidden domain name in the domain name replacement list may be determined according to one or more of a geographic location of the terminal device, an operating system of the terminal device, and a client that triggers the loading request.
In one possible implementation manner, the implementation process of setting the domain name replacement list to include the non-forbidden domain name corresponding to the forbidden domain name may be: the server refers to one or more of three influencing factors of the type and version of the App which is required to be loaded on the page, the operating system used by the current App and the geographic position of the current App, and determines one or more domain names which prohibit the access of the current App, namely prohibited domain names. And the server determines one or more non-forbidden domain names corresponding to the one or more forbidden domain names one by one according to the determined one or more forbidden domain names.
After determining the non-forbidden domain name corresponding to the forbidden domain name, one or more non-forbidden domain names determined to be in one-to-one correspondence with the one or more forbidden domain names can be added into a domain name replacement list.
The domain name replacement list can ensure that the terminal equipment solves the problem that the domain name corresponding to any resource is not forbidden in the page loading process based on the domain name replacement list.
Furthermore, there are also restrictions on the resource download channels (or communication links) used to download resources due to different countries, regions, network providers. For example, only a fixed one of the resource download channels can be used for a certain period of time to download resources, or different types of resources need to be downloaded through different resource download channels. Therefore, the server may configure the terminal device with channel configuration information indicating a resource download channel used for downloading the resource, in addition to the domain name replacement list. In the embodiment of the present application, the resource downloading channel refers to a communication link used by a resource in a downloaded page. Optionally, the resource download channel includes, but is not limited to, at least one of: HTTP communication link, TCP (Transmission Control Protocol ) communication link, low latency internet transport layer protocol (quinc) communication link based on UDP (User Datagram Protocol ).
In one possible implementation, the configuration information for the channel may include the following two aspects of configuration.
In the first aspect, the server may set at least one resource type, and a download channel identifier corresponding to the at least one resource type, where the download channel identifier corresponding to each resource type is used to indicate a resource download channel used for downloading a corresponding resource.
It should be noted that the types of resources required in the page loading process may be described by a file for indicating a plurality of different types of resources. Such as: js files, css files, picture files, etc. represent different types of resources, respectively. The js file is used for storing a javascript; CSS files refer to text files for loading CSS codes.
In one possible implementation manner, the implementation process of setting at least one resource type and the download channel identifier corresponding to the at least one resource type respectively may be: the server refers to one or more of three influencing factors of the type and version of the App which is required to be loaded on the page currently, the operating system used by the current App and the geographic position of the current App, and determines at least one resource type and a downloading channel identifier corresponding to the at least one resource type respectively.
After determining at least one resource type and a download channel identifier corresponding to the at least one resource type, the at least one resource type and a plurality of download channel identifiers corresponding to the at least one resource type may be added to the channel configuration information.
Second aspect: the server may also set the current download channel identification.
In one possible implementation manner, the implementation process of setting the current download channel identifier may be: the server refers to one or more of three influencing factors of the type and version of the App which is required to be loaded on the page currently, the operating system used by the current App and the geographic position of the current App, determines a currently allowed resource downloading channel, and determines the identification of the currently allowed resource downloading channel as the identification of the currently downloaded channel.
The current download channel identifier is used for indicating that all resources of the resource types are downloaded, and the resource download channel indicated by the current download channel identifier is used by the resources.
In one possible implementation, the current download channel identification may be indicated by way of a channel switch. At this time, the channel configuration information includes at least one download channel identifier and a value corresponding to each download channel identifier. When the value corresponding to a certain download channel identifier is a first value, the current download channel identifier is marked as the download channel identifier. When the value corresponding to a certain download channel identifier is a second value, the current download channel identifier is marked as not being the download channel identifier. Wherein the first value may be 1 and the second value may be 0. Of course, the first value and the second value may be set to other values, which are not particularly limited in the embodiment of the present application.
In another possible implementation manner, the current download channel identifier may be recorded in the channel configuration information, where other download channel identifiers are not required to be recorded in the channel configuration information.
It should be noted that, the resource download channel indicated by the current download channel identifier may be a resource download channel with a higher priority. Specifically, by setting the priority of the resource downloading channel, the resource downloading channel with higher priority is used as the first-selected currently available resource downloading channel. The priority setting can refer to the confidentiality of the resource downloading channel, and the resource downloading channel with high confidentiality is used as the resource downloading channel with higher priority. Or the setting of the priority can refer to the page loading success rate of the resource downloading channels counted in real time on line, and the resource downloading channel with higher page loading success rate is used as the resource downloading channel with higher priority.
Alternatively, the server may send resource configuration information to the terminal device, and accordingly, the terminal device receives resource configuration information from the server, where the resource configuration information may include the domain name replacement list and/or channel configuration information described above. Optionally, the resource configuration information is determined according to one or more of a geographical location of the terminal device, an operating system of the terminal device, and the client. In addition, the domain name replacement list and the channel configuration information may change in real time, so that the server can update the resource configuration information periodically, the server can actively push the updated resource configuration information to the terminal device, or the terminal device can actively pull the latest resource configuration information from the server periodically, thereby ensuring that the terminal device stores the latest and most effective resource configuration information and improving the success rate of page loading.
Optionally, the server may also set a white list.
Note that the white list is used to indicate one or more access parties that can use the resource configuration information. For example, the whitelist may be set to bigo. When other websites, such as baidu. Com, want to actively access and use the current resource configuration information, it is forbidden due to non-compliance with the whitelist. Or when the server actively pushes the resource configuration information to the terminal equipment, the server refers to the white list and actively pushes the resource configuration information to one or more visitors including the website white list.
Of course, the server may not be provided with the white list, and in this case, the acquiring party for acquiring the resource allocation information is not limited. In addition, when the server is provided with the white list, the server may update the white list periodically, which is not limited in the embodiment of the present application.
Step 202: and if the corresponding domain name in the n resource identifiers is a first resource identifier of the forbidden domain name, replacing the domain name corresponding to the first resource identifier with a non-forbidden domain name.
Optionally, the terminal device replaces the domain name corresponding to the first resource identifier with a non-forbidden domain name based on a domain name replacement list, where the domain name replacement list includes at least one forbidden domain name and non-forbidden domain names respectively corresponding to the at least one forbidden domain name. For example, there may be a one-to-one correspondence between forbidden domain names and non-forbidden domain names. Where a barred domain name refers to a domain name that prohibits acquisition of resources from an indicated download source, and a non-barred domain name refers to a domain name that allows acquisition of resources from an indicated download source.
For example, when the terminal device has a condition that a domain name bypass.com for downloading js files is blocked in the process of page loading, the terminal device determines that a non-forbidden domain name corresponding to the forbidden domain name bypass.com is dsite.com based on the domain name replacement list, and uses dsite.com to replace bypass.com in the page loading request.
After the domain names adopted by the current page loading are all the non-forbidden domain names through the step 202, the resources required by the current page loading can be downloaded through the following step 203, so that the page loading process is completed.
Step 203: and acquiring resources respectively corresponding to the n resource identifiers based on the page loading request after domain name replacement, and loading the page according to the acquired resources.
In one possible scenario, if the server does not issue the channel configuration information to the terminal device, a possible implementation procedure of step 203 is: and sending the page loading request after the domain name is replaced on the basis of the resource downloading channel with higher priority, so that the server returns the resources required in the page loading process to the terminal equipment on the basis of the resource downloading channel with higher priority.
In addition, when a condition that a certain resource downloading channel is blocked occurs, the resource downloading channel can be switched. The switching of the resource downloading channel can determine the switched resource downloading channel according to the priority of the resource downloading channel. For example, the switching of the resource download channels is performed according to the order of priority from high to low. Assume that the priority of the resource download channel is HTTP communication link, TCP communication link, and quin communication link, respectively, from high to low. When the HTTP communication link is disabled, a priority may be given to switching to the TCP communication link for downloading of resources.
In another possible scenario, if the server issues channel configuration information to the terminal device, a possible implementation procedure of step 203 is: determining a resource downloading channel according to channel configuration information, wherein the channel configuration information is used for indicating the resource downloading channel used for downloading the resource; and based on the page loading request after the domain name is replaced, adopting a resource downloading channel to download the resources respectively corresponding to the n resource identifiers.
Optionally, if the resource configuration information includes the current download channel identifier, the possible implementation process of determining the resource download channel according to the channel configuration information in the above steps is: and determining a resource downloading channel for downloading the resources corresponding to the n resource identifiers respectively according to the current downloading channel identifiers.
That is, in this case, each resource in the page load is downloaded based on the same resource download channel (i.e., the resource download channel indicated by the current download channel identification).
Optionally, if the channel configuration information includes at least one resource type and a download channel identifier corresponding to the at least one resource type, the possible implementation process of determining the resource download channel according to the channel configuration information is: for a second resource identifier in the n resource identifiers, determining a resource type corresponding to the second resource identifier, wherein the second resource identifier is any one of the n resource identifiers; determining a download channel identifier corresponding to the resource type corresponding to the second resource identifier from the download channel identifiers respectively corresponding to the at least one resource type; and determining a resource downloading channel for downloading the resource corresponding to the second resource identifier according to the determined downloading channel identifier.
For example, the channel configuration information includes a resource type a and a download channel 01 corresponding to the resource type a, includes a resource type b and a download channel 02 corresponding to the resource type b, and includes a resource type c and a download channel 03 corresponding to the resource type c. The resources required by the current page loading are respectively as follows: resource a for indicating js files, resource B for indicating css files, and resource C for indicating picture files. The type of resource a is resource type a. The type of resource B is resource type B. The type of resource C is resource type C. The terminal device obtains the resource a according to the resource download channel indicated by the download channel identifier 01, obtains the resource B according to the resource download channel indicated by the download channel identifier 02, and obtains the resource C according to the resource download channel indicated by the download channel identifier 03.
After determining the resource downloading channels corresponding to the resources respectively, the terminal equipment downloads the resources by adopting the corresponding resource downloading channels to acquire the resources, and then integrates the resources acquired by downloading so as to realize the loading display of the page.
Optionally, for a third resource identifier in the n resource identifiers, if the downloading of the resource corresponding to the third resource identifier by using the resource downloading channel fails, determining an adjusted resource downloading channel; and downloading the resource corresponding to the third resource identifier by adopting the adjusted resource downloading channel.
When downloading a certain resource by adopting a certain resource downloading channel fails, the terminal equipment can adjust the resource downloading channel and re-download the resource by adopting the adjusted resource downloading channel. Optionally, the terminal device may determine the adjusted resource downloading channel according to the channel configuration information, for example, the channel configuration information may include priorities of the resource downloading channels, and the terminal device may adjust the resource downloading channels according to the priority order of the resource downloading channels, for example, in the case that the resource downloading channel with a certain priority fails to download the resource, may adjust to select the resource downloading channel with the next priority to download the resource again.
In summary, according to the technical solution provided in the embodiments of the present application, by acquiring a page loading request triggered by any client on a terminal device, n resource identifiers carried by the page loading request and domain names respectively corresponding to the n resource identifiers are further acquired. If a forbidden domain name exists in the n domain names, the forbidden domain name is replaced by a non-forbidden domain name. Where a barred domain name refers to a domain name that prohibits acquisition of resources from an indicated download source, and a non-barred domain name refers to a domain name that allows acquisition of resources from an indicated download source. Therefore, each domain name carried in the page loading request after the domain name is replaced is guaranteed to be a non-forbidden domain name, and when resources are acquired based on the page loading request after the domain name is replaced, the condition that the resources are failed to download due to forbidden domain names is avoided, and the success rate of page loading is improved.
In addition, the resource configuration information can include a domain name replacement list, the forbidden domain name is replaced by the non-forbidden domain name based on the domain name replacement list, and the corresponding relation between the forbidden domain name and the non-forbidden domain name can be preconfigured in the domain name replacement list, so that the accuracy of domain name replacement is ensured, and the success rate of page loading is improved.
In addition, the resource configuration information can also comprise channel configuration information, the channel configuration information can be configured with channel identifiers corresponding to the types of the resources, and the terminal equipment selects a proper resource downloading channel for downloading according to the types of the resources required to be downloaded, so that the success rate and the efficiency of resource downloading are ensured, and further the success rate and the speed of page loading are improved.
In addition, the embodiment of the application also provides a switching mechanism of multiple download channels, when a certain resource is downloaded by adopting a certain resource download channel, the terminal equipment can adjust the resource download channel, the resource is downloaded again by adopting the adjusted resource download channel, and the resource is downloaded by switching different resource download channels, so that the success rate of the resource download is improved, and the success rate of page loading is improved.
All the above optional technical solutions may be combined according to any choice to form an optional embodiment of the present application, which is not described in detail herein.
Fig. 3 is a block diagram of a page loading device according to an embodiment of the present application. The page loading device has the function of realizing the page loading method, and the function can be realized by hardware or by executing corresponding software by the hardware. The device may be the terminal device described above, or may be provided in the terminal device. As shown in fig. 3, the page loading apparatus 300 may include: a request acquisition module 301, a domain name replacement module 302, and a page loading module 303.
The request obtaining module 301 is configured to obtain a page load request triggered by a client, where the page load request carries n resource identifiers and domain names corresponding to the n resource identifiers, the domain name corresponding to the resource identifier is used to indicate a download source of a resource indicated by the corresponding resource identifier, and n is a positive integer.
The domain name replacement module 302 is configured to replace, if a first resource identifier corresponding to the first resource identifier is a forbidden domain name, the forbidden domain name refers to a domain name that is forbidden to acquire resources from the indicated download source, and the non-forbidden domain name refers to a domain name that is allowed to acquire resources from the indicated download source.
The page loading module 303 is configured to obtain resources corresponding to the n resource identifiers respectively based on the page loading request after the domain name is replaced, and load a page according to the obtained resources.
Optionally, the domain name replacement module is configured to: and replacing the domain name corresponding to the first resource identifier with the non-forbidden domain name based on the domain name replacement list. The domain name replacement list comprises at least one forbidden domain name and non-forbidden domain names respectively corresponding to the at least one forbidden domain name.
Optionally, the page loading module includes:
the channel determining submodule is used for determining a resource downloading channel according to channel configuration information, and the channel configuration information is used for indicating the resource downloading channel used for downloading the resource;
the resource downloading sub-module is used for downloading resources respectively corresponding to the n resource identifiers by adopting a resource downloading channel based on the page loading request after the domain name is replaced;
and the page loading sub-module is used for loading the page according to the acquired resources.
Optionally, the channel configuration information includes a current download channel identifier, where the current download channel identifier is used to indicate a resource download channel used by a current time to download the resource;
and the channel determining sub-module is used for determining a resource downloading channel for downloading the resources corresponding to the n resource identifiers respectively according to the current downloading channel identifiers.
Optionally, the channel configuration information includes at least one resource type and a download channel identifier corresponding to the at least one resource type, where the download channel identifier corresponding to each resource type is used to indicate a resource download channel used for downloading the corresponding resource;
a channel determination submodule for:
for a second resource identifier in the n resource identifiers, determining a resource type corresponding to the second resource identifier, wherein the second resource identifier is any one of the n resource identifiers;
determining a download channel identifier corresponding to the resource type corresponding to the second resource identifier from the download channel identifiers respectively corresponding to the at least one resource type;
and determining a resource downloading channel for downloading the resource corresponding to the second resource identifier according to the determined downloading channel identifier.
Optionally, the page loading module may further include:
the channel adjustment sub-module is used for determining an adjusted resource downloading channel if the resource corresponding to the third resource identifier fails to be downloaded by adopting the resource downloading channel for the third resource identifier in the n resource identifiers;
and the resource downloading sub-module is also used for downloading the resource corresponding to the third resource identifier by adopting the adjusted resource downloading channel.
Optionally, the resource download channel includes at least one of: HTTP communication link, TCP communication link, UDP based quinc communication link.
Optionally, the request acquisition module is configured to call an interception system through an API to acquire a page loading request triggered by the client, where the interception system is a system for intercepting the request to acquire resource information.
Optionally, the page loading apparatus 300 further includes:
the configuration receiving module is used for receiving resource configuration information from the server, wherein the resource configuration information comprises a domain name replacement list and/or channel configuration information;
wherein the resource configuration information is determined according to one or more of a geographic location of the terminal device, an operating system of the terminal device, and the client.
In the embodiment of the application, the page loading request triggered by the client is obtained, so that n resource identifiers carried by the page loading request and domain names respectively corresponding to the n resource identifiers are obtained. If a forbidden domain name exists in the n domain names, the forbidden domain name is replaced by a non-forbidden domain name. Where a barred domain name refers to a domain name that prohibits acquisition of resources from an indicated download source, and a non-barred domain name refers to a domain name that allows acquisition of resources from an indicated download source. Therefore, each domain name carried in the page loading request after the domain name is replaced is guaranteed to be a non-forbidden domain name, and when resources are acquired based on the page loading request after the domain name is replaced, the condition that the resources are failed to download due to forbidden domain names is avoided, and the success rate of page loading is improved.
It should be noted that: in the page loading device provided in the above embodiment, only the division of the above functional modules is used for illustration, and in practical application, the above functional allocation may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the page loading device and the page loading method provided in the foregoing embodiments belong to the same concept, and specific implementation processes of the page loading device and the page loading method are detailed in the method embodiments, which are not repeated herein.
Fig. 4 shows a block diagram of a terminal device 400 according to an embodiment of the present application. The terminal device 400 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion picture expert compression standard audio plane 3), an MP4 (Moving Picture Experts Group Audio Layer IV, motion picture expert compression standard audio plane 4) player, a notebook computer, or a desktop computer. Terminal device 400 may also be referred to by other names as user device, portable terminal device, laptop terminal device, desktop terminal device, etc.
In general, the terminal device 400 includes: a processor 401 and a memory 402.
Processor 401 may include one or more processing cores such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing ), FPGA (Field-Programmable Gate Array, field programmable gate array), PLA (Programmable Logic Array ). The processor 401 may also include a main processor, which is a processor for processing data in an awake state, also called a CPU (Central Processing Unit ), and a coprocessor; a coprocessor is a low-power processor for processing data in a standby state. In some embodiments, the processor 401 may integrate a GPU (Graphics Processing Unit, image processor) for rendering and drawing of content required to be displayed by the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence ) processor for processing computing operations related to machine learning.
Memory 402 may include one or more computer-readable storage media, which may be non-transitory. Memory 402 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 402 is used to store a computer program for execution by processor 401 to implement the page loading method provided by the method embodiments in the present application.
In some embodiments, the terminal device 400 may further optionally include: a peripheral interface 403 and at least one peripheral. The processor 401, memory 402, and peripheral interface 403 may be connected by a bus or signal line. The individual peripheral devices may be connected to the peripheral device interface 403 via buses, signal lines or a circuit board. Specifically, the peripheral device includes: at least one of radio frequency circuitry 404, a display screen 405, a camera assembly 406, an audio circuit 407, a positioning assembly 408, and a power supply 409.
It will be appreciated by those skilled in the art that the structure shown in fig. 4 is not limiting of the terminal device 400 and may include more or fewer components than shown, or may combine certain components, or may employ a different arrangement of components.
The present application also provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor of a terminal device, enables the terminal device to perform the page loading method provided by the above embodiments.
Alternatively, the computer-readable storage medium may include: ROM, RAM, SSD (Solid State Drives, solid state disk) or optical disk, etc. The random access memory may include ReRAM (Resistance Random Access Memory, resistive random access memory) and DRAM (Dynamic Random Access Memory ), among others.
The embodiment of the application also provides a computer program product which, when running on the terminal equipment, causes the terminal equipment to execute the page loading method provided by the embodiment.
It should be understood that references herein to "a plurality" are to two or more. In addition, the step numbers described herein are merely exemplary of one possible execution sequence among steps, and in some other embodiments, the steps may be executed out of the order of numbers, such as two differently numbered steps being executed simultaneously, or two differently numbered steps being executed in an order opposite to that shown, which is not limited by the embodiments of the present application.
The foregoing description of the preferred embodiments of the present application is not intended to limit the invention to the particular embodiments of the present application, but to limit the scope of the invention to the particular embodiments of the present application.

Claims (11)

1. A method of page loading, the method comprising:
acquiring a page loading request triggered by a client, wherein the page loading request carries n resource identifiers and domain names respectively corresponding to the n resource identifiers, the domain name corresponding to the resource identifier is used for indicating a downloading source of a resource indicated by the corresponding resource identifier, and n is a positive integer;
If a first resource identifier of which the corresponding domain name is a forbidden domain name exists in the n resource identifiers, replacing the domain name corresponding to the first resource identifier with a non-forbidden domain name, wherein the forbidden domain name is a domain name for forbidding to acquire resources from the indicated download source, and the non-forbidden domain name is a domain name for allowing to acquire resources from the indicated download source;
determining a resource downloading channel according to channel configuration information, wherein the channel configuration information is used for indicating a resource downloading channel used for downloading resources, and the resource downloading channel refers to a communication link used by the resources in a downloading page;
and based on the page loading request after domain name replacement, adopting the resource downloading channel to download resources respectively corresponding to the n resource identifiers, and loading the page according to the acquired resources.
2. The method of claim 1, wherein the replacing the domain name corresponding to the first resource identifier with a non-forbidden domain name comprises:
replacing the domain name corresponding to the first resource identifier with a non-forbidden domain name based on a domain name replacement list;
the domain name replacement list comprises at least one forbidden domain name and non-forbidden domain names respectively corresponding to the at least one forbidden domain name.
3. The method of claim 1, wherein the channel configuration information includes a current download channel identification indicating a resource download channel used by a current time to download a resource;
the determining the resource downloading channel according to the channel configuration information comprises the following steps:
and determining a resource downloading channel for downloading the resources respectively corresponding to the n resource identifiers according to the current downloading channel identifiers.
4. The method of claim 1, wherein the channel configuration information includes at least one resource type, and a download channel identifier corresponding to the at least one resource type, respectively, each of the download channel identifiers corresponding to the at least one resource type being used to indicate a resource download channel used to download the corresponding resource;
the determining the resource downloading channel according to the channel configuration information comprises the following steps:
for a second resource identifier in the n resource identifiers, determining a resource type corresponding to the second resource identifier, wherein the second resource identifier is any one of the n resource identifiers;
determining a download channel identifier corresponding to the resource type corresponding to the second resource identifier from the download channel identifiers respectively corresponding to the at least one resource type;
And determining a resource downloading channel for downloading the resource corresponding to the second resource identifier according to the determined downloading channel identifier.
5. The method of claim 1, wherein after downloading the resources corresponding to the n resource identifiers respectively using the resource downloading channel based on the page load request after the domain name is replaced, further comprising:
for a third resource identifier in the n resource identifiers, if the resource downloading channel is adopted to download the resource corresponding to the third resource identifier fails, determining an adjusted resource downloading channel;
and downloading the resources corresponding to the third resource identifier by adopting the adjusted resource downloading channel.
6. The method of claim 1, wherein the resource download channel comprises at least one of: a hypertext transfer protocol HTTP communication link, a transmission control protocol TCP communication link, a low latency internet transport layer protocol quin communication link based on user datagram protocol UDP.
7. The method of any of claims 1 to 6, wherein the obtaining a client-triggered page load request comprises:
and calling an interception system through an Application Programming Interface (API), wherein the interception system is used for intercepting a request to acquire resource information, and acquiring the page loading request triggered by the client.
8. The method of any one of claims 1 to 6, further comprising:
receiving resource configuration information from a server, wherein the resource configuration information comprises a domain name replacement list and/or channel configuration information;
wherein the resource configuration information is determined according to one or more of a geographical location of the terminal device, an operating system of the terminal device and the client.
9. A page loading apparatus, the apparatus comprising:
the first acquisition module is used for acquiring a page loading request triggered by a client, wherein the page loading request carries n resource identifiers and domain names respectively corresponding to the n resource identifiers, the domain name corresponding to the resource identifier is used for indicating a downloading source of a resource indicated by the corresponding resource identifier, and n is a positive integer;
a replacing module, configured to replace, if a first resource identifier corresponding to a domain name that is forbidden in the n resource identifiers exists, a domain name corresponding to the first resource identifier with a non-forbidden domain name, where the forbidden domain name is a domain name that forbids acquisition of resources from the indicated download source, and the non-forbidden domain name is a domain name that allows acquisition of resources from the indicated download source;
The second acquisition module is used for determining a resource downloading channel according to channel configuration information, wherein the channel configuration information is used for indicating a resource downloading channel used for downloading resources, and the resource downloading channel refers to a communication link used by the resources in a downloading page; and based on the page loading request after domain name replacement, adopting the resource downloading channel to download resources respectively corresponding to the n resource identifiers, and loading the page according to the acquired resources.
10. A terminal device, characterized in that it comprises a processor and a memory, in which a computer program is stored, which computer program is loaded and executed by the processor to implement the page loading method according to any of claims 1 to 8.
11. A non-transitory computer readable storage medium, on which a computer program is stored, characterized in that the computer program, when executed by a processor, implements the page loading method according to any one of claims 1 to 8.
CN202010265258.XA 2020-04-07 2020-04-07 Page loading method, device, terminal and storage medium Active CN111475754B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010265258.XA CN111475754B (en) 2020-04-07 2020-04-07 Page loading method, device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010265258.XA CN111475754B (en) 2020-04-07 2020-04-07 Page loading method, device, terminal and storage medium

Publications (2)

Publication Number Publication Date
CN111475754A CN111475754A (en) 2020-07-31
CN111475754B true CN111475754B (en) 2023-06-20

Family

ID=71749901

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010265258.XA Active CN111475754B (en) 2020-04-07 2020-04-07 Page loading method, device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN111475754B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202760A (en) * 2020-09-28 2021-01-08 厦门美柚股份有限公司 Webpage access method, device, terminal and medium
CN112134968A (en) * 2020-09-29 2020-12-25 平安普惠企业管理有限公司 Domain name access method and device, electronic equipment and storage medium
CN113239301B (en) * 2021-04-22 2023-02-07 维沃移动通信(杭州)有限公司 Page loading request method and device and electronic equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105516261A (en) * 2015-11-26 2016-04-20 深圳市深信服电子科技有限公司 Web page loading control method and load balancer
CN108717435B (en) * 2018-05-16 2023-05-23 腾讯科技(深圳)有限公司 Webpage loading method, information processing method, computer equipment and storage medium
CN110647700A (en) * 2019-08-13 2020-01-03 平安普惠企业管理有限公司 Page resource loading method and device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN111475754A (en) 2020-07-31

Similar Documents

Publication Publication Date Title
CN111475754B (en) Page loading method, device, terminal and storage medium
CN107861816B (en) Resource allocation method and device
EP2919440B1 (en) Advertisement processing method and device
CN104965848B (en) A kind of front end resource loading method and device
CN110990075B (en) Method, device, equipment and storage medium for starting fast application
US20140143647A1 (en) Method for improving browser cache by reducing duplicate stored content
CN109391676B (en) Terminal device control method, terminal device, and computer-readable storage medium
CN111580879A (en) Applet running method and device, electronic equipment and computer storage medium
US11909812B2 (en) Application control method and apparatus, electronic device, and storage medium
US9906626B2 (en) Resource demand-based network page generation
CN111324834B (en) Method, device, electronic equipment and computer readable medium for image-text mixed arrangement
CN112579048A (en) Applet integration method, device, electronic equipment and storage medium
CN112818270A (en) Data cross-domain transfer method and device and computer equipment
US20140215035A1 (en) Distribution of application components among devices
CN112015309B (en) Display switching method and device and mobile terminal
US20140074910A1 (en) Method and system for providing digital contents in a network environment
CN111953718A (en) Page debugging method and device
US10977425B1 (en) Dynamic resource refresh
CN116127219A (en) Method and device for displaying pages in applet and computer equipment
CN103140852A (en) System and method for managing memory resource(s) of a wireless handheld computing device
CN115470432A (en) Page rendering method and device, electronic equipment and computer readable medium
CN111241852A (en) File translation method, device, terminal and storage medium
Oliveira et al. The Mobile Context Framework: providing context to mobile applications
CN115250259B (en) Information interaction method and device and electronic equipment
CN109783329B (en) Application program blank data prompting method and system and terminal equipment

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
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20231007

Address after: 31a, 15 / F, building 30, maple mall, bangrang Road, Brazil, Singapore

Patentee after: Baiguoyuan Technology (Singapore) Co.,Ltd.

Address before: 511402 5-13 / F, West Tower, building C, 274 Xingtai Road, Shiqiao street, Panyu District, Guangzhou City, Guangdong Province

Patentee before: GUANGZHOU BAIGUOYUAN INFORMATION TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right