Page loading method and device, equipment and storage medium

By passing the information of the page to be loaded from the service process to the application process in the Android system, and prioritizing the execution of related tasks according to the relationship between the task and the page, the problem of slow loading speed when the application is started is solved, and more efficient page loading is achieved .

CN119440645APending Publication Date: 2025-02-14BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310947009.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-28
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

In Android system, when the application starts, the first page you enter cannot be predicted, resulting in mismatch of tasks selected in advance, resulting in waste of resources and reduced loading speed.

Method used

The service process sends information about the page to be loaded to the application process. The application process parses the information to obtain data, and prioritizes the tasks associated with the page to be loaded based on the relationship between the task and the page.

Benefits of technology

It improves the speed of loading pages when the application starts, avoids unnecessary resource preemption, and ensures the efficiency of page loading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119440645A_ABST
    Figure CN119440645A_ABST
Patent Text Reader

Abstract

The invention discloses a page loading method and device, equipment and a storage medium, and the method comprises the steps that after a to-be-loaded page of an application is started, a service process can obtain related information of the to-be-loaded page, and sends the related information to an application process; the application process can obtain the information of the to-be-loaded page for analysis so as to obtain the data of the to-be-loaded page. In the embodiment of the invention, a plurality of tasks can be included in the application use process, the association relationship between each task and each page of the application can be pre-configured, and the task associated with the to-be-loaded page is acquired according to the association relationship and the data of the to-be-loaded page. And preferentially executing a task associated with the to-be-loaded page to load the to-be-loaded page. Through the method, the information of the to-be-loaded page can be obtained in advance in the life cycle callback stage of the application process, so that the task associated with the to-be-loaded page can be executed preferentially, and the page loading speed during application starting is increased.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for loading a page. Background Art

[0002] When launching an application on the Android system, in order to improve the speed of launching the application, some initialization tasks and preloading tasks related to the page after launching are usually placed in advance in the lifecycle callback Application onCreate of the application process loading, so as to give priority to the selected tasks during the application startup process, increase the speed of loading the page when the application starts, and reduce the time spent on executing the application startup tasks.

[0003] In the current common implementation in the industry, since it is impossible to know the first page entered after the application is started in the lifecycle callback of the application process loading, when selecting tasks in advance, tasks related to pages with higher user penetration (such as the homepage of the application) are usually selected. In this case, only when the application enters the page related to the selected task when it starts can the speed of loading the page after the application starts be effectively improved. When the application enters a page unrelated to the task selected in advance after it starts, the task selected in advance will additionally occupy computing resources such as the system CPU and memory, affecting the execution of tasks related to the startup page, which in turn causes a decrease in the speed of loading the startup page. Summary of the invention

[0004] In view of this, the present application provides a method, apparatus, device and storage medium for loading a page, so as to improve the speed of loading a page during application startup.

[0005] To achieve the above objectives, the technical solutions provided by this application are as follows:

[0006] In a first aspect of the present application, a method for loading a page is provided, the method being applied to an application process, the method comprising:

[0007] In response to the operation of starting the application, receiving information of a page to be loaded of the application sent by the service process;

[0008] Parsing the information of the page to be loaded, and obtaining the data of the page to be loaded;

[0009] Based on the association relationship between each task and each page included in the application and the data of the page to be loaded, acquiring the task associated with the page to be loaded;

[0010] Execute tasks associated with the page to be loaded, and load the page to be loaded.

[0011] In a possible implementation, the receiving the information of the to-be-loaded page of the application sent by the service process includes:

[0012] Receiving application loading information and information of the page to be loaded sent by the service process;

[0013] The application loading information and the information of the page to be loaded are stored in a message queue.

[0014] In a possible implementation, parsing the information of the page to be loaded during the life cycle callback phase of the application process includes:

[0015] When processing the application loading information based on the life cycle callback of the application process, obtaining the information of the page to be loaded from the message queue;

[0016] The information of the page to be loaded is parsed based on the life cycle callback of the page loading.

[0017] In a possible implementation, the method further includes:

[0018] Adding tasks that are not related to the page to be loaded among the tasks to a task queue;

[0019] A preset number of tasks are obtained from the task queue in batches and executed.

[0020] In a possible implementation, the method further includes:

[0021] In response to a user's operation of switching pages, based on the association relationship between each task and each page, acquiring the task associated with the switched page from the task queue;

