CN115390954A - Page display method, device and equipment of application program - Google Patents

Page display method, device and equipment of application program Download PDF

Info

Publication number
CN115390954A
CN115390954A CN202110564615.7A CN202110564615A CN115390954A CN 115390954 A CN115390954 A CN 115390954A CN 202110564615 A CN202110564615 A CN 202110564615A CN 115390954 A CN115390954 A CN 115390954A
Authority
CN
China
Prior art keywords
components
target page
component
page
frame
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
CN202110564615.7A
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 Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network 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 Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to CN202110564615.7A priority Critical patent/CN115390954A/en
Publication of CN115390954A publication Critical patent/CN115390954A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/485Task life-cycle, e.g. stopping, restarting, resuming execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Abstract

When the first frame of a target page of the application program is triggered to be displayed, the initialization method of a basic component and the GUIs of all the components are loaded, the calling module in the electronic equipment related to the page is triggered to be started, and then the initialization method of a service component is loaded after the initialization method of the basic component and the GUIs of all the components are loaded and the calling module in the electronic equipment related to the page is started. Therefore, the method and the device realize smooth and quick first frame display of the target page, optimize the first frame display duration of the target page, ensure the first frame display performance of the target page, and meet the user appeal for quickly realizing the first frame display of the target page.

Description

Page display method, device and equipment of application program
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, and a device for displaying a page of an application.
Background
One page of an Application (APP) usually requires loading of multiple components. The lifecycle of the components is in one-to-one correspondence with the lifecycle of the pages implemented by the view controller (ViewController). Currently, the loading of a component consumes many Central Processing Unit (CPU) resources. Meanwhile, modules such as a camera and/or a player associated with the page need to be started, and much CPU resources also need to be consumed. Therefore, mutual competition of CPU resources is easily caused, the performance of the first frame display of the page is affected, the duration of the first frame display of the page is longer along with the increase of the components, and the user appeal for quickly realizing the first frame display of the page cannot be met.
Disclosure of Invention
In order to solve the technical problem or at least partially solve the technical problem, the present disclosure provides a page display method, apparatus and device for an application.
In a first aspect, the present disclosure provides a page display method for an application program, including:
when the first frame display of a target page of an application program is triggered, loading an initialization method of a basic component in the target page and a graphical user interface of all components in the target page, wherein all the components consist of the basic component and a business component in the target page, the basic component is used for triggering the first frame display of the target page, and the business component is used for realizing the basic function and the expansion function of the target page;
triggering a calling module associated with a target page to start in the initialization method of the basic component and the loading process of the graphical user interfaces of all the components;
after the initialization method of the basic component and the graphical user interfaces of all the components are loaded and the calling module is started, the initialization method of the business component is loaded;
and after the initialization method of the service component is loaded, executing the operation of displaying the first frame of the target page based on the loaded initialization methods and the graphical user interfaces of all the components.
By the method provided by the first aspect, when the first frame display of the target page of the application program is triggered, the initialization method of the basic component and the GUIs of all the components are loaded and the calling module in the electronic device associated with the page is triggered to start, and then the initialization method of the business component is loaded after the initialization method of the basic component and the GUIs of all the components are loaded and the calling module in the electronic device associated with the page is started. Therefore, the calling module can occupy CPU resources to be started smoothly in the process of loading the initialization method of the basic component and the GUI of all the components, and can preempt the CPU resources to be started, the initialization method of the service component can occupy CPU resources for loading later, ensures that the two processes can be executed in sequence, avoids the mutual competition of the CPU resources, and cannot cause the deterioration of the first frame display of the target page no matter how the initialization method of the service component changes. Therefore, the method and the device realize smooth and quick first frame display of the target page, optimize the first frame display duration of the target page, ensure the first frame display performance of the target page, and meet the user appeal for quickly realizing the first frame display of the target page.
In a possible design, after the initialization method of the business component is loaded, based on the initialization methods and the graphical user interfaces of all loaded components, the operation of displaying the first frame of the target page is executed, which includes:
after the initialization method of the business component is loaded, rendering all the components based on the loaded initialization methods and graphical user interfaces of all the components; and after all the components are rendered, executing the operation of displaying the first frame of the target page.
In one possible design, during the initialization method of the basic component and the loading process of the graphical user interfaces of all the components, triggering the start of the calling module associated with the target page includes:
in the initialization method of the basic component and the loading process of the graphical user interfaces of all the components, sending a starting instruction to the calling module, wherein the starting instruction is used for indicating the calling module to start;
after the initialization method of the basic component and the graphical user interfaces of all the components are loaded and the calling module is started, the initialization method for loading the business component comprises the following steps:
receiving a first frame callback instruction from an operating system of the electronic equipment, wherein the first frame callback instruction is sent to the operating system of the electronic equipment after a calling module is started in response to a starting instruction, and the first frame callback instruction is used for indicating that the calling module is started; and after the initialization method of the basic component and the graphical user interfaces of all the components are loaded, responding to a first frame callback instruction, and loading the initialization method of the service component.
In one possible design, the calling module is a camera in the electronic device, and the target page is used for realizing the shooting function of the application program by using the camera.
In one possible design, the calling module is a player in the electronic device, and the target page is used for implementing a playing function of the application program by using the player.
In one possible design, the method further includes: and when the non-first-frame display of the target page is triggered, executing the operation of the non-first-frame display of the target page based on all the rendered components.
In a second aspect, the present disclosure provides a page display apparatus for an application, including:
the loading module is used for loading an initialization method of a basic component in a target page and a graphical user interface of all components in the target page when the first frame display of the target page of an application program is triggered, wherein all the components consist of the basic component and business components in the target page, the basic component is used for triggering the first frame display of the target page, and the business components are used for realizing the basic function and the expansion function of the target page;
the triggering module is used for triggering the starting of the calling module associated with the target page in the process of initializing the basic component and loading the graphical user interfaces of all the components;
the loading module is also used for loading the initialization method of the business component after the initialization method of the basic component and the graphical user interfaces of all the components are loaded and the calling module is started;
and the display module is used for executing the operation of displaying the first frame of the target page based on the initialization methods and the graphical user interfaces of all the loaded components after the initialization method of the service component is loaded.
In one possible design, the display module is specifically configured to render all the components based on the loaded initialization methods and graphical user interfaces of all the components after the initialization method of the service component is loaded; and after all the components are rendered, executing the operation of displaying the first frame of the target page.
In one possible design, the trigger module is specifically configured to send a start instruction to the call module in the initialization method of the basic component and the loading process of the graphical user interfaces of all the components, where the start instruction is used to instruct the call module to start;
the loading module is specifically used for receiving a first frame callback instruction from an operating system of the electronic equipment, the first frame callback instruction is sent to the operating system of the electronic equipment after the calling module is started in response to the starting instruction, and the first frame callback instruction is used for indicating that the calling module is started; and after the initialization method of the basic component and the graphical user interfaces of all the components are loaded, responding to a first frame callback instruction, and loading the initialization method of the service component.
In one possible design, the calling module is a camera in the electronic device, and the target page is used for realizing the shooting function of the application program by using the camera.
In one possible design, the calling module is a player in the electronic device, and the target page is used for implementing a playing function of the application program by using the player.
In a possible design, the display module is further configured to, when triggering the non-first frame display of the target page, perform an operation of the non-first frame display of the target page based on all the rendered components.
The advantageous effects of the page display apparatus for an application program provided in the second aspect and the possible designs of the second aspect may refer to the advantageous effects brought by the possible embodiments of the first aspect and the first aspect, and are not described herein again.
In a third aspect, the present disclosure provides an electronic device, comprising: a memory and a processor; the memory is used for storing program instructions; the processor is configured to invoke the program instructions in the memory to cause the electronic device to perform the page display method of the application program in the first aspect and any one of the possible designs of the first aspect.
In a fourth aspect, the present disclosure provides a computer storage medium including computer instructions, which, when run on an electronic device, cause the electronic device to perform the method for displaying pages of an application program in the first aspect and any one of the possible designs of the first aspect.
In a fifth aspect, the present disclosure provides a computer program product for causing a computer to perform the method for displaying pages of an application program in any one of the possible designs of the first aspect and the first aspect when the computer program product runs on the computer.
In a sixth aspect, the present disclosure provides a chip system for application to an electronic device comprising a memory, a display screen, and a sensor; the chip system includes: a processor; when the processor executes the computer instructions stored in the memory, the electronic device performs the page display method of the application program in the first aspect and any one of the possible designs of the first aspect.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present disclosure, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a block diagram of a portion of a software architecture of an application provided by an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of a page display method of an application according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a page display device of an application program according to an embodiment of the present disclosure.
Detailed Description
In order that the above objects, features and advantages of the present disclosure may be more clearly understood, aspects of the present disclosure will be further described below. It should be noted that the embodiments and features of the embodiments of the present disclosure may be combined with each other without conflict.
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 in other ways than those described herein; it is to be understood that the embodiments disclosed in the specification are only a few embodiments of the present disclosure, and not all embodiments.
The present disclosure provides a page display method, apparatus, device, computer storage medium, and computer program product for an Application program, which are applied to an electronic device or an Application program (APP), a web page, and a public account in the electronic device, and can divide all components in a page of the Application program into a basic component and a business component, where the basic component is used to trigger the display of a first frame of the page, and the business component is used to implement a basic function and an extended function of the page. When the first frame of the page is triggered to be displayed, the initialization method of the basic component, the Graphical User Interface (GUI) of all the components and the calling module in the electronic equipment associated with the page are loaded firstly, and then the initialization method of the business component is loaded after the initialization method of the basic component and the GUI of all the components are loaded and the calling module in the electronic equipment associated with the page is started. Therefore, the calling module associated with the page can be started preferentially, even if the service component executes complex service logic when realizing the function, the starting of the calling module associated with the page cannot be influenced, the mutual competition of CPU resources is avoided, the first frame display of the page can be executed smoothly and quickly, and meanwhile, the deterioration of the first frame display of the page cannot be caused even if the service component changes the service logic of the function. Therefore, the duration of the first frame display of one page of the application program is optimized, the performance of the first frame display of one page of the application program is guaranteed, and the user appeal of quickly realizing the first frame display of one page of the application program is met.
The first frame of display of a page referred to in this disclosure may be understood as the first time the application displays the page. The process of displaying the first frame of a page may generally include: loading the initialization method and GUI of all components in the page, rendering all components, and displaying the page in the first frame. The method for initializing the component is used for realizing the business logic of the component, the GUI of the component is used for realizing the view of the component, the method for initializing the component is consumed by loading the component, and the GUI loading the component is not consumed by CPU resources.
Also, the amount of computation of the initialization method of the business component is typically greater than the amount of computation of the initialization method of the base component. Therefore, loading the initialization method for the business component consumes (may also be referred to as occupying) more CPU resources than loading the initialization method for the base component.
The non-first frame display of a page related to the present disclosure may be understood as that an application program does not display the page for the first time, for example, after the application program displays the page, the application program jumps to the page from other pages, and the non-first frame display of the page may be implemented. The process of non-first frame display of a page may generally include: the non-first frame displays the page without the loading and rendering of all components.
The specific implementation modes of the calling module and the page are not limited in the present disclosure.
When the calling module is a camera in the electronic device, the page may be a shooting page for implementing a shooting function of the application program by using the camera.
When the calling module is a player in the electronic device, the page may be a playing page, and is used for implementing a playing function of the application program by using the player.
When the calling module comprises a camera and a player in the electronic equipment, the page can be a page which is integrally set for shooting and playing, and is used for realizing the shooting function of the application program by adopting the camera and realizing the playing function of the application program by adopting the player.
The electronic device may be a tablet computer, a mobile phone, a wearable device, an in-vehicle device, an Augmented Reality (AR)/Virtual Reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a Personal Digital Assistant (PDA), a smart television, a smart screen, a high definition television, a 4K television, a smart speaker, a smart projector, and the like.
Next, an application related to the present disclosure will be described with reference to fig. 1.
Referring to fig. 1, fig. 1 is a block diagram of a partial software architecture of an application according to an embodiment of the present disclosure. As shown in FIG. 1, part of the software architecture of the application is used to implement the lifecycle of all components in one page of the application. The partial software architecture of the application may include: view controller (ViewController), component manager (componentmanager), and module component (featurecommand).
A view controller (ViewController) for implementing the lifecycle of a page of an application. Among them, the view controller (ViewController) may include: the method includes an initialization method (init), a view loading method (viewDidLoad), a first frame callback method (firstFrameDidRender), a view rendering preparation method (viewWillAppier) and a view rendering completion method (viewDidAppear), and the foregoing methods may be sequentially invoked.
And a component manager (componentmanager) for traversing a plurality of module components (featurecomoponent) corresponding to all the components in one page of the calling application. Among them, the component manager (componentmanager) may include: initializing a component method (LoadComponent), loading a basic component method (LoadComponentOfphase: beforeFirstRefnder), loading a full view method (LoadComponentView), completing a first frame callback task method (finshFirstReferenditask), preparing a component rendering method (prepareforWillAppear), and completing a component rendering method (prepareforDidApper), and the aforementioned methods may be called in sequence.
A module component (featurecponent) for implementing the lifecycle of all components in one page of an application. Wherein, each module component (featurecompont) may include: an initialization method (init), a load basic component method (BeforeFirstReferender), a load view method (LoadComponentView), a load business component method (Eager & Lazy), a prepare View rendering method (ComponentWillAppear), and a finish View rendering method (ComponentDidApper), and the foregoing methods may be sequentially invoked.
When the first frame display of one page of the application program is triggered, an initialization method (init) in a view controller (ViewController) can call an initialization component method (LoadComponent) in a component manager (componentmanager), and the initialization component method (LoadComponent) in the component manager (componentmanager) can call the initialization method (init) in a module component (featureComponent) corresponding to all components in the page in a traversing manner.
Thus, initialization of the page and all components in the page is achieved.
After initialization, the view load method (viewDidLoad) in the view controller (ViewController) may first call a load base component method (LoadComponentOfphase: beforefirstsender), a load base component method (loadComponentOfphase: beforeFirstRender) in a component manager (ComponentManger) may call a load base component method (componentDidMount: beforeFirstRender) in a module component (FeatureComponent) corresponding to all components in the page.
Thus, the loading of the initialization method of the basic components in the page is realized.
After the loading of the initialization method of the basic component is completed, a view loading method (viewDidLoad) in a view controller (ViewController) can recall a load all-view method (LoadComponentView) in a component manager (ComponentManger), and the load all-view method (LoadComponentView) in the component manager (ComponentManger) can call a load view method (LoadComponentView) in a module component (FeatureComponent) corresponding to all components in the page in a traversing manner.
Thus, loading of the GUI for all components in the page is achieved.
It should be noted that the loading process of the initialization method of the basic component in the page and the loading process of the GUI of all components may be executed in different orders, and the two processes may be executed simultaneously or sequentially.
During the initialization method of the basic components in the page and the loading process of the GUIs of all the components, the application may trigger the calling module associated with the page to start.
After the initialization method of the base component and the GUI loading of all components are completed and the calling module associated with the page is started, the first frame callback method (firstframedid render) in the view controller (ViewController) may call the method (finshfirstframecallback task) in the component manager (componentmanager). The method (finshFirstRetnderTask) for completing the first frame callback task in the component manager (ComponentManger) can call the loading service component method (componentDidMount: eager & Lazy) in the module component (FeatureComponent) corresponding to all the components in the page in a traversal way.
Therefore, the loading of the initialization method of the business components in the page is realized.
After the initialization method of the service component is loaded, a view rendering preparation method (viewwillapplicator) in a view controller (ViewController) may call a preparation component rendering method (prepareforwwillapplicator) in a component manager (componentmanager). After the method of completing the first frame callback task in the component manager (componentmanager) sends a notification 1 that the data is ready to the ready component rendering method (prepareforwall applicator) in the component manager (componentmanager), the ready component rendering method (prepareforwall applicator) in the component manager (componentmanager) may traverse and call the ready view rendering method (componentwillapplicator) in the module component (featureconsistent) corresponding to all components in the page.
Therefore, the view rendering of all the components in the page is realized.
After the view rendering of all components is completed, a view rendering completion method (viewdidappper) in a view controller (ViewController) may call a completion component rendering method (preparefordappper) in a component manager (componentmanager). After the prepare component rendering method (prepareforwallapplearer) in the component manager (componentmanager) sends a notification 2 that the data is ready to the complete component rendering method (prepareforddidappearr) in the component manager (componentmanager), the complete component rendering method (preparefordappearr) in the component manager (componentmanager) may traverse and call the complete view rendering method (componentdapper) in the module component (FeatureComponent) corresponding to all components in the page.
Therefore, the first frame of the page can be displayed based on the GUI and the initialization method of all the components.
Therefore, the life cycle of the component is updated based on the partial software architecture of the application program, and the first frame display of one page of the application program is realized.
In addition, the application program and the operating system of the electronic device can transmit data to each other. The present disclosure does not limit the type of operating system of the electronic device. For example, an Android system, a Linux system, a Windows system, an iOS system, etc.
Based on the foregoing description, the present disclosure will take the application program in fig. 1 as an example, and in conjunction with the accompanying drawings and application scenarios, set forth in detail the image processing method provided by the present disclosure.
Referring to fig. 2, fig. 2 is a flowchart illustrating a page display method of an application according to an embodiment of the present disclosure. As shown in fig. 2, the page display method of the application provided by the present disclosure may include:
s101, when the first frame of a target page of an application program is triggered to be displayed, loading an initialization method of basic components in the target page and graphical user interfaces of all components in the target page.
In this disclosure, the target page may be a page of the application. The specific implementation manner of the target page may refer to the description of one page of the application program, which is not described herein again.
And, all components in the target page may be composed of a base component and business components in the target page, i.e., all components may be divided into a base component and business components. The basic component is used for triggering the first frame display of the target page, and the business component is used for realizing the basic function and the extended function of the target page.
Since the CPU of one component typically consumes a Graphics Processing Unit (GPU) without consuming CPU resources, the loading of the initialization method of the business component consumes more CPU resources than the loading of the initialization method of the base component. Therefore, when the first frame of the page is triggered to be displayed, the application program can load the initialization method of the basic component and GPIs of all the components. Thus, the consumption of CPU resources is reduced and the user is enabled to watch GPI of all components in the target page first.
The triggering mode of the first frame display of the target page is not limited by the disclosure.
In some embodiments, the operating system of the electronic device may send a trigger instruction to an application program. And the triggering instruction is used for indicating that the first frame display of the target page of the application program is triggered. The trigger instruction can be represented by means of identification, parameter transmission in the method, state change and the like. Thus, upon receiving a trigger instruction, the application program can load the initialization method of the base component and the GUI of all components.
S102, in the initialization method of the basic assembly and the loading process of the graphical user interfaces of all the assemblies, triggering a calling module associated with a target page to start.
Because the initialization method of the basic component consumes very few CPU resources, and the loading of the GPUs of all the components does not consume the CPU resources. Therefore, the calling module can smoothly occupy the CPU resource to realize starting at the moment, and the phenomenon of mutual competition of the CPU resource can not occur.
Therefore, in the initialization method of the basic component and the loading process of the GUI of all the components, the application program can trigger the calling module to start, so that the calling module can be started smoothly.
The calling module can be arranged in the electronic equipment, and is associated with the target page, namely, the calling module is started to realize corresponding functions when the first frame of the target page is displayed. The specific implementation manner of the calling module may refer to the description of the calling module of the page relationship, which is not described herein again.
S103, after the initialization method of the basic component and the graphical user interfaces of all the components are loaded and the calling module is started, the initialization method of the business component is loaded.
After the initialization method of the basic component and the GUI loading of all the components are completed and the calling module is known to be started, the application program can load the initialization method of the business component. Therefore, the starting of the calling module and the loading of the initialization method of the service component can use the CPU resources in sequence, and the mutual competition of the CPU resources is avoided.
And S104, after the initialization method of the business component is loaded, executing the operation of displaying the first frame of the target page based on the loaded initialization methods and graphical user interfaces of all the components.
After the initialization method of the business component is loaded, the application program can execute the operation of the first frame display of the target page based on the loaded initialization methods and the loaded GUI of all the components. Thus, the first frame display of the target page is realized.
According to the page display method of the application program, when the first frame display of the target page of the application program is triggered, the initialization method of the basic component and the GUIs of all the components are loaded, the calling module in the electronic equipment related to the page is triggered to start, and then the initialization method of the business component is loaded after the initialization method of the basic component and the GUIs of all the components are loaded and the calling module in the electronic equipment related to the page is started. Therefore, the calling module can occupy CPU resources to be started smoothly in the process of loading the initialization method of the basic component and the GUI of all the components, the calling module can be started by preempting the CPU resources, the initialization method of the service component can occupy the CPU resources to be loaded later, the two processes can be sequentially executed, mutual competition of the CPU resources is avoided, and deterioration of first frame display of a target page cannot be caused no matter how the initialization method of the service component changes. Therefore, the first frame display of the target page is smooth and quick, the first frame display duration of the target page is optimized, the first frame display performance of the target page is guaranteed, and the user appeal for quickly realizing the first frame display of the target page is met.
Based on the description of the above embodiments, in some embodiments, after the initialization method of the business component is loaded, the application program may render all the components based on the loaded initialization methods of all the components and the graphical user interface. Thus, after all components are rendered, the application may perform the first frame display of the target page.
Correspondingly, in fig. 1, the initiation of the calling module takes a certain time, and after the user performs operations for entering into the target page for a plurality of times, the view rendering preparation method (viewwillapplicator) in the view controller (ViewController) may be executed in preference to the first frame callback method (firstFrameDidRender) in the view controller (ViewController). Namely, the execution order of the view rendering preparation method (viewwillapplearer) and the first frame callback method (firstFrameDidRender) in the view controller (ViewController) is uncertain.
There is a data dependency due to a load business component method (componentDidMount: eager & Lazy) and a prepare view rendering method (componentWillAppeak) in a module component (FeatureComponent).
Thus, the finish first frame callback task method (finshFirstRetnderTask) in the component manager (ComponentManger) may determine that the data is ready after the initialization method loading of the service component is completed. Thus, the complete first frame callback task method (finshFirstRetnderTask) in the component manager (ComponentManger) can send notification 1 that data of the prepare view rendering method (componentWillAppier) in the module component (FeatureComponent) corresponding to all components in the target page is prepared to the prepare component rendering method (prepareforWillAppier) in the component manager (ComponentManger).
After receiving the notification 1, the preparation component rendering method (prepareforgewillapplicator) in the component manager (componentmanager) may traverse the preparation view rendering method (componentwillapplicator) in the module component (featurecomp) corresponding to all the components in the call target page, so as to smoothly implement the process of rendering all the components based on the initialization method and the graphical user interface of all the loaded components.
There is a data dependency due to the prepare view rendering method (componentwillapplearer) and the complete view rendering method (componentdidappearer) in the module component (featurec).
Thus, the prepare component rendering method (prepareforwall applicator) in the component manager (componentmanager) can determine that the data is armed after all component renderings are complete. Thus, the prepare component rendering method (prepareforwallapplearer) in the component manager (componentmanager) can send notification 2 that the data is ready to the complete component rendering method (preparefordida) in the component manager (componentmanager).
After receiving the notification 2, a completion component rendering method (prepareforddidappper) in the component manager (componentmanager) may traverse a completion view rendering method (componentdidappper) in a module component (FeatureComponent) corresponding to all components in the calling target page, so as to smoothly implement a process of executing the first frame display of the target page.
Based on the above description of the embodiments, in some embodiments, during the initialization method of the basic component and the loading of the graphical user interface of all components, the application may send a start instruction to the calling module. The starting instruction is used for indicating the calling module to start. The start instruction can be represented by means of identification, parameter transmission in the method, state change and the like.
The calling module is started after receiving the starting instruction, and after the starting, the calling module can send a first frame callback instruction to an operating system of the electronic equipment. The first frame callback instruction is used for indicating that the calling module is started. The first frame callback instruction can be represented by adopting modes such as identification, transmission parameters in a method, state change and the like.
Thus, the operating system of the electronic device sends a first frame callback instruction to the application program. After the initialization method of the basic component and the graphical user interfaces of all the components are loaded, and the first frame callback instruction is received, the initialization method of the service component can be loaded by the application program.
Correspondingly, in fig. 1, a first frame callback method (firstFrameDidRender) in the view controller (ViewController) may receive a first frame callback instruction from an operating system of the electronic device. Upon receiving the head frame callback instruction, the head frame callback method (firstframedidender) in the view controller (ViewController) may invoke the finish head frame callback task method (finshfirstreferttask) in the component manager (componentmanager). Therefore, the method (finshFirstRetrandTask) for completing the first frame callback task in the component manager (ComponentManger) can call the loaded business component method (componentDidMount: eager & Lazy) in the module component (FeatureComponent) corresponding to all the components in the page in a traversing way, so as to smoothly realize the loading process of the initialization method of the business component in the target page.
In summary, the calling module can be started to use the CPU resource first, and the initialization method of the service component can be loaded to use the CPU resource later, so that the calling module and the service component can use the CPU resource sequentially, thereby avoiding the mutual competition of the CPU resource.
Based on the above description of the embodiments, when the non-first frame display of the target page is triggered, the initialization method and the graphical user interface of all the components are rendered. Therefore, the application program can perform the operation of the non-first frame display of the target page based on the rendered all components without performing the process of loading the initialization method and GUI of all components and the process of rendering all components. Thus, after the target first frame is displayed, the life cycle of the component is consistent with that of the target page.
Correspondingly, in fig. 1, the view load method (viewDidLoad), the first frame callback method (firstFrameDidRender), and the view rendering preparation method (viewwillapplearer) in the view controller (ViewController) may not perform an operation of calling a method. Thus, the view rendering completion method (viewdidappper) in the view controller (ViewController) may call the prepare component rendering method (prepareforwwillapplear) in the component manager (componentmanager). The prepare component rendering method (prepareforgewilapplearer) in the component manager (componentmanager) may traverse the process of calling the prepare view rendering method (componentwillapplearer) in the module component (featurecomoponent) corresponding to all the components in the page so as to smoothly implement the non-first frame display of the target page.
Illustratively, the present disclosure provides a page display apparatus of an application.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a page display device of an application according to an embodiment of the present disclosure. The page display device of the application program of the present disclosure may be disposed in an electronic device, and may implement the operation of the page display method of the application program in the embodiments of fig. 1 to 2, corresponding to the application program in the electronic device, and the electronic device is disposed with a calling module.
As shown in fig. 3, the page display apparatus 100 of the application provided by the present disclosure may include: a loading module 101, a triggering module 102 and a display module 103.
The loading module 101 is configured to load an initialization method of a basic component in a target page and a graphical user interface of all components in the target page when a first frame display of the target page of an application is triggered, where all the components are composed of the basic component and a service component in the target page, the basic component is used to trigger the first frame display of the target page, and the service component is used to implement a basic function and an extension function of the target page;
the triggering module 102 is used for triggering the starting of the calling module associated with the target page in the process of initializing the basic component and loading the graphical user interfaces of all the components;
the loading module 101 is further configured to load the initialization method of the service component after the initialization method of the basic component and the graphical user interfaces of all the components are loaded and the calling module is started;
and the display module 103 is configured to, after the initialization method of the service component is loaded, execute an operation of displaying a first frame of the target page based on the initialization methods and the graphical user interfaces of all loaded components.
In some embodiments, the display module 103 is specifically configured to render all the components based on the loaded initialization methods and graphical user interfaces of all the components after the initialization method of the service component is loaded; and after all the components are rendered, executing the operation of displaying the first frame of the target page.
In some embodiments, the triggering module 102 is specifically configured to send a starting instruction to the calling module in the initialization method of the basic component and the loading process of the graphical user interfaces of all the components, where the starting instruction is used to instruct the calling module to start;
the loading module 101 is specifically configured to receive a first frame callback instruction from an operating system of the electronic device, where the first frame callback instruction is sent to the operating system of the electronic device after the calling module is started in response to the start instruction, and the first frame callback instruction is used to indicate that the calling module is started; and after the initialization method of the basic component and the graphical user interfaces of all the components are loaded, responding to a first frame callback instruction, and loading the initialization method of the service component.
In some embodiments, the calling module is a camera in the electronic device, and the target page is used for implementing a shooting function of the application program by using the camera.
In some embodiments, the calling module is a player in the electronic device, and the target page is used for implementing a playing function of the application program by using the player.
In some embodiments, the display module 103 is further configured to, when triggering the non-top frame display of the target page, perform an operation of the non-top frame display of the target page based on all the rendered components.
The page display device of the application program provided by the present disclosure may implement the above method embodiments, and specific implementation principles and technical effects thereof may refer to the above method embodiments, which are not described herein again.
Illustratively, the present disclosure provides an electronic device comprising: one or more processors; a memory; and one or more computer programs; wherein the one or more computer programs are stored in the memory; the one or more processors, when executing the one or more computer programs, cause the electronic device to implement the page display method of the application program of the foregoing embodiment.
Exemplarily, the present disclosure provides a chip system applied to an electronic device including a display area, a memory, and a sensor; the chip system includes: a processor; when the processor executes the page display method of the application program in the previous embodiment.
Illustratively, the present disclosure provides a computer-readable storage medium on which a computer program is stored, the computer program, when executed by a processor, causes an electronic device to implement the page display method of the application program of the foregoing embodiments.
Illustratively, the present disclosure provides a computer program product which, when run on a computer, causes the computer to execute the page display method of the application program of the previous embodiment.
In the above-described embodiments, all or part of the functions may be implemented by software, hardware, or a combination of software and hardware. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the disclosure are wholly or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a magnetic tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a Solid State Disk (SSD)), among others.
It is noted that, in this document, relational terms such as "first" and "second," and the like, may be 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. Also, 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 a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
The foregoing are merely exemplary embodiments of the present disclosure, which enable those skilled in the art to understand or practice the present 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 herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for displaying a page of an application program, the method comprising:
when the first frame display of a target page of an application program is triggered, loading an initialization method of a basic component in the target page and graphical user interfaces of all components in the target page, wherein all the components are composed of the basic component and business components in the target page, the basic component is used for triggering the first frame display of the target page, and the business components are used for realizing the basic function and the expansion function of the target page;
triggering a calling module associated with the target page to start in the initialization method of the basic component and the loading process of the graphical user interfaces of all the components;
after the initialization method of the basic component and the graphical user interfaces of all the components are loaded and the calling module is started, the initialization method of the business component is loaded;
and after the initialization method of the service component is loaded, executing the operation of displaying the first frame of the target page based on the loaded initialization methods of all the components and the graphical user interface.
2. The method according to claim 1, wherein after the initialization method of the business component is loaded, based on the loaded initialization methods of all the components and the graphical user interface, performing an operation of displaying a first frame of the target page, including:
after the initialization method of the business component is loaded, rendering all the components based on the loaded initialization methods and graphical user interfaces of all the components;
and after all the components are rendered, executing the operation of displaying the first frame of the target page.
3. The method according to claim 1 or 2,
the triggering of the starting of the calling module associated with the target page in the initialization method of the basic component and the loading process of the graphical user interfaces of all the components comprises the following steps:
sending a starting instruction to the calling module in the initialization method of the basic component and the loading process of the graphical user interfaces of all the components, wherein the starting instruction is used for indicating the calling module to start;
the initialization method for loading the service component after the initialization method for the basic component and the graphical user interfaces of all the components are loaded and the calling module is started comprises the following steps:
receiving a first frame callback instruction from an operating system of the electronic equipment, wherein the first frame callback instruction is sent to the operating system of the electronic equipment by the calling module after responding to the starting instruction, and the first frame callback instruction is used for indicating that the calling module is started;
and after the initialization method of the basic component and the loading of the graphical user interfaces of all the components are finished, responding to the first frame callback instruction, and loading the initialization method of the service component.
4. The method according to any one of claims 1 to 3, wherein the calling module is a camera in an electronic device, and the target page is used for realizing a shooting function of the application program by using the camera.
5. The method according to any one of claims 1 to 4, wherein the calling module is a player in an electronic device, and the target page is used for implementing a playing function of the application program by using the player.
6. The method according to any one of claims 1-5, further comprising:
and when the non-first-frame display of the target page is triggered, executing the non-first-frame display operation of the target page based on the rendered all components.
7. An apparatus for displaying a page of an application, the apparatus comprising:
the system comprises a loading module, a display module and a display module, wherein the loading module is used for loading an initialization method of a basic component in a target page and a graphical user interface of all components in the target page when the first frame display of the target page of an application program is triggered, the all components are composed of the basic component and a business component in the target page, the basic component is used for triggering the first frame display of the target page, and the business component is used for realizing the basic function and the expansion function of the target page;
the triggering module is used for triggering the starting of the calling module related to the target page in the process of initializing the basic component and loading the graphical user interfaces of all the components;
the loading module is further configured to load the initialization method of the business component after the initialization method of the basic component and the graphical user interfaces of all the components are loaded and the calling module is started;
and the display module is used for executing the operation of displaying the first frame of the target page based on the loaded initialization methods and graphical user interfaces of all the components after the initialization method of the service component is loaded.
8. An electronic device, comprising: one or more processors; a memory; and one or more computer programs; wherein the one or more computer programs are stored in the memory; characterized in that the one or more processors, when executing the one or more computer programs, cause the electronic device to implement a page display method of an application program as claimed in any one of claims 1 to 6.
9. A computer storage medium comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the page display method of an application program according to any one of claims 1-6.
10. A computer program product, characterized in that it causes a computer to carry out a page display method of an application program according to any one of claims 1 to 6, when said computer program product is run on said computer.
CN202110564615.7A 2021-05-24 2021-05-24 Page display method, device and equipment of application program Pending CN115390954A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110564615.7A CN115390954A (en) 2021-05-24 2021-05-24 Page display method, device and equipment of application program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110564615.7A CN115390954A (en) 2021-05-24 2021-05-24 Page display method, device and equipment of application program

