Data processing method, device and storage medium during application startup

By pre-rendering and storing animation frames in the terminal device, the problem of animation effect jamming during application startup is solved, and smoother animation effect display is achieved.

CN115904563BActive Publication Date: 2025-09-09HONOR DEVICE CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111166945.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2025-09-09
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

During the application startup process in the terminal device, there is an animation effect jamming phenomenon. This is mainly due to excessive CPU load and insufficient DDR transmission bandwidth resource allocation, resulting in resource waste and frame drops during frame display.

Method used

When the application starts, multiple animation frames are pre-rendered and stored in the cache. When the synthesis period arrives, synthesis is performed to reduce the load on the CPU and GPU. The GPU calculates the status information of the object to be displayed, which reduces the burden on the CPU and reduces the waste of transmission bandwidth resources.

Benefits of technology

By pre-rendering and synthesizing animation frames, the jamming phenomenon in the animation effect is reduced, and the smoothness and efficiency of application startup are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115904563B_ABST
    Figure CN115904563B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data processing method, device and storage medium in the startup of an application, which is applied to the field of terminal technology. The method includes: receiving a startup instruction for an application; in response to the startup instruction, determining N animation frames to be displayed during the startup process of the application; when the vsync for drawing and rendering the first animation frame arrives, drawing and rendering N animation frames, and storing the N animation frames after drawing and rendering; the first animation frame is the first animation frame among the N animation frames; when the vsync period for synthesizing the target animation frame among the N animation frames arrives, synthesizing the stored target animation frame after drawing and rendering, so that during the synthesis of the N animation frames, the terminal device can synthesize and display the rendered animation frames, and the load of the terminal device will not be too heavy, which helps to reduce frame drops, and further helps to reduce the jamming phenomenon during the display of the animation effect corresponding to the target application.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a data processing method, device, and storage medium during application startup. Background Art

[0002] Currently, due to limitations in storage technology and hardware computing power, launching applications on terminal devices can take time. Terminal devices can display animation effects during application launch to reduce the abrupt transition from the desktop to the first frame of the launched application. The first frame is the first page displayed by the launched application.

[0003] For example: during the startup process of an application, the terminal device can display the icon of the launched application and the first frame of the application frame by frame from small to large, and reduce the transparency of the icon of the launched application frame by frame, and increase the transparency of the first frame of the launched application frame by frame until the terminal device completely displays the first frame of the launched application.

[0004] Currently, the animation effects displayed during the startup process of applications on some terminal devices may be stuck. Summary of the Invention

[0005] The embodiments of the present application provide a data processing method, device and storage medium during application startup, which are applied to terminal devices and help reduce the occurrence of freezes in animation effects during the startup process of applications in terminal devices.

[0006] In a first aspect, an embodiment of the present application provides a data processing method during application startup, which is applied to a terminal device, the method comprising: receiving a startup instruction for the application; in response to the startup instruction, determining N animation frames to be displayed during the startup process of the application; N is an integer greater than 1; when the vsync for drawing and rendering the first animation frame arrives, drawing and rendering the N animation frames, and storing the N animation frames after drawing and rendering; the first animation frame is the first animation frame among the N animation frames; when the vsync period for synthesizing the target animation frame among the N animation frames arrives, synthesizing the stored target animation frame after drawing and rendering.

[0007] In an embodiment of the present application, the load on the terminal device is relatively light when the application is just started, and the terminal device renders N animation frames to be displayed during the startup process of the application. In this way, during the synthesis of the N animation frames, the terminal device can synthesize the rendered animation frames and display them. The load on the terminal device will not be too heavy, which helps to reduce frame drops, and further helps to reduce the freeze phenomenon during the display of the animation effects corresponding to the target application.

[0008] In a possible implementation, the method further includes: determining a target storage area within a vsync period for drawing and rendering a target animation frame among N animation frames, and storing the drawn and rendered target animation frame in the target storage area; when a vsync period for synthesizing the target animation frame among the N animation frames arrives, synthesizing the stored drawn and rendered target animation frame, including: when a vsync period for synthesizing the target animation frame among the N animation frames arrives, obtaining the drawn and rendered target animation frame from the target storage area and synthesizing it.

[0009] In an embodiment of the present application, the terminal device can store N pre-rendered animation frames in a storage area, and when the vsync period for synthesizing animation frames arrives, the stored rendered animation frames are stored in a target storage area. There is no need to measure, layout, draw, and render the frames, thereby reducing the computing burden of the terminal device and helping to reduce the load of the terminal device.

[0010] In a possible implementation, the method further includes: creating M frame buffer objects; M is greater than or equal to N; the above-mentioned storing the N animation frames after drawing and rendering includes: storing the N animation frames after drawing and rendering in N frame buffer objects respectively; the N frame buffer objects are frame buffer objects among the M frame buffer objects.

[0011] In a possible implementation, a rendering thread and a display synthesis process of an application are running in a terminal device; within a vsync period for drawing and rendering a target animation frame among N animation frames, a target storage area is determined, and the rendered target animation frame is stored in the target storage area, including: within a vsync period for drawing and rendering a target animation frame among N animation frames, the rendering thread sends a cache request instruction to the display synthesis process; the cache request instruction is used to request the target storage area; the display synthesis process determines the target cache address; the storage area corresponding to the target cache address is the target storage area; the display synthesis process sends the target cache address to the rendering thread; the rendering thread stores the rendered target animation frame from N frame cache objects in the target storage area according to the target cache address.

[0012] In a possible implementation, the method also includes: obtaining a preset target display frame rate and animation duration; the animation duration is the playback duration of the animation effect of the application; determining the N animation frames to be displayed during the startup process of the application, including: performing a preset calculation on the target display frame rate and animation duration to obtain the N animation frames to be displayed during the startup process of the application.

[0013] In a possible implementation, a terminal device runs a logical thread of an application; the method further includes: during a vsync period used for drawing and rendering a frame to be displayed, the logical thread counts and obtains a count result; if the logical thread determines that the count result is less than N, the frame to be displayed is an animation frame among N animation frames; the logical thread determines that the frame to be displayed is a target animation frame among the N animation frames during a vsync period used for drawing and rendering; if the logical thread determines that the count result is greater than or equal to N, rendering the frame to be displayed and storing the rendered frame to be displayed. In this way, the logical thread running in the terminal device can perform storage of rendered animation frames or rendering of frames to be displayed by simply counting.

[0014] In a possible implementation, a terminal device includes a central processing unit (CPU) and a graphics processing unit (GPU). The method further includes: the CPU obtaining shader code; the shader is used to render N animation frames; the CPU calls the GPU to compile the shader code; and drawing and rendering the N animation frames, including: the CPU drawing the N animation frames; the CPU calling the GPU to execute the compiled shader code to render the N animation frames. Thus, by continuously rendering the N animation frames using the shader, transmission bandwidth resources for interaction between the CPU and the GPU are conserved.

[0015] In a possible implementation, the method also includes: the central processing unit obtains the object to be displayed, the values ​​of the coefficients of multiple motion effect formulas, and the start and end state information of the object to be displayed, and transmits them to the graphics processor; the object to be displayed includes the application icon, background icon and first frame; the first frame is the first page displayed by the application; the background icon is the icon other than the application icon in the desktop displayed by the terminal device; the start and end state information includes the start and end coordinates, start and end sizes, and start and end transparency; the shader code includes multiple motion effect formulas; the central processing unit calls the graphics processor to execute the compiled shader code to render N animation frames, including: the central processing unit calls the graphics processor to call the shader code according to the object to be displayed, the target display frame rate, the values ​​of the coefficients of multiple motion effect formulas, and the start and end state information of the object to be displayed, and obtains the state information of the object to be displayed in the N animation frames; and renders the N animation frames according to the state information of the object to be displayed in the N animation frames; the state information includes coordinates, size and transparency.

[0016] In an embodiment of the present application, the graphics processor is responsible for calculating the status information of the objects to be displayed in N animation frames, reducing the load on the central processing unit. The central processing unit and the graphics processor can complete the rendering of N animation frames through less interaction, reducing the waste of transmission bandwidth resources, thereby helping to reduce lag.

[0017] In a possible implementation, the terminal device also includes a memory; a configuration file is stored in the memory; the central processing unit obtains the values ​​of the coefficients of multiple motion effect formulas, including: the central processing unit obtains the values ​​of the coefficients of multiple motion effect formulas corresponding to different display frame rates from the configuration file.

[0018] In a possible implementation, a logic thread of an application and a rendering thread of the application are running in a central processing unit, and the method further includes: the rendering thread sends a graphics buffer variable creation instruction to a graphics processor; the graphics buffer variable creation instruction includes identifiers of a first target number of graphics buffer variables; the graphics processor creates a first target number of graphics buffer variables according to the graphics buffer variable creation instruction; the graphics processor sends a graphics buffer variable creation completion instruction to the rendering thread; the central processing unit transmits the objects to be displayed and the start and end status information of the objects to be displayed to the graphics processor, including: the logic thread assigns values ​​to the first target number of graphics buffer variables through the rendering thread according to the objects to be displayed, the start and end status information of the objects to be displayed and the identifiers of the first target number of graphics buffer variables to transmit the objects to be displayed and the start and end status information of the objects to be displayed to the graphics processor.

[0019] In a possible implementation, the start and end coordinates include a starting abscissa, a starting ordinate, an ending abscissa, and an ending ordinate; the coordinates (x, y) of the object to be displayed in the target animation frame satisfy the following formula:

[0020] x=x1+(x2-x1)[a1(t / t 总 ) 3 +b1(t / t 总 ) 2 +c1(t / t 总 )+d1]

[0021] y=y1+(y2-y1)[a2(t / t 总 ) 3 +b2(t / t 总 ) 2 +c2(t / t 总 )+d2]

