CN121210791A - Page loading methods, devices, electronic devices, and storage media - Google Patents

Page loading methods, devices, electronic devices, and storage media

Info

Publication number
CN121210791A
CN121210791A CN202511371033.1A CN202511371033A CN121210791A CN 121210791 A CN121210791 A CN 121210791A CN 202511371033 A CN202511371033 A CN 202511371033A CN 121210791 A CN121210791 A CN 121210791A
Authority
CN
China
Prior art keywords
target
page
access request
resource
target resource
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
CN202511371033.1A
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202511371033.1A priority Critical patent/CN121210791A/en
Publication of CN121210791A publication Critical patent/CN121210791A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

本公开涉及一种页面加载方法、装置、电子设备以及存储介质,方法包括:响应于针对目标应用程序的启动操作,通过系统线程向源服务器发送针对目标页面的第一访问请求,且并行启动所述目标应用程序的主线程;所述目标页面为与所述目标应用程序的启动操作关联的网页;接收来自源服务器的与第一访问请求对应的第一目标资源;第一目标资源是基于第一访问请求中是否携带的预设类型数据而确定的;若第一目标资源包括预设类型资源,通过主线程,使用第一目标资源进行页面渲染,得到目标页面并展示。该方式有效缩短了首屏内容的加载耗时,使用户在应用程序启动后能够更快看到首屏核心内容,从而提升用户体验。

This disclosure relates to a page loading method, apparatus, electronic device, and storage medium. The method includes: in response to a startup operation of a target application, sending a first access request for a target page to a source server via a system thread, and simultaneously starting the main thread of the target application; the target page is a webpage associated with the startup operation of the target application; receiving a first target resource corresponding to the first access request from the source server; the first target resource is determined based on whether the first access request carries preset type data; if the first target resource includes preset type resources, rendering the page using the first target resource via the main thread to obtain and display the target page. This method effectively shortens the loading time of the first screen content, allowing users to see the core content of the first screen faster after the application starts, thereby improving the user experience.

Description

