Application loading method and electronic device
By using a non-fixed frame rate for application loading and detecting blank screens during the application loading phase of electronic devices, the problem of excessively long loading times was solved, thus improving the user experience.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-06-27
- Publication Date
- 2026-04-02
AI Technical Summary
In existing technologies, electronic devices need to load a large amount of resources when loading applications, resulting in excessively long waiting times for users and affecting their gaming experience.
By loading at a non-fixed frame rate during the application loading phase, the CPU's idle time is utilized for acceleration, and a loading page is displayed when a blank screen is detected, thus preventing users from seeing a blank screen.
It improved application loading speed, enhanced the user's entertainment experience, reduced waiting time, and improved the overall user experience.
Smart Images

Figure CN2025104297_02042026_PF_FP_ABST
Abstract
Description
Application loading method and electronic device
[0001] The present application claims priority to the Chinese patent application No. 202411375152.X, filed on September 29, 2024, and entitled "Application loading method and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD
[0002] The present application relates to the technical field of electronic devices, and more particularly, the present application relates to an application loading method and an electronic device. BACKGROUND
[0003] With the development and application of electronic devices, the functions that the electronic devices can support are more and more, and the electronic devices can run various application programs or web pages. In recent years, electronic devices have gradually become an indispensable part of people's lives. In addition to basic Internet and communication needs, more and more people use electronic devices for entertainment. Electronic games are a kind of entertainment activities relying on electronic devices, which are widely loved by users because of their rich game content and varied game experience. Taking mobile games as an example, users can download an installation package through a mobile software store and then start the game in the corresponding application program, which is called a game application program.
[0004] However, no matter which game, a large number of resources need to be loaded before the game runs, which will cause the user to wait for a long time, thereby affecting the user's game experience. SUMMARY
[0005] The present application provides an application loading method and an electronic device, which helps to reduce the user's waiting time before the application runs, thereby helping to improve the user's entertainment experience.
[0006] In a first aspect, the present application provides an application loading method, which is applied to an electronic device and includes: detecting that a target application enters a loading stage; in response to the target application entering the loading stage, loading the target application at a non-fixed frame rate, wherein the frame rate of each frame in the loading stage is determined by the working time length of each frame, and the frame rate of at least one frame in the loading stage is higher than a preset frame rate.
[0007] Based on the above technical solution, by loading the target application at a non-fixed frame rate in the loading stage of the target application, the loading speed of the application is improved, the user's waiting time before the application runs is reduced, and the user's entertainment experience is improved.
[0008] In some possible implementation manners, the method further includes: in an application running stage, running the target application at the preset frame rate.
[0009] With reference to the first aspect, in some implementations of the first aspect, the application loading method further includes: in the loading stage, detecting that the loading page of the target application is a blank screen, obtaining a first loading page, and displaying the first loading page.
[0010] Based on the above technical solution, when the loading page is a blank screen, the electronic device can display the first loading page. In this way, without the need for application developers to adapt, the user can be prevented from seeing a blank screen during the application loading stage, which helps to improve the user's entertainment experience.
[0011] With reference to the first aspect, in some implementations of the first aspect, detecting that the loading page of the target application is a blank screen includes: in the n-th frame of the loading stage, obtaining pixel values of a plurality of pixel points in a to-be-displayed screen, where n is an integer greater than 0; and when the pixel values of the plurality of pixel points are all 0, determining that the loading page of the target application is a blank screen.
[0012] Based on the above technical solution, the electronic device can automatically detect the pixel values of the pixel points in the to-be-displayed screen during the loading process, and determine whether the loading page is a blank screen through the pixel values, so that targeted optimization can be performed after detecting the blank screen, which helps to improve the user experience.
[0013] With reference to the first aspect, in some implementations of the first aspect, the method can further include: in the p-th frame of the loading stage, obtaining pixel values of a plurality of pixel points in a to-be-displayed screen, where p is an integer greater than 0, and the p-th frame is a frame after the n-th frame; and when the pixel values of the plurality of pixel points are not all 0, stopping displaying the first loading page.
[0014] Based on the above technical solution, when the electronic device determines through the detection of the pixel values of the pixel points in the to-be-displayed screen that the current screen is not a blank screen (such as other pages), the electronic device can stop displaying the first loading page and display other pages. In this way, the first loading page and the other pages can be connected, the user can be prevented from seeing a blank screen, and the user's entertainment experience can be improved.
[0015] With reference to the first aspect, in some implementations of the first aspect, detecting that the loading page of the target application is a blank screen includes: in the m-th frame of the loading stage, obtaining a number of times of calling a graphics drawing application programming interface (API), where m is an integer greater than 0; and when the number of times of calling the graphics drawing API is 0, determining that the loading page of the target application is a blank screen.
[0016] Based on the technical solution, the electronic device can determine whether the current picture is a blank picture by obtaining the number of times of calling the graphics rendering API without affecting the loading speed, so that targeted optimization can be performed after detecting the blank picture, thereby helping to improve the user experience.
[0017] With reference to the first aspect, in some implementations of the first aspect, the method can further include: obtaining the number of times of calling the graphics rendering API in the qth frame in the loading stage, where q is an integer greater than 0, and the qth frame is a frame after the mth frame; and stopping displaying the first loading page when the number of times of calling the graphics rendering API is not 0.
[0018] Based on the technical solution, when the electronic device determines that the current picture is not a blank picture (such as other pages) by the number of times of calling the graphics rendering API, the electronic device can stop displaying the first loading page and display other pages. In this way, the first loading page and other pages can be connected, and the user can be prevented from seeing a blank picture, thereby helping to improve the user's entertainment experience.
[0019] With reference to the first aspect, in some implementations of the first aspect, the application loading method further includes: obtaining first information before loading the target application at the non-fixed frame rate, the first information being used to indicate that the loading page of the target application is a blank picture; and displaying the first loading page according to the first information in the loading stage.
[0020] Based on the technical solution, by obtaining the loading page data in advance, the electronic device can display the first loading page after the application loading stage starts, without the adaptation of the application developer, thereby avoiding the user from seeing a blank picture during the application loading stage, and helping to better improve the user's entertainment experience.
[0021] With reference to the first aspect, in some implementations of the first aspect, the application loading method further includes: obtaining information of a first time length before loading the target application at the non-fixed frame rate, the first time length being a time length of loading the target application at the non-fixed frame rate; and loading the target application at the non-fixed frame rate includes loading the target application at the non-fixed frame rate within the first time length from the start of the loading stage.
[0022] Based on the technical solution, by obtaining the loading time data in advance, the electronic device can load the target application at the non-fixed frame rate after the application loading stage starts, thereby improving the loading speed of the application and helping to better improve the user's entertainment experience.
[0023] With reference to the first aspect, in some implementations of the first aspect, the application loading method can further include: stopping displaying the first loading page after the end of the first time length from the start of the loading stage.
[0024] Based on the technical solution, the electronic device can cancel the display of the first loading page in time according to the application loading condition, realize the connection between the first loading page and other pages, avoid the user from seeing a blank screen, and help improve the user's entertainment experience.
[0025] With reference to the first aspect, in some implementations of the first aspect, the application loading method can further include: running the target application at a preset frame rate after a first time length from the loading stage ends.
[0026] Based on the technical solution, the electronic device can switch to running the target application at a preset frame rate at the end of the application loading stage, ensure the stability of the frame rate of the target application in the application running stage, speed up the application loading speed, and not affect the user's operation and visual experience, thereby helping to improve the overall entertainment experience of the user.
[0027] With reference to the first aspect, in some implementations of the first aspect, the application loading method can further include: receiving a first instruction sent by the first application, the first instruction being used to instruct to display the first loading page; and displaying the first loading page according to the first instruction.
[0028] Based on the technical solution, the electronic device can display the first loading page in time according to the instruction of the first application, avoid the user from seeing a blank screen in the application loading stage, and help improve the user's entertainment experience.
[0029] With reference to the first aspect, in some implementations of the first aspect, the application loading method can further include: receiving a second instruction sent by the first application, the second instruction being used to instruct to stop displaying the first loading page; and stopping displaying the first loading page according to the second instruction.
[0030] Based on the technical solution, the electronic device can stop displaying the first loading page according to the instruction of the first application, realize the connection between the first loading page and other pages, avoid the user from seeing a blank screen, and help improve the user's entertainment experience.
[0031] With reference to the first aspect, in some implementations of the first aspect, the application loading method can further include: sending a third instruction to the first application, the third instruction being used to instruct to draw the first frame of the loading stage; receiving a fourth instruction sent by the first application, the fourth instruction being used to instruct to accelerate the loading stage; and loading the target application at a non-fixed frame rate, including: loading the target application at a non-fixed frame rate according to the fourth instruction.
[0032] Based on the technical solution, the electronic device can load the target application at a non-fixed frame rate after the start of the loading stage according to the indication of the first application, improve the loading speed of the application, and help better improve the user's entertainment experience.
[0033] In combination with the first aspect, in some implementations of the first aspect, the application loading method can further include: receiving a fifth instruction sent by the first application, the fifth instruction being used to indicate that the loading stage is stopped accelerating; and running the target application at a preset frame rate according to the fifth instruction.
[0034] Based on the technical solution, the electronic device can switch to running the target application at a preset frame rate in a timely manner according to the indication of the first application, improve the loading speed of the application in the loading stage, and not affect the application operation and visual experience of the user in the application running stage, which helps better improve the overall entertainment experience of the user.
[0035] In the second aspect, the present application provides an electronic device, which includes one or more processors, one or more memories, and one or more programs; wherein the one or more programs are stored in the one or more memories, and the one or more programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the application loading method corresponding to any of the implementations of the first aspect.
[0036] In the third aspect, the present application provides an electronic device, which includes units or modules for performing the application loading method corresponding to any of the implementations of the first aspect.
[0037] In the fourth aspect, the present application provides a readable storage medium, which stores programs or instructions, and when the programs or instructions are executed, the application loading method corresponding to any of the implementations of the first aspect can be implemented.
[0038] In the fifth aspect, the present application provides a chip, which includes circuits for performing the application loading method corresponding to any of the implementations of the first aspect.
[0039] In the sixth aspect, the present application provides a program product, which stores programs or instructions, and when the programs or instructions are executed, the application loading method corresponding to any of the implementations of the first aspect can be implemented. BRIEF DESCRIPTION OF DRAWINGS
[0040] FIG. 1 is a partial structural block diagram of an electronic device 100 related to the embodiments of the present application.
[0041] FIG. 2 is a software structural block diagram of an electronic device 100 according to an embodiment of the present application.
[0042] FIG. 3 is a graphical user interface diagram of a small game start loading process in a set of mobile phones.
[0043] FIG. 4 is a frame cycle diagram of an application loading stage and a running stage.
[0044] FIG. 5 is a flowchart of an application loading method 300 according to the present application.
[0045] FIG. 6 is a frame cycle diagram of an application loading method according to an embodiment of the present application.
[0046] FIG. 7 is a frame cycle diagram of another application loading method according to an embodiment of the present application.
[0047] FIG. 8 is a frame cycle diagram of still another application loading method according to an embodiment of the present application.
[0048] FIG. 9 is a first loading page diagram drawn by some game engines according to an embodiment of the present application.
[0049] FIG. 10 is a flowchart of an application loading method 500 according to the present application.
[0050] FIG. 11 is a game start stage flowchart corresponding to the method 500 according to an embodiment of the present application.
[0051] FIG. 12 is a flowchart of an application loading method 600 according to the present application.
[0052] FIG. 13 is a game start stage flowchart corresponding to the method 600 according to an embodiment of the present application.
[0053] FIG. 14 is a diagram of an apparatus 900 for application loading according to an embodiment of the present application.
[0054] FIG. 15 is a structural diagram of an electronic device 1000 for application loading according to an embodiment of the present application. DETAILED DESCRIPTION
[0055] The technical solutions in the present application will be described below with reference to the accompanying drawings. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments.
[0056] Hereinafter, the terms "first" and "second" are only used for description purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined with "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments, unless otherwise specified, the meaning of "a plurality of" is two or more.
[0057] The terminology used in the following description merely for the purpose of describing particular embodiments and is not intended to limit the application. As used in this description and the accompanying claims, the singular forms "a," "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items. The term "or" as used herein refers to any or all possible combinations of one or more of the associated listed items.
[0058] Reference throughout this specification to "one embodiment" or "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. Thus, the appearances of the phrases "in one embodiment" or "in some embodiments" in various places throughout this specification are not necessarily all referring to the same embodiment, unless otherwise specified. The terms "including," "containing," "comprising," and similar terms are intended to be open-ended terms that also mean "deleting from" unless otherwise noted. The term "consisting of" is intended to be a closed term that means "including and limited to."
[0059] The method provided by some embodiments of the application can be applied to electronic devices capable of loading applications (Apps) or games, videos, etc., such as mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, various game consoles, notebook computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices, and the like. The embodiments of the application do not limit the specific type of electronic device.
[0060] FIG. 1 shows a block diagram of a partial structure of an electronic device 100 related to the embodiments of the application. Referring to FIG. 1, the electronic device 100 can include a processor 110, an external memory interface 120, an internal memory 121, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a sensor module 180, an audio module 170, a display screen 194, and the like.
[0061] It can be understood that the structure shown in the embodiments of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 can include more or fewer components than shown, or combine certain components, or split certain components, or different arrangement of components. The components shown can be implemented by hardware, software, or a combination of software and hardware.
[0062] The various constituent components of the electronic device 100 will be specifically introduced below in conjunction with FIG. 1:
[0063] The processor 110 can include one or more processing units. For example, the processor 110 can include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units can be independent devices or integrated into one or more processors.
[0064] The controller can be the nerve center and command center of the electronic device 100. The controller can generate operation control signals according to instruction operation codes and timing signals, and complete the control of fetching and executing instructions.
[0065] The memory can also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory can save instructions or data that have just been used or are repeatedly used by the processor 110. If the processor 110 needs to use the instructions or data again, it can be directly called from the memory, avoiding repeated access and reducing the waiting time of the processor 110, thus improving the efficiency of the system.
[0066] In some embodiments, the processor 110 can include one or more interfaces. The interfaces can include an inter-integrated circuit (I2C) interface, an inter-integrated circuit 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 interface, etc.
[0067] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor, and the baseband processor, etc.
[0068] The mobile communication module 150 can provide a solution including 2G / 3G / 4G / 5G wireless communication applied to the electronic device 100.
[0069] The modem processor can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a 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. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. The application processor outputs a sound signal through an audio device, or displays an image or a video through the display screen 194. In some embodiments, the modem processor can be a separate device. In other embodiments, the modem processor can be independent of the processor 110, and be arranged in the same device as the mobile communication module 150 or other functional modules.
[0070] The wireless communication module 160 can provide solutions for wireless communication, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), Bluetooth low energy (BLE), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, and the like, which are applied to the electronic device 100.
[0071] In some embodiments, the antenna 1 of the electronic device 100 is coupled with the mobile communication module 150, and the antenna 2 is coupled with the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technology. The electronic device 100 implements a display function through a GPU, a display screen 194, and an application processor, etc. The GPU is a microprocessor for image processing, connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations, and for graphics rendering. The processor 110 can include one or more GPUs that execute program instructions to generate or change display information.
[0072] The display screen 194 is used to display images, videos, and the like. The display screen 194 includes a display panel. The display panel can be made of liquid crystal display (LCD), or one of organic light-emitting diode (OLED), active-matrix organic light emitting diode (AMOLED), flex light-emitting diode (FLED), miniled, microled, micro-oled, or quantum dot light emitting diodes (QLED). In some embodiments, the electronic device 100 can include 1 or N display screens 194, N being a positive integer greater than 1.
[0073] The external memory interface 120 can be used to connect an external memory card to expand the storage capacity of the electronic device 100.
[0074] The internal memory 121 can be used to store computer executable program codes including instructions. The processor 110 performs various functional applications of the electronic device 100 and data processing by executing the instructions stored in the internal memory 121.
[0075] The sensor module 180 can include a pressure sensor, a gyro sensor, a barometric sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a touch sensor, a bone conduction sensor, etc. FIG. 2 is a software structure block diagram of the electronic device 100 according to an embodiment of the present application. A layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the operating system is divided into four layers, from top to bottom, application program layer, application program framework layer, system library, and kernel layer. The application program layer can include a series of application program packages.
[0076] As shown in FIG. 2, the application program layer can include camera, gallery, game, call, map, navigation, motion, Bluetooth, music, video, chat, etc. application programs.
[0077] The application program framework layer can include window manager, content provider, view system, phone manager, resource manager, notification manager, etc. The application program framework layer includes some pre-defined functions.
[0078] The window manager is used to manage window programs. The window manager can obtain the display screen size, judge whether there is a status bar, lock the screen, intercept the screen, etc.
[0079] The content provider is used to store and obtain data, and make these data accessible to application programs. These data can include video, image, audio, dialing and answering phone, browsing history and bookmark, phone book, etc.
[0080] The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to build application programs. The display interface can be composed of one or more views. For example, the display interface including the short message notification icon can include the view for displaying text and the view for displaying pictures.
[0081] The phone manager is used to provide the communication function of the electronic device 100. For example, the management of the call state (including connection, hang up, etc.).
[0082] The resource manager provides various resources for application programs, such as localized strings, icons, pictures, layout files, video files, etc.
[0083] The notification manager enables an application to display notification information in the status bar, which can be used to convey a message of the informing type, which can automatically disappear after a short stay without user interaction. For example, the notification manager is used to inform the completion of downloading, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or a scroll bar text, such as a notification of an application running in the background, and can also be a notification that appears on the screen in the form of a dialog window. For example, the status bar prompts text information, emits a prompt sound, the electronic device vibrates, the indicator light flashes, etc.
[0084] The application layer and the application framework layer run in a virtual machine. The virtual machine is used to perform functions such as management of the object lifecycle, stack management, thread management, management of security and exceptions, garbage collection, etc.
[0085] The system library can include a plurality of functional modules, such as a surface manager, media libraries, a three-dimensional graphics processing library (for example: OpenGL ES), a two-dimensional graphics engine (for example: SGL), etc.
[0086] The surface manager is used to manage the display subsystem and provides a fusion of two-dimensional and three-dimensional layers for a plurality of applications.
[0087] The media library supports playback and recording of a plurality of commonly used audio, video formats, and static image files, etc. The media library can support a plurality of audio and picture, video encoding formats.
[0088] The three-dimensional graphics processing library is used to implement three-dimensional graphics drawing, image rendering, image synthesis, and layer processing, etc.
[0089] The two-dimensional graphics engine is a drawing engine for two-dimensional drawing.
[0090] The kernel layer is a layer between hardware and software. The kernel layer can include, but is not limited to, display drivers, camera drivers, audio drivers, sensor drivers, etc.
[0091] It should be understood that the technical solutions in some embodiments of the present application can be used in Android, IOS, Harmony, etc.
[0092] The application of the embodiments of the present application can include applications such as games and videos loaded and run in a frame cycle. The videos involved in the embodiments of the present application include but are not limited to short videos, movies, TV series, animations, sports events, and the like. The games involved in the application loading method of some embodiments of the present application can be arcade games, host games, computer games, portable games, including but not limited to online games, mobile games, small games, online games (H5 games) developed based on hypertext markup language (HTML) 5 technology, cloud games, and the like, according to the operation scene. According to the game content, it can be an action game, an adventure game, a simulation game, a role-playing game, a strategy game, a music game, a leisure game, a sports game, a racing game, and the like. According to the number of game participants, it can be a single-player game, a two-player interactive game, a multi-player game, and the like. The present application does not limit the specific application type.
[0093] The game engine involved in some embodiments of the present application can be set in any one of the above application program layer, application program framework layer, system library, and kernel layer, and the present application does not limit the software layer where the game engine is located. In an implementation manner, the API required to be called by the application loading method of the embodiments of the present application in the execution process can be in the same software layer as the game engine.
[0094] The terms involved in the applications of the embodiments of the present application are introduced as follows:
[0095] 1. Engine:
[0096] The engine refers to some already written editable software systems or some core components supporting interactive real-time image application programs, and is a code (instruction) set that can be recognized by a machine designed for a machine running a certain type of application. These systems provide application designers with various tools required for writing applications, and the purpose is to enable application developers to easily and quickly make programs without starting from scratch. Commonly used engines include game engines, audio and video engines, search engines, and the like. Most engines support multiple operating platforms, such as the Android system, the Linux embedded operating system, the Mac operating system (Mac OS X), the Windows operating system, the IOS operating system, and the Harmony operating system.
[0097] 2. API:
[0098] The API is a set of pre-defined functions, or a convention for the connection of different components of a software system. As a set of rules and protocols, the API defines the method and data format used for communication between software components. It acts as an intermediary between different systems, enabling different software applications to communicate with each other.
[0099] 3. Frame, Frame Number, Frame Rate:
[0100] Frame refers to a picture in a video or animation. Game pictures or videos are generated by playing a series of static pictures in succession, and each static picture is 1 frame.
[0101] Frame number is a short form of the number of frames generated, that is, the total number of static pictures. If the frame rate of an animation is fixed at 60 frames per second, then the frame number in one second is 60 frames. The reciprocal of the frame number is the time length occupied by each frame, with the unit of milliseconds.
[0102] Frame rate (frame rate) is the number of frames displayed per second (frames per second, fps). Frame rate = frame number (frames) / time (time), with the unit of frames per second. Frame rate marks the mapping relationship between the rate of picture cycle and real time. For example, 60 frames per second means that the engine draws a picture every 16.7 ms.
[0103] 4. Frame Cycle:
[0104] Frame cycle refers to drawing pictures in frames. Taking games as an example, game frame cycle is also called game main loop, which is the core mechanism of game engine, that is, executing game logic, processing game events, and drawing game pictures in frames. The running process of the game can be abstracted as repeatedly performing the following actions: user input, updating game logic state, and rendering game pictures. The game main loop repeatedly executes the above actions to keep the game running until the user exits the game. After each cycle is completed, the picture is updated once, and it is called once per frame.
[0105] The existing picture display architecture consists of three parts. The first part is responsible for rendering, including CPU, video card, GPU and some system modules; the second part is the picture buffer, where the rendered data is saved; and the third part is the screen, which is used to draw the data on the picture buffer. After the video card generates an image, the image is written into the picture buffer in the memory, and then transmitted from the picture buffer to the screen to display the image. The number of page refreshes per second on the screen is called refresh rate. Taking a mobile phone as an example, the mobile phone screen is composed of many pixel points, and each pixel point displays different colors to finally make the screen present various images.
[0106] In order to ensure smooth running of an application such as a video or a game, the frame rate of the application running CPU or GPU should be consistent with the screen refresh rate. If the screen refresh rate is 60 Hz, in an ideal condition, in order to achieve a smooth frame rate of 60 frames per second, the application needs to complete rendering of a frame of image within 16.7 ms. When the speed of GPU rendering is inconsistent with the speed of screen refresh, if the time of GPU rendering of a frame is relatively long, the same picture will be displayed twice by screen refresh, that is, frame dropping, and the user can have a feeling of "picture freezing".
[0107] Taking a game as an example, a game developer usually takes a game engine as a basic framework of a new game to save a large amount of development time and cost. A game made by using the game engine can be played by a user only by loading the environment configuration of the corresponding game engine in a resource package of the game. Taking a small game as an example, the small game is a game form and has the characteristics of installation-free and click-to-play. An application program for uniformly managing the small game is referred to as a game platform. The small game adopts a manner of separating the game engine from game content, and the game engine and necessary execution environment are provided by the game platform, and the game developer only needs to implement the game content. The small game is uniformly managed by the game platform, the game platform can display a list of the small game, provide a starting entry of the small game, and integrate the game engine for running the small game. The game engine is responsible for rendering of a game picture and execution of game code. The game platform can be pre-installed on an electronic device, or can be downloaded from an application store or a browser.
[0108] However, in most use scenarios of users, the user generally needs to download a code package and load a large amount of resources when starting the application, which needs to consume a long time. Taking a starting process of a game as an example, a page displayed when the user can formally start playing the game is referred to as a main page by embodiments of the application; in another use scenario, taking a starting process of a video as an example, a first frame of picture of a video file or a starting page of video playing is referred to as a main page by embodiments of the application. A stage from starting the application by the user through an application entry to displaying the main page is referred to as a loading stage of the application, and a stage after displaying the main page is referred to as a running stage of the application. Exemplarily, a loading page is a page displayed by the electronic device in the loading stage of the application. A long time consumption of the loading stage can cause the user to have a feeling of application freezing, and the user experience is poor.
[0109] Taking a mobile game as an example, FIG. 3 shows a set of graphical user interfaces (GUIs) of a mobile game startup loading process. (a) in FIG. 3 shows a game platform App display page, which includes a game icon, a search control, and an opening control. The display page of the current game platform App corresponds to the page displayed before the user starts the game. Taking game 1 as an example, in response to the operation of the user clicking control 301, the mini-game starts to start. Exemplarily, the mini-game goes through a game loading stage as shown in (b) in FIG. 3, and finally presents the main page of game 1 as shown in (c) in FIG. 3.
[0110] Because there are many game developers, their technology, manpower, and funds are at different levels, and a considerable part of the games are not optimized in the experience of the above-mentioned game loading stage. If the game developer does not preset any loading page, the electronic device may appear a "black screen" as shown in (b) in FIG. 3 during the game loading stage, at which time the user cannot determine when the game is loaded, and this screen may cause the user to misunderstand and be anxious that the device is dead. This "black screen" seriously affects the user experience.
[0111] FIG. 4 shows a frame cycle diagram of an application loading stage and a running stage. Each frame in the application loading process needs to draw a picture. The drawing time of the picture depends on the complexity of the picture, and there is a large difference in the drawing time of different pictures. For the same application, the drawing time of different frames may be the same or different. Taking a game as an example, in one implementation scenario, according to the preset running logic, some game developers set the game loading mode to asynchronous loading; in another implementation scenario, the game developer sets the user login, account verification, privacy notification, and other interfaces that need user operation in the loading stage, and the game engine needs to process user input and give feedback. Therefore, in addition to drawing, some frame in the loading stage may also need to process other events, and processing events also needs to occupy a certain time. In the implementation of the game engine, user input, asynchronous tasks, and other events are not processed immediately after they occur, but are put into an event queue and executed in the next frame. As shown in FIG. 4, event 1 occurring in frame 2 will be processed in frame 3.
[0112] When the frame rate is unstable, for example, the frame rate is switched from 60 frames / second to 30 frames / second, some users may feel that the picture update has become "slow", and have a feeling similar to that of lag. Therefore, in addition to the drawing time and the processing event time in each frame, the game engine fills an idle time of an indefinite length between two frames to ensure a fixed frame interval.
[0113] In the application loading stage, the application platform does not know when the application is loaded, and always runs at a fixed frame rate. For the user, the loading stage seen by the user is a static picture, and the user cannot feel whether the picture frame rate is stable. The fixed frame rate causes the CPU idle time to be wasted. Therefore, the existing application loading stage has the problem of long time, poor user experience, and an application loading method is needed to speed up the loading speed of the application and reduce the time consumption of the loading stage.
[0114] Based on this, the embodiment of the application provides an application loading method and an electronic device. Through the method, the electronic device can load the target application at a non-fixed frame rate in the loading stage, reduce the time consumption of the loading stage, and improve the loading speed.
[0115] The application loading method and the electronic device of the embodiment of the application are introduced below. The application loading method can help to reduce the waiting time of the user before the application runs, thereby helping to improve the entertainment experience of the user.
[0116] FIG. 5 shows a flowchart of an application loading method 300 of the application. The application loading method 300 includes:
[0117] S310: detecting that a target application enters a loading stage.
[0118] For example, after detecting that the user starts the application, in response to the operation of the user starting the target application, the electronic device loads the resources of the target application according to the operation. At this time, the target application enters the loading stage.
[0119] In an embodiment, taking a small game as an example, if it is detected that the user opens the small game for the first time or it is detected that the user has opened the small game before but the code package of the small game has been deleted, the code package corresponding to the game needs to be downloaded before entering the loading stage. The code package downloading stage includes that the game engine or the game platform downloads the game content, detects the game update, etc. If it is detected that the user opens the small game for the first time, and the data downloaded before is still cached in the electronic device, the code package downloading may not be needed at this time, or only a small amount of data is downloaded, and the loading stage is entered more quickly.
[0120] S320: in response to the target application entering the loading stage, loading the target application at a non-fixed frame rate; wherein the frame rate of each frame in the loading stage is determined by the working time length of each frame, and the frame rate of at least one frame in the loading stage is higher than a preset frame rate.
[0121] In an embodiment, when the loading stage ends, the method 300 can further include: in the running stage, running the target application at the preset frame rate.
[0122] The application loading method provided in the embodiments of the present application is described in detail below with the loading stage and the running stage of the mini-game in FIG. 6 to FIG. 13 as examples. FIG. 6 shows a frame cycle diagram of the application loading method provided in the embodiments of the present application. In the embodiments of the present application, the working time length can include one or more of the drawing time, the possible processing event time, and the time length occupied by other tasks (for example, the screen detection time). Alternatively, all the time lengths except the idle time length can be referred to as the working time length, and the working time length of each frame is equal to the non-idle time length of each frame. As shown in FIG. 6, the first 5 frames are the frames in the application loading stage, and the main page is displayed at the 6th frame. The 6th frame and each frame after the 6th frame of the target application are the frames in the running stage. It is assumed that the preset frame rate is 60 frames per second, and before the application loading optimization, the frame rate of the loading stage and the running stage of the target application is the same, and the preset frame interval is 16.7 ms.
[0123] As shown in FIG. 6, the application loading method provided in the embodiments of the present application does not fill the idle time length in each frame except the working time length in the loading stage shown in the first 5 frames. After the drawing, the processing of events, and the end of other tasks, the electronic device directly executes the next frame, so that the frame rate of each frame in the first 5 frames can be higher than 60 frames per second. Therefore, in the method of the embodiments of the present application, the frame rate of each frame in the application loading stage is determined by the working time length of each frame. The frame rates corresponding to different frames can be different, that is, the non-fixed frame rate is used for loading in the application loading stage.
[0124] After the end of the drawing of the 5th frame, the electronic device can render the main page, the end of the loading stage, and the entry into the running stage. In order to ensure that the application is refreshed with a smooth picture at a frame rate of 60 frames per second, that is, the interval between the start of the drawing of the 6th frame and the end of the 6th frame is 16.7 ms, the electronic device fills the idle time length after the end of the drawing of the 6th frame. Since the 6th frame, the frame rate of the running stage returns to the fixed frame rate, and the application is run according to the fixed frame interval of 16.7 ms.
[0125] The application loading method fully utilizes the idle time of the CPU and automatically accelerates the application loading stage. By loading the target application with the non-fixed frame rate in the application loading stage, the application loading speed is improved and the user experience in the application loading stage is improved.
[0126] Taking the mini-game as an example, in the actual scene, the game platform usually provides a starting entry of multiple mini-games. However, the game platform does not know whether the developers of the mini-games have set the loading page. If the developers of part of the games do not preset the loading page in advance, the user can see a blank picture for a period of time in the loading stage. According to the difference of the electronic devices used by the user, the blank picture can be displayed as a “black screen” or a “white screen” on different devices. Such a blank picture seriously affects the user experience.
[0127] In this scenario, to further improve the user experience, the method 300 optionally further includes: in the loading stage, detecting that the loading page of the target game is a blank screen, obtaining a first loading page, and displaying the first loading page.
[0128] For example, the electronic device can automatically detect whether the loading stage of the target application contains a loading page. For games that do not have a loading page, the electronic device can draw a first loading page of a uniform style to cover the blank screen, thereby avoiding the user from seeing the blank screen. The method of the embodiments of the present application can avoid the user from seeing the blank screen during the application loading stage, which helps to improve the user's entertainment experience.
[0129] In an implementation, the electronic device can determine the start and end of the application loading stage through screen detection. When a blank screen is detected, the electronic device determines that the application has entered the loading stage and does not have a preset loading page, and starts to accelerate at this time. The electronic device sets the frame rate of the loading stage to a non-fixed frame rate, and does not reserve idle time between two frames except for the working duration, that is, the application is loaded at a non-fixed frame rate to speed up the loading speed of the application. When the electronic device detects the first non-blank screen, it can be determined that the application loading stage is over and the running stage is entered. Thereafter, the electronic device can run the application at a preset frame rate.
[0130] Optionally, detecting that the loading page of the target application is a blank screen includes: in the nth frame of the loading stage, obtaining pixel values of a plurality of pixel points in a to-be-displayed screen, where n is an integer greater than 0; and when the pixel values of the plurality of pixel points are all 0, determining that the loading page of the target application is a blank screen.
[0131] Optionally, the method can further include: in the pth frame of the loading stage, obtaining pixel values of a plurality of pixel points in a to-be-displayed screen, where p is an integer greater than 0, and the pth frame is a frame after the nth frame; and when the pixel values of the plurality of pixel points are not all 0, stopping displaying the first loading page.
[0132] For example, FIG. 7 shows a schematic diagram of an application loading stage frame cycle provided by an embodiment of the present application. As shown in FIG. 7, after the end of the drawing of the first frame, the electronic device starts to perform picture detection. If the pixel values of the plurality of pixel points of the to-be-displayed picture in the picture buffer are all 0, it can be determined that the electronic device currently displays a blank picture, and the electronic device can display the first loading page. After the end of the picture detection of the first frame, the electronic device can not fill the idle time, and directly execute the second frame. After the end of the drawing of the second frame, the electronic device starts to perform picture detection. If the pixel values of the plurality of pixel points of the to-be-displayed picture are all 0, it can be determined that the electronic device currently displays a blank picture, and the electronic device can continue to display the first loading page. After the end of the picture detection of the second frame, the electronic device can directly execute the third frame. After the drawing of the third frame and the processing of the event 1 input in the second frame, the electronic device starts to perform picture detection. If the pixel values of the plurality of pixel points of the to-be-displayed picture are all 0, it can be determined that the electronic device currently displays a blank picture, and the electronic device can continue to display the first loading page. After the end of the picture detection of the third frame, the electronic device can directly execute the fourth frame. The drawing and picture detection method of the fourth frame is similar to the above. After the drawing of the fifth frame, the electronic device detects that the pixel values of the plurality of pixel points of the to-be-displayed picture are not all 0, and the electronic device can determine that the first non-blank picture has been rendered, the electronic device can stop displaying the first loading page, and the electronic device can restore the preset frame rate. In order to ensure that the picture frame rate is stable during the running of the application, after the end of the picture detection of the sixth frame and before the start of the drawing of the seventh frame, the idle time is filled, so that the frame rate of the sixth frame and each frame after the sixth frame is the preset frame rate.
[0133] Optionally, in order to improve the application loading speed and avoid excessive occupation of resources, the electronic device can flexibly adjust the sampling rule of the scheme. For example, the electronic device can detect once every r frames, once every s pixel points, or once every t seconds, etc., to reduce the total time consumption of picture detection. Wherein r and s are integers greater than 0, and t is a number greater than 0. When picture detection is performed every s pixel points, the electronic device can achieve this by flexibly adjusting the sampling rate of detection. For example, if detection is performed once every 4 pixel points, the sampling rate is set to 1 / 4, that is, in the adjacent 2*2 pixels, only one pixel is detected. Similarly, the electronic device can also set the sampling rate to 1 / 9, 1 / 16, etc.
[0134] Due to the performance difference between different electronic devices, for some devices with poor processor performance, when the picture drawn in a frame is relatively complex, the drawing time of the frame is prolonged and the idle time is shortened, and the idle time can be insufficient to complete picture detection. If picture detection is still performed in this case, it can cause the working time of the frame to exceed the preset frame interval (for example, the preset frame rate is 60 frames per second, and the preset frame interval is 16.7 ms), resulting in frame loss, lag, and other phenomena. In another scenario, the drawing time of a frame can exceed the preset frame interval, i.e., there is no idle time in a frame. The actual frame rate of the application in this scenario is lower than the preset frame rate.
[0135] For example, FIG. 8 shows another schematic diagram of the application loading stage frame cycle provided by an embodiment of the present application. (a) in FIG. 8 is a schematic diagram of the frame cycle in the preset frame rate state. It is assumed that the application enters the game running stage at the 7th frame, and if the loading stage does not include a loading page, the picture displayed on the game page before the completion of the drawing at the 6th frame is a blank picture. Taking the preset frame rate of 60 frames per second as an example, before the loading optimization, the frame rate of the loading stage and the running stage is the same, and the preset frame interval is 16.7 ms. The electronic device can calculate that the drawing time of each frame from the 1st frame to the 6th frame is y1, y2, y3, y4, y5, and y6, respectively, and the idle time corresponding to each frame is z1, z2, z3, z4, z5, and z6, respectively. If the application adopts the preset frame rate, then z1 = 16.7 - y1, and z2 = 16.7 - y2.
[0136] It is assumed that the time for the electronic device to perform picture detection once is x. As shown in (b) in FIG. 8, the electronic device judges the size of z1 and x according to the drawing time y1 of the 1st frame. If x < z1, picture detection is directly performed according to the embodiment shown in FIG. 7; if x > z1, picture detection is not performed at the end of the drawing of the 1st frame, the fixed frame interval is cancelled after the end of the drawing, the idle time is not reserved, and the 2nd frame is directly executed, at which time the frame rate of the 1st frame is higher than the preset frame rate. The electronic device judges the size of z1+z2 and x according to the rendering time y2 of the 2nd frame. If x < z1+z2, picture detection is performed at the end of the drawing of the 2nd frame according to the embodiment shown in FIG. 7; if x > z1+z2, picture detection is not performed at the end of the drawing of the 2nd frame, the fixed frame interval is cancelled after the end of the drawing of the 2nd frame, the idle time is not reserved, and the 3rd frame is directly executed. The 3rd frame is continued in this way, and if the similar calculation condition is still not met, picture detection can be performed at the 4th frame, and the specific process is not described herein again. In the embodiment shown in FIG. 8(b), x < z1+z2, and therefore picture detection is performed after the end of the drawing of the 2nd frame.
[0137] As shown in (b) of FIG. 8, assuming that the drawing time of the 3rd frame exceeds 16.7 ms, and the electronic device executes the 4th frame after the end of the drawing of the 3rd frame, in this case, the idle time z3 of the 3rd frame is 0, and the idle time z4 of the 4th frame is 16.7-y4. The electronic device determines the size of z4 and x according to the drawing time of the 4th frame. If x<z4, the screen detection is performed at the end of the drawing of the 4th frame; if x>z4, the screen detection is not performed at the end of the drawing of the 4th frame, the fixed frame interval is cancelled after the end of the drawing of the 4th frame, the idle time is not reserved, and the 5th frame is directly executed, at this time, the frame rate of the 4th frame is higher than the preset frame rate. By analogy, the idle time of the 5th frame is further determined. After the drawing of the 6th frame, the electronic device performs the screen detection, and it is detected that at least part of the pixel point data in the to-be-displayed screen is not 0, the electronic device can determine that the electronic device has rendered the main page, at this time, the preset first loading page can be stopped to be displayed, and the target application running at the preset frame rate is switched to.
[0138] Optionally, the detection that the loading page of the target application is a blank screen comprises: in the mth frame in the loading stage, acquiring a number of times of calling a graphics drawing application programming interface (API), where m is an integer greater than 0; and when the number of times of calling the graphics drawing API is 0, determining that the loading page of the target application is a blank screen.
[0139] Optionally, the method can further comprise: in the qth frame in the loading stage, acquiring a number of times of calling the graphics drawing API, where q is an integer greater than 0, and the qth frame is a frame after the mth frame; and when the number of times of calling the graphics drawing API is not 0, stopping displaying the first loading page.
[0140] The electronic device can also detect whether there is a drawing action to be executed in a frame before the drawing of the frame, and determine whether the loading page of the target application is a blank screen according to the presence or absence of the drawing action. For example, the electronic device can determine whether there is a drawing action in a frame by counting the number of drawing behaviors or the number of drawing instruction calls in the frame. In an embodiment, if the number of drawing behaviors is 0, the frame does not draw any content, and it is determined that the loading page of the target application is a blank screen. The electronic device acquires the first loading page and displays the first loading page. When the electronic device detects that there is a drawing action in a frame, for example, the number of drawing behaviors in the frame is greater than 0, the electronic device performs a drawing operation in this frame, and the screen is a non-blank screen. It is determined that the loading stage is ended, and the first loading page is stopped to be displayed.
[0141] In an embodiment, the electronic device determines whether there is a drawing action in a frame by counting the number of times the target application calls a drawing instruction in the frame. The number of times the drawing instruction is called can be the number of times a graphics drawing API is called. If the graphics drawing API is not called in a frame, i.e., the number of times the drawing instruction is called is 0, it is determined that the game does not draw anything in the frame, and the frame is determined to be a blank frame. The electronic device obtains a first loading page and displays the first loading page. When the number of times the graphics drawing API is called in a frame after the blank frame is greater than 0, it is determined that the target application draws in the frame, and the frame is determined to be a non-blank frame. The electronic device has rendered a main page, and it is determined that the loading stage is over. The electronic device can stop displaying the first loading page. The graphics drawing API can be a web graphics library (WebGL), for example.
[0142] The above-described screen detection method does not affect the working time of each frame of the application, and has better application loading acceleration effect than the method of detecting the screen by the pixel value of the pixel point, and can further reduce the loading waiting time of the user. The method of detecting the screen by the number of times the API is called can be executed in each frame of the loading stage, or can be flexibly adjusted according to the detection needs of the application program operator.
[0143] It should be understood that the screen detection method introduced in the embodiments of the present application is only an example, and the method of detecting the screen is not limited to the above-mentioned manner. Any screen detection method or combination of methods that can be automatically executed by the electronic device is within the scope of protection of the present application.
[0144] When the electronic device detects a blank screen in the loading stage, i.e., it is determined that the loading page of the target application is a blank screen, the electronic device can obtain a first loading page with a unified style, and then display the first loading page. The first loading page drawn by the electronic device can be run in a different running unit from the application, and does not occupy the time interval. The running unit can be a thread, a CPU core, or a processor.
[0145] For example, taking a small game loading scene as an example, FIG. 9 shows a schematic diagram of a first loading page drawn by some electronic devices according to an embodiment of the present application. The electronic device can record the obtained first loading page in a database. When the application is loaded and it is determined that the loading page of the target application is a blank screen, at least one of the following first loading pages is displayed.
[0146] As shown in (a) of FIG. 9, the content of the first loading page can include a background image 401, a progress bar 402, loading progress indication information 404, a game name, related text prompt information 403, etc. The electronic device can flexibly arrange these contents to form a first loading page.
[0147] As shown in (b) of FIG. 9, the electronic device can dynamically combine the first loading page according to the media materials (e.g., related text description 406, game screenshots, animations, videos, etc.) submitted when the mini-game is launched.
[0148] As shown in (c) of FIG. 9, when the mini-game is launched and audited, the application operator can manually or through an automated tool capture the first frame of the mini-game or any frame during the game running as the first loading page. When the game is updated or patched, the content of the first loading page can also include new game play, patch content, etc., and can also include advertising content of the game or other games, such as new characters, new skins, limited-time activities, or promotional activities, etc. When the user starts the game for the first time or updates the game, the first loading page can also include game play, plot introduction, game character introduction, etc. The form of the first loading page can be a static picture or a dynamic one. The content of the first loading page can be a flexible combination of loading progress indication information, game name, text information, game screenshot, video, and sound effect.
[0149] Optionally, the picture and text display content of the first loading page can be displayed full screen, as shown in (c) of FIG. 9; or, only part of the page can display pictures, as shown in (a) and (b) of FIG. 9.
[0150] In an embodiment, the electronic device can provide corresponding sound effects for the first loading page, which can be manually selected by the application operator when the game is launched.
[0151] Optionally, the first loading page can be provided with input controls, as shown in (b) of FIG. 9, the first loading page can add button controls 405. In response to the user's operation (e.g., touch operation or click operation) on the controls, different pages can be displayed on the screen of the electronic device. For example, in response to the user's operation on the button controls 405, the first loading page starts to play a dynamic promotional video.
[0152] Optionally, the content or form of the first loading page can be implemented uniformly for all display screens in the game loading stage, or only for blank screens. The first loading page in the game loading stage can be fixed, or can be preset and changed multiple times. The electronic device can set a first loading page with uniform form or content for all games, or set different first loading page styles according to game types or other classification methods. For the same game, it is not limited to a fixed first loading page, for example, different first loading pages can be displayed each time the game is started, or a new first loading page can be changed when the game is updated, etc.
[0153] It should be understood that the embodiments of the present application are not limited to the specific content and implementation of the first loading page, and the display mode, as long as the loading page is drawn by the game engine is covered within the scope of the embodiments of the present application.
[0154] The method of the embodiments of the present application can automatically display a first loading page of a uniform style when the loading page is a blank screen, without the need for the developer to adapt, and can stop displaying the first loading page when the loading stage ends, thereby realizing the connection between the first loading page and other pages. The method of the embodiments of the present application improves the loading speed while avoiding the user from seeing a blank screen, which helps to improve the user experience.
[0155] It should be noted that when the target application is a game, since the game platform cannot determine whether the game is loaded, the method of the embodiments determines that the loading is complete when a non-blank screen appears through screen detection. However, in fact, displaying a non-blank screen in some games does not mean that the loading stage is complete. For example, in some scenarios, the loading stage of some games is divided into a first loading stage and a second loading stage. After the first loading stage ends, the game developer sets a user login page. At this time, the game engine detects that a user login prompt appears in the screen, determines that it is a non-blank screen, and stops loading the game at a non-fixed frame rate. However, the main page does not appear at this time. After the user logs in, the game enters the second loading stage, and the frame rate of the second loading stage is a preset frame rate.
[0156] In the above embodiments, the electronic device needs to perform screen detection multiple times, and since the electronic device cannot identify whether the non-blank screen is the main page, the method can only identify the first loading stage. In another implementation of the embodiments of the present application, before the game is launched, the application program operator or an automated tool performs blank screen detection and loading stage judgment.
[0157] For example, before the loading stage, the application program operator can first perform sampling. Sampling refers to that before the game is launched, the application program operator performs a series of determinations on the loading stage to obtain sampling data. The electronic device records the sampling data in the database; after detecting that the user starts the application, the electronic device determines whether to perform loading acceleration and whether to display the first loading page according to the sampling data. According to the sampling data, the electronic device performs the operations of starting and ending acceleration, displaying and withdrawing the first loading page.
[0158] Optionally, the application loading method 300 further comprises: obtaining information of a first time length before loading the target application at the non-fixed frame rate, the first time length being a time length of loading the target application at the non-fixed frame rate; and loading the target application at the non-fixed frame rate comprises loading the target application at the non-fixed frame rate within the first time length from the start of the loading stage.
[0159] Optionally, the application loading method 300 further comprises: running the target application at a preset frame rate after the first time length from the start of the loading stage ends.
[0160] Optionally, the sampling data can comprise a first time length, the first time length being a time length of loading the target application at the non-fixed frame rate, denoted as a seconds. Taking game loading as an example, the first time length can be the shortest loading time of the target game without filling idle time, which is counted by an application operator after starting loading acceleration. The start and end of the game loading stage can be determined by changes in the game display page. In an embodiment, for a game whose loading resource does not include a loading page, the application operator can determine whether the game loading is completed by changes in the blank screen. The application operator can record the initial time when the first blank screen appears after the game is downloaded, and record the end time when the blank screen disappears, and the difference between the two is the first time length a seconds.
[0161] Since it is difficult to accurately determine the time node of loading completion when manually measuring, to improve the accuracy of the measurement data, the first time length can also be obtained by multiple measurements to obtain an arithmetic mean, denoted as a1 seconds. Optionally, other statistical methods such as removing outliers and weighted average can also be used when calculating the average, and the specific calculation method of the first time length is not limited in the embodiments of the present application.
[0162] In an embodiment, to save manpower, the first time length can be calculated by an automatic tool. For example, the application operator can use a screen detection method by calling the number of APIs, in combination with the frame cycle diagram of the application loading method shown in FIG. 6, to record the working time of each frame of the target game by an automatic tool during testing, calculate the sum of the working time of all frames, and obtain the first time length a2 seconds. Optionally, the electronic device can also use the above-mentioned screen detection method by pixel values of pixel points, in combination with the application loading method shown in FIG. 7 or FIG. 8, to calculate the sum of the working time of all frames, and then subtract the time of all screen detections to obtain the first time length a2 seconds.
[0163] Optionally, the application loading method 300 further comprises: before loading the target application at the non-fixed frame rate, obtaining first information, the first information being used to indicate that a loading page of the target application is a blank screen; and displaying the first loading page according to the first information in the application loading stage.
[0164] Optionally, the application loading method 300 can further comprise: stopping displaying the first loading page after the first duration from the start of the loading stage.
[0165] Taking game loading as an example, in an implementation, the sampling data can further indicate whether the loading resource of the target game includes information of the loading page, i.e., whether there is a blank screen in the loading stage. Before the game is put on the shelf, if the application program operator or the automatic tool judges that the developer of a certain game does not set the loading page in advance, it is considered that the loading stage of the game is a blank screen. For example, the electronic device can mark each game accordingly, and mark as 0 when there is no preset loading page and mark as 1 when there is a loading page. If the sampling data indicates that the loading page of the target game is a blank screen, the electronic device can actively overlay the first loading page on the game screen in the loading stage. The method and specific content of obtaining the first loading page can refer to FIG. 9 and the corresponding description, which will not be described here.
[0166] The application program operator can adjust the calculation method of the first duration according to the characteristics of different games. As described above, the display of a non-blank screen in some games cannot be equated to the end of the loading stage. These games include a first loading stage and a second loading stage, and the loading time is not the same as the duration of the blank screen. For this type of game, considering that the loading resource of the second loading stage of some games can include a loading page, the application program operator can only start the loading acceleration for the first loading stage, and at this time, the first duration a3 seconds corresponds to the duration of loading the target game at the non-fixed frame rate in the first loading stage. Within the first duration a3 seconds, the target game always displays a blank screen. Optionally, in order to further improve the loading speed, the application program operator can also load the entire game loading stage at the non-fixed frame rate, and at this time, the first duration a4 seconds corresponds to the total duration of the first loading stage and the second loading stage at the non-fixed frame rate. In this scenario, the application program operator can separately calculate the duration of the blank screen.
[0167] Optionally, the electronic device can also statistically obtain the loading time and frame number suitable for most games according to the development test experience or historical game data, and directly set the first j seconds or the first k frames of the loading stage of all games to be loaded at the non-fixed frame rate, and restore the fixed frame rate after the loading stage lasts for j seconds or at the k+1 frame.
[0168] For example, in an embodiment, if the loading page is a blank screen, the sampling data can also be the start frame number and the duration frame number of the blank screen in the loading stage, i.e., the first blank screen appears when the game draws the c-th frame, and lasts for d frames in total. The sampling data can include the end frame number of the blank screen, i.e., the first non-blank screen appears when the game draws the e-th frame, and d = e - c. The start frame number and the duration frame number of the blank screen can be obtained by the method of screen detection. For example, the game engine can record the frame corresponding to the first blank screen and the frame corresponding to the first non-blank screen, i.e., the c-th frame and the e-th frame. c, d and e are all integers greater than 0, and e is greater than c.
[0169] FIG. 10 shows a flowchart of an application loading method 500 according to an embodiment of the present application. The application loading method 500 can include:
[0170] S510: obtaining information of a first time duration, the first time duration being a time duration for loading the target application at a non-fixed frame rate.
[0171] Before the target application is put on the shelf, the target application is loaded at a non-fixed frame rate to obtain information of a first time duration. As described above, the first time duration can be obtained by an application program staff or an automated tool.
[0172] Optionally, the method 500 can further include: obtaining first information, the first information being used to indicate that the loading page of the target application is a blank screen; and displaying the first loading page according to the first information in the loading stage.
[0173] For example, when the loading page of the target application is a blank screen, the first loading page is obtained and displayed in the loading stage. The method for obtaining the first loading page can refer to FIG. 9 and the corresponding description.
[0174] S520: in response to the target application entering a loading stage, loading the target application at a non-fixed frame rate within a first time duration from the start of the loading stage; wherein the frame rate of each frame in the loading stage is determined by the working time duration of each frame, and the frame rate of at least one frame in the loading stage is higher than a preset frame rate.
[0175] The method for loading the target application at a non-fixed frame rate can refer to the corresponding embodiments of FIG. 6.
[0176] Before step S520, the application loading method 500 can further include: detecting that the target application enters the loading stage.
[0177] Based on the technical solution, the electronic device can load the target application at a non-fixed frame rate after the application loading stage starts, based on the pre-acquired loading page data and loading time data, thereby improving the loading speed of the application. When the loading page of the application is a blank screen, the electronic device can display the first loading page without the need for adaptation by the application developer, thereby avoiding the user from seeing a blank screen during the application loading stage and helping to better improve the user's entertainment experience.
[0178] S530: running the target application at a preset frame rate after the first duration from the start of the loading stage ends.
[0179] For example, based on the sampling data, the electronic device can determine that the loading stage ends after the first duration from the start of the loading stage ends. To ensure the stability of the frame rate during application running, the electronic device can switch to running the target application at a preset frame rate.
[0180] Optionally, the method 500 can further include: stopping displaying the first loading page after the first duration from the start of the loading stage ends.
[0181] Based on the technical solution, the electronic device can switch to running the target application at a preset frame rate and stop displaying the first loading page in a timely manner according to the game loading condition, based on the pre-acquired loading page data and loading time data, thereby realizing the connection between the first loading page and other game pages, accelerating the loading speed without affecting the user's operation and visual experience, and helping to improve the user's overall entertainment experience.
[0182] The following takes a small game as an example to introduce the steps of the application loading method 500 in detail. FIG. 11 shows a game start stage flowchart corresponding to the method 500. As shown in FIG. 11, a game platform 11 is configured to display a small game list and provide a game entry; a game engine 12 is integrated in the game platform 11 and is responsible for rendering a game screen and executing a game code. A first application 13 can include game content or a game framework, etc., and is coded by a game developer; or the first application 13 can be stored in an electronic device. Taking a small game as an example, the first application 13 can be a code file downloaded through a network, which can include a game script and other key information in the game such as attributes of game characters, game scenes or environments, layout of a game map, game progress, etc. The game script is the key to the logic and interaction of the game and is responsible for controlling character movement, enemy behavior, item generation, level design, collision detection, etc. The game engine 12 reads a carrier file of the first application 13 and executes the game script to respond to user operations and handle events.
[0183] The following steps 501 to 508 based on the interaction process between the game platform 11, the game engine 12 and the first application 13, the application loading method 500 of the present application is described in detail. The target game starting stage can include but is not limited to the following contents:
[0184] 501: detecting the user's operation of starting the target game.
[0185] The game platform can display multiple game entrances for the user to start. Different game platforms can have different game starting methods, such as touch, click, shake, etc.
[0186] 502: in response to the starting operation of the target game, loading the resources of the target game according to the operation.
[0187] Optionally, before the game enters the loading stage, the target game starting stage also includes a code package downloading stage. When the game platform receives the user's starting instruction, it downloads the corresponding code package of the game from the server through the game engine built in the game platform, including downloading game content, detecting game updates, etc.
[0188] 503: starting loading acceleration according to the first preset condition.
[0189] Optionally, the first preset condition can include information of a first time length.
[0190] As mentioned earlier, the game platform can obtain sampling data manually or by using automated tools before the game is launched. According to the characteristics and experience values of the game, the game platform can preset the first preset condition for starting loading acceleration. After the preset is completed, the first preset condition is executed by the game engine during the game loading stage. For example, in one embodiment, the first preset condition can be that within the first time length after the game enters the loading stage, the game engine runs the loading acceleration, adjusts the game frame rate of the loading stage to a non-fixed frame rate, and improves the loading speed of the game during the loading stage; when the first time length from the loading stage ends, the game engine stops acceleration and runs the game at a preset frame rate.
[0191] Optionally, the first preset condition can include information of the frame at which acceleration starts and the frame at which acceleration ends.
[0192] For example, the first preset condition can include information of the 1st frame and the 5th frame, where the 1st frame is the frame at which acceleration starts and the 5th frame is the frame at which acceleration ends. After detecting the user's operation of starting the target game, the game engine can start executing game loading from the 1st frame at a non-fixed value frame rate; after the 5th frame ends, switch to running the game at a fixed frame rate.
[0193] 504: displaying the first loading page according to the second preset condition.
[0194] Exemplarily, if the sampling data indicates that the game developer does not preset the loading page, the display screen of the game loading page is a blank screen, and the game platform displays the first loading page.
[0195] Exemplarily, the second preset condition can include a second time length for displaying the first loading page. For example, the game engine can display the first loading page within the second time length from the game loading stage. Optionally, a plurality of first loading pages can be prepared before the game is launched and stored in a database. At the 0th second and the 5th second of the game loading, different first loading pages can be displayed.
[0196] Exemplarily, the first time length and the second time length can be the same.
[0197] Exemplarily, the second preset condition can include information of a start frame and an end frame of the blank screen. For example, the second preset condition includes information of the 1st frame and the 5th frame, where the 1st frame is the start frame of the blank screen and the 5th frame is the end frame of the blank screen. After detecting that the user starts the target game, the electronic device can display the first loading page from the 1st frame through the display screen; and stop displaying the first loading page at the end of the 5th frame.
[0198] Optionally, according to different preset conditions, the order of steps 503 and 504 can be adjusted, that is, the game engine can also display the first loading page first and then start the loading acceleration.
[0199] It should be noted that if the game developer has preset the loading page, the step 504 can be omitted.
[0200] 505: loading the target game at a non-fixed frame rate.
[0201] During the game loading stage, the game engine performs loading in the form of frame cycle, executes game scripts, processes game events, and draws game screens in units of frames. The game loading stage in the embodiment of the application adopts a non-fixed frame rate, and the specific loading method can refer to the embodiment shown in FIG. 6.
[0202] 506: ending the loading acceleration according to the first preset condition.
[0203] For example, the first preset condition can include information of a first time length. The first preset condition can be set to end the non-fixed frame rate loading and run the game at a fixed frame rate after the first time length from the game loading stage ends.
[0204] Optionally, the game platform can also set different ending time for the first start and the second start of the game on the new device, for example, when the first start needs to load more content, the game engine can end the loading acceleration step after loading g seconds; when the second start, the game engine can end the loading acceleration step after loading h seconds, h is less than g, and h and g are greater than 0.
[0205] Considering the difference in the performance of the processor of the electronic device, the loading stage time of the game on different electronic devices can be different. In an embodiment, in order to ensure the acceleration effect of the game, the game engine can delay for a certain time before restoring the preset frame rate after loading to the end of the first time length. The delay time can be 2 seconds or 3 seconds without affecting the user experience.
[0206] In an embodiment, the first preset condition can include the information of the frame at which the loading acceleration ends.
[0207] For example, the first preset condition can include the information of the first frame and the fifth frame, where the first frame is the frame at which the acceleration starts, and the fifth frame is the frame at which the acceleration ends. After detecting that the user starts the target game, the game engine runs the game at a fixed frame rate after the fifth frame ends.
[0208] 507: Remove the first loading page according to the second preset condition.
[0209] For example, the second preset condition can be the time at which the first loading page is removed. For example, according to the first time length in the sampling data, the first loading page can be removed after the first time length from the game loading stage ends.
[0210] For example, the second preset condition can be the frame at which the first loading page is removed. For example, according to the sampling data, the first loading page can be removed after the game ends drawing at the e-th frame.
[0211] Optionally, according to different preset conditions, the order of steps 506 and 507 can be adjusted, that is, the game engine can first remove the first loading page and then end the loading acceleration.
[0212] Similar to step 504, if the game developer has preset the loading page, this step 507 can be omitted.
[0213] In an embodiment, steps 503, 504, 506 and 507 can be included in the frame cycle shown in step 505. For example, the game loading process of the partial game can also include user login, account verification, privacy notification and other pages. According to these intermediate pages, the game engine can flexibly adjust the running order of each step. For games without pre-installed loading pages, when the user login page is included in step 505, the game engine determines that the screen is not blank, but the loading process has not been completed, and in this case, step 507 is included in the cycle of step 505, that is, the first loading page has been removed by the game engine before the end of the loading stage.
[0214] 508: Display the main page.
[0215] Displaying the game main page indicates that the game has entered the running stage, and the user can normally operate.
[0216] Optionally, step 506 can also be performed after step 508, that is, the fixed frame rate is restored after the main page is displayed, without affecting user operation.
[0217] It should be noted that the order of the steps in the embodiments of the present application is only an example, and those skilled in the art can flexibly adjust the running order of each step according to the actual situation.
[0218] Optionally, the sampling data can also include the original loading time of the game at the fixed frame rate, which is set to i seconds. By comparing the data ratio of the first time length to the original loading time i seconds, the acceleration effect of a certain game can be judged and counted, which can be aggregated into a database or used for product promotion, etc.
[0219] In an embodiment, the game platform can set a threshold value according to the game startup time and historical user retention rate, etc. The threshold value can be used to judge whether to start the game loading acceleration. In an embodiment, the threshold value can be time. When the original loading time exceeds the threshold value, the loading stage of the game is started for loading acceleration. At this time, the startup steps of the game can refer to the embodiment shown in FIG. 11 of the present application. When the original loading time is less than or equal to the threshold value, it is considered that the game developer has optimized the loading stage of the game, and the user can accept the original loading time, and the loading acceleration does not need to be started. In another embodiment, the threshold value can also be the ratio of the first time length to the original loading time i seconds. For example, assuming that the threshold value is 70%, when the ratio of the first time length to the original loading time i seconds is higher than 70%, it is considered that the game loading acceleration effect is general, and the influence on user experience is small, and the loading acceleration method can not be used; when the ratio of the first time length to the original loading time i seconds is lower than 70%, it is considered that the game loading acceleration method has good optimization effect, and the loading acceleration step is started for the loading stage of the game.
[0220] The method of the embodiment of the application does not need to frequently perform picture detection in the loading process, and moves the picture detection and the judgment step of accelerating the loading to before the application is put on the shelf, thereby solving the problem that the electronic device cannot accurately identify when the game loading stage ends, and thereby better improving the user experience.
[0221] In the above embodiment, since the electronic device cannot determine the node at which the loading is completed, the node at which the loading ends can be determined by the picture detection result or by the game platform according to the sampling data. In order to enable the electronic device to accurately determine the start and end signs of the loading acceleration and the nodes of displaying and removing the first loading page, the embodiment of the application provides another application loading method. Taking the loading process of a game application as an example, the application loading method needs the game developer to set the node of calling the API when the first application is written.
[0222] In the embodiment, the game engine can include but is not limited to the following APIs that are open to the game developer, and the function of each API is as follows:
[0223] API 1: Start the loading acceleration, do not fix the game running frame rate, and do not reserve idle time for each frame;
[0224] API 2: End the loading acceleration, run the game at a preset frame rate, and stabilize the screen refresh rate;
[0225] API 3: Display the first loading page, which is set by the game platform to block the blank picture in the game loading stage;
[0226] API 4: Remove the first loading page displayed in API 3 to expose the game main page.
[0227] The game engine can open the document and the use method of the above API to the game developer, and the use method can include the definition, introduction, example code, etc. of the API. The game developer knows whether the game has a loading page and at which step of the game script execution the loading stage ends, and therefore, after the game is started, the game developer can select the appropriate opportunity to call different APIs through the first application 13 according to the needs. The game engine can perform the corresponding operation step after receiving the calling request of the API. Therefore, the game loading method of the embodiment of the application realizes the loading acceleration and the display and removal of the first loading page by calling the API.
[0228] FIG. 12 shows a flowchart of an application loading method 600 of the application. The application loading method 600 can include:
[0229] S610: Send a third instruction to the first application, the third instruction being used to instruct to draw the first frame of the loading stage.
[0230] S620: receiving a fourth instruction sent by the first application, the fourth instruction being used to indicate to accelerate the loading stage.
[0231] When the electronic device receives the fourth instruction sent by the first application, it is determined that the target application enters the loading stage.
[0232] Optionally, the method 600 can further include receiving a first instruction sent by the first application, the first instruction being used to indicate to display a first loading page; and displaying the first loading page according to the first instruction. The method for obtaining the first loading page can refer to the corresponding embodiments and the descriptions of FIG. 9, which will not be described here.
[0233] S630: loading the target application at a non-fixed frame rate according to the fourth instruction.
[0234] The frame rate of each frame of the target game after entering the loading stage is determined by the working time length of each frame, and the frame rate of at least one frame in the loading stage is higher than a preset frame rate. The method for loading the target game at a non-fixed frame rate can refer to the embodiment shown in FIG. 6.
[0235] Based on the above method, the electronic device can load the target application at a non-fixed frame rate after the loading stage starts according to the indication of the first application, and display the first loading page in time, which improves the loading speed of the application, avoids the user from seeing a blank screen during the loading stage, and helps to improve the user's entertainment experience.
[0236] S640: receiving a fifth instruction sent by the first application, the fifth instruction being used to indicate to stop accelerating the loading stage.
[0237] When the electronic device receives the second instruction sent by the first application, it is determined that the loading stage of the target game ends.
[0238] Optionally, the method 600 can further include receiving a second instruction sent by the first application, the second instruction being used to indicate to stop displaying the first loading page; and stopping displaying the first loading page according to the second instruction.
[0239] S650: running the target application at a preset frame rate according to the fifth instruction.
[0240] Based on the above method, the electronic device can timely switch to run the target application at a preset frame rate according to the indication of the first application, and stop displaying the first loading page, which improves the loading speed of the application in the loading stage, realizes the connection between the first loading page and other pages, does not affect the operation and visual experience of the user in the running stage, and helps to better improve the overall entertainment experience of the user.
[0241] The following takes a game as an example to introduce the steps of the application loading method 600 in detail. FIG. 13 shows a game starting stage flowchart corresponding to the embodiment of the application and the method 600. The following steps 601 to 609 are based on the interaction process between the game platform 11, the game engine 12 and the first application 13, and the game loading method 600 of the application is described in detail. The game starting stage can include but is not limited to the following:
[0242] 601: detecting that the user starts the operation of the target game.
[0243] The game platform can display multiple game entrances for the user to start. Different game platforms can have different starting methods, such as touch, click, shake, etc.
[0244] 602: in response to the starting operation of the target game, loading the resources of the target game according to the operation.
[0245] Optionally, before the game enters the loading stage, the target game starting stage also includes a code package downloading stage. When the game platform receives the starting instruction of the user, the game engine built-in the game platform downloads the code package corresponding to the game from the server, including downloading the game content, detecting the game update, etc.
[0246] 603: executing the game script and rendering the first frame.
[0247] According to the existing API calling process of the game engine, the API cannot be directly called to the game engine before the game is executed. The execution of the game script needs to be triggered by the game engine, and the subsequent API calling step can be performed after the game starts running.
[0248] 604: the first application 13 calls API 1 to instruct the game engine 12 to start loading acceleration.
[0249] When designing the first application 13, the game developer can determine at which time or which frame the game enters the loading stage. Therefore, the first application 13 can call API 1 to the game engine at a node after the game script is executed, so as to load the remaining frames in a non-fixed frame rate manner, and improve the loading speed of the game in the loading stage.
[0250] In an implementation manner, the step can also include the following: the game engine 12 receives the calling request of API 1, and returns the calling result to the first application 13. According to the calling result, the first application 13 can judge whether the calling request of API 1 is successful. If the request fails, the first application 13 can analyze the failure reason according to the status code in the calling result, and process the corresponding error.
[0251] 605: The first application 13 calls the API 3 to instruct the game engine 12 to display the first loading page.
[0252] If the first application 13 does not preset the loading page in the loading stage, the API 3 can be called to instruct the game engine to display the first loading page. The specific determination manner and content of the first loading page can refer to the corresponding content of FIG. 9.
[0253] Optionally, the front and back order of steps 604 and 605 can be adjusted, that is, the game engine can first display the first loading page and then start the loading acceleration.
[0254] Optionally, if the loading resource of the target game includes the loading page and does not need to be drawn by the game platform, this step 605 can be omitted.
[0255] 606: The game engine 12 loads the remaining frames at a non-fixed frame rate.
[0256] The remaining frames in the loading stage are run in step 606. The game engine 12 responds to the calling request of the API 1, and the loading stage adopts a non-fixed frame rate. The method of loading the target game at a non-fixed frame rate can refer to the embodiment shown in FIG. 6.
[0257] 607: The first application 13 judges that the loading stage is ended.
[0258] The first application 13 can determine the node at which the loading is ended. When the game script runs to this step, the main page can be drawn, and it is considered that the loading stage is ended.
[0259] 608: The first application 13 calls the API 2 to instruct the game engine 12 to end the loading acceleration.
[0260] The first application 13 judges that the loading stage is ended or needs to match a stable screen refresh rate at a certain node after the game starts, and then calls the API 2 to run the target game at a preset frame rate.
[0261] 609: The first application 13 calls the API 4 to instruct the game engine 12 to remove the first loading page.
[0262] The first application 13 needs to call the API 4 to instruct the game engine 12 to remove the first loading page displayed in step 605 after judging that the loading stage is ended.
[0263] Optionally, if the loading resource of the target game includes the loading page and does not need to be drawn by the game platform, and the API 3 is not called, this step 609 is omitted.
[0264] Optionally, the front and back order of steps 608 and 609 can be adjusted, that is, the game engine can first remove the first loading page and then end the loading acceleration.
[0265] In an embodiment, steps 604, 605, 608 and 609 can be included in the frame cycle shown in step 606. The steps in the embodiments of the present application are only examples, and the first application 13 can adjust the calling timing and sequence of the API according to the game logic.
[0266] 610: display the main page.
[0267] Displaying the game main page indicates that the game enters the running stage, and the user can normally play.
[0268] The method of the embodiments of the present application determines when to start and end the loading acceleration, and whether the first loading page needs to be displayed and removed. The first application 13 can autonomously select the timing of displaying and removing the first loading page and starting and ending the loading acceleration by calling the API, thereby achieving precise control of the game loading acceleration and loading page display and improving the loading speed of the game in the loading stage.
[0269] It should be noted that the specific implementation of the above game loading method is only an example, and those skilled in the art can flexibly adjust the running order of each step according to the actual situation, or can split or combine the methods in different embodiments.
[0270] The device provided by the embodiments of the present application will be described in detail below with reference to FIG. 14 and FIG. 15. It should be understood that the description of the device embodiments corresponds to the description of the method embodiments, and therefore, the content not described in detail can be referred to the above method embodiments, and for brevity, will not be described here.
[0271] FIG. 14 describes a schematic diagram of a device 900 for application loading according to an embodiment of the present application. The application loading device 900 includes a processing unit 910 and a storage unit 920. The storage unit can be used to store instructions and / or data, and the processing unit 910 can read the instructions and / or data in the storage unit 920, so that the application loading device implements the related actions performed by the electronic device in the above method embodiments. The application loading device 900 can be a component of the electronic device, for example, the application loading device 900 can also be a chip or integrated circuit in the electronic device.
[0272] It should be understood that the specific process of each unit performing the above corresponding steps has been described in detail in the above method embodiments, and for brevity, will not be described here.
[0273] FIG. 15 illustrates a structural diagram of an electronic device 1000 that can be used for application loading according to an embodiment of the present application. The electronic device 1000 includes at least one processor 1010, at least one memory 1020, and at least one communication bus 1030. The communication bus 1030 is used to realize the connection and communication between the components. The electronic device 1000 further includes a user interface 1040 for connecting a display device (e.g., a display, a touch screen, an LCD, a holographic, or a projector, etc.) and an input device (e.g., a keyboard, a mouse, a trackball, a gamepad, a touchpad, or a touch screen, etc.).
[0274] The memory 1020 is configured to store instructions and provide instructions and data to the processor 1010. The memory 1020 can be a volatile memory or a non-volatile memory. The non-volatile memory can be a read-only memory (ROM), a programmable ROM (PROM), an erasable PROM (EPROM), an electrically EPROM (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM). For example, the RAM can be used as an external cache. By way of example and not limitation, the RAM includes a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synch link DRAM (SLDRAM), and direct rambus RAM (DR RAM). The memory described herein includes, but is not limited to, these and any other suitable types of memory.
[0275] It should be noted that the memory 1020 can be coupled to the processor 1010 through an interface or integrated with the processor 1010.
[0276] In some embodiments, the memory 1020 stores the following elements, executable modules or data structures, or a subset thereof, or an expanded set thereof:
[0277] The operating system 1021 includes various system programs, such as the application framework layer, system library, kernel layer, and the like shown in FIG. 2, for implementing various basic services and processing hardware-based tasks.
[0278] The application module 1022 includes various applications, such as the camera, gallery, game, chat, music, video, and the like shown in FIG. 2, for implementing various application services.
[0279] In the embodiments of the present application, by invoking the programs or instructions stored in the memory 1020, the processor 1010 can read the instructions and / or data in the memory 1020, so that the electronic device 1000 implements the related actions performed by the electronic device in the foregoing various method embodiments.
[0280] The embodiments of the present application also provide a program product (also referred to as a computer program product), which, when running on a device, causes the device to perform any one of the application loading methods in the above embodiments. The implementation principle and technical effects are similar to the above method-related embodiments, and will not be described here.
[0281] The embodiments of the present application provide a readable storage medium (also referred to as a computer readable storage medium), which contains instructions, when the instructions run on a device, causes the device to perform any one of the application loading methods in the above embodiments. The implementation principle and technical effects are similar, and will not be described here.
[0282] The embodiments of the present application provide a chip, which includes circuits that can be used to execute any one of the application loading methods in the above embodiments. The implementation principle and technical effects are similar, and will not be described here.
[0283] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0284] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other manners. For example, the division of the above-described device embodiment is merely an example, and there can be other division manners. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0285] The units described as separated components can or can not be physically separated, and the components displayed as units can or can not be physical units, i.e., can be located in one place or can be distributed on multiple network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments of the present application.
[0286] In addition, each functional unit in the embodiments of the present application can be integrated in one processing unit, or each unit can exist physically as a separate unit, or two or more units can be integrated in one unit.
[0287] If the above functions are implemented in the form of software function units and sold or used as an independent product, they can be stored in a readable storage medium. Based on such an understanding, the technical solutions of the present application essentially or the part that makes a contribution to the prior art or part of the technical solutions can be embodied in the form of a software product, and the software product is stored in a storage medium, including a number of instructions to make a device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory, random access memory, magnetic disk or optical disk, and various program codes that can be stored in the medium.
[0288] The above describes only the specific embodiments of the present application, but the protection scope of the present application is not limited thereto, and any person skilled in the art can easily think of changes or replacements within the technical scope disclosed in the present application, which should be covered in the protection scope of the present application.
Claims
1. An application loading method characterized by comprising: The method is applied to an electronic device, and the method comprises: detecting that a target application enters a loading stage; in response to the target application entering the loading stage, loading the target application at a non-fixed frame rate, wherein a frame rate of each frame in the loading stage is determined by a working duration of the each frame, and a frame rate of at least one frame in the loading stage is higher than a preset frame rate.
2. The application loading method according to claim 1, wherein The method further comprises: in the loading stage, detecting that a loading page of the target application is a blank screen, obtaining a first loading page; displaying the first loading page.
3. The application loading method according to claim 2, wherein The detection that the loading page of the target application is a blank screen comprises: in an n-th frame in the loading stage, obtaining pixel values of a plurality of pixel points in a to-be-displayed screen, wherein n is an integer greater than 0; when the pixel values of the plurality of pixel points are all 0, determining that the loading page of the target application is a blank screen.
4. The application loading method according to claim 3, wherein The method further comprises: in a p-th frame in the loading stage, obtaining pixel values of a plurality of pixel points in a to-be-displayed screen, wherein p is an integer greater than 0; when the pixel values of the plurality of pixel points are not all 0, stopping displaying the first loading page, wherein the p-th frame is a frame after the n-th frame.
5. The application loading method of claim 2, wherein The detection that the loading page of the target application is a blank screen comprises: in an m-th frame in the loading stage, obtaining a number of times of calling a graphics drawing application programming interface (API), wherein m is an integer greater than 0; when the number of times of calling the graphics drawing API is 0, determining that the loading page of the target application is a blank screen.
6. The application loading method according to claim 5, wherein The method further comprises: in a q-th frame in the loading stage, obtaining a number of times of calling a graphics drawing API, wherein q is an integer greater than 0; when the number of times of calling the graphics drawing API is not 0, stopping displaying the first loading page, wherein the q-th frame is a frame after the m-th frame.
7. The application loading method of claim 1, wherein The method further comprises: before the loading of the target application at the non-fixed frame rate, obtaining first information, the first information being used to indicate that a loading page of the target application is a blank screen; in the loading stage, displaying a first loading page according to the first information.
8. The application loading method according to Claim 7, wherein The method further comprises: before the loading of the target application at the non-fixed frame rate, obtaining information of a first duration, the first duration being a duration of the loading of the target application at the non-fixed frame rate; wherein the loading of the target application at the non-fixed frame rate comprises: in the first duration from the start of the loading stage, loading the target application at the non-fixed frame rate.
9. The application loading method according to claim 8, wherein The method further comprises: after the end of the first duration from the start of the loading stage, stopping displaying the first loading page.
10. The application loading method according to claim 8 or 9, wherein The method further comprises: after the end of the first duration from the start of the loading stage, running the target application at the preset frame rate.
11. The application loading method of claim 1, wherein, The method further comprises: receiving a first instruction sent by a first application, the first instruction being used to indicate displaying a first loading page; displaying the first loading page according to the first instruction.
12. The application loading method according to Claim 11, wherein The method further comprises: receiving a second instruction sent by the first application, the second instruction being used to indicate stopping displaying the first loading page; According to a second instruction, stop displaying the first loading page.
13. The application loading method according to any one of claims 1, 11 or 12, wherein, The method further includes: sending a third instruction to the first application, the third instruction being used to instruct to draw a first frame of the loading stage; receiving a fourth instruction sent by the first application, the fourth instruction being used to instruct to accelerate the loading stage; wherein the loading of the target application at a non-fixed frame rate includes: loading the target application at a non-fixed frame rate according to the fourth instruction.
14. The application loading method according to Claim 13, wherein The method further includes: receiving a fifth instruction sent by the first application, the fifth instruction being used to instruct to stop accelerating the loading stage; running the target application at the preset frame rate according to the fifth instruction.
15. An electronic device, comprising: The electronic device includes: one or more processors; one or more memories; and one or more programs, wherein the one or more programs are stored in the one or more memories, and the one or more programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the application loading method according to any one of claims 1 to 14.
16. A readable storage medium, characterized by, The readable storage medium stores a program or instructions, and when the program or instructions are executed, the application loading method according to any one of claims 1 to 14 is implemented.
17. A chip, characterized by The chip includes a circuit for executing the application loading method according to any one of claims 1 to 14.
18. A program product, characterized by The program product stores a program or instructions, and when the program or instructions are executed, the application loading method according to any one of claims 1 to 14 is implemented.
Citation Information
Patent Citations
Method and device for determining loading speed of browser
CN105260406A
Method, device and system for adjusting frame rate
CN105611316A
Application frame rate smoothing method, electronic equipment and storage medium
CN116680153A
WebView-based webpage refreshing method and device
CN117271924A
Display device and browser rendering frame rate adjusting method
CN118450199A