[0022] Wherein, x1 is the starting horizontal coordinate of the object to be displayed, y1 is the starting vertical coordinate of the object to be displayed, x2 is the ending horizontal coordinate of the object to be displayed, and y2 is the ending vertical coordinate of the object to be displayed; 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a1, b1, c1, d1, a2, b2, c2 and d2 are all preset coefficients.

[0023] In a possible implementation, the start and end sizes include a starting size and an ending size; the size of the object to be displayed in the target animation frame satisfies the following formula:

[0024] m=m1+(m2-m1)[a3(t / t 总 ) 3 +b3(t / t 总 ) 2 +c3(t / t 总 )+d3]

[0025] Among them, m is the size of the object to be displayed in the target animation frame, m1 is the starting size, m2 is the ending size, t 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a3, b3, c3, and d3 are all preset coefficients.

[0026] In a possible implementation, the start and end transparency includes a starting transparency and an ending transparency; the transparency of the object to be displayed in the target animation frame satisfies the following formula:

[0027] p=1-[a4(t / t 总 ) 3 +b4(t / t 总 ) 2 +c4(t / t 总 )+d4]

[0028] Among them, p is the transparency of the object to be displayed in the target animation frame, t 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a4, b4, c4, and d4 are all preset coefficients.

[0029] In a possible implementation, a terminal device runs a logical thread of an application; the method further includes: during a vsync period used for drawing and rendering a frame to be displayed, the logical thread counts and obtains a count result; if the logical thread determines that the count result is less than N, the frame to be displayed is an animation frame among N animation frames; the logical thread determines that the frame to be displayed is a target animation frame among the N animation frames during a vsync period used for drawing and rendering; if the logical thread determines that the count result is greater than or equal to N, rendering the frame to be displayed and storing the rendered frame to be displayed. In this way, the logical thread running in the terminal device can perform storage of rendered animation frames or rendering of frames to be displayed by simply counting.

[0030] In a second aspect, an embodiment of the present application provides a terminal device, comprising a processing module, for: receiving a startup instruction for an application; in response to the startup instruction, determining N animation frames to be displayed during the startup process of the application; N is an integer greater than 1; when the vsync for drawing and rendering the first animation frame arrives, drawing and rendering N animation frames, and storing the N animation frames after drawing and rendering; the first animation frame is the first animation frame among the N animation frames; when the vsync period for synthesizing the target animation frame among the N animation frames arrives, synthesizing the stored target animation frame after drawing and rendering.

[0031] Optionally, the processing module is also used to determine the target storage area within the vsync period for drawing and rendering the target animation frame among N animation frames, and store the drawn and rendered target animation frame in the target storage area; when the vsync period for synthesizing the target animation frame among N animation frames arrives, synthesize the stored drawn and rendered target animation frame, including: when the vsync period for synthesizing the target animation frame among N animation frames arrives, obtain the drawn and rendered target animation frame from the target storage area and synthesize it.

[0032] Optionally, the processing module is further used to create M frame buffer objects; M is greater than or equal to N; the processing module is specifically used to store the N animation frames after drawing and rendering in the N frame buffer objects respectively; the N frame buffer objects are frame buffer objects among the M frame buffer objects.

[0033] Optionally, a rendering thread and a display synthesis process of an application are running in the terminal device; during the vsync period used to draw and render a target animation frame among N animation frames, the rendering thread is used to send a cache request instruction to the display synthesis process; the cache request instruction is used to request a target storage area; the display synthesis process is used to determine a target cache address; the storage area corresponding to the target cache address is the target storage area; the display synthesis process is used to send the target cache address to the rendering thread; the rendering thread is used to store the drawn and rendered target animation frame from N frame cache objects to the target storage area according to the target cache address.

[0034] Optionally, the processing module is also used to obtain a preset target display frame rate and animation duration; the animation duration is the playback duration of the animation effect of the application; the processing module is specifically used to: perform preset calculations on the target display frame rate and animation duration to obtain N animation frames to be displayed during the startup process of the application.

[0035] Optionally, a logical thread of an application is running in the terminal device; within the vsync period used for drawing and rendering the frame to be displayed, the logical thread is used to count and obtain the counting result; the logical thread is used to determine that when the counting result is less than N, the frame to be displayed is an animation frame among N animation frames; the logical thread is used to determine that within the vsync period used for drawing and rendering the target animation frame among N animation frames, the frame to be displayed is the target animation frame; the logical thread is used to determine that when the counting result is greater than or equal to N, the frame to be displayed is drawn and rendered, and the frame to be displayed after drawing and rendering is stored.

[0036] Optionally, the terminal device includes a central processing unit and a graphics processing unit, the central processing unit is used to obtain the shader code; the shader is used to render N animation frames; the central processing unit is used to draw N animation frames; the central processing unit calls the graphics processing unit to execute the compiled shader code to render N animation frames.

[0037] Optionally, the central processing unit is used to obtain the object to be displayed, the values ​​of the coefficients of multiple motion effect formulas, and the start and end state information of the object to be displayed, and transmit them to the graphics processor; the object to be displayed includes the application icon, background icon and first frame; the first frame is the first page displayed by the application; the background icon is the icon other than the application icon in the desktop displayed by the terminal device; the start and end state information includes the start and end coordinates, start and end sizes, and start and end transparency; the shader code includes multiple motion effect formulas; the central processing unit is specifically used to call the graphics processor to call the shader code according to the object to be displayed, the target display frame rate, the values ​​of the coefficients of multiple motion effect formulas, and the start and end state information of the object to be displayed, to obtain the state information of the object to be displayed in N animation frames; and render the N animation frames according to the state information of the object to be displayed in the N animation frames; the state information includes coordinates, size and transparency.

[0038] Optionally, the terminal device further includes a memory; a configuration file is stored in the memory; and the central processing unit is configured to obtain coefficient values ​​of multiple motion effect formulas corresponding to different display frame rates from the configuration file.

[0039] Optionally, the central processing unit runs a logic thread of an application and a rendering thread of the application, the rendering thread is used to send a graphics buffer variable creation instruction to the graphics processor; the graphics buffer variable creation instruction includes an identifier of a first target number of graphics buffer variables; the graphics processor is used to create a first target number of graphics buffer variables according to the graphics buffer variable creation instruction; the graphics processor is used to send a graphics buffer variable creation completion instruction to the rendering thread; the logic thread is used to assign values ​​to the first target number of graphics buffer variables through the rendering thread according to the objects to be displayed, the start and end status information of the objects to be displayed, and the identifiers of the first target number of graphics buffer variables to transmit the objects to be displayed and the start and end status information of the objects to be displayed to the graphics processor.

[0040] Optionally, the start and end coordinates include a start abscissa, a start ordinate, an end abscissa, and an end ordinate; the coordinates (x, y) of the object to be displayed in the target animation frame satisfy the following formula:

[0041] x=x1+(x2-x1)[a1(t / t 总 ) 3 +b1(t / t 总 ) 2 +c1(t / t 总 )+d1]

[0042] y=y1+(y2-y1)[a2(t / t 总 ) 3 +b2(t / t 总 ) 2 +c2(t / t 总 )+d2]

[0043] Wherein, x1 is the starting horizontal coordinate of the object to be displayed, y1 is the starting vertical coordinate of the object to be displayed, x2 is the ending horizontal coordinate of the object to be displayed, and y2 is the ending vertical coordinate of the object to be displayed; 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a1, b1, c1, d1, a2, b2, c2 and d2 are all preset coefficients.

[0044] Optionally, the start and end sizes include a starting size and an ending size; the size of the object to be displayed in the target animation frame satisfies the following formula:

[0045] m=m1+(m2-m1)[a3(t / t 总 ) 3 +b3(t / t 总 ) 2 +c3(t / t 总 )+d3]

[0046] Among them, m is the size of the object to be displayed in the target animation frame, m1 is the starting size, m2 is the ending size, t 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a3, b3, c3, and d3 are all preset coefficients.

[0047] Optionally, the start and end transparency includes a start transparency and an end transparency; the transparency of the object to be displayed in the target animation frame satisfies the following formula:

[0048] p=1-[a4(t / t 总 ) 3 +b4(t / t 总 ) 2 +c4(t / t 总 )+d4]

[0049] Among them, p is the transparency of the object to be displayed in the target animation frame, t 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a4, b4, c4, and d4 are all preset coefficients.

[0050] Optionally, a terminal device runs a logical thread of an application; the method further includes: during a vsync period used for drawing and rendering a frame to be displayed, the logical thread counts and obtains a count result; when the logical thread determines that the count result is less than N, the frame to be displayed is an animation frame among N animation frames; during a vsync period used for drawing and rendering a target animation frame among N animation frames, the logical thread determines that the frame to be displayed is the target animation frame; when the logical thread determines that the count result is greater than or equal to N, rendering the frame to be displayed and storing the rendered frame to be displayed. In this way, the logical thread running in the terminal device can perform storage of rendered animation frames or rendering of frames to be displayed by simply counting.

[0051] In a third aspect, an embodiment of the present application provides a terminal device, which includes a processor and a memory, and the processor is used to call a computer program in the memory to execute the data processing method as described in the first aspect.

[0052] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, which stores computer instructions. When the computer instructions are executed on a terminal device, the terminal device executes the data processing method described in the first aspect.

[0053] In a fifth aspect, an embodiment of the present application provides a chip, the chip including a processor, the processor being used to call a computer program in a memory to execute the data processing method as described in the first aspect.

[0054] It should be understood that the second to fifth aspects of the present application correspond to the technical solutions of the first aspect of the present application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation methods are similar and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Figure 1 A schematic diagram of five frames included in an animation effect corresponding to a target application applicable to an embodiment of the present application;

[0056] Figure 2 A schematic diagram showing the processing flow for the animation effect corresponding to the target application;

[0057] Figure 3 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0058] Figure 4 A schematic diagram of the software structure of the terminal device provided in the embodiment of the present application;

[0059] Figure 5 This is a schematic diagram of the process of interaction between various modules of the terminal device from the time the terminal device is powered on to the time the icon of the target application is displayed in an embodiment of the present application;