Page loading method and device, electronic equipment and storage medium
Technical Field
The disclosure relates to the technical field of internet, and in particular relates to a page loading method, a page loading device, electronic equipment and a storage medium.
Background
With the continuous development of internet technology, accessing web pages by users through application programs on terminal devices has become an important way to acquire information and interact with each other. Especially in large websites (e.g., news portals, e-commerce platforms, video viewing platforms, social platforms, etc.), users often desire to be able to quickly see the core content of the first screen after an application is launched. Therefore, the loading speed of the first screen content of the application program directly influences the use experience, the page stay time and the user satisfaction of the user. Therefore, how to increase the loading speed of the first screen of the application program is a problem to be solved.
Disclosure of Invention
In order to solve the technical problems described above or at least partially solve the technical problems described above, the present disclosure provides a page loading method, a device, an electronic apparatus, and a storage medium.
In a first aspect, the present disclosure provides a page loading method, including:
responding to a starting operation for a target application program, sending a first access request for a target page to a source server through a system thread, and starting a main thread of the target application program in parallel;
Receiving a first target resource corresponding to the first access request from the source server, wherein the first target resource is determined based on whether preset type data are carried in the first access request or not;
And if the first target resource comprises a preset type resource, performing page rendering by using the first target resource through the main thread to obtain and display the target page.
In a second aspect, the present disclosure further provides a page loading apparatus, including:
The system comprises a sending module, a source server and a target application program, wherein the sending module is used for responding to the starting operation of the target application program, sending a first access request for the target page to the source server through a system thread and starting the main thread of the target application program in parallel;
The receiving module is used for receiving a first target resource corresponding to the first access request from the source server, wherein the first target resource is determined based on whether preset type data are carried in the first access request or not;
And the rendering module is used for performing page rendering by using the first target resource through the main thread if the first target resource comprises a preset type resource, so as to obtain and display the target page.
In a third aspect, the present disclosure also provides an electronic device, including:
One or more processors;
a storage means for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the page loading method as described above.
In a fourth aspect, the present disclosure also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements a page loading method as described above.
Compared with the prior art, the technical scheme provided by the embodiment of the disclosure has the following advantages:
According to the technical scheme, a first access request for a target page is sent to a source server through a system thread in response to starting operation for the target application program, and a main thread of the target application program is started in parallel, the target page is a webpage related to the starting operation of the target application program, a first target resource corresponding to the first access request is received from the source server, the first target resource is determined based on whether preset type data are carried in the first access request, if the first target resource comprises the preset type resource, page rendering is conducted through the main thread by using the first target resource, the target page is obtained and displayed, and the essence of the method is that after the starting operation of the target application program is detected, the first access request for the target page and the operation for starting the main thread of the target application program are sent to the source server through the system thread in parallel. Therefore, the main thread can directly perform rendering of the first screen page based on the acquired first target resource after being started, and the resource acquisition is performed by starting the access request for the target page after waiting for the main thread to be started. The method effectively shortens the time consumption for loading the first screen content, so that a user can see the first screen core content faster after the application program is started, and the user experience is improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments of the present disclosure or the solutions in the prior art, the drawings that are required for the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a flowchart of a page loading method provided in an embodiment of the present disclosure;
Fig. 2 is a schematic diagram of an application scenario of a page loading method according to an embodiment of the present disclosure;
FIG. 3 is a block diagram of a page loader according to an embodiment of the present disclosure;
Fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, a further description of aspects of the present disclosure will be provided below. It should be noted that, without conflict, the embodiments of the present disclosure and features in the embodiments may be combined with each other.
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present disclosure, but the present disclosure may be practiced otherwise than as described herein, and it is apparent that the embodiments in the specification are only some, rather than all, of the embodiments of the present disclosure.
Fig. 1 is a flowchart of a page loading method provided in an embodiment of the present disclosure, where the embodiment may be suitable for a case of performing page loading in a client, and the method may be performed by a page loading device, where the device may be implemented in software and/or hardware, and the device may be configured in an electronic device, for example, a terminal, and specifically includes, but is not limited to, a smart phone, a palm top computer, a tablet computer, a wearable device with a display screen, a desktop computer, a notebook computer, an all-in-one machine, a smart home device, and so on.
As shown in fig. 1, the method specifically may include:
s110, responding to the starting operation of the target application program, sending a first access request for a target page to a source server through a system thread, and starting the main thread of the target application program in parallel, wherein the target page is a webpage related to the starting operation of the target application program.
The target application may be, for example, an application that is currently in need of launching, and the disclosure is not limited as to what type of application the target application specifically refers to. Illustratively, the target application may be an audio play class application, a video play class application, a social class application, a shooting beautification class application, a travel navigation class application, a shopping price class application, a utility class application, or a sports health class application, among others.
The start operation for the target application may be, for example, an operation for expressing that the user wishes to open the target application. The start operation for the target application program may be, for example, a selection operation of an icon of the target application program in the desktop of the electronic device.
Selection of icons may be accomplished by direct physical contact by the user (e.g., touch screen operation), indirect physical input devices (e.g., mouse, touch pad), or non-contact input means (e.g., gesture recognition, voice control), among others. If implemented by direct physical contact (e.g., touch screen operation) of a user, indirect physical input devices (e.g., mouse, touch pad) may include, but are not limited to, click operation, slide operation, drag operation, or long press operation. In addition, according to different application scenes and technical implementation conditions, the selection operation can be further expanded to an emerging man-machine interaction method adopting more advanced interaction technologies, such as eyeball tracking, brain-computer interfaces and the like.
The "target page is a web page associated with a start operation of a target application program" may be, for example, a first web page opened by default after the target application program is started. In some scenarios, the target application is an application tailored to access a particular website that is dedicated to accessing and using the services of that particular website. Illustratively, an application is customized for a video viewing website, in which case the target page may be the home page or channel page of the video viewing website. The homepage is the first page displayed when a user accesses a website, usually displays recommended content or user personalized information, and the channel page is a thematic page divided according to content types, themes or user groups and is used for aggregating and displaying video resources of specific categories.
In the present disclosure, an origin server corresponds to a target page. Specifically, when loading the target page, the source server is configured to provide resources required for rendering the target page. It should be noted that, the origin server refers to a server that stores an original version of a network resource (such as a web page, application data, a file, etc.), and serves as an initial source and authority provider of the resource.
The main thread is a thread created by an operating system of the electronic equipment when the target application program is started, is used as a main execution flow of the application program, and is responsible for processing tasks such as user interaction events, page rendering, life cycle and the like. In some programming languages, the main thread appears as a thread that performs the main () method.
The system thread may be, for example, an operating system level thread installed in the electronic device that starts the target application program, and is a thread independent of the main thread of the target application program, and is an external thread that does not belong to the target application program.
The first access request may be, for example, a request sent by a system thread to a server to obtain resources required for rendering the target page.
In some scenarios, the first access request may or may not carry preset type data, and the present application does not limit what type of preset data is specifically. The preset type data may be one or more of data reflecting user preference, user portrait data, data reflecting the condition of a terminal used by a user, user membership grade, user history, and operation record of an application program, for example.
The essence of this step is that after the start operation for the target application is detected, a first access request for the target page is sent to the source server through the system thread, and the main thread for the target application is started, instead of the main thread for the target application being started, the first access request for the target page is sent to the source server through the main thread.
And S120, receiving a first target resource corresponding to the first access request from the source server, wherein the first target resource is determined based on whether the first access request carries preset type data or not.
The first target resource may be, for example, a resource required by the source server to render the target page returned by the first access request.
The essence of this step is that the source server, after receiving the first access request, looks up and returns the resources needed for rendering the target page (i.e. the first target resources) based on the URL (uniform resource locator ) path in the first access request.
The "first target resource is determined based on whether the first access request carries preset type data", for example, if the first access request carries or does not carry preset type data, the content included in the first target resource may be affected, for example, whether the first target resource includes preset type resources is affected.
And S130, if the first target resource comprises a preset type resource, performing page rendering by using the first target resource through the main thread to obtain a target page and displaying the target page.
The application does not limit what kind of resource is specifically the "preset type resource". Illustratively, a "preset type resource" is a resource that matches preset type data carried in the first access request. If the preset type data is one or more of data reflecting user preference, user portrait data, data reflecting the condition of a terminal used by a user, user membership grade, user history, and operation record of an application program. The preset type of resource may be a personalized resource customized for the user.
According to the technical scheme, a first access request for a target page is sent to a source server through a system thread in response to starting operation for the target application program, and a main thread of the target application program is started in parallel, the target page is a webpage related to the starting operation of the target application program, first target resources corresponding to the first access request are received from the source server, the first target resources are determined based on whether preset type data are carried in the first access request, if the first target resources comprise the preset type resources, page rendering is conducted through the main thread by using the first target resources, the target page is obtained and displayed, and the essence of the method is that after the starting operation of the target application program is detected, the first access request for the target page and the operation for starting the main thread of the target application program are sent to the source server through the system thread in parallel. Therefore, the main thread can directly perform rendering of the first screen page based on the acquired first target resource after being started, and the resource acquisition is performed by starting the access request for the target page after waiting for the main thread to be started. The method effectively shortens the time consumption for loading the first screen content, so that a user can see the first screen core content faster after the application program is started, and the user experience is improved.
On the basis of the technical scheme, optionally, the step of responding to the starting operation of the target application program and sending the first access request for the target page to the source server through the system thread can comprise the steps of responding to the starting operation of the target application program and determining user data corresponding to the target page through the system thread, taking the user data as preset type data, generating a first access request through the system thread based on the user data, so that the first access request comprises the user data, and sending the first access request to the source server through the system thread.
The user data may be, for example, data recorded and/or stored during use of the target application by the user to identify access status, user account, user behavior, or session information. This information can be used to quickly restore context, identify user identity, or optimize loading flow for subsequent accesses. In some embodiments, the user data may be Cookie data corresponding to the target application. Cookies are small text data used to store state information at a client, typically written by a server via an HTTP response header, and automatically carried by the client for transmission to the server in subsequent requests. The present disclosure is not limited to parameters specifically included in Cookie data. By way of example, the Cookie data may include at least one of uid (unique identifier of the user), vip (membership level or privilege status of the user), auth (authentication information or token of the user), device (identifier for distinguishing different terminal devices), reduce_id (channel identifier for distinguishing different traffic sources or channels), scale (screen zoom scale), brightness (screen brightness setting), mode (application mode such as daytime mode or nighttime mode), isLowPerformPC (whether low-performance computer), os (operating system type and version), v (client software version) adExt (advertisement extension information), page (current page identification), themeds (theme setting), xcardParam (card parameter), numofRes (resource number), ad (advertisement related parameter).
The purpose of setting the first access request to include the user data is to enable the source server to perform a matching process based on the user data when searching for the corresponding first target resource in response to the first access request. Thus, the first target resource returned by the server may include a resource customized for the current user (hereinafter referred to as a "customized resource"), such as personalized page content, and the like, thereby improving the pertinence of the resource and the user experience.
Further, "generating the first access request based on the user data by the system thread" may include generating the first access request by the system thread based on the user data and the first token such that the first access request includes the first token, the first token being used to trigger the origin server to identify the user data in the first access request, the origin server being used to determine the first target resource based on the user data.
Since the first access request is not sent by the main thread, it is sent by the system thread. This means that the origin server, upon receiving the first access request, cannot identify the user data carried in the first access request by a default mechanism. By setting the first mark in the first access request, the source server can be clearly indicated to identify and analyze the user data, so that the source server can return personalized resources (namely customized resources) based on the user data, and the accuracy of resource matching is improved.
In practice, the user data may be non-null or null. The user data is a non-null value, for example, it may be that at least some of the parameters in the user data have specific values. The user data is null, for example, there may be no specific value of all parameters in the user data. The user data is illustratively Cookie data, which includes parameters uid, vip, auth, device and os. In the first case, devices and os have specific values, but uid, vip and auth have no specific values. In case two, uid, vip, auth, device and os have specific values. In case three, uid, vip, auth, device and os are not specifically valued. In the above case, the case one and the case two belong to the case where the user data is a non-null value. Case three belongs to the case that the user data is a non-null value.
In some scenarios, if the "start operation for the target application" in S110 is the first operation in the terminal in which the target application is installed, each parameter in the user data has no specific value, and the user data is null. If the "start operation for the target application" in S110 is a non-first operation in the terminal for installing the target application, at least some parameters in the user data have specific values, and the user data are non-null values.
Based on this, optionally, in the case that the user data is a non-null value, the first target resource includes a customized resource, and the customized resource is a resource that matches the value of the user data. In the case where the user data is null, the first target resource does not include the customized resource. The customized resource can be, for example, a resource which is screened out according to the specific value of the parameter in the user data and is used for rendering the page, and the resource can be understood as a result of personalized customization of the resource by the user. Such as content modules recommended based on historical browsing behavior of the user, dynamically generated interface layouts based on the user's identity, or style and script resources determined based on user configuration parameters, etc.
On the basis of the technical scheme, optionally, if the first target resource comprises a preset type resource, performing page rendering by using the first target resource through the main thread, wherein the step of performing page rendering by using the first target resource through the main thread comprises the step of performing page rendering by using the first target resource under the condition that the first target resource comprises a customized resource. I.e. the preset type of resource is a customized resource.
Since the customized resources are more targeted to users, pages rendered based on the customized resources can better meet the demands of users. Under the condition that the first target resource comprises the customized resource, the main thread is used for carrying out page rendering by using the first target resource, so that the finally obtained and displayed target page is ensured to be a page meeting the user requirement, and the user experience can be improved.
Further, the method may further include performing page rendering using the first target resource without the main thread if the first target resource does not include the customized resource. Because the first target resource does not include the customized resource, if page rendering is still performed based on the first target resource, the final target page is incomplete or inconsistent with the user demand. And therefore forgo rendering of the page by the main thread using the first target resource that does not include the customized resource.
It should be noted that in some scenarios, it may be set that the source server does not send the first target resource to the terminal in the case where the user data is null, or that the source server sends the first target resource to the terminal, but the first target resource is null.
On the basis of the technical scheme, optionally, the method further comprises the steps of updating user data corresponding to the target page through a main thread under the condition that the first target resource does not comprise customized resources, sending a second access request for the target page to the source server through the main thread, wherein the second access request comprises updated user data corresponding to the target page, receiving a second target resource for the second access request from the source server, and performing page rendering by using the second target resource through the main thread to obtain the target page and display the target page.
The second access request may be, for example, a request sent to the source server through the main thread of the target application to obtain resources required for rendering the target page. The second target resource may be, for example, a resource required by the source server to render the target page returned by the second access request.
The "updating the user data corresponding to the target page by the main thread" may include, for example, sending a network request for acquiring the user data to the source server by the main thread. The network request carries terminal equipment information, and receives and stores user data returned from the source server, wherein the user data is in a non-null state.
The essence of this arrangement is that, in the case where the first target resource does not include a customized resource, after the main thread is started, user data is updated by the main thread, and then the source server is obtained by the main thread from the resources for rendering the target page. Thus, the second target resource comprising the customized resource can be obtained, and further, the finally obtained and displayed target page is ensured to be a page meeting the personalized requirements of the user.
On the basis of the technical scheme, optionally, the method further comprises the steps of sending the first access request to a standby server corresponding to the source server through a system thread under the condition that the source server is in a fault state, receiving a third target resource aiming at the first access request from the standby server, and carrying out page rendering through a main thread by using the third target resource to obtain a target page and displaying the target page.
The standby server can be, for example, standby equipment for ensuring continuous support of the service of web page access, and has the main function of taking over the work of the source server when the source server fails (such as hardware damage, software breakdown, network interruption and the like), and reducing service interruption time.
The third target resource may be, for example, a resource required by the backup server to render the target page returned by the first access request.
It should be noted that in some scenarios, the backup server synchronizes only the universal resource with the source server, does not synchronize the customized resource and/or determines the logic of the customized resource based on the non-null user data, which excludes the customized resource from the third target resource returned by the backup server to the terminal device. In this scenario, since the source server is in a failure state, even if the third target resource does not include the customized resource, page rendering is performed by the main thread using the third target resource, and a target page is obtained and displayed.
In some embodiments, the terminal may be configured to send the first access request to a CDN (Content Delivery Network ) server, which forwards the first access request to the origin server. In the event of a source server failure, the first access request is forwarded by the CDN server to the backup server.
Fig. 2 is a schematic diagram of an application scenario of a page loading method according to an embodiment of the present disclosure. The page loading method provided by the present disclosure is described below with reference to the application scenario in fig. 2.
Referring to fig. 2, if a user performs a start operation on a terminal for a target application, a system thread sends a first access request for a target page to an origin server and starts a main thread of the target application in parallel. The first access request is forwarded to the origin server via the CDN server. The first access request carries user data corresponding to the target page.
In the case where the source server is in a normal operating state (i.e., a non-failure state) and the user data is a non-null value, the source server returns a first target resource comprising the customized resource. The first target resource is forwarded to the terminal via a CDN (Content Delivery Network ) server. After the main thread is started, page rendering is carried out by using a first target resource, a target page is obtained and displayed, and after the selection operation of options or identifiers in the target page by a subsequent user, an access request for a page (namely a second page) associated with the selected options or identifiers is sent to the source server through the main thread.
In the case where the source server is in a normal operating state (i.e., a non-failure state) and the user data is null, the source server returns a first target resource that does not include the customized resource. The first target resource is forwarded to the terminal via the CDN server. And sending a second access request which aims at the target page and comprises the updated user data to the source server through the main thread. The source server returns a second target resource comprising the customized resource. The second target resource is forwarded to the terminal via the CDN server. And carrying out page rendering by using a second target resource through the main thread to obtain a target page and displaying the target page, and after the subsequent user selects an option or an identifier in the target page, sending an access request for a page (namely a second page) associated with the selected option or identifier to the source server through the main thread.
In the event that the source server is in a failure state, the first access request is forwarded to the backup server via the CDN (Content Delivery Network ) server, whether or not the user data is null. The standby server returns a third target resource that does not include the customized resource. The third target resource is forwarded to the terminal via the CDN server. After the main thread is started, page rendering is carried out by using a third target resource, a target page is obtained and displayed, and after the selection operation of the option or the identifier in the target page by a subsequent user, an access request for a page (namely a second page) associated with the selected option or identifier is sent to the source server through the main thread.
It should be noted that, for simplicity of description, the foregoing method embodiments are all described as a series of acts, but it should be understood by those skilled in the art that the present invention is not limited by the order of acts described, as some steps may be performed in other orders or concurrently in accordance with the present invention. Further, those skilled in the art will also appreciate that the embodiments described in the specification are all preferred embodiments, and that the acts and modules referred to are not necessarily required for the present invention.
Fig. 3 is a block diagram of a page loading apparatus according to an embodiment of the present disclosure. The page loading device provided by the embodiment of the disclosure may be configured in the client or may be configured in the server. Referring to fig. 3, the page loading device specifically includes:
A sending module 310, configured to send, by a system thread, a first access request for a target page to a source server in response to a start operation for a target application program, and start a main thread of the target application program in parallel;
a receiving module 320, configured to receive a first target resource corresponding to the first access request from the source server, where the first target resource is determined based on whether preset type data is carried in the first access request;
And the rendering module 330 is configured to, if the first target resource includes a preset type resource, perform, by using the main thread, page rendering using the first target resource, obtain the target page, and display the target page.
Further, the sending module 310 is configured to:
Determining user data corresponding to a target page through a system thread in response to a starting operation for the target application program;
Generating the first access request based on the user data by the system thread by taking the user data as the preset type data so that the first access request comprises the user data;
and sending the first access request to the source server through the system thread.
Further, the sending module 310 is configured to:
The first access request is generated based on the user data and a first mark through the system thread, so that the first access request comprises the first mark, the first mark is used for triggering the source server to identify the user data in the first access request, and the source server is used for determining the first target resource based on the user data.
Further, in the case that the user data is a non-null value, the first target resource comprises a customized resource, and the customized resource is a resource matched with the value of the user data.
Further, the rendering module 330 is configured to:
and under the condition that the first target resource comprises the customized resource, performing page rendering by using the first target resource through the main thread.
Further, the rendering module 330 is configured to:
Updating user data corresponding to the target page through the main thread under the condition that the first target resource does not comprise customized resources;
Sending a second access request aiming at the target page to the source server through the main thread, wherein the second access request comprises updated user data corresponding to the target page;
receiving a second target resource for the second access request from the origin server;
And performing page rendering by using the second target resource through the main thread to obtain and display the target page.
Further, the device also comprises a bottom covering module for:
sending the first access request to a standby server corresponding to the source server through the system thread under the condition that the source server is in a fault state;
receiving a third target resource for the first access request from the standby server, the third target resource not including a customized resource;
and performing page rendering by using the third target resource through the main thread to obtain and display the target page.
The page loading device provided by the embodiment of the present disclosure may execute steps executed by the client or the server in the page loading method provided by the embodiment of the present disclosure, and has the executing steps and beneficial effects, which are not described herein again.
Fig. 4 is a schematic structural diagram of an electronic device in an embodiment of the disclosure. Referring now in particular to fig. 4, a schematic diagram of an electronic device 1000 suitable for use in implementing embodiments of the present disclosure is shown. The electronic device 1000 in the embodiments of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), wearable electronic devices, and the like, and fixed terminals such as digital TVs, desktop computers, smart home devices, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device 1000 may include a processing means (e.g., a central processor, a graphic processor, etc.) 1001 that may perform various suitable actions and processes according to a program stored in a Read Only Memory (ROM) 1002 or a program loaded from a storage means 1008 into a Random Access Memory (RAM) 1003 to implement a page loading method of an embodiment as described in the present disclosure. In the RAM 1003, various programs and information necessary for the operation of the electronic apparatus 1000 are also stored. The processing device 1001, the ROM 1002, and the RAM 1003 are connected to each other by a bus 1004. An input/output (I/O) interface 1005 is also connected to bus 1004.
In general, devices including input devices 1006 such as a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc., output devices 1007 including a Liquid Crystal Display (LCD), speaker, vibrator, etc., storage devices 1008 including, for example, magnetic tape, hard disk, etc., and communication devices 1009 may be connected to the I/O interface 1005. The communication means 1009 may allow the electronic device 1000 to communicate wirelessly or by wire with other devices to exchange information. While fig. 4 shows an electronic device 1000 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flowcharts, thereby implementing the page loading method as described above. In such an embodiment, the computer program may be downloaded and installed from a network via the communication device 1009, or installed from the storage device 1008, or installed from the ROM 1002. The above-described functions defined in the method of the embodiment of the present disclosure are performed when the computer program is executed by the processing device 1001.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of a computer-readable storage medium may include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include an information signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to electrical wiring, fiber optic cable, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with digital information communication (e.g., a communication network) in any form or medium. Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any known or future developed networks.
The computer readable medium may be included in the electronic device or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to:
responding to a starting operation for a target application program, sending a first access request for a target page to a source server through a system thread, and starting a main thread of the target application program in parallel;
Receiving a first target resource corresponding to the first access request from the source server, wherein the first target resource is determined based on whether preset type data are carried in the first access request or not;
And if the first target resource comprises a preset type resource, performing page rendering by using the first target resource through the main thread to obtain and display the target page.
Alternatively, the electronic device may perform other steps described in the above embodiments when the above one or more programs are executed by the electronic device.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. Wherein the names of the units do not constitute a limitation of the units themselves in some cases.
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic that may be used include Field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems-on-a-chip (SOCs), complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, the present disclosure provides an electronic device comprising:
One or more processors;
A memory for storing one or more programs;
When executed by the one or more processors, cause the one or more processors to implement the page loading method as any one of the present disclosure provides.
According to one or more embodiments of the present disclosure, there is provided a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements a page loading method as any of the present disclosure provides.
The disclosed embodiments also provide a computer program product comprising a computer program or instructions which, when executed by a processor, implements a page loading method as described above.
It should be noted that in this document, relational terms such as "first" and "second" and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
The foregoing is merely a specific embodiment of the disclosure to enable one skilled in the art to understand or practice the disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the disclosure. Thus, the present disclosure is not intended to be limited to the embodiments shown and described herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1.一种页面加载方法,其特征在于,包括:1. A page loading method, characterized in that it includes: 响应于针对目标应用程序的启动操作,通过系统线程向源服务器发送针对目标页面的第一访问请求,且并行启动所述目标应用程序的主线程;所述目标页面为与所述目标应用程序的启动操作关联的网页;In response to a launch operation for the target application, a first access request for the target page is sent to the source server via a system thread, and the main thread of the target application is launched in parallel; the target page is a webpage associated with the launch operation of the target application. 接收来自所述源服务器的与所述第一访问请求对应的第一目标资源;所述第一目标资源是基于所述第一访问请求中是否携带的预设类型数据而确定的;Receive a first target resource corresponding to the first access request from the source server; the first target resource is determined based on whether the first access request carries preset type data; 若所述第一目标资源包括预设类型资源,通过所述主线程,使用所述第一目标资源进行页面渲染,得到所述目标页面并展示。If the first target resource includes a preset type of resource, the main thread uses the first target resource to render the page, obtain the target page, and display it. 2.根据权利要求1所述的方法,其特征在于,所述响应于针对目标应用程序的启动操作,通过系统线程向源服务器发送针对目标页面的第一访问请求,包括:2. The method according to claim 1, wherein sending a first access request for the target page to the source server via a system thread in response to a startup operation for the target application includes: 响应于针对目标应用程序的启动操作,通过系统线程确定与所述目标页面对应的用户数据;In response to a launch operation for the target application, the user data corresponding to the target page is determined by a system thread; 将所述用户数据作为所述预设类型数据,通过所述系统线程基于所述用户数据,生成所述第一访问请求,以使所述第一访问请求包括所述用户数据;The user data is used as the preset type of data, and the system thread generates the first access request based on the user data, so that the first access request includes the user data; 通过所述系统线程向所述源服务器发送所述第一访问请求。The system thread sends the first access request to the source server. 3.根据权利要求2所述的方法,其特征在于,所述通过所述系统线程基于所述用户数据,生成所述第一访问请求,包括:3. The method according to claim 2, wherein generating the first access request based on the user data via the system thread includes: 通过所述系统线程,基于所述用户数据以及第一标记,生成所述第一访问请求,以使所述第一访问请求包括所述第一标记,所述第一标记用于触发所述源服务器识别所述第一访问请求中的所述用户数据;所述源服务器用于基于所述用户数据,确定所述第一目标资源。The system thread generates the first access request based on the user data and the first tag, such that the first access request includes the first tag, which is used to trigger the source server to identify the user data in the first access request; the source server is used to determine the first target resource based on the user data. 4.根据权利要求2所述的方法,其特征在于,在所述用户数据为非空值的情况下,所述第一目标资源包括定制化资源;所述定制化资源为与所述用户数据的取值相匹配的资源。4. The method according to claim 2, wherein when the user data is not empty, the first target resource includes a customized resource; the customized resource is a resource that matches the value of the user data. 5.根据权利要求4所述的方法,其特征在于,所述若所述第一目标资源包括预设类型资源,通过所述主线程,使用所述第一目标资源进行页面渲染,包括:5. The method according to claim 4, wherein if the first target resource includes a preset type resource, and page rendering is performed using the first target resource through the main thread, the step of rendering the page using the first target resource includes: 在所述第一目标资源包括所述定制化资源的情况下,通过所述主线程,使用所述第一目标资源进行页面渲染。If the first target resource includes the customized resource, the page is rendered using the first target resource through the main thread. 6.根据权利要求1所述的方法,其特征在于,所述方法还包括:6. The method according to claim 1, characterized in that the method further comprises: 在所述第一目标资源不包括定制化资源的情况下,通过所述主线程,更新所述目标页面对应的用户数据;If the first target resource does not include customized resources, the user data corresponding to the target page is updated through the main thread; 通过所述主线程,向所述源服务器发送针对所述目标页面的第二访问请求;所述第二访问请求包括更新后的与所述目标页面对应的用户数据;The main thread sends a second access request for the target page to the source server; the second access request includes updated user data corresponding to the target page. 接收来自所述源服务器的针对所述第二访问请求的第二目标资源;Receive the second target resource from the source server in response to the second access request; 通过所述主线程,使用所述第二目标资源进行页面渲染,得到所述目标页面并展示。The main thread uses the second target resource to render the page, resulting in the target page, which is then displayed. 7.根据权利要求1所述的方法,其特征在于,所述方法还包括:7. The method according to claim 1, characterized in that the method further comprises: 在所述源服务器处于故障状态的情况下,通过所述系统线程将所述第一访问请求发送至与所述源服务器对应的备用服务器;In the event that the source server is in a faulty state, the first access request is sent to the backup server corresponding to the source server through the system thread; 接收来自所述备用服务器的针对所述第一访问请求的第三目标资源;所述第三目标资源不包括定制化资源;Receive a third target resource from the backup server in response to the first access request; the third target resource does not include customized resources; 通过所述主线程,使用所述第三目标资源进行页面渲染,得到所述目标页面并展示。The main thread uses the third target resource to render the page, resulting in the target page, which is then displayed. 8.一种页面加载装置,其特征在于,包括:8. A page loading device, characterized in that it comprises: 发送模块,用于响应于针对目标应用程序的启动操作,通过系统线程向源服务器发送针对目标页面的第一访问请求,且并行启动所述目标应用程序的主线程;所述目标页面为与所述目标应用程序的启动操作关联的网页;The sending module is used to respond to the launch operation of the target application by sending a first access request for the target page to the source server through a system thread, and simultaneously launching the main thread of the target application; the target page is a webpage associated with the launch operation of the target application. 接收模块,用于接收来自所述源服务器的与所述第一访问请求对应的第一目标资源;所述第一目标资源是基于所述第一访问请求中是否携带的预设类型数据而确定的;A receiving module is configured to receive a first target resource corresponding to the first access request from the source server; the first target resource is determined based on whether the first access request carries preset type data. 渲染模块,用于若所述第一目标资源包括预设类型资源,通过所述主线程,使用所述第一目标资源进行页面渲染,得到所述目标页面并展示。The rendering module is used to render the target page using the first target resource through the main thread if the first target resource includes a preset type of resource, thereby obtaining and displaying the target page. 9.一种电子设备,其特征在于,所述电子设备包括:9. An electronic device, characterized in that the electronic device comprises: 一个或多个处理器;One or more processors; 存储装置,用于存储一个或多个程序;Storage device for storing one or more programs; 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一项所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-7. 10.一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时实现如权利要求1-7中任一项所述的方法。10. A computer-readable storage medium having a computer program stored thereon, characterized in that the program, when executed by a processor, implements the method as described in any one of claims 1-7.
CN202511371033.1A 2025-09-24 2025-09-24 Page loading methods, devices, electronic devices, and storage media Pending CN121210791A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202511371033.1A CN121210791A (en) 2025-09-24 2025-09-24 Page loading methods, devices, electronic devices, and storage media

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202511371033.1A CN121210791A (en) 2025-09-24 2025-09-24 Page loading methods, devices, electronic devices, and storage media