[0022] The task associated with the switched page is executed.

[0023] In a second aspect of the present application, a method for loading a page is provided, the method being applied to a terminal, the terminal including an application process and a service process, the method comprising:

[0024] In response to the operation of starting the application, the service process sends information of the to-be-loaded page of the application to the application process;

[0025] The application process parses the information of the page to be loaded, and obtains the data of the page to be loaded;

[0026] The application process acquires the task associated with the page to be loaded based on the association relationship between each task and each page included in the application and the data of the page to be loaded;

[0027] The application process executes a task associated with the page to be loaded, and loads the page to be loaded.

[0028] In a third aspect of the present application, a device for loading a page is provided, the device being applied to an application process, the device comprising:

[0029] A receiving module, configured to receive information of a page to be loaded of the application sent by a service process in response to an operation of starting the application;

[0030] A parsing module, used for parsing the information of the page to be loaded and obtaining the data of the page to be loaded;

[0031] An acquisition module, configured to acquire a task associated with the page to be loaded based on the association relationship between each task and each page included in the application and the data of the page to be loaded;

[0032] The execution module is used to execute the task associated with the page to be loaded and load the page to be loaded.

[0033] In a possible implementation, the receiving module is specifically configured to receive the application loading information and the information of the page to be loaded sent by the service process; and store the application loading information and the information of the page to be loaded in a message queue.

[0034] In a possible implementation, the parsing module is specifically used to obtain the information of the page to be loaded from the message queue when processing the application loading information based on the lifecycle callback of the application process; and parse the information of the page to be loaded based on the lifecycle callback of page loading.

[0035] In a possible implementation, the device further includes: an adding module, configured to add tasks that are not related to the page to be loaded among the tasks to a task queue;

[0036] The execution module is further used to obtain a preset number of tasks from the task queue in batches and execute them.

[0037] In a possible implementation, the acquisition module is further configured to, in response to a user's operation of switching pages, acquire, from the task queue, tasks associated with the switched page based on associations between the tasks and the pages;

[0038] The execution module is further used to execute the task associated with the switched page.

[0039] In a fourth aspect of the present application, an electronic device is provided, the device comprising: a processor and a memory;

[0040] The memory is used to store instructions or computer programs;

[0041] The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method described in the first aspect above.

[0042] In a fifth aspect of the present application, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium. When the instructions are executed on a device, the device executes the method described in the first aspect above.

[0043] In a sixth aspect of the present application, a computer program product is provided, wherein the computer program product comprises a computer program / instructions, and when the computer program / instructions are executed by a processor, the method described in the first aspect is implemented.

[0044] It can be seen that this application has the following beneficial effects:

[0045] In the above implementation of the present application, when the user starts the page to be loaded of the application, the service process can obtain the relevant information of the page to be loaded, and then send the information of the page to be loaded to the application process. The application process can obtain the information of the page to be loaded and parse it to obtain the data of the page to be loaded. The application will include multiple tasks during use. The association relationship between each task and each page of the application can be pre-configured, and then the task associated with the page to be loaded is obtained based on the association relationship between the task and the page and the data of the page to be loaded obtained by parsing. The tasks associated with the page to be loaded are executed first to load the page to be loaded of the application. Through the page loading method provided by the present application, the information of the page to be loaded can be obtained in advance during the life cycle callback stage of the application process, so that the tasks associated with the page to be loaded can be executed first, thereby improving the speed of loading the page when the application starts. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0047] Figure 1 A flowchart of a method for loading a page provided in an embodiment of the present application;

[0048] Figure 2 A schematic diagram of an application startup process provided in an embodiment of the present application;

[0049] Figure 3A schematic diagram of communication between a service process and an application process provided in an embodiment of the present application;

[0050] Figure 4 A schematic diagram of a page loading task processing provided by an embodiment of the present application;

[0051] Figure 5 A schematic diagram of another method for processing a page loading task provided in an embodiment of the present application;

[0052] Figure 6 A flowchart of another method for loading a page provided in an embodiment of the present application;

[0053] Figure 7 A schematic diagram of a device for loading a page provided in an embodiment of the present application;