[0060] Figure 6 In the embodiment of this application, a(t / t 总 ) 3 +b(t / t 总 ) 2 +c(t / t 总 )+d with t / t 总 Schematic diagram of the change curve;

[0061] Figure 7 A schematic diagram of the process of interaction between various modules involved in the pre-rendering stage of the data processing method in application startup provided by an embodiment of the present application;

[0062] Figure 8 A schematic diagram of the animation effect display processing flow corresponding to the target application provided in an embodiment of the present application;

[0063] Figure 9 A schematic diagram of the relationship between the screen coordinate system and the icon coordinate system applicable to the embodiment of the present application;

[0064] Figure 10 A schematic diagram of the interaction process between various modules involved in the synthesis and display phase of the data processing method for starting a target application provided in an embodiment of the present application;

[0065] Figure 11Schematic diagram of the relationship between identifiers and storage areas corresponding to addresses in a cache queue in an embodiment of the present application;

[0066] Figure 12 A schematic diagram of the structure of a chip provided in an embodiment of the present application. DETAILED DESCRIPTION

[0067] For ease of understanding, the examples given herein provide some descriptions of concepts related to the embodiments of the present application and the display process of the terminal device for reference.

[0068] 1. Frame: This refers to the smallest unit of a single image displayed on an interface. A frame can be understood as a still image. Displaying multiple frames in rapid succession can create the illusion of motion.

[0069] 2. Frame rate: This refers to the number of frames that refresh an image in one second. It can also be understood as the number of times per second that the graphics processor in the terminal device refreshes the screen. A higher frame rate produces smoother and more realistic animation. The more frames per second, the smoother the displayed motion.

[0070] It should be noted that before the interface displays a frame, it usually needs to go through processes such as drawing, rendering, and synthesis.

[0071] 3. Frame drawing: refers to the image drawing of the display interface. The display interface can be composed of one or more views. Each view can be drawn by the visual controls of the view system. Each view is composed of subviews. A subview corresponds to a small widget in the view. For example, one of the subviews corresponds to an application icon in the image view.

[0072] 4. Frame rendering: This is to shade the drawn view or add 3D effects, etc. For example, 3D effects can be lighting effects, shadow effects, and texture effects.

[0073] 5. Frame synthesis: It is the process of synthesizing multiple rendered views into a display interface.

[0074] 6. Desktop Launcher: used to start the Android desktop.

[0075] 7. Other terms:

[0076] In the embodiments of this application, terms such as "first" and "second" are used to distinguish between identical or similar items with substantially the same functions and effects. For example, the terms "first chip" and "second chip" are used solely to distinguish between different chips and do not define their order. Those skilled in the art will understand that terms such as "first" and "second" do not define the quantity or execution order, and do not necessarily define differences.

[0077] It should be noted that in the embodiments of this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of words such as "exemplary" or "for example" is intended to present the relevant concepts in a concrete manner.

[0078] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0079] Currently, users can launch an application by clicking on its icon on an electronic device. The application launch process includes the electronic device receiving a click operation on the application icon and displaying an animation effect corresponding to the application in response to the click operation, until the electronic device displays the first frame of the application in full screen. The first frame of the application is the first page displayed by the application. The animation effect corresponding to the application can also be called the application's startup animation.

[0080] like Figure 1 Shown are five frames included in the animation effect corresponding to the target application, and the five frames are frames A to E respectively. Figure 1 The target application's icon text is Settings.

[0081] Figure 1 The target application icon in frame A is dimmed, while the target application icon in frame B is larger than the target application icon in frame A. Since the transparency value of the first frame in frame B is 0, the first frame in frame B is not visible. The first frame of the target application is the first page displayed by the target application.

[0082] Figure 1In frame C, the target application icon is larger than the target application icon in frame B, and its transparency is reduced, while the transparency of the first frame is increased. Therefore, the first frame is visible in frame C. In frame D, the transparency of the target application icon is further reduced, while the transparency of the first frame is further increased. The target application icon and the first frame are further enlarged. Frame E fully displays the first frame of the target application.

[0083] It should be noted that each frame in the animation effect corresponding to the target application is displayed based on the vertical synchronization (vsync) signal. In a possible implementation, the main execution thread of the application in the electronic device (for example, the app UI thread) measures and lays out each frame to obtain basic information about each frame. The basic frame information includes the size of the view corresponding to the frame and the position of each view. Measuring each frame can obtain the size of the view corresponding to the frame, and layout determines the position of each view in the frame.

[0084] The app rendering thread obtains the information used to render each frame based on the basic information of each frame, and calls the graphics processing unit (GPU) to render each frame based on the information used to render each frame. The GPU puts the rendering results into the frame buffer object, and then the display synthesis process (for example, the surface flinger) synthesizes the rendering results and sends them to the display.

[0085] For example, Figure 2 The figure shows the process flow of displaying the animation effect corresponding to the target application. In chronological order, the animation effect displayed by the electronic device corresponds to frame 1, frame 2 and frame 3. Figure 2 vsync is used to control the start of processes or threads such as frame rendering, compositing, and display. Among them, the app UI thread, app rendering thread, and GPU are used to control frame rendering, and the display compositing process is used to control frame compositing.

[0086] Figure 2In the video, vsync1 is used to indicate the start of measurement and layout of frame 1 in the animation effect. The app UI thread is used to measure and layout frame 1 to obtain basic information of frame 1. The app rendering thread is used to obtain information for rendering frame 1 based on the basic information of frame 1, and call the GPU to render frame 1 according to the information used to render frame 1 to obtain the rendering result of frame 1. The GPU stores the rendering result of frame 1 in the frame buffer position applied by the app rendering thread to the display synthesis process. The app rendering thread sends the position and the frame identifier of frame 1 stored at the position to the display synthesis process. The display synthesis process stores the frame identifier of frame 1 pointing to the position in the cache queue. Vsync2 is used to instruct the display synthesis process to synthesize the rendering result of frame 1 according to the frame identifier of frame 1 pointing to the position in the cache queue to obtain frame 1. Vsync3 is used to indicate that frame 1 is displayed on the screen of the electronic device. Figure 2 Frame 2 is similar to frame 1 and will not be described in detail.

[0087] Figure 2 Vsync3 is used to indicate the start of frame 3 measurement and layout. Figure 2 The app UI thread takes a long time to measure and layout frame 3 to obtain the basic information of frame 3. The app rendering thread also takes a long time to obtain the information used to render frame 3 based on the basic information of frame 3. When Vsync4 arrives, the GPU has not completed the rendering of frame 3. Therefore, the frame buffer location requested by the app rendering thread to the display synthesis process does not contain the rendering result of frame 3. During the display cycle corresponding to Vsync5, the screen of the electronic device still displays frame 2, that is, frame drop occurs. When frame drop occurs continuously, freezes will occur.

[0088] By tracking the animation effect display process of the target application, it was found that when the central processing unit (CPU) is heavily loaded, insufficient allocation of CPU resources and DDR transmission bandwidth resources may cause the app UI thread to take a long time to measure and layout the frame and obtain the basic information of the frame. The app rendering thread also takes a long time to obtain the information used to render the frame based on the basic information of the frame. As a result, the CPU still controls the screen to display the previous frame during the frame display period, that is, frame drops occur. When frame drops occur continuously, freezes may occur.

[0089] During the animation display process of the target application, the CPU and GPU have many inputs and / or outputs, resulting in a heavy CPU load and a waste of double data rate synchronous dynamic random access memory (DDR SDRAM) transmission bandwidth resources. The heavy CPU load and the waste of DDR transmission bandwidth resources result in insufficient allocation of CPU resources and DDR transmission bandwidth resources.

[0090] In view of this, an embodiment of the present application provides a data processing method in application startup. When an electronic device receives a startup instruction from a target application, the load on the central processing unit and the graphics processing unit in the electronic device is relatively light. The electronic device can continuously draw and render each frame in the animation effect, obtain the rendering results of each frame, and store them. In this way, the electronic device can use the rendering results of each frame for synthesis. The load on the graphics processor and the central processing unit will not be too heavy, which helps to reduce frame drops, and further helps to reduce the jamming phenomenon during the display of the animation effect corresponding to the target application.

[0091] The data processing method for application startup provided in the embodiment of the present application can be applied to a terminal device with a display function. The terminal device can also be referred to as a terminal, user equipment (UE), mobile station (MS), mobile terminal (MT), etc. The terminal device can be a mobile phone, a smart TV, a wearable device, a tablet computer (Pad), a computer with wireless transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self-driving, a wireless terminal in remote medical surgery, a wireless terminal in smart grid, a wireless terminal in transportation safety, a wireless terminal in smart city, a wireless terminal in smart home, etc. The embodiments of the present application do not limit the specific technology and specific device form adopted by the terminal device.

[0092] In order to better understand the embodiments of the present application, the structure of the terminal device in the embodiments of the present application is introduced below:

[0093] Figure 3 FIG1 shows a schematic diagram of the structure of a terminal device 10. The terminal device 10 may include a processor 110, a memory 120, a battery 130, a communication module 140, a sensor module 150, a button 160, and a display screen 170. The sensor module 150 may include a pressure sensor 150A, a touch sensor 150B, and the like.

[0094] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the terminal device 10. In other embodiments of the present application, the terminal device 10 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0095] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.

[0096] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.

[0097] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the instruction or data again, it can retrieve it from the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.

[0098] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, an inter-integrated circuits sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface.

[0099] The I2C interface is a bidirectional synchronous serial bus that includes a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple I2C bus lines. The processor 110 may be coupled to the touch sensor 150B, a charger, a flashlight, etc. via different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 150B via the I2C interface, enabling communication between the processor 110 and the touch sensor 150B via the I2C bus interface, thereby implementing the touch function of the terminal device 10.

[0100] The I2S interface may be used for audio communication. In some embodiments, the processor 110 may include multiple I2S buses.