Publications (1)

Publication Number Publication Date
CN115390954A true CN115390954A (en) 2022-11-25

Family

ID=84114585

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110564615.7A Pending CN115390954A (en) 2021-05-24 2021-05-24 Page display method, device and equipment of application program

Country Status (1)

Country Link
CN (1) CN115390954A (en)

Similar Documents

Publication Publication Date Title
WO2019174473A1 (en) User interface rendering method and apparatus, and terminal
CN107251004B (en) Backward compatibility by using spoofed clocks and fine-grained frequency control
CN110300328B (en) Video playing control method and device and readable storage medium
US8978051B2 (en) Method and apparatus for displaying application image
US20160328241A1 (en) Data processing method for multiple operating systems and terminal equipment
US20160004542A1 (en) Booting method for computer system with multiple central processing units
CN112947969B (en) Page off-screen rendering method, device, equipment and readable medium
CN109213607B (en) Multithreading rendering method and device
WO2015078211A1 (en) Method and device for browser to decode picture, and client
CN111737019A (en) Method and device for scheduling video memory resources and computer storage medium
WO2015161809A1 (en) Picture splitting method and apparatus, and picture loading method and apparatus
CN115421787A (en) Instruction execution method, apparatus, device, system, program product, and medium
US20240078072A1 (en) Method and apparatus for displaying message box, terminal device and non-transitory computer-readable storage medium
TWI521431B (en) Full screen processing in multi-application environments
CN114168301A (en) Thread scheduling method, processor and electronic device
CN115390954A (en) Page display method, device and equipment of application program
CN113825022B (en) Method and device for detecting play control state, storage medium and electronic equipment
CN112612633B (en) Inter-process communication method, inter-process communication device, storage medium and terminal
CN111949150B (en) Method and device for controlling peripheral switching, storage medium and electronic equipment
CN110442342B (en) Interface generation method and device, storage medium and computer equipment
TWI556167B (en) System and method for multiple native software applications user interface composition
US20100299682A1 (en) Method and apparatus for executing java application
CN113687879B (en) Interaction method and device for cross-platform framework and platform interaction library
CN115826898B (en) Cross-screen display method, system, device, equipment and storage medium
US10922126B2 (en) Context processing method and apparatus in switching process of multiple virtual machines, and electronic device

Legal Events

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