[0054] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0055] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0056] Currently, in the lifecycle callback of application process loading, it is not possible to know the first page entered after the application is started. Therefore, when selecting tasks in advance, tasks related to pages with higher user penetration (such as the homepage of the application) are usually selected. In this case, only when the application enters the page related to the selected task when it starts can the speed of loading the page after the application starts be effectively improved. When the application enters a page unrelated to the task selected in advance after it starts, the task selected in advance will additionally occupy computing resources such as the system CPU and memory, affecting the execution of tasks related to the startup page, which in turn causes a decrease in the speed of loading the startup page.

[0057] Based on this, an embodiment of the present application provides a method for page loading to improve the speed of page loading when the application starts. In specific implementation, when the user starts the page to be loaded of the application, the service process can obtain the relevant information of the page to be loaded, and then send the information of the page to be loaded to the application process. The application process can obtain the information of the page to be loaded and parse it to obtain the data of the page to be loaded. The application will include multiple tasks during use, and the association relationship between each task and each page of the application can be pre-configured. Then, based on the association relationship between the task and the page and the data of the page to be loaded obtained by parsing, the task associated with the page to be loaded is obtained. Prioritize the execution of tasks associated with the page to be loaded to load the page to be loaded of the application. Through the page loading method provided by the present application, the information of the page to be loaded can be obtained in advance during the life cycle callback stage of the application process, so that the tasks associated with the page to be loaded can be executed preferentially, thereby improving the speed of page loading when the application starts.

[0058] In order to facilitate the understanding of the technical solution provided by the embodiments of the present application, a detailed introduction will be given below with reference to the accompanying drawings.

[0059] See also Figure 1 , Figure 1 A flowchart of a method for loading a page provided in an embodiment of the present application.

[0060] The method may be executed by an application process, where the application process represents an application (Application, app) process corresponding to when a user starts an application in an Android system.

[0061] The method may include the following steps:

[0062] S101: In response to an operation of starting an application, receiving information of a page to be loaded of the application sent by a service process.

[0063] When the user starts the application, the service process of the Android system can obtain the page to be loaded by the application. For example, the page to be loaded can be the home page when the application is opened, or it can be the page displayed when the user receives a message sent by the application and clicks on the message.

[0064] In specific implementation, the application process can receive the information of the page to be loaded sent by the Activity Manager Service that manages the loading of the application page. Among them, the Activity Manager Service can be referred to as AMS, which is a service created by the service process system_server of the Android system, and is mainly responsible for managing the life cycle, process, service, etc. of the Activity in the Android system. In this application, Activity can correspond to the loading of the page.

[0065] See also Figure 2 As shown, it is a schematic diagram of an application startup process provided by an embodiment of the present application. When the Android system is running, when the first process Init process in the user space is started, a Zygote process will be created. The Zygote process can create a service process system_server and an application process through the fork function. The system service AMS included in the service process system_server can be used to manage the application loading page, that is, AMS can obtain the first page information to be loaded when the application starts.

[0066] After AMS obtains the information of the page to be loaded, it can send the information of the page to be loaded to the application process. In one possible implementation, the AMS of the service process can send the application loading information and the information of the page to be loaded to the application process, wherein the application loading information is information related to the application startup loading. Optionally, AMS can send the application loading information and the information of the page to be loaded (i.e., activity loading information) to the application thread object ApplicationThread in the application process through the interface attachApplication (i.e., function attachApplication()) and the interface realStartActivityLocked (i.e., function realStartActivityLocked()). The application thread object ApplicationThread can obtain the application loading information and the information of the page to be loaded through the interface bindApplication and the interface scheduleTransaction, and store them in the message queue. The communication process between the service process and the application process can be seen in Figure 3 , which is a schematic diagram of communication between a service process and an application process provided in an embodiment of the present application.

[0067] S102: Parse the information of the page to be loaded and obtain the data of the page to be loaded.

[0068] Each application process corresponds to a life cycle, which refers to the entire process from the creation to the extinction of the application process. Among them, the foreground process is the most important process in the entire life cycle, mainly referring to the process that can be displayed at the forefront of the screen and interact with the user, including the callback method that is executing the life cycle, onCreat(), onStart() or onResume() method. When the application is started, in the application process life cycle callback phase ApplicationonCreate, when processing the application loading information, since the information of the page to be loaded is also stored in the message queue, the application process can read the information of the page to be loaded from the message queue in advance, and then parse the information of the page to be loaded through the page loading life cycle callback Activity onCreate to obtain the data of the page to be loaded.