[0101] The UART interface is a universal serial data bus used for asynchronous communication. The bus can be a bidirectional communication bus. It converts the data to be transmitted between serial communication and parallel communication. In some embodiments, the UART interface is generally used to connect the processor 110 and the communication module 140.

[0102] The MIPI interface can be used to connect the processor 110 to peripheral devices such as the display 170. MIPI interfaces include the camera serial interface (CSI) and the display serial interface (DSI). In some embodiments, the processor 110 and the display 170 communicate via the DSI interface to implement the display function of the terminal device 10.

[0103] The GPIO interface can be configured through software. The GPIO interface can be configured as a control signal or a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 to the display 170, the communication module 140, the sensor module 150, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a UART interface, a MIPI interface, etc.

[0104] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is for illustrative purposes only and does not constitute a structural limitation on the terminal device 10. In other embodiments of the present application, the terminal device 10 may also adopt different interface connection methods from those in the above embodiments, or a combination of multiple interface connection methods.

[0105] The wireless communication function of the terminal device 10 can be implemented through the communication module 140, the modem processor and the baseband processor.

[0106] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium- or high-frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor displays images or videos via the display screen 170. In some embodiments, the modem processor may be a standalone device. In other embodiments, the modem processor may be independent of the processor 110 and provided in the same device as the communication module 140 or other functional modules.

[0107] The communication module 140 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the terminal device 10. The communication module 140 can be one or more devices that integrate at least one communication processing module. The communication module 140 can receive electromagnetic waves, frequency modulate and filter the electromagnetic wave signals, and send the processed signals to the processor 110. The communication module 140 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation.

[0108] The terminal device 10 implements display functions through a GPU, display screen 170, and an application processor. The GPU is a microprocessor for image processing that connects the display screen 170 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.

[0109] The display screen 170 is used to display images, videos, and receive sliding operations. The display screen 170 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, the terminal device 10 may include one or N display screens 170, where N is a positive integer greater than one.

[0110] Video codecs are used to compress or decompress digital video. Terminal device 10 may support one or more video codecs. This allows terminal device 10 to play or record videos in various encoding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, and MPEG4.

[0111] The memory 120 can be used to store computer executable program code, and the executable program code includes instructions. The memory 120 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device 10 (such as audio data, a phone book, etc.), etc. In addition, the memory 120 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the terminal device 10 by running instructions stored in the memory 120 and / or instructions stored in a memory provided in the processor.

[0112] The pressure sensor 150A is used to sense pressure signals and convert them into electrical signals. In some embodiments, the pressure sensor 150A can be set on the display screen 170. There are many types of pressure sensors 150A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. A capacitive pressure sensor can be a parallel plate comprising at least two conductive materials. When force acts on the pressure sensor 150A, the capacitance between the electrodes changes. The terminal device 10 determines the intensity of the pressure based on the change in capacitance. When a touch operation is applied to the display screen 170, the terminal device 10 detects the intensity of the touch operation based on the pressure sensor 150A. The terminal device 10 can also calculate the position of the touch based on the detection signal of the pressure sensor 150A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions.

[0113] The touch sensor 150B is also referred to as a "touch control device." The touch sensor 150B can be disposed on the display screen 170. The touch sensor 150B and the display screen 170 form a touch screen, also referred to as a "touch screen." The touch sensor 150B is used to detect touch operations applied thereto or in the vicinity thereof. The touch sensor can transmit the detected touch operations to the application processor to determine the type of touch event. Visual output related to the touch operations can be provided via the display screen 170. In other embodiments, the touch sensor 150B can also be disposed on the surface of the terminal device 10, at a location different from that of the display screen 170.

[0114] The buttons 160 include a power button, a volume button, and the like. The buttons 160 may be mechanical buttons or touch buttons. The terminal device 10 may receive key inputs and generate key signal inputs related to user settings and function control of the terminal device 10.

[0115] The software system of the terminal device 10 may adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture, etc. In the embodiment of the present application, the Android system with a layered architecture is used as an example to exemplify the software structure of the terminal device 10 .

[0116] Figure 4 It is a schematic diagram of the software structure of the terminal device of an embodiment of the present application.

[0117] A layered architecture divides software into several layers, each with distinct roles and responsibilities. Layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into five layers: from top to bottom: the application layer, the application framework layer, the Android runtime and system libraries, and the kernel layer.

[0118] The application layer can include a series of application packages. Figure 4 As shown, the application package may include applications such as camera, recorder, address book, message, setting, phone, launcher, etc. Among them, launcher includes logic thread and rendering thread.

[0119] The application framework layer provides an application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions.

[0120] like Figure 4 As shown, the application framework layer may include window management services, package management services, resource managers, view systems, and frame rate control modules.

[0121] The Window Manager Service (WMS) manages windowed applications. It can obtain the display size, determine whether a status bar is present, lock the screen, and take screenshots.

[0122] The Activity Management Service manages the lifecycle of each application and the navigation back function. It is responsible for creating the Android main thread and maintaining the lifecycle of each application.

[0123] Package management services are used for program management within the system, such as application installation, uninstallation, and upgrades.

[0124] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0125] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.

[0126] The frame rate control module is used to manage and determine the screen refresh frame rate of the terminal device.

[0127] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0128] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0129] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files from the application layer and application framework layer as binary files. The virtual machine performs functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection. The virtual machine also runs a display compositing process (for example, SurfaceFlinger), which controls image composition.

[0130] The system library can include multiple functional modules, such as image drawing module, image rendering module, image synthesis module, function library and media library.

[0131] The image drawing module is used to draw 2D or 3D images. The image rendering module is used to render 2D or 3D images. The image synthesis module is used to synthesize 2D or 3D images.

[0132] In a possible implementation, the application draws an image using an image drawing module, renders the drawn image using an image rendering module, and stores the rendered image in a cache queue of the display synthesis process. Whenever a vertical synchronization signal arrives, the display synthesis process (e.g., a surface flinger) sequentially retrieves a frame of image to be synthesized from the cache queue and then performs image synthesis using the image synthesis module.

[0133] The function library provides macros, type definitions, string operation functions, mathematical calculation functions, and input and output functions used in the C language.

[0134] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0135] The hardware abstraction layer (HAL) can contain multiple library modules, such as the hardware configuration module (HWComposer, HWC) and the camera library module. The Android system can load the corresponding library modules for the device hardware, enabling the application framework layer to access the device hardware. Device hardware can include, for example, LCD screens and cameras in electronic devices.

[0136] The kernel layer is the layer between hardware and software. It drives the hardware, making it work. It includes at least the LCD / LED driver, display driver, and sensor driver.

[0137] Hardware can be audio devices, camera devices, sensor devices, etc.

[0138] The following specific embodiments are used to describe in detail the technical solution of the present application and how the technical solution of the present application solves the above technical problems. The following specific embodiments can be implemented independently or in combination with each other. For the same or similar concepts or processes, some embodiments may not be described in detail.

[0139] It is understandable that when the terminal device is powered on and displays an application icon, the terminal device can receive a user's startup instruction for the application displayed on the terminal device and start the application in response to the startup instruction.

[0140] For ease of understanding, the following describes the interaction between the various modules involved in the process from powering on the terminal device to displaying the icon of the target application in the embodiment of the present application with reference to the accompanying drawings. The target application is any application installed on the terminal device.

[0141] For example, Figure 5 The diagram is a schematic diagram of the interaction between various modules of the terminal device from the time the terminal device is powered on to the time the icon of the target application is displayed in an embodiment of the present application. The terminal device may include: a memory, a CPU, and a GPU.

[0142] The memory stores configuration files and shader code. The shader code is used to render each frame of the animation effect during the target application startup process. After the terminal device is powered on, the threads and processes running in the CPU include the Launcher logic thread, the Launcher rendering thread, and the display composition process.

[0143] S500: The terminal device is powered on to start the Launcher logic thread and the Launcher rendering thread.

[0144] In a possible implementation, a terminal device receives a power-on command and, in response to the power-on command, initiates a zygote process. The zygote process is used to create system services, including window management services, activity management services, and package management services. The activity management service within the system services initiates the Launcher. The initiated Launcher includes a Launcher logic thread and a Launcher rendering thread.

[0145] S501: The Launcher logic thread obtains a configuration file from the memory.

[0146] In an embodiment of the present application, the configuration file includes layout information of the desktop displayed by the terminal device and values ​​of coefficients of multiple motion effect formulas at different display frame rates.

[0147] In an embodiment of the present application, the layout information includes the position, icon size, icon text size of the icons on the desktop displayed by the terminal device, the number of fixed application bars at the bottom of the desktop, the position, icon size and icon text size of the icons in the application bar, etc.

[0148] The coefficient values ​​of the motion effect formulas in the configuration file include at least the coefficient values ​​of the first horizontal axis displacement formula, the second horizontal axis displacement formula, the first vertical axis displacement formula, the second vertical axis displacement formula, the size change formula, and the transparency change formula.

[0149] The first horizontal axis displacement formula is used to control the displacement of the horizontal axis coordinate in the position of the target icon, where the target icon is the icon of the target application. The first horizontal axis displacement formula is also used to control the displacement of the horizontal axis coordinate in the position of the first frame. The first frame of the target application is the first page displayed by the target application.

[0150] For example, at a certain moment, the horizontal axis coordinate x satisfies the following formula:

[0151] x=x1+(x2-x1)[a1(t / t 总 ) 3 +b1(t / t 总 ) 2 +c1(t / t 总 )+d1]

[0152] Where x1 is the starting horizontal coordinate and x2 is the ending horizontal coordinate. 总 is the animation duration, and t is the time offset from the start of the animation during the animation. a1, b1, c1, and d1 are constants, and a1 + b1 + c1 + d1 = 1. The animation duration is the duration of the animation effect during the application startup process. Animation effects can also be referred to as animation effects.

[0153] The second horizontal axis displacement formula is used to control the displacement of the horizontal axis coordinate in the position of the desktop background icon displayed by the terminal device. Wherein, the desktop background icon is the icon other than the icon of the target application on the desktop displayed by the terminal device.