Publications (1)

Publication Number Publication Date
CN121210791A true CN121210791A (en) 2025-12-26

Family

ID=98107296

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202511371033.1A Pending CN121210791A (en) 2025-09-24 2025-09-24 Page loading methods, devices, electronic devices, and storage media

Country Status (1)

Country Link
CN (1) CN121210791A (en)

Similar Documents

Publication Publication Date Title
US10462231B2 (en) Continuing an application session on a different device
US8527862B2 (en) Methods for making ajax web applications bookmarkable and crawlable and devices thereof
CN111488185B (en) Page data processing method, device, electronic equipment and readable medium
WO2020199751A1 (en) Method and apparatus for loading page picture, and electronic device
CN111400625B (en) Page processing method and device, electronic equipment and computer readable storage medium
US8539101B2 (en) Systems, methods, and computer programs for detecting carrier-controlled requests for a web site
CN106598972A (en) Information display method and device as well as intelligent terminal
US12164588B2 (en) Enhanced navigation in a web browser while avoiding redirects
TW201903604A (en) System and method for application navigation
CN112269959A (en) Control method, apparatus, readable medium and electronic device for displaying content
CN106202578A (en) A kind of browser local information synchronization processing method and device
CN111783010B (en) Webpage blank page monitoring method, device, terminal and storage medium
CN111723309B (en) Method and device for web page searching
CN112183045A (en) Online document processing method and device and electronic equipment
CN112307393A (en) Information issuing method and device and electronic equipment
CN110798701A (en) Video update push method and terminal
CN113835571A (en) A terminal device, information display method and storage medium
JP2025521266A (en) Media content processing method, device and electronic device
CN110619101B (en) Method and apparatus for processing information
TW201525740A (en) Method and device for displaying web page and computer-readable storage medium
CN111258800A (en) Page processing method and device and electronic equipment
CN114048404A (en) Display method, apparatus and electronic device
CN113360704A (en) Voice playing method and device and electronic equipment
CN116595047B (en) Rights management method, rights management device, electronic device and computer-readable storage medium
CN121210791A (en) Page loading methods, devices, electronic devices, and storage media

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