[0069] In a possible implementation, the information in the message queue can be processed by the Handler in the application process in a loop. The Handler is mainly used for asynchronous message processing: when a message is sent, it first enters a message queue, and the function that sends the message returns immediately. The other part can take out the messages one by one from the message queue, and then process the taken out messages, that is, sending and receiving messages are not processed synchronously.

[0070] The above process of processing the application loading information and the page to be loaded information can be found in Figure 3 . When the Handler reads the stored information from the message queue, it will call handleMessage in a loop to perform processing. When the application loading information is obtained, the Handler can trigger the application loading information to the Application's life cycle callbacks attachBaseContext and onCreate through the interface handleBindApplication. In this process, the initialization task of the application startup can be performed. In this process, the information of the page to be loaded stored in the message queue can be actively obtained, and then the information of the page to be loaded can be triggered to the Activity's life cycle callback onCreate through the interface handleLaunchActivity to realize the actual loading process of the page to be loaded.

[0071] In one possible implementation, the corresponding message queue can be obtained from the main process Looper of the application process. It should be noted that when the Android API level is less than 23, the main thread Looper does not provide an interface for directly obtaining the message queue, and it is necessary to use Java reflection to obtain it. Among them, the API level is an integer value that uniquely identifies the framework API version provided by the Android platform. The Android platform provides a framework API that applications can use to interact with the underlying Android system.

[0072] In one possible implementation, a plurality of different information may be stored in the message queue, and the information of the page to be loaded is obtained by traversing the message queue. When Android API <= 27, the information of the page to be loaded can correspond to the class object ActivityClientRecord. When Android API> 27, the information of the page to be loaded can correspond to the class object ClientTransaction, and the actual information of the page to be loaded is cached in the list ClientTransactionItem, where the first object element LaunchActivityItem in the list ClientTransactionItem contains the information related to the page to be loaded. Finally, the Intent data in ActivityClientRecord or LaunchActivityItem can be obtained through Java reflection to obtain the information of the page to be loaded, thereby parsing the data of the page to be loaded.

[0073] S103: Based on the association relationship between each task and each page included in the application and the data of the page to be loaded, the task associated with the page to be loaded is obtained.

[0074] When starting an application, it is necessary to execute various tasks included in the application. In the embodiment of the present application, since the application process obtains the data of the page to be loaded in advance, in order to increase the speed of loading the page to be loaded, the tasks associated with the page to be loaded can be executed first, and the tasks unrelated to the page to be loaded can be postponed.

[0075] In specific implementation, when developers are writing the code engineering of the application, they can pre-configure the association between each page included in the application and each task to be executed, that is, mark which tasks are associated with each page when it is loaded. For example, the page name or identifier can be associated with the task identifier. Based on this, after parsing and obtaining the data of the page to be loaded, the application process can obtain the task associated with the page to be loaded based on the association between each task and each page, and the page name or identifier included in the data of the page to be loaded.

[0076] S104: Execute tasks associated with the page to be loaded, and load the page to be loaded.

[0077] When a task associated with the page to be loaded is obtained, the task is executed to load the page to be loaded. After the application process obtains the information of the page to be loaded in advance through the service process, the task associated with the page to be loaded can be executed first by using the association relationship between the marked task and the page, thereby improving the speed of loading the page when the application starts.

[0078] In one possible implementation, since each task of the application needs to be executed, when obtaining the tasks associated with the page to be loaded, the tasks unrelated to the page to be loaded can be added to the task queue. After executing the tasks associated with the page to be loaded, a preset number of tasks can be obtained from the task queue in batches and executed. The number of tasks obtained each time can be the same or different, so as to realize batch processing of tasks. Thereby, the speed of loading the first page is not affected, and the unexecuted tasks can be processed in batches, avoiding the execution of too many tasks at one time, occupying computer resources such as memory, and causing the use of the first page to be jammed. The following is an explanation in conjunction with a specific application scenario.

[0079] See also Figure 4 As shown, it is a schematic diagram of processing a page loading task provided by an embodiment of the present application.