[0154] The first vertical axis displacement formula is used to control the displacement of the vertical axis coordinate in the position of the target icon. The first vertical axis displacement formula is also used to control the displacement of the vertical axis coordinate in the position of the first frame. The second vertical axis displacement formula is used to control the displacement of the vertical axis coordinate in the position of the desktop background icon displayed by the terminal device. For example, at a certain moment, the vertical axis coordinate y satisfies the following formula:

[0155] y=y1+(y2-y1)[a2(t / t 总 ) 3 +b2(t / t 总 ) 2 +c2(t / t 总 )+d2]

[0156] Among them, y1 is the starting vertical coordinate, and y2 is the ending vertical coordinate. 总 is the preset animation duration, and t is the time offset from the start of the animation. a2, b2, c2, and d2 are constants, and a2 + b2 + c2 + d2 = 1.

[0157] The size change formula is used to control the length and width of the target application icon and the length and width of the first frame. For example, at a certain moment, the width m of the target application icon satisfies the following formula:

[0158] m=m1+(m2-m1)[a3(t / t 总 ) 3 +b3(t / t 总 ) 2 +c3(t / t 总 )+d3]

[0159] Where m1 is the starting width of the target application's icon, and m2 is the ending width of the target application's icon. 总 is the preset animation duration. t is the time offset from the start of the animation. a3, b3, c3, and d3 are constants, and a3 + b3 + c3 + d3 = 1.

[0160] For example, the length n of the target application icon at a certain moment satisfies the following formula:

[0161] n=n1+(n2-n1)[a4(t / t 总 ) 3 +b4(t / t 总 ) 2 +c4(t / t 总 )+d4]

[0162] Where n1 is the starting length of the target application's icon, and n2 is the ending length of the target application's icon. 总 is the preset animation duration. t is the time offset from the start of the animation. a4, b4, c4, and d4 are constants, and a4 + b4 + c4 + d4 = 1.

[0163] It's important to note that the formula for resizing the background icon is the same as the target application's icon. m and n are the length and width, respectively. The starting length and width can be stored in the image properties, while the ending length and width of the background icon can be specified by the Launcher. The ending length and width of the first frame and the ending length and width of the target icon are both based on the screen size.

[0164] The transparency change formula is used to control the transparency change of the target icon and the first frame. For example, the transparency p of the target application icon at a certain moment satisfies the following formula:

[0165] p=1-[a5(t / t 总 ) 3 +b5(t / t 总 ) 2 +c5(t / t 总 )+d5]

[0166] Among them, t 总 is the preset animation duration. t is the time offset from the start of the animation. a5, b5, c5, and d5 are constants, and a5 + b5 + c5 + d5 = 1. It can be understood that p changes from 1 to 0, that is, from opaque to transparent.

[0167] The transparency q of the first frame satisfies the following formula: q=[a6(t / t 总 ) 3+b6(t / t 总 ) 2 +c6(t / t 总 )+d6], where t 总 is the preset animation duration. t is the time offset from the start of the animation. a6, b6, c6, and d6 are constants, and a6 + b6 + c6 + d6 = 1. It can be understood that q changes from 0 to 1, that is, from transparent to opaque.

[0168] For example, the values ​​of the coefficients of the first horizontal axis displacement formula at different display frame rates included in the configuration file are shown in Table 1 below:

[0169] Table 1

[0170] Display frame rate First coefficient The second coefficient The third coefficient Fourth coefficient 60fps 1.2488 -3.3018 3.064 0.0002 90fps 1.3 -3.0 2.7 0.0002

[0171] In Table 1, the first coefficient a1 of the first horizontal axis displacement formula corresponding to a display frame rate of 60 fps is 1.2488, the second coefficient b1 is 3.3018, the third coefficient c1 is 3.064, and the fourth coefficient d1 is 0.0002. The first coefficient a1 of the first horizontal axis displacement formula corresponding to a display frame rate of 90 fps is 1.3, the second coefficient b1 is 3, the third coefficient c1 is 2.8, and the fourth coefficient d1 is 0.0002.

[0172] For ease of understanding, due to t / t 总 From 0-1, at 60Hz a1(t / t 总 ) 3 +b1(t / t 总 ) 2 +c1(t / t 总 )+d1 with t / t 总 The change curve of Figure 6 shown. Figure 6 Middle longitudinal axis a1(t / t 总 ) 3 +b1(t / t 总 ) 2 +c1(t / t 总 )+d1, the horizontal axis is t / t 总 It can be understood that during the dynamic scaling process, as time goes by, the icon moves from the starting point coordinates x1, y1 to the end point coordinates x2, y2, and the speed is first fast and then slow.

[0173] S502: The Launcher logic thread obtains the coefficient values ​​of each motion effect formula corresponding to different display frame rates from the obtained configuration file.

[0174] In an embodiment of the present application, the display frame rate is used to control the screen refresh frame rate of the terminal device.

[0175] In a possible implementation, the Launcher logic thread obtains the coefficient values ​​of the dynamic effect formulas such as the first horizontal axis displacement formula, the second horizontal axis displacement formula, the first vertical axis displacement formula, the second vertical axis displacement formula and the transparency change formula corresponding to multiple display frame rates.

[0176] Exemplarily, the values ​​of coefficients of various motion effect formulas corresponding to different display frame rates obtained by the Launcher logic thread include the values ​​of coefficients of the first horizontal axis displacement formula at different display frame rates shown in Table 1.

[0177] S503: The Launcher logic thread obtains the target display frame rate from the display composition process.

[0178] In a possible implementation, the Launcher logic thread and the display composition process simultaneously monitor a variable storing the display frame rate, and the Launcher logic thread can obtain the target display frame rate from the variable.

[0179] Exemplarily, the target display frame rate obtained by the Launcher logic thread from the display composition process is 60 fps.

[0180] S504: The Launcher logic thread sends a coefficient variable creation instruction to the graphics processor through the Launcher rendering thread.

[0181] In an embodiment of the present application, a coefficient variable creation instruction is used by a graphics processor to create a coefficient variable. The coefficient variable creation instruction includes an identifier of the coefficient variable. For example, the identifier of the coefficient variable can be a name of the coefficient variable.

[0182] S505: The graphics processor creates coefficient variables according to the coefficient variable creation instruction.

[0183] In a possible implementation, the graphics processor creates coefficient variables corresponding to the coefficients of each motion effect formula according to the coefficient variable creation instruction.

[0184] Based on the example of the first displacement formula in S501, the coefficient variables created by the graphics processor according to the coefficient variable creation instruction include A1, B1, C1, and D1. Among them, A1 is the coefficient variable in the GPU corresponding to a1, B1 is the coefficient variable in the GPU corresponding to b1, C1 is the coefficient variable in the GPU corresponding to c1, and D1 is the coefficient variable in the GPU corresponding to d1.

[0185] S506: The graphics processor sends a coefficient variable creation completion message to the Launcher rendering thread.

[0186] In the embodiment of the present application, the coefficient variable creation completion message includes multiple first correspondences. The first correspondence is a correspondence between coefficient variables and variable identifiers.

[0187] S507: The Launcher logic thread assigns the values ​​of the coefficients of each motion effect formula corresponding to the target display frame rate to the coefficient variables corresponding to the coefficients through the Launcher rendering thread.

[0188] Based on the values ​​of the coefficients of the first horizontal-axis displacement formula in Table 1 and the example of the coefficient variables in the GPU in S505, if the target display frame rate is 60fps, the value of the coefficient variable A1 in the GPU is: 1.2488, the value of the coefficient variable B1 in the GPU is: 3.3018, the value of the coefficient variable C1 in the GPU is 3.064, and the value of the coefficient variable D1 in the GPU is 0.0002.

[0189] S508: The Launcher logic thread obtains the shader code from the memory.

[0190] S509: The Launcher logic thread sends a shader compilation instruction to the graphics processor through the Launcher rendering thread. The shader compilation instruction includes shader code.

[0191] S510: The graphics processor compiles shader codes according to the shader compilation instruction.

[0192] In a possible implementation, the graphics processor compiles the shader into an executable program according to the shader compilation instruction.

[0193] S511: The graphics processor returns a compilation completion response message to the Launcher rendering thread.

[0194] In the embodiment of the present application, the compilation completion response message may include an identifier corresponding to the compiled executable program.

[0195] It should be noted that S511 can also be the GPU returning an indication message to the Launcher rendering thread that the compilation instructions are correct. For example, after executing S509, if the GPU determines that the shader compilation instructions are correct, it returns an indication message to the Launcher rendering thread that the compilation instructions are correct. At this time, the shader code may not have been compiled. The specific operation mechanism of the processor is determined and is not limited in this embodiment of the application.

[0196] S512: The Launcher rendering thread sends a graphics buffer variable creation instruction to the graphics processor, where the graphics buffer variable creation instruction includes identifiers of a first target number of graphics buffer variables.

[0197] In the embodiment of the present application, the identifier of the graphics buffer variable can be preset in the memory through code.

[0198] Exemplarily, the graphics buffer variable creation instruction includes identifiers for variables such as an animation duration variable, a desktop display frame rate variable, and state variables of objects to be displayed. Objects to be displayed include target icons, desktop backgrounds, and the first frame of a target application. State variables include a starting horizontal coordinate variable, a starting vertical coordinate variable, an ending horizontal coordinate variable, an ending vertical coordinate variable, a starting transparency variable, an ending transparency variable, a starting size variable, and an ending size variable.

[0199] It should be noted that if the Launcher logic thread determines the target number of frames within the animation duration based on the animation duration in memory and the acquired display frame rate, the graphics buffer variable creation instruction can include a frame number variable and a state variable for the object to be displayed. This eliminates the need for the graphics processor to determine the target number of frames within the animation duration based on the value of the animation duration variable and the desktop display frame rate.

[0200] S513: Create a first target number of graphics buffer variables according to the graphics buffer variable creation instruction.

[0201] S514: The graphics processor sends a graphics buffer variable creation completion instruction to the Launcher rendering thread.

[0202] In the embodiment of the present application, the graphics buffer variable creation completion instruction may be used to indicate that a first target number of graphics buffer variables has been successfully created.

[0203] The Launcher logic thread loads the applications installed on the terminal device and displays the icons of the applications installed on the terminal device on the display screen of the terminal device based on the desktop layout information, combined with the Launcher rendering thread, view system, display-related system libraries, graphics processor and display-related hardware.

[0204] At this point, the terminal device can receive a start instruction for the target application from the user, and start the target application in response to the start instruction.

[0205] The data processing method in application startup in the embodiment of the present application includes a pre-rendering stage and a synthesis and display stage.

[0206] The following combination Figure 7 The process of interaction between various modules involved in the pre-rendering stage in the data processing method in application startup provided by an embodiment of the present application is described.

[0207] S700: The Launcher logic thread receives a startup instruction for a target application.

[0208] In a possible implementation, the Launcher logic thread receives a startup instruction for the target application, and in response to the startup instruction of the target application, sends a process creation instruction of the target application to the system service, and the system service instructs the incubator process to create a process of the target application.

[0209] S701: The Launcher logic thread obtains a second target number from a memory, where the second target number is used to determine the number of frame buffer objects (FBOs) created by the GPU.

[0210] In the embodiment of the present application, the frame buffer object is used to store the rendering results of the frame.

[0211] S702: The Launcher logic thread sends a first frame image acquisition instruction to the window management service. The first frame image acquisition instruction is used to acquire the first frame image of the target application.

[0212] In the embodiment of the present application, the first frame includes the image of the first frame, the image format, and the image size of the first frame.

[0213] S703: The window management service sends a feedback instruction of the first frame to the Launcher logical thread.

[0214] In an embodiment of the present application, the feedback instruction of the first frame includes indication information of the first frame, and the indication information is used to point to the first frame.

[0215] In a possible implementation, if the first frame of the target application exists in the CPU cache, the window management service sends a first-frame feedback instruction to the Launcher logical thread. If the first frame of the target application does not exist in the CPU cache, the window management service starts the target application and draws the first frame of the target application. The window management service sends a first-frame feedback instruction to the Launcher logical thread, and the feedback instruction includes instruction information pointing to the drawn first frame.

[0216] S704: The Launcher logic thread sends a frame buffer object creation instruction to the GPU through the Launcher rendering thread, where the frame buffer object creation instruction includes identifiers of a second target number of frame buffer objects.

[0217] S705: The GPU creates a second target number of frame buffer objects.

[0218] In the embodiment of the present application, the second target number can be set by code based on experience and stored in the memory.

[0219] S706: The GPU returns a frame buffer object creation response message to the Launcher rendering thread. The frame buffer object creation response message includes the identifier of each created frame buffer object.

[0220] It is understandable that different frame buffer object identifiers point to different frame buffer objects.

[0221] S707: The Launcher rendering thread stores the identifier of each frame buffer object.

[0222] S708: The Launcher rendering thread sends a frame buffer object creation response message to the Launcher logic thread.

[0223] It should be noted that the embodiment of the present application does not limit the execution order of S707 and S708. For example, the Launcher rendering thread may execute S707 after executing S708.

[0224] S709: The Launcher logic thread obtains the playing duration of the animation effect during the startup of the target application and the status information of the object to be displayed from the memory.

[0225] In the embodiment of the present application, the objects to be displayed include the target icon, the desktop background, and the first frame of the target application, etc. The status information includes the starting horizontal coordinate, the starting vertical coordinate, the ending horizontal coordinate, the ending vertical coordinate, the starting transparency, the ending transparency, the starting height and width, and the ending height and width.

[0226] It should be noted that, in the embodiment of the present application, the playing duration of the animation effect during the startup of the target application and the status information of the object to be displayed can be preset in the memory of the terminal device through code.

[0227] For example, the coordinates of the upper left corner of the screen are (0, 0), the horizontal axis is along the short side of the screen, and the vertical axis is along the long side of the screen. The playback duration of the animation effect during the startup of the target application is 332ms. The state information of the object to be displayed includes: the starting coordinates of the target icon are: (700, 1200), the ending coordinates of the target icon are (0, 0), the starting transparency of the target icon is 1, the ending transparency of the target icon is 0, the starting size of the target icon is (200, 200), and the ending size of the target icon is (1080, 2400).

[0228] S710: The Launcher logic thread calls the GPU through the Launcher rendering thread to execute the assignment instruction, and assigns values ​​to the graphics buffer variables according to the playback duration of the animation effect in the target application startup, the target display frame rate, the status information of the object to be displayed, and the identifier of the graphics buffer variable.

[0229] In an embodiment of the present application, the assignment instruction includes the playback duration of the animation effect during the startup of the target application, the target display frame rate, the status information of the object to be displayed, and the identifier of the graphics buffer variable, etc.

[0230] S711: The Launcher logic thread measures and lays out each frame in the animation effect upon receiving the Vsync signal. Each frame corresponds to a frame identifier.

[0231] In this embodiment of the present application, the frame identifier may be the time offset of each frame in the animation effect. The time offset of each frame is the time offset between the start time of each frame display and the time when the start command is received. The start command reception time is the time when the terminal device receives the start command of the target application. The terminal device may record the start command reception time.

[0232] In a possible implementation, the Launcher logic thread measures the size of the view of each frame and obtains the position of each view in each frame according to a preset measurement method.

[0233] Based on the example of the view working mechanism of Android, the measurement method can be the measure method of the view preset by code, and the layout method can be the layout method of the view preset by code.

[0234] For example, the Launcher logic thread can be the app UI thread, such as Figure 8 As shown, when the app UI thread receives Vsync1, it measures and lays out frames 1 to 5.

[0235] S712: The Launcher logic thread calls the Launcher rendering thread to draw each frame.

[0236] In a possible implementation, the Launcher logic thread calls the Launcher rendering thread to draw the view in each frame according to a preset drawing method.

[0237] Based on an example of an Android view working mechanism, the preset drawing method may be a draw method of a view preset by code.

[0238] based on Figure 8 In the example, the app UI thread calls the app rendering thread to draw frames 1 to 5.

[0239] S713: The Launcher rendering thread calls the GPU to render each frame in the animation effect and obtains the rendering results of each frame.

[0240] In a possible implementation, the Launcher rendering thread calls the GPU to perform the following steps to obtain the rendering results of each frame in the animation effect:

[0241] Step 1: The GPU obtains the target number of frames based on the playback duration of the animation effect in the graphics buffer variable (hereinafter referred to as animation duration) and the target display frame rate.

[0242] In the embodiment of the present application, the target number of frames is the number of frames to be displayed within the animation duration.

[0243] In a possible implementation, the target number of frames satisfies the formula: target number of frames = animation duration (seconds) ÷ (1 second / desktop display frame rate).

[0244] For example, when the animation duration is 332 milliseconds and the display frame rate of the desktop is 60 frames per second, the target number of frames is 20 frames.

[0245] Step 2: The GPU calculates the rendering information of the object to be displayed in each frame of the animation effect based on the target frame number, the state information of the object to be displayed, the assigned coefficient variables, and the dynamic effect formula that controls the object to be displayed.

[0246] In the embodiment of the present application, the rendering information includes information such as the coordinates, transparency, and size of the object to be displayed.

[0247] Exemplarily, the GPU obtains the coordinates of the target icon in the first frame as (440, 755), the coordinates of the target icon in the second frame as (268, 459), the coordinates of the target icon in the third frame as (161, 276), and the coordinates of the target icon in the last frame as (0, 0) based on the starting coordinates (700, 1200) of the target icon, the ending coordinates (0, 0) of the target icon, the target number of frames 20, and the first horizontal axis displacement formula. The GPU obtains the transparency of the target icon in each frame based on the starting transparency of the target icon as 1, the ending transparency of the target icon as 0, the target number of frames 20, and the transparency change formula. The GPU obtains the size of the target icon in each frame based on the starting size of the target icon as (200, 200), the ending size of the target icon as (1080, 2400), the target number of frames 20, and the size change formula.

[0248] It should be noted that the coordinates of the icon in the embodiment of the present application may be the coordinates of the coordinate origin in the icon coordinate system relative to the coordinate origin in the screen coordinate system. For example, Figure 9 As shown, the horizontal axis of the screen coordinate system of screen 90 is the X-axis, and the vertical axis is the Y-axis. The horizontal axis of the icon coordinate system of icon 901 is the a-axis, and the vertical axis is the b-axis. The coordinate origin of the icon coordinate system of icon 901 relative to the coordinate origin of the screen coordinate system is (700, 1200), so the coordinates of icon 901 can be (700, 1200).

[0249] Similarly, the GPU can obtain the rendering information of the first frame in each frame of the animation effect and the rendering information of the desktop background icon in each frame of the animation effect.

[0250] Step 3: The GPU renders each frame of the animation effect based on the objects to be displayed in each frame and the rendering information of the objects to be displayed in each frame of the animation effect, obtaining the rendering results of each frame. The rendering information of the objects to be displayed includes information such as the position, size, and transparency of the objects to be displayed.

[0251] S714: The graphics processor stores the rendering results of each frame in the animation effect into the frame buffer object, and obtains a plurality of second correspondences, wherein the second correspondences are correspondences between frame identifiers and frame buffer objects.

[0252] like Figure 8 As shown, the GPU stores the rendering results of frames 1 to 5 in the animation effect into frame buffer objects respectively.

[0253] It should be noted that the graphics processor may store the rendering results of each frame into the frame buffer object after all frames 1 to 5 are rendered, or may store the rendering results of each frame into the frame buffer object after each frame is rendered.

[0254] S715: The graphics processor sends the second correspondence to the Launcher rendering thread.

[0255] S716: The Launcher rendering thread stores the second corresponding relationship.