[0080] In this application scenario, the tasks included in the application startup process are Task A1, Task A2, Task A3, Task B1, Task B2, Task B3, Task C1, Task C2, Task C3, etc. During the application process loading process, when processing the application loading information, the information of the page to be loaded can be obtained, that is, the page A loading information. Then, according to the association between the pre-marked tasks and the pages, the tasks associated with page A can be obtained as Task Ax, that is, Task A1, Task A2, Task A3, so that Task A1, Task A2, Task A3 can be executed first to realize the loading of page A. At this time, tasks Bx and Cx that are not associated with page A can also be added to the task queue, that is, Figure 4 The unassociated queue shown includes tasks B1, B2, B3, C1, C2, C3, etc. After page A is loaded, a certain number of tasks can be obtained from the task queue in batches for processing. For example, two tasks can be obtained each time for execution. The first time, tasks C1 and C2 are obtained from the unassociated queue for execution. After a period of time, tasks B1 and C3 are continued to be obtained from the unassociated queue for execution. After a period of time, tasks B2 and B3 are continued to be obtained from the unassociated queue for execution, and so on, until all tasks in the unassociated queue are executed.

[0081] In one possible implementation, when processing unexecuted tasks in batches, if the user switches pages, there may be tasks associated with the switched pages that are still unexecuted in the task queue. In order to improve the page loading speed when switching pages, in response to the user's operation of switching pages, tasks associated with the switched page can be obtained from the task queue based on the association relationship between the pre-marked tasks and the pages, so that tasks associated with the switched page are executed first to improve the loading speed when switching pages.

[0082] See also Figure 5 As shown, Figure 5 A schematic diagram of another method for processing page loading tasks provided for the implementation of this application.

[0083] When processing tasks C1 and C2 in batches, the user switches from page A to page B. To increase the loading speed of page B, tasks associated with page B are obtained from the task queue according to the association between each task and each page, namely, task B1, task B2, and task B3, so that tasks associated with page B can be executed first, increasing the loading speed of page B. After loading page B, unexecuted tasks in the unassociated queue are processed in batches.

[0084] By using the page loading method provided by the present application, when the application is started to load the first page, the information of the page to be loaded can be obtained in advance during the life cycle callback phase of the application process, so that the tasks associated with the page to be loaded can be executed first, thereby improving the page loading speed when the application is started. When the user switches the page loading, the tasks associated with the switched page can also be executed first, thereby improving the page loading speed.

[0085] Based on the above method embodiment, the present application embodiment also provides a method for loading a page. Figure 6 , Figure 6 A flowchart of another method for loading a page provided in an embodiment of the present application.

[0086] The method may be applied to a terminal, and the terminal may include an application process and a service process. The method may include:

[0087] S601: In response to the operation of starting the application, the service process sends information of the application's to-be-loaded page to the application process;

[0088] S602: The application process parses the information of the page to be loaded, and obtains the data of the page to be loaded;

[0089] S603: The application process acquires the task associated with the page to be loaded based on the association relationship between each task and each page included in the application and the data of the page to be loaded;

[0090] S604: The application process executes the tasks associated with the page to be loaded and loads the page to be loaded. Through the above page loading method, when the application is started to load the first page, the application process can obtain the information of the page to be loaded from the service process in advance during the life cycle callback phase, so that the tasks associated with the page to be loaded can be executed first, thereby improving the speed of loading pages when the application is started.

[0091] Based on the above method embodiment, the present application embodiment also provides a device for loading a page. Figure 7 , Figure 7 A schematic diagram of a device for loading a page provided in an embodiment of the present application.

[0092] The device 700 may be applied to an application process, and the device 700 may include:

[0093] The receiving module 701 is used for receiving information of a page to be loaded of the application sent by the service process in response to the operation of starting the application;

[0094] The parsing module 702 is used to parse the information of the page to be loaded and obtain the data of the page to be loaded;

[0095] The acquisition module 703 is used to acquire the task associated with the page to be loaded based on the association relationship between each task and each page included in the application and the data of the page to be loaded;

[0096] The execution module 704 is used to execute the task associated with the page to be loaded, and load the page to be loaded.

[0097] In a possible implementation, the receiving module 701 is specifically configured to receive the application loading information and the information of the page to be loaded sent by the service process; and store the application loading information and the information of the page to be loaded in a message queue.

[0098] In a possible implementation, the parsing module 702 is specifically used to obtain the information of the page to be loaded from the message queue when processing the application loading information based on the lifecycle callback of the application process; and parse the information of the page to be loaded based on the lifecycle callback of page loading.

[0099] In a possible implementation, the device further includes: an adding module, configured to add tasks that are not related to the page to be loaded among the tasks to a task queue;

[0100] The execution module 704 is further configured to obtain a preset number of tasks from the task queue in batches and execute them.