[0256] At this point, the pre-rendering phase of the data processing method in application startup is completed. The Launcher rendering thread can determine the frame buffer object where the rendering result of each frame is stored based on the second corresponding relationship.

[0257] In an embodiment of the present application, after the Launcher logical thread receives the startup instruction of the target application and receives the Vsync signal, the graphics processor in the terminal device is lightly loaded, and the graphics processor can obtain the information of the object to be displayed in each frame of the animation effect, render each frame to obtain the rendering result, and put the rendering result of each frame into the frame buffer. In this way, during the display of each frame in the animation effect, the central processing unit in the terminal device can directly obtain the rendering result of the frame to be displayed from the frame buffer without the need to perform window measurement, layout, and drawing steps. The load on the graphics processor and the central processing unit, as well as the DDR bandwidth for data transmission between the central processing unit and the graphics processor, will not be too heavy, thereby helping to reduce frame drops, and further helping to reduce the jamming phenomenon during the display of the animation effect corresponding to the target application.

[0258] The following combination Figure 10The process of interaction between various modules involved in the synthesis and display stage in the data processing method for starting the target application provided in an embodiment of the present application is explained. Figure 10 This is a schematic diagram of the interaction process between various modules involved in the synthesis and delivery phase of the data processing method in the target application startup provided by an embodiment of the present application. Figure 10 The synthesis and transmission stage in the data processing method shown includes the following steps:

[0259] S1000: The Launcher rendering thread sends a cache request instruction to the display composition process. The cache request instruction is used to request the storage address of the rendering result of the frame.

[0260] S1001: The display synthesis process determines the target cache address.

[0261] In the embodiment of the present application, the target cache address is the address where the display synthesis process obtains the rendering result of the frame to be displayed.

[0262] In a possible implementation, the display synthesis process determines any idle cache address among a plurality of preset cache addresses as the target cache address.

[0263] In another possible implementation, the display synthesis process determines the target cache address from a plurality of cache addresses according to a preset order.

[0264] like Figure 11 As shown, identifier 1 points to the storage area corresponding to the first address, identifier 2 points to the storage area corresponding to the second address, and identifier 3 points to the storage area corresponding to the third address. If the display composition process determines that the storage area corresponding to the first address indicated by identifier 1, the storage area corresponding to the second address indicated by identifier 2, and the storage area corresponding to the third address indicated by identifier 3 in the cache queue are all idle, the display composition process can determine that the first address is the target cache address. Among them, identifiers 1 to 3 can be pointers to corresponding storage areas.

[0265] S1002: The display synthesis process sends the target cache address to the Launcher rendering thread.

[0266] S1003: The Launcher rendering thread stores the rendering result of the first frame in the animation effect into a storage area corresponding to the target cache address.

[0267] Exemplarily, the frame to be displayed is frame 1. Based on the example of S1001, the display synthesis process stores the rendering result of frame 1 from the frame buffer object stored therein to the storage area corresponding to the first address.

[0268] S1004: The Launcher rendering thread sends the target cache address and the frame identifier of the first frame in the animation effect to the display composition process.

[0269] Based on the example of S1003 , the Launcher rendering thread sends the first address and the frame identifier of frame 1 to the display composition process.

[0270] S1005: The display synthesis process updates the cache queue according to the target cache address and the frame identifier of the first frame in the animation effect.

[0271] Based on the example of S1004 and Figure 11 , showing that the composition process updates the frame ID of frame 1 to the position corresponding to ID 4 in the cache queue.

[0272] S1006: When the display synthesis process receives the Vsync signal, it obtains the rendering result of the first frame in the animation effect from the storage area corresponding to the target cache address according to the frame identifier of the first frame in the animation effect in the cache queue and the position of the frame identifier, synthesizes and displays it, and counts it.

[0273] Based on the example of S1005 , the display synthesis process obtains the rendering result of frame 1 from the storage area corresponding to the first address for synthesis.

[0274] It can be understood that, when the first frame count of the animation effect is 1, and the counting result thereafter is less than the target number of frames, the counting result is increased by 1 each time a Vsync signal is received.

[0275] For example, Figure 8 As shown, when the surfaceFlinger synthesis process receives Vsync2, it obtains the rendering result of frame 1 in the animation effect from the storage area corresponding to the first address according to the cache queue and the position of the frame identifier of frame 1 in the cache queue, and synthesizes it, and counts it as 1. When Vsync3 is received, the counting result is 2, when Vsync4 is received, the counting result is 3, and so on. When Vsync6 is received, the counting result is 5.

[0276] S1007: When the Launcher logic thread receives the Vsync signal, it counts and obtains the counting result.

[0277] Based on the example in S1006 , the count result obtained by the Launcher logic thread from the display composition process is 1 when Vsync2 is received.

[0278] S1008: The Launcher logic thread determines whether the counting result is less than the target number of frames. If so, execute S1009; if not, execute S1010.

[0279] S1009: The Launcher rendering thread sends a cache request instruction to the display synthesis process to request the storage address of the rendering result of the next frame in the animation effect. The display synthesis process determines the next target cache address and returns the next target cache address to the Launcher rendering thread. The Launcher rendering thread stores the rendering result of the next frame in the animation effect in the storage area corresponding to the next target cache address. The Launcher rendering thread sends the next target cache address and the frame identifier of the next frame in the animation effect to the display synthesis process. The display synthesis process updates the cache queue according to the next target cache address and the frame identifier of the next frame in the animation effect.

[0280] For possible implementation methods and examples, please refer to the description in S1000 to S1005 and will not be repeated here.

[0281] It can be understood that when executing this step, when the Launcher logic thread receives the Vsync signal, if it determines that the counting result is less than the target number of frames, it skips the steps of window measurement, layout and drawing, and can store the rendering results of the frames to be displayed through the Launcher rendering thread, thereby helping to reduce the occupancy of computing resources in the central processing unit and the occupancy of computing resources in the graphics processing unit.

[0282] S1010: The Launcher logic thread performs measurement and layout of frames to be displayed.

[0283] For possible implementation methods, please refer to the description in S711 and will not go into details.

[0284] S1011: The Launcher logic thread calls the Launcher rendering thread to draw the frame to be displayed.

[0285] For possible implementation methods, please refer to the description in S712 and will not be repeated here.

[0286] S1012: The Launcher rendering thread calls the GPU to render the frame to be displayed, obtains the rendering result of the frame to be displayed, and stores the rendering result in the storage area corresponding to the next target cache address requested from the display composition process.

[0287] based on Figure 8For example, when the Launcher logic thread, such as the app UI thread, receives Vsync6, the count result obtained from the display synthesis process is 5, the target number of frames is 5, and the count result is equal to the target number of frames. The Launcher logic thread measures and lays out frame 6. The app rendering thread draws frame 6, the GPU renders frame 6, and stores the rendering result of frame 6 in the storage area corresponding to the next target cache address requested from the display synthesis process, so that the display synthesis process updates the cache queue according to the frame identifier of frame 6 and the identifier of the storage area corresponding to the next target cache address stored in frame 6. When the display synthesis process receives Vsync7, it obtains frame 6 from the storage area corresponding to the next target cache address according to the cache queue, synthesizes it, and sends it to the display.

[0288] It should be noted that the target cache address obtained by the above request and the next target cache address are used to distinguish the requested cache addresses. For example, the target cache address obtained by the first request is different from the target cache address obtained by the second request. The target cache address obtained by the Rth request can be the same as or different from the target cache address obtained by the first request. This embodiment of the present application is not limited to this. R is a positive integer.

[0289] In an embodiment of the present application, when the target application is preparing to display the first frame of the animation effect corresponding to the target application, the central processing unit transmits information such as the animation duration, the target display frame rate, and the status information of the object to be displayed to the graphics processor by assigning values ​​to the graphics buffer variables. The graphics processor calculates the rendering information of each frame in the animation effect based on the information transmitted by the central processing unit, renders each frame, and stores the rendering results of each frame in the frame buffer object corresponding to each frame. In this way, the graphics processor generates the rendering results of each frame in the animation effect once, and in the display process of subsequent frames in the animation effect, the terminal device only needs to perform the storage of the rendering results of the frames to be displayed, which saves the computing power of the central processing unit and the computing power of the graphics processor after the first frame of the animation effect is displayed. The load on the graphics processor and the central processing unit will not be too heavy, which helps to reduce frame drops and further helps to reduce the jamming phenomenon during the display process of the animation effect corresponding to the target application.

[0290] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of method. In order to realize the above functions, it includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily appreciate that, in combination with the method steps of each example described in the embodiment disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0291] The embodiment of the present application can divide the functional modules of the terminal device that implements the data processing method in the application startup of the embodiment of the present application according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. Exemplarily, the functions of the target application, the drawing interface and the display engine are integrated into the display control unit. The above-mentioned integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules 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.

[0292] For example, combined Figure 3 In the embodiment of the present application, the data processing method in the application startup can be performed by Figure 3 The processor 110 in the memory 120 calls the computer program to implement.

[0293] like Figure 12 FIG2 is a schematic diagram of the structure of a chip provided in an embodiment of the present application. The chip 300 includes one or more (including two) processors 3001 , a communication circuit 3002 and a communication interface 3003 , and optionally, the chip 300 also includes a memory 3004 .

[0294] In some embodiments, the memory 3004 stores the following elements: executable modules or data structures, or a subset thereof, or an extended set thereof.

[0295] The method described in the above embodiment of the present application can be applied to the processor 3001, or implemented by the processor 3001. The processor 3001 may be an integrated circuit chip with signal processing capabilities. During implementation, the steps of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 3001. The above processor 3001 can be a general-purpose processor (for example, a microprocessor or a conventional processor), a digital signal processor (digital signal processing, DSP), an application specific integrated circuit (application specific integrated circuit, ASIC), a field-programmable gate array (field-programmable gate array, FPGA) or other programmable logic devices, discrete gates, transistor logic devices or discrete hardware components. The processor 3001 can implement or execute the disclosed methods, steps and logic block diagrams in the embodiments of the present application.

[0296] The steps of the method disclosed in conjunction with the embodiments of the present application can be directly embodied as being executed by a hardware decoding processor, or can be executed by a combination of hardware and software modules in the decoding processor. Among them, the software module can be located in a storage medium mature in the art, such as a random access memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable read-only memory (EEPROM). The storage medium is located in the memory 3004, and the processor 3001 reads the information in the memory 3004 and completes the steps of the above method in conjunction with its hardware.

[0297] The processor 3001 , the memory 3004 and the communication interface 3003 can communicate with each other through the communication line 3002 .

[0298] In the above embodiment, the instructions stored in the memory for execution by the processor may be implemented in the form of a computer program product, wherein the computer program product may be pre-written in the memory or downloaded and installed in the memory in the form of software.

[0299] The present application also provides a computer program product including one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) method. The computer-readable storage medium can be any available medium that a computer can store or a data storage device such as a server or data center that includes one or more available media integrated. For example, the available medium can include magnetic media (e.g., floppy disk, hard disk or tape), optical media (e.g., digital versatile disc (DVD)), or semiconductor media (e.g., solid state disk (SSD)).

[0300] The present application also provides a computer-readable storage medium. The methods described in the above embodiments can be implemented in whole or in part via software, hardware, firmware, or any combination thereof. Computer-readable media can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one location to another. The storage medium can be any target medium that can be accessed by a computer.

[0301] As one possible design, computer-readable media may include compact disc read-only memory (CD-ROM), RAM, ROM, EEPROM or other optical disc storage; computer-readable media may include magnetic disk storage or other magnetic disk storage devices. Moreover, any connecting line may also be appropriately referred to as a computer-readable medium. For example, if the software is transmitted from a website, server or other remote source using a coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave, then the coaxial cable, fiber optic cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwave are included in the definition of medium. Disk and disc as used herein include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk and Blu-ray disc, where disks usually reproduce data magnetically, while discs reproduce data optically using lasers.

[0302] The above combinations should also be included within the scope of computer-readable media. The above description is only a specific embodiment of the present application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by any person skilled in the art within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A data processing method during application startup, characterized in that: Applied to a terminal device, the method includes: receiving a startup instruction for an application; In response to the startup instruction, determining N animation frames to be displayed during the startup process of the application; N is an integer greater than 1; When a vsync for drawing and rendering a first animation frame arrives, drawing and rendering the N animation frames, and storing the N rendered animation frames; the first animation frame is the first animation frame among the N animation frames; When a vsync period for synthesizing a target animation frame among the N animation frames arrives, synthesizing the stored target animation frame after drawing and rendering; The method further comprises: Determining a target storage area within a vsync period used for drawing and rendering a target animation frame among the N animation frames, and storing the rendered target animation frame in the target storage area; When a vsync period for synthesizing a target animation frame among the N animation frames arrives, synthesizing the stored target animation frame after drawing and rendering, comprising: When a vsync period for synthesizing the target animation frame among the N animation frames arrives, the target animation frame after the drawing and rendering is obtained from the target storage area and synthesized.

2. The data processing method according to claim 1, wherein: The method further comprises: Create M frame buffer objects; M is greater than or equal to N; The storing and rendering the N animation frames includes: The N animation frames after drawing and rendering are stored in N frame buffer objects respectively; the N frame buffer objects are frame buffer objects in the M frame buffer objects.

3. The data processing method according to claim 2, characterized in that: The terminal device runs a rendering thread and a display synthesis process of the application; determining an available target storage area within a vsync period for rendering a target animation frame among the N animation frames, and storing the rendered target animation frame in the target storage area, including: During a vsync period for drawing and rendering the target animation frame, the rendering thread sends a cache request instruction to the display composition process; the cache request instruction is used to request a target storage area; The display synthesis process determines a target cache address; the storage area corresponding to the target cache address is the target storage area; The display composition process sends the target cache address to the rendering thread; The rendering thread stores the rendered target animation frame from the N frame buffer objects to the target storage area according to the target cache address.

4. The data processing method according to any one of claims 1 to 3, characterized in that: The method further comprises: Obtaining a preset target display frame rate and animation duration; the animation duration is the playback duration of the animation effect of the application; The determining of N animation frames to be displayed during the startup of the application comprises: The target display frame rate and the animation duration are calculated in advance to obtain N animation frames to be displayed during the startup of the application.

5. The data processing method according to claim 4, characterized in that: The terminal device runs a logical thread of the application; the method further includes: During a vsync period for drawing and rendering a frame to be displayed, the logic thread counts and obtains the count result; When the logic thread determines that the count result is less than N, the frame to be displayed is an animation frame among the N animation frames; the logic thread determines that within a vsync period used for drawing and rendering a target animation frame among the N animation frames, the frame to be displayed is the target animation frame; When the logic thread determines that the counting result is greater than or equal to N, it renders the frame to be displayed and stores the rendered frame to be displayed.

6. The data processing method according to claim 4, characterized in that: The terminal device includes a central processing unit and a graphics processing unit, and the method further includes: The central processing unit obtains a shader code; the shader is used to render the N animation frames; The CPU calls the GPU to compile the shader code; The drawing and rendering of the N animation frames includes: The central processing unit draws the N animation frames; The central processing unit calls the graphics processing unit to execute the compiled shader code to render the N animation frames.

7. The data processing method according to claim 6, characterized in that: The method further comprises: The central processing unit obtains the object to be displayed, the values ​​of the coefficients of multiple dynamic effect formulas, and the start and end state information of the object to be displayed, and transmits them to the graphics processor; the object to be displayed includes the icon, background icon and first frame of the application; the first frame is the first page displayed by the application; the background icon is the icon on the desktop displayed by the terminal device other than the icon of the application; the start and end state information includes the start and end coordinates, the start and end sizes, and the start and end transparency; the code of the shader includes the multiple dynamic effect formulas; The CPU calls the GPU to execute the compiled shader code to render the N animation frames, including: The central processing unit calls the graphics processor to call the shader code according to the object to be displayed, the target display frame rate, the values ​​of the coefficients of the multiple motion effect formulas, and the start and end state information of the object to be displayed, to obtain the state information of the object to be displayed in the N animation frames; and renders the N animation frames according to the state information of the object to be displayed in the N animation frames; the state information includes coordinates, size, and transparency.

8. The data processing method according to claim 7, characterized in that: The terminal device further includes a memory; a configuration file is stored in the memory; The central processing unit obtains values ​​of coefficients of multiple motion effect formulas, including: The central processing unit obtains the values ​​of the coefficients of the multiple motion effect formulas corresponding to different display frame rates from the configuration file.

9. The data processing method according to claim 7 or 8, characterized in that: The central processing unit runs a logic thread of the application and a rendering thread of the application, and the method further includes: The rendering thread sends a graphics buffer variable creation instruction to the graphics processor; the graphics buffer variable creation instruction includes identifiers of a first target number of graphics buffer variables; The graphics processor creates the first target number of graphics buffer variables according to the graphics buffer variable creation instruction; The graphics processor sends a graphics buffer variable creation completion instruction to the rendering thread; The central processing unit transmits the object to be displayed and the start and end state information of the object to be displayed to the graphics processor, including: The logic thread assigns values ​​to the first target number of graphics buffer variables through the rendering thread based on the objects to be displayed, the start and end status information of the objects to be displayed, and the identifiers of the first target number of graphics buffer variables to transmit the objects to be displayed and the start and end status information of the objects to be displayed to the graphics processor.

10. The data processing method according to any one of claims 7 to 8, characterized in that: The starting and ending coordinates include a starting abscissa, a starting ordinate, an ending abscissa, and an ending ordinate; the coordinates (x, y) of the object to be displayed in the target animation frame satisfy the following formula: x=x1+(x2-x1)[a1(t / t 总 ) 3 +b1(t / t 总 ) 2 +c1(t / t 总 )+d1] y=y1+(y2-y1)[a2(t / t 总 ) 3 +b2(t / t 总 ) 2 +c2(t / t 总 )+d2] Wherein, x1 is the starting horizontal coordinate of the object to be displayed, y1 is the starting vertical coordinate of the object to be displayed, x2 is the ending horizontal coordinate of the object to be displayed, and y2 is the ending vertical coordinate of the object to be displayed; 总 is the animation duration, t is the time offset of the start display moment of the target animation frame relative to the start moment of the animation effect; a1, b1, c1, d1, a2, b2, c2 and d2 are all preset coefficients.

11. The data processing method according to any one of claims 7 to 8, characterized in that: The start and end sizes include a start size and an end size; the size of the object to be displayed in the target animation frame satisfies the following formula: m=m1+(m2-m1)[a3(t / t 总 ) 3 +b3(t / t 总 ) 2 +c3(t / t 总 )+d3] Wherein, m is the size of the object to be displayed in the target animation frame, m1 is the starting size, m2 is the ending size, t 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a3, b3, c3, d3 are all preset coefficients.

12. The data processing method according to any one of claims 7 to 8, characterized in that: The start and end transparency includes a start transparency and an end transparency; the transparency of the object to be displayed in the target animation frame satisfies the following formula: p=1-[a4(t / t 总 ) 3 +b4(t / t 总 ) 2 +c4(t / t 总 )+d4] Wherein, p is the transparency of the object to be displayed in the target animation frame, t 总 is the animation duration, t is the time offset between the start display moment of the target animation frame and the start moment of the animation effect; a4, b4, c4, d4 are all preset coefficients.

13. A terminal device, characterized in that: The terminal device includes a processor, and the processor is used to call a computer program in a memory to execute the data processing method according to any one of claims 1 to 12.

14. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a terminal device, the terminal device executes the data processing method according to any one of claims 1 to 12.

15. A chip, characterized in that: The chip includes a processor, and the processor is used to call a computer program in a memory to execute the data processing method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data processing method and related device

    CN113254120A