[0101] In a possible implementation, the acquisition module 703 is further configured to, in response to a user's operation of switching pages, acquire, from the task queue, tasks associated with the switched page based on associations between the tasks and the pages;

[0102] The execution module 704 is further configured to execute the task associated with the switched page.

[0103] The beneficial effects of the device for loading pages provided in the embodiment of the present application can be found in the above method embodiment and will not be described in detail here.

[0104] It should be noted that the specific implementation of each unit in this embodiment can refer to the relevant description in the above method embodiment. The division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation. The functional units in the embodiment of the present application can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. For example, in the above embodiment, the processing unit and the sending unit can be the same unit or different units. The above integrated units can be implemented in the form of hardware or in the form of software functional units.

[0105] See also Figure 8 , which shows a schematic diagram of the structure of an electronic device 800 suitable for implementing the embodiment of the present application. The terminal device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.

[0106] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0107] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0108] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 809, or installed from the storage device 808, or installed from the ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present application are executed.

[0109] The electronic device provided in the embodiment of the present application and the method provided in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be referred to the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.

[0110] An embodiment of the present application provides a computer storage medium on which a computer program is stored. When the program is executed by a processor, the method provided by the above embodiment is implemented.

[0111] It should be noted that the computer-readable medium mentioned above in the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0112] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (Hyper Text Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0113] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0114] The computer-readable medium carries one or more programs, and when the one or more programs are executed by the electronic device, the electronic device can execute the method.

[0115] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0116] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0117] The units involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the unit / module does not, in some cases, constitute a limitation on the unit itself.

[0118] 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 components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0119] In the context of the present application, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0120] It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments, and the same or similar parts between the various embodiments can be referred to each other. For the system or device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.

[0121] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0122] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0123] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0124] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for loading a page, characterized in that: The method is applied to an application process, and the method comprises: In response to the operation of starting the application, receiving information of a page to be loaded of the application sent by the service process; Parsing the information of the page to be loaded, and obtaining the data of the page to be loaded; Based on the association relationship between each task and each page included in the application and the data of the page to be loaded, acquiring the task associated with the page to be loaded; Execute tasks associated with the page to be loaded, and load the page to be loaded.

2. The method according to claim 1, characterized in that The receiving service process sends information about the page to be loaded of the application, including: Receiving application loading information and information of the page to be loaded sent by the service process; The application loading information and the information of the page to be loaded are stored in a message queue.

3. The method according to claim 2, characterized in that The parsing of the information of the page to be loaded includes: When processing the application loading information based on the life cycle callback of the application process, obtaining the information of the page to be loaded from the message queue; The information of the page to be loaded is parsed based on the life cycle callback of the page loading.

4. The method according to claim 1, characterized in that The method further comprises: Adding tasks that are not related to the page to be loaded among the tasks to a task queue; A preset number of tasks are obtained from the task queue in batches and executed.

5. The method according to claim 4, characterized in that The method further comprises: In response to a user's operation of switching pages, based on the association relationship between each task and each page, acquiring the task associated with the switched page from the task queue; The task associated with the switched page is executed.

6. A method for loading a page, characterized in that: The method is applied to a terminal, the terminal includes an application process and a service process, and the method includes: In response to the operation of starting the application, the service process sends information of the to-be-loaded page of the application to the application process; The application process parses the information of the page to be loaded, and obtains the data of the page to be loaded; The application process acquires the task associated with the page to be loaded based on the association relationship between each task and each page included in the application and the data of the page to be loaded; The application process executes a task associated with the page to be loaded, and loads the page to be loaded.

7. A device for loading a page, characterized in that: The device is applied to an application process, and the device includes: A receiving module, configured to receive information of a page to be loaded of the application sent by a service process in response to an operation of starting the application; A parsing module, used for parsing the information of the page to be loaded and obtaining the data of the page to be loaded; An acquisition module, configured to acquire a task associated with the page to be loaded based on the association relationship between each task and each page included in the application and the data of the page to be loaded; The execution module is used to execute the task associated with the page to be loaded and load the page to be loaded.

8. An electronic device, characterized in that: The device comprises: a processor and a memory; The memory is used to store instructions or computer programs; The processor is used to execute the instructions or computer programs in the memory so that the electronic device executes the method of any one of claims 1 to 5 or claim 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores instructions, and when the instructions are executed on a device, the device executes the method according to any one of claims 1 to 5 or claim 6.