WO2024120177A1 - 应用程序运行控制方法、装置、设备及存储介质 - Google Patents

应用程序运行控制方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2024120177A1
WO2024120177A1 PCT/CN2023/132854 CN2023132854W WO2024120177A1 WO 2024120177 A1 WO2024120177 A1 WO 2024120177A1 CN 2023132854 W CN2023132854 W CN 2023132854W WO 2024120177 A1 WO2024120177 A1 WO 2024120177A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
function
window
frame rate
program
Prior art date
Application number
PCT/CN2023/132854
Other languages
English (en)
French (fr)
Inventor
黄靖斌
陈可惟
李懿礼
Original Assignee
北京字跳网络技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京字跳网络技术有限公司 filed Critical 北京字跳网络技术有限公司
Publication of WO2024120177A1 publication Critical patent/WO2024120177A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the embodiments of the present disclosure relate to the field of computer technology, and more particularly to a method, apparatus, device, and storage medium for controlling the execution of an application program.
  • images or videos are edited through image processing applications to achieve the purpose of adding visual effects to them.
  • the application will preview the edited image in real time, so that the operator can observe the effect of image editing in real time, thereby improving the quality and efficiency of image editing.
  • the terminal device running the image processing application needs to run other applications at the same time.
  • the running of the image processing application will cause other applications to run stuck, have reduced fluency, and run slower, thus affecting the normal operation of other applications.
  • the embodiments of the present disclosure provide an application running control method, apparatus, device and storage medium to overcome the problem that the running of an image processing application causes the running of other applications to become stuck, have reduced fluency and slow down.
  • an embodiment of the present disclosure provides an application program execution control method, comprising:
  • the current application frame rate of the first application is set as a target application frame rate, wherein the application frame rate represents an interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • an application program execution control device including:
  • a detection module used for detecting indication information of an operating system, wherein a first application and a second application are running in the operating system, and the indication information is used for indicating an input focus for receiving input information;
  • a control module used to set the current application frame rate of the first application as a target application frame rate according to the indication information after the input focus is transferred from the first application to the second application, wherein the application frame rate represents the interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • an electronic device including:
  • a processor and a memory communicatively connected to the processor
  • the memory stores computer-executable instructions
  • the processor executes the computer-executable instructions stored in the memory to implement the application execution control method described in the first aspect and various possible designs of the first aspect.
  • an embodiment of the present disclosure provides a computer-readable storage medium, in which computer execution instructions are stored.
  • a processor executes the computer execution instructions, the application execution control method described in the first aspect and various possible designs of the first aspect is implemented.
  • an embodiment of the present disclosure provides a computer program product, including a computer program, which, when executed by a processor, implements the application execution control method described in the first aspect and various possible designs of the first aspect.
  • the application running control method, apparatus, device and storage medium detects indication information of an operating system, in which a first application and a second application are running, and the indication information is used to indicate an input focus for receiving input information; according to the indication information, after the input focus is transferred from the first application to the second application, the current application frame rate of the first application is set to a target application frame rate, wherein the application frame rate represents the interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • the running parameters of the first application are configured so that the first application runs at a rate lower than the current frame rate.
  • the target application frame rate of the previous application frame rate is run, thereby releasing the computing resources occupied by the first application, allowing the second application to use more sufficient computing resources to run, improving the fluency and running speed of the second application, and reducing program jams.
  • FIG1 is a diagram of an application scenario of the application program execution control method provided by an embodiment of the present disclosure
  • FIG2 is a flow chart of a method for controlling application program execution according to an embodiment of the present disclosure
  • FIG3 is a flowchart of a specific implementation method of step S102 in the embodiment shown in FIG2 ;
  • FIG4 is a schematic diagram of a process for determining a target application frame rate provided by an embodiment of the present disclosure
  • FIG5 is a flowchart of a specific implementation method of step S103 in the embodiment shown in FIG2 ;
  • FIG6 is a schematic diagram of a video playback process provided by an embodiment of the present disclosure.
  • FIG. 7 is a flowchart of a specific implementation method of step S1031 in the embodiment shown in FIG. 5 ;
  • FIG8 is a flowchart of a specific implementation method of step S1032 in the embodiment shown in FIG5 ;
  • FIG9 is a schematic diagram of a process of pausing an application function provided by an embodiment of the present disclosure.
  • FIG10 is a second flow chart of the application program execution control method provided in an embodiment of the present disclosure.
  • FIG11 is a schematic diagram of creating a first window provided by an embodiment of the present disclosure.
  • FIG12 is a structural block diagram of an application program execution control device provided by an embodiment of the present disclosure.
  • FIG13 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure.
  • FIG. 14 is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present disclosure.
  • user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • user information including but not limited to user device information, user personal information, etc.
  • data including but not limited to data used for analysis, stored data, displayed data, etc.
  • FIG. 1 is an application scenario diagram of the application program running control method provided by the embodiment of the present disclosure.
  • the application program running control method provided by the embodiment of the present disclosure can be applied to the application scenario of multiple applications running synchronously. More specifically, for example, in application scenarios such as image editing and video special effects production.
  • the method provided by the embodiment of the present disclosure can be applied to terminal devices, such as personal computers, etc.
  • application scenarios such as image editing and video special effects production that require multiple programs to run synchronously, in the operating system of the terminal device, while running the image editing program, other programs, such as browser programs, will also be run in the background.
  • the terminal device displays the program interface (shown as program interface A in the figure) of the image editing program (shown as program P1 in the figure) at the top layer of the operating system interface
  • the program interface of the image editing program has an input focus, and then the operation of the image editing program can be realized by responding to the input information input by the user.
  • the terminal device switches the display of the image editing program and the browser program, and displays the program interface (shown as program interface B in the figure) of the browser program (shown as program P2 in the figure) at the top layer of the operating system interface.
  • the program interface of the browser program has the input focus, and then the operation of the browser program can be realized by responding to the input information input by the user.
  • the synchronous operation and coordination between multiple programs can be realized, for example, the picture in the browser program can be copied to the image editing program through the clipboard.
  • the graphic editing program will preview the edited image in real time, so that the operator can observe the effect of image editing in real time, thereby improving the quality and efficiency of image editing. Since this process requires a large amount of computing resources of the terminal device to perform real-time image rendering, the computing resource occupancy rate of the terminal device is high. In this case, when the user needs to switch to other programs, such as the browser program shown in FIG1, the browser program may freeze or run slowly due to insufficient system resources, affecting the normal operation of the browser program.
  • the disclosed embodiment provides an application program operation control method to solve the above problems.
  • FIG. 2 is a flow chart of an application program execution control method provided by an embodiment of the present disclosure.
  • the method of this embodiment can be applied in a terminal device, and the application program execution control method includes:
  • Step S101 detecting indication information of an operating system, wherein a first application and a second application are running in the operating system, and the indication information is used to indicate an input focus for receiving input information.
  • the execution subject of the application running control method provided in this embodiment is a terminal device, such as a personal computer, a tablet computer, etc.
  • An operating system is installed in the terminal device, such as a Windows operating system, an Android operating system, etc.
  • the corresponding application is run in the operating system.
  • at least a first application and a second application are run in the operating system of the terminal device, and the first application and the second application respectively have program interfaces that can be displayed in the operating system interface.
  • the first application and the second application can also be other applications, such as a file management program, other image editing programs, or programs that come with the operating system. Examples are not given one by one here, and the first application and the second application can be configured as needed.
  • the Windows operating system is a message-oriented system.
  • the application can only passively wait for the user's key press message, and cannot actively read the keyboard status. That is to say, every time a key is pressed on the keyboard, the operating system will send a key press message to the window to tell it that a certain key has been pressed. As long as the mouse moves, the system will also send a corresponding message and pass the mouse coordinate information to the window.
  • the Windows operating system can execute many programs at the same time, and the use of input focus can solve this problem. For example, when a certain interface or window obtains the input focus, it will not only be promoted to the front of the screen, but also have a different color, and all keyboard messages will be directed to the window, and the interface or window will also become the "active window".
  • the operating system when the application is running, the operating system will assign input focus to the program interface of the running program currently running in the foreground.
  • the operating system when the input focus changes, the operating system will also track the input focus and obtain the corresponding window pointer.
  • the implementation method of input focus detection is different, but the specific implementation method is a prior art known to those skilled in the art and will not be repeated here.
  • Step S102 According to the indication information, after the input focus is transferred from the first application to the second application, the current application frame rate of the first application is set as the target application frame rate, wherein the application frame rate represents the interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • step S102 includes:
  • Step S1021 After the input focus is transferred from the first application to the second application, the program type of the second application is obtained.
  • Step S1022 Determine a target application frame rate based on the program type of the second application program.
  • Step S1023 setting the current first application frame rate of the first application program as the target application frame rate.
  • the transfer of input focus from the first application to the second application is the result of the terminal device receiving and responding to the switching operation of the user input, which represents the change of the user's operation target.
  • the user needs to switch to use multiple applications.
  • the lower the target application frame rate set for the first application the lower the resource consumption of the first application, and the more redundant computing resources are left for the second application to use.
  • the fluency of the second application cannot be further improved.
  • the target application frame rate set by the first application is too low, which will cause the response speed of the first application to be slower.
  • the amount of computing resources required to run the application of that program type can be determined by first obtaining the program type of the second application, and then the target application frame rate of the first application can be determined based on the difference between the total computing resources of the terminal device and the required computing resources.
  • Figure 4 is a schematic diagram of a process for determining a target application frame rate provided by an embodiment of the present disclosure. As shown in Figure 4, after the input focus is transferred, the program type of the second application is determined. When the second application is of the first program type, the frame rate coefficient is determined to be 0.9.
  • the first program type characterization includes: applications such as wordpad programs, drawing board programs, calculator programs, and picture viewer programs whose running requires computing resources less than a first preset value.
  • the frame rate coefficient is 0.9, which characterizes that the target application frame rate of the first application is 90% of the current application frame rate of the first application.
  • the frame rate coefficient is determined to be 0.5.
  • the program type of the second application that receives the input focus is determined, and based on the program type of the second application, the target amount of computing resources required to run the second application is determined, thereby determining the target application frame rate of the first application; thereby, while ensuring that sufficient computing resources are reserved for the second application, the target application frame rate of the first application is improved, and when it is necessary to switch back to the first application later, the response speed of the first application is improved, thereby improving the overall smoothness of the process of switching between the first application and the second application.
  • the first application has at least one application function, and after the input focus is transferred from the first application to the second application, the method further includes:
  • Step S103 stopping at least one application function of the first application, where the application function includes a video playback function and/or an audio playback function.
  • the first application has at least one application function, such as a video playback function, an audio playback function, etc.
  • a video editing application for example, it is a video preview, an audio preview, and other functions in the video editing process.
  • application functions such as video playback and audio playback will continue to run, resulting in the occupation of more computing resources.
  • the video playback function and/or the audio playback function are stopped, which can further reduce the resource occupation of the first application and reduce the waste of computing resources.
  • other continuously running functions such as video subtitles, etc., can also be stopped, which will not be repeated here.
  • step S103 includes:
  • Step S1031 Obtain the buffering time length corresponding to the first application program, where the buffering time length is determined by the pause time length required to pause the target application function of the first application program.
  • Step S1032 after the buffering time, synchronously stop the target application function and at least one other application function of the first application.
  • the first application has multiple applications, including a target application function and at least one other application function except the target application function.
  • the target application function is a video playback function, which is a video preview function for an image editing application
  • other application functions include audio playback, video subtitle display, etc.
  • the pause time required to suspend the above-mentioned application functions is inconsistent. For example, for the target application function, suspending the target application function requires a longer pause time, such as 0.5 seconds. While pausing other application functions requires a shorter pause time, such as 0.02 seconds. That is, the application function with a longer pause time can be determined as the target application function.
  • the pause time is a preset value corresponding to each application function, which can be obtained by reading the corresponding configuration file or preset information, and the details will not be repeated. Furthermore, the difference in the pause time of the above-mentioned application functions is due to the specific implementation process of the application function. For example, for the video playback function (video preview function), in the process of playing the video, the video needs to be decoded and then The decoded video frames are displayed frame by frame.
  • FIG6 is a schematic diagram of a video playback process provided by an embodiment of the present disclosure.
  • the video decoding-video frame playback process is asynchronous (i.e., the decoding time and the playback time are inconsistent).
  • the video decoding is performed first, and the video frame is played after that.
  • the decoded but not played video frames (deemed as frames to be played in the figure) will continue to be played, resulting in a "delayed pause" phenomenon in the display of the application.
  • the decoding and playback are restarted from the decoding time to avoid frame skipping due to the loss of the above-mentioned decoded but not played video frames.
  • the cache duration is determined based on the duration required to suspend the target application, and after the cache duration, the target application function of the first application and at least one other application function are synchronously stopped.
  • FIG. 7 is a flowchart of a specific implementation method of step S1031 in the embodiment shown in FIG. 5 .
  • the specific steps of step S1041 include:
  • Step S1031A Determine the target application function of the first application program, where the target application function is the application function that takes the longest time to pause.
  • Step S1031B Obtain the buffering duration corresponding to the first application program according to the suspension duration of the target application function.
  • the application function with the longest suspension time is determined as the target application function according to the suspension time of each application function, wherein the suspension time corresponding to each application function is a preset value, and the specific acquisition method is not repeated. Then, according to the suspension time of the target application function, the buffering time corresponding to the first application is determined.
  • FIG. 8 is a flowchart of a specific implementation method of step S1032 in the embodiment shown in FIG. 5 .
  • the specific steps of step S1032 include:
  • Step S1032A Send a first stop instruction to the target application function to stop the first sub-function of the target application function.
  • Step S1032B After the buffering time, a second stop instruction is sent to the target application function and other application functions to stop the second sub-function of the target application function and other application functions.
  • the video playback function is implemented based on the decoding function (first sub-function) and the rendering function (second sub-function) executed in sequence.
  • the decoding function is a background processing function, wherein the background processing function refers to a function that is not displayed at the front end of the application interface.
  • the rendering function is a foreground display function, and correspondingly, the foreground display function refers to a function displayed at the front end of the application interface.
  • Figure 9 is a schematic diagram of a process of pausing an application function provided by an embodiment of the present disclosure.
  • the terminal device first sends a first stop instruction to the target application function to stop the first sub-function, such as stopping the decoding function, that is, no longer generating new video frames to be played.
  • a first stop instruction to the target application function to stop the first sub-function, such as stopping the decoding function, that is, no longer generating new video frames to be played.
  • the decoding position P1 and the playback position P2 in the target video are as shown in Figure 9, and the two are separated by several video frames to be played.
  • a second stop instruction is sent to the target application function and other application functions.
  • the video frame to be played is (almost) consumed by the second sub-function (rendering function), and the decoding position P1 and the playback position P2 in the target video are as shown in Figure 9.
  • the two are (almost) overlapped.
  • the second sub-function and other application functions are stopped. Since the pause of other application functions (such as audio playback function, subtitle display function) takes a shorter time, an instantaneous stop can be achieved. Therefore, the synchronous pause of multiple application functions of the first application is achieved (stopped simultaneously at time P2), thereby improving the synchronization between multiple application functions.
  • a first application and a second application are running in the operating system, and the indication information is used to indicate the input focus for receiving input information; according to the indication information, after the input focus is transferred from the first application to the second application, the current application frame rate of the first application is set to the target application frame rate, wherein the application frame rate represents the interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • the operating parameters of the first application are configured after detecting that the input focus of the operating system is transferred from the first application to the second application, the first application is run at a target application frame rate lower than the current application frame rate, thereby releasing the computing resources occupied by the first application, allowing the second application to run with more sufficient computing resources, improving the fluency and running speed of the second application, and reducing program jams.
  • FIG. 10 is a flow chart of an application program execution control method provided by an embodiment of the present disclosure. Schematic diagram 2. Based on the embodiment shown in FIG. 2, this embodiment adds a step of controlling the input focus within the first application program.
  • the application program operation control method includes:
  • Step S201 Detect instruction information of the operating system.
  • FIG. 11 is a schematic diagram of creating a first window provided by an embodiment of the present disclosure.
  • the second window is an "active window" and the second window can receive input information input by the user, i.e., the second input information.
  • the second input information is, for example, a trigger instruction for the component button_1 (shown as a hand mark in the figure).
  • the terminal device responds to the second input information, triggers the component button_1, and creates a new functional window in the first application, i.e., the first window.
  • the input focus is transferred from the second window to the first window. Since the first window is created on the basis of the second window, the input focus is also transferred from the second window to the first window. Therefore, the second window is equivalent to the parent window of the first window.
  • a transfer record representing the transfer relationship between the first window and the second window, i.e., the focus information, is generated.
  • the terminal device receives and responds to the third input information and creates a third window
  • the first window is the parent window of the third window
  • the focus information is further updated thereafter so that the focus information can represent the transfer record of the input focus being transferred in the order of the second window-the first window-the third window.
  • Step S204 displaying a first window of a first application program, and receiving operation input information for the first window, where the operation input information is used to operate an application function in the first window.
  • the first window after creating the first window and transferring the input focus from the second window to the first window, the first window, as the current "active window", can receive the operation input information input by the user to execute the application function in the first window. For example, if the first window is used for video preview, then in response to the operation input information, functions such as video jump and video playback speed setting can be implemented. Examples are not given one by one. It should be noted that this step is an optional step. The specific implementation method of receiving and responding to the operation input information of the first window can be set as needed. After displaying the first window of the first application, Perform multiple operations (receive multiple operation input instructions), or close the first window without performing any operation (not accepting operation input instructions). During this process, the input focus is always located in the first window of the first application, and the step of reducing the application frame rate will not be triggered.
  • Step S205 In response to the first input information for the first window, close the first window.
  • Step S206 Determine the second window corresponding to the first window according to the focus information, and transfer the input focus to the second window.
  • the user inputs the first input information to close the first window.
  • the first input information is, for example, a trigger instruction for a window close button (shown as a hand-shaped mark in the figure), and the terminal device responds to the first input information to close the first window.
  • it is necessary to control the input focus of the first window so that the input focus returns to the parent window of the first window without leaving the first application, resulting in the problem of false triggering of the application frame rate reduction.
  • the focus information generated in the previous step is obtained, and the focus information records the input focus transfer record when the first window is generated.
  • the parent window of the first window that is, the second window in the previous step
  • the window pointer of the parent window corresponding to the first window is recorded in the focus information.
  • the input focus is transferred from the first window to the second window, making the second window the "active window", thereby realizing step-by-step backtracking of the input focus.
  • the input focus can be transferred in sequence according to the order in which the functional windows in the first application are generated, so that the input focus is always located in the first application, avoiding the disappearance of the input focus caused by opening and closing the window in the first application, which in turn leads to the problem of erroneous triggering of a reduction in the application frame rate.
  • Step S207 After the input focus is transferred from the first application to the second application, the current application frame rate of the first application is set as the target application frame rate, wherein the application frame rate represents the interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • step S201 and step S207 are consistent with steps S101 and S102 in the above embodiment.
  • steps S101 and S102 in the embodiment shown in FIG. 2 , which will not be repeated here.
  • FIG. 12 is a structural block diagram of the application program execution control device provided by the embodiment of the present disclosure.
  • the application program execution control device 3 includes:
  • the detection module 31 is used to detect indication information of an operating system.
  • a first application and a second application are running in the operating system.
  • the indication information is used to indicate an input focus for receiving input information.
  • the control module 32 is used to set the current application frame rate of the first application to the target application frame rate according to the indication information after the input focus is transferred from the first application to the second application, wherein the application frame rate represents the interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • control module 32 is specifically used to: obtain the program type of the second application after the input focus is transferred from the first application to the second application; determine the target application frame rate based on the program type of the second application; and set the current first application frame rate of the first application as the target application frame rate.
  • the first application has at least one application function.
  • the control module 32 is also used to: stop at least one application function of the first application, and the application functions include video playback function and/or audio playback function.
  • the first application has a target application function and at least one other application function.
  • the control module 32 is specifically used to: obtain a buffering time corresponding to the first application, where the buffering time is determined by the pause time required to suspend the target application function of the first application; after the buffering time, synchronously stop the target application function and at least one other application function of the first application.
  • the control module 32 when obtaining the buffering time corresponding to the first application, is specifically used to: determine the target application function of the first application, the target application function is the application function that takes the longest time to pause; and obtain the buffering time corresponding to the first application based on the pause time of the target application function.
  • the target application function is implemented based on the first sub-function and the second sub-function executed in sequence, wherein the first sub-function is a background processing function and the second sub-function is a foreground display function; after the buffering period, the control module 32 is specifically used to synchronously stop the target application function and at least one other application function of the first application program by: sending a first stop instruction to the target application function to stop the first sub-function of the target application function; after the buffering period, sending a second stop instruction to the target application function and the other application functions to stop the second sub-function of the target application function and the other application functions; Function.
  • the detection module 31 is also used to: display a first window of a first application, with the input focus located in the first window; in response to first input information for the first window, close the first window, and transfer the input focus to a second window of the first application, wherein the second window is the parent window of the first window, and the parent window is the window that outputs the input focus.
  • the detection module 31 before displaying the first window of the first application, is also used to: create a first window in response to second input information for the first application; transfer the input focus currently located in the second window to the first window, and generate focus information, the focus information representing a record of the transfer of the input angle; when the detection module 31 transfers the input focus to the second window of the first application, it is specifically used to: determine the second window corresponding to the first window according to the focus information; and transfer the input focus to the second window.
  • the detection module 31 is connected to the control module 32.
  • the application program execution control device 3 provided in this embodiment can execute the technical solution of the above method embodiment, and its implementation principle and technical effect are similar, which will not be described in detail in this embodiment.
  • FIG. 13 is a schematic diagram of the structure of an electronic device provided by an embodiment of the present disclosure. As shown in FIG. 13 , the electronic device 4 includes:
  • the memory 42 stores computer executable instructions
  • the processor 41 executes the computer execution instructions stored in the memory 42 to implement the application program running control method in the embodiments shown in FIG. 2 to FIG. 7 .
  • processor 41 and the memory 42 are connected via a bus 43 .
  • the terminal device may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, personal digital assistants (PDAs), tablet computers (Portable Android Devices, PADs), portable multimedia players (Portable Media Players, PMPs), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.
  • PDAs personal digital assistants
  • PADs tablet computers
  • PMPs portable multimedia players
  • vehicle-mounted terminals such as vehicle-mounted navigation terminals
  • fixed terminals such as digital TVs, desktop computers, etc.
  • the electronic device shown in FIG14 is only an example and should not be construed as an embodiment of the present disclosure. The functionality and scope of use of this example are not limited in any way.
  • the electronic device 900 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 901, which may perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 to a random access memory (RAM) 903.
  • a processing device e.g., a central processing unit, a graphics processing unit, etc.
  • RAM random access memory
  • Various programs and data required for the operation of the electronic device 900 are also stored in the RAM 903.
  • the processing device 901, the ROM 902, and the RAM 903 are connected to each other via a bus 904.
  • An input/output (I/O) interface 905 is also connected to the bus 904.
  • the following devices may be connected to the I/O interface 905: input devices 906 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 907 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 908 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 909.
  • the communication device 909 may allow the electronic device 900 to communicate with other devices wirelessly or by wire to exchange data.
  • FIG. 14 shows an electronic device 900 having various devices, it should be understood that it is not required to implement or have all of the devices shown. More or fewer devices may be implemented or have alternatively.
  • an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart.
  • the computer program can be downloaded and installed from the network through the communication device 909, or installed from the storage device 908, or installed from the ROM 902.
  • the processing device 901 the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
  • the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the two.
  • the computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above.
  • Computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), Optical storage device, magnetic storage device, or any suitable combination of the above.
  • a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, device or device.
  • a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate or transmit a program for use by or in combination with an instruction execution system, device or device.
  • the program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
  • the computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
  • the computer-readable medium carries one or more programs.
  • the electronic device executes the method shown in the above embodiment.
  • Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages.
  • the program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server.
  • the remote computer may be connected to the user's computer via any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
  • LAN Local Area Network
  • WAN Wide Area Network
  • each box in the flowchart or block diagram may represent a module, a program segment, or a portion of code, which contains one or more executable instructions for implementing the specified logical functions.
  • the functions marked in the box may also be The blocks shown in the figure may occur in a different order than that indicated in the figure. For example, two blocks shown in succession may actually be executed substantially in parallel, and they may sometimes be executed in the opposite order, depending on the functions involved.
  • each block in the block diagram and/or flow chart, and combinations of blocks in the block diagram and/or flow chart may be implemented by a dedicated hardware-based system that performs the specified functions or operations, or may be implemented by a combination of dedicated hardware and computer instructions.
  • the units involved in the embodiments described in the present disclosure may be implemented by software or hardware.
  • the name of a unit does not limit the unit itself in some cases.
  • the first acquisition unit may also be described as a "unit for acquiring at least two Internet Protocol addresses".
  • exemplary types of hardware logic components include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
  • FPGAs field programmable gate arrays
  • ASICs application specific integrated circuits
  • ASSPs application specific standard products
  • SOCs systems on chip
  • CPLDs complex programmable logic devices
  • a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment.
  • a machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium.
  • a machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing.
  • a more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or flash memory erasable programmable read-only memory
  • CD-ROM portable compact disk read-only memory
  • CD-ROM compact disk read-only memory
  • magnetic storage device or any suitable combination of the foregoing.
  • a method for controlling application execution comprising:
  • Detect indication information of an operating system wherein a first application and a second application are running in the operating system, and the indication information is used to indicate an input focus for receiving input information; based on the indication information, after the input focus is transferred from the first application to the second application, set the current application frame rate of the first application to a target application frame rate, wherein the application frame rate represents an interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • setting the current application frame rate of the first application as the target application frame rate includes: obtaining the program type of the second application; determining the target application frame rate based on the program type of the second application; and setting the current first application frame rate of the first application to the target application frame rate.
  • the first application has at least one application function
  • the method further includes: stopping at least one application function of the first application, the application function including a video playback function and/or an audio playback function.
  • the first application has a target application function and at least one other application function
  • stopping at least one of the application functions of the first application includes: obtaining a buffering time corresponding to the first application, where the buffering time is determined by the pause time required to suspend the target application function of the first application; after the buffering time, synchronously stopping the target application function and at least one other application function of the first application.
  • obtaining the buffering duration corresponding to the first application includes: determining a target application function of the first application, the target application function being an application function that takes the longest time to suspend; and obtaining the buffering duration corresponding to the first application based on the suspension time of the target application function.
  • the target application function is implemented based on a first sub-function and a second sub-function executed in sequence, wherein the first sub-function is a background processing function and the second sub-function is a foreground display function; after the buffering period, synchronously stopping the target application function and at least one other application function of the first application program comprises: sending a first stop instruction to the target application function to stop the first sub-function of the target application function; after the buffering period, sending a second stop instruction to the target application function and the other application functions to stop the second sub-function of the target application function and the other application functions.
  • the method also includes: displaying a first window of the first application, with the input focus located within the first window; in response to first input information for the first window, closing the first window, and transferring the input focus to a second window of the first application, wherein the second window is an upper-level window of the first window, and the upper-level window is a window that outputs the input focus.
  • the first window displaying the first application also includes: creating the first window in response to second input information for the first application; transferring the input focus currently located in the second window to the first window, and generating focus information, wherein the focus information represents the transfer record of the input angle; transferring the input focus to the second window of the first application, including: determining the second window corresponding to the first window according to the focus information; and transferring the input focus to the second window.
  • an application program execution control device comprising:
  • a detection module configured to detect indication information of an operating system, wherein a first application and a second application are running in the operating system, and the indication information is used to indicate an input focus for receiving input information;
  • a control module used to set the current application frame rate of the first application as a target application frame rate according to the indication information after the input focus is transferred from the first application to the second application, wherein the application frame rate represents the interface refresh rate of the application, and the target application frame rate is less than the current application frame rate of the first application.
  • control module is specifically used to: obtain the program type of the second application after the input focus is transferred from the first application to the second application; determine the target application frame rate based on the program type of the second application; and set the current first application frame rate of the first application to the target application frame rate.
  • the first application has at least one application function
  • the control module is further used to: stop at least one application function of the first application, and the application function includes a video playback function and/or an audio playback function.
  • the first application has a target application function and at least one other application function.
  • the control module stops at least one of the application functions of the first application, it is specifically used to: obtain a buffering time corresponding to the first application, where the buffering time is determined by the pause time required to suspend the target application function of the first application; and after the buffering time, synchronously stop the target application function and at least one other application function of the first application.
  • control module when the control module obtains the buffering time corresponding to the first application, it is specifically used to: determine the target application function of the first application, the target application function is the application function that takes the longest time to pause; When the consumption is stopped, the buffering time corresponding to the first application is obtained.
  • the target application function is implemented based on a first sub-function and a second sub-function executed in sequence, wherein the first sub-function is a background processing function and the second sub-function is a foreground display function; after the buffering period, when the control module synchronously stops the target application function and at least one other application function of the first application, it is specifically used to: send a first stop instruction to the target application function to stop the first sub-function of the target application function; after the buffering period, send a second stop instruction to the target application function and the other application functions to stop the second sub-function of the target application function and the other application functions.
  • the detection module is also used to: display a first window of the first application, with the input focus located within the first window; in response to first input information for the first window, close the first window, and transfer the input focus to a second window of the first application, wherein the second window is an upper-level window of the first window, and the upper-level window is a window that outputs the input focus.
  • the detection module before displaying the first window of the first application, is further used to: create the first window in response to second input information for the first application; transfer the input focus currently located in the second window to the first window, and generate focus information, wherein the focus information represents a transfer record of the input angle; when the detection module transfers the input focus to the second window of the first application, the detection module is specifically used to: determine the second window corresponding to the first window according to the focus information; and transfer the input focus to the second window.
  • an electronic device comprising: a processor, and a memory communicatively connected to the processor;
  • the memory stores computer-executable instructions
  • the processor executes the computer-executable instructions stored in the memory to implement the application execution control method described in the first aspect and various possible designs of the first aspect.
  • a computer-readable storage medium stores computer execution instructions.
  • the application execution control method described in the first aspect and various possible designs of the first aspect is implemented.
  • an embodiment of the present disclosure provides a computer program product, including a computer program, When the computer program is executed by a processor, it implements the application program execution control method described in the first aspect and various possible designs of the first aspect.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

本公开实施例提供一种应用程序运行控制方法、装置、设备及存储介质,通过检测操作系统的指示信息,操作系统内运行有第一应用程序和第二应用程序,指示信息用于指示接收输入信息的输入焦点;根据指示信息,在输入焦点由第一应用程序转移至第二应用程序之后,将第一应用程序当前的应用帧率设置为目标应用帧率,其中,应用帧率表征应用程序的界面刷新率,目标应用帧率小于第一应用程序当前的应用帧率。由于在检测到操作系统的输入焦点由第一应用程序转移至第二应用程序后,对第一应用程序的运行参数进行配置,使第一应用程序以低于当前的应用帧率的目标应用帧率运行,从而释放计算资源,提高第二应用程序的流畅度和运行速度,减少程序卡顿。

Description

应用程序运行控制方法、装置、设备及存储介质
本申请要求2022年12月05日递交的、标题为“应用程序运行控制方法、装置、设备及存储介质”、申请号为202211552513.4的中国发明专利申请的优先权,该申请的全部内容通过引用结合在本申请中。
技术领域
本公开实施例涉及计算机技术领域,尤其涉及一种应用程序运行控制方法、装置、设备及存储介质。
背景技术
在图像编辑、图像后期处理等应用领域中,通过图像处理应用程序,对图片或视频进行编辑,来达到为图片或视频增加视觉特效的目的。在该过程中,应用程序会对编辑后的图像进行实时的预览显示,使操作者能够实时的观察到图像编辑的效果,从而提高图像编辑的质量和效率。
然而,在实际应用过程中,运行图像处理应用程序的终端设备需要同时运行其他应用程序,而图像处理应用程序的运行,会导致其他应用程序的运行出现卡顿、流畅度降低和运行速度变慢等问题,影响其他应用程序的正常运行。
发明内容
本公开实施例提供一种应用程序运行控制方法、装置、设备及存储介质,以克服图像处理应用程序的运行导致其他应用程序的运行出现卡顿、流畅度降低和运行速度变慢等问题。
第一方面,本公开实施例提供一种应用程序运行控制方法,包括:
检测操作系统的指示信息,所述操作系统内运行有第一应用程序和第二应用程序,所述指示信息用于指示接收输入信息的输入焦点;根据所述指示信息,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后, 将所述第一应用程序当前的应用帧率设置为目标应用帧率,其中,所述应用帧率表征应用程序的界面刷新率,所述目标应用帧率小于所述第一应用程序当前的应用帧率。
第二方面,本公开实施例提供一种应用程序运行控制装置,包括:
检测模块,用于检测操作系统的指示信息,所述操作系统内运行有第一应用程序和第二应用程序,所述指示信息用于指示接收输入信息的输入焦点;
控制模块,用于根据所述指示信息,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,将所述第一应用程序当前的应用帧率设置为目标应用帧率,其中,所述应用帧率表征应用程序的界面刷新率,所述目标应用帧率小于所述第一应用程序当前的应用帧率。
第三方面,本公开实施例提供一种电子设备,包括:
处理器,以及与所述处理器通信连接的存储器;
所述存储器存储计算机执行指令;
所述处理器执行所述存储器存储的计算机执行指令,以实现如上第一方面以及第一方面各种可能的设计所述的应用程序运行控制方法。
第四方面,本公开实施例提供一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的应用程序运行控制方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序,该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的应用程序运行控制方法。
本实施例提供的应用程序运行控制方法、装置、设备及存储介质,通过检测操作系统的指示信息,所述操作系统内运行有第一应用程序和第二应用程序,所述指示信息用于指示接收输入信息的输入焦点;根据所述指示信息,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,将所述第一应用程序当前的应用帧率设置为目标应用帧率,其中,所述应用帧率表征应用程序的界面刷新率,所述目标应用帧率小于所述第一应用程序当前的应用帧率。由于在检测到操作系统的输入焦点由第一应用程序转移至第二应用程序后,对第一应用程序的运行参数进行配置,使第一应用程序以低于当 前的应用帧率的目标应用帧率运行,从而释放第一应用程序所占用的计算资源,使第二应用程序能够使用更加充足的计算资源运行,提高第二应用程序的流畅度和运行速度,减少程序卡顿。
附图说明
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本公开的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本公开实施例提供的应用程序运行控制方法的一种应用场景图;
图2为本公开实施例提供的应用程序运行控制方法的流程示意图一;
图3为图2所示实施例中步骤S102的具体实现方式流程图;
图4为本公开实施例提供的一种确定目标应用帧率的过程示意图;
图5为图2所示实施例中步骤S103的具体实现方式流程图;
图6为本公开实施例提供的一种视频播放过程示意图;
图7为图5所示实施例中步骤S1031的具体实现方式流程图;
图8为图5所示实施例中步骤S1032的具体实现方式流程图;
图9为本公开实施例提供的一种暂停应用功能的过程示意图;
图10为本公开实施例提供的应用程序运行控制方法的流程示意图二;
图11为本公开实施例提供的一种创建第一窗口的示意图;
图12为本公开实施例提供的应用程序运行控制装置的结构框图;
图13为本公开实施例提供的一种电子设备的结构示意图;
图14为本公开实施例提供的电子设备的硬件结构示意图。
具体实施方式
为使本公开实施例的目的、技术方案和优点更加清楚,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本公开一部分实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
需要说明的是,本申请所涉及的用户信息(包括但不限于用户设备信息、用户个人信息等)和数据(包括但不限于用于分析的数据、存储的数据、展示的数据等),均为经用户授权或者经过各方充分授权的信息和数据,并且相关数据的收集、使用和处理需要遵守相关国家和地区的相关法律法规和标准,并提供有相应的操作入口,供用户选择授权或者拒绝。
下面对本公开实施例的应用场景进行解释:
图1为本公开实施例提供的应用程序运行控制方法的一种应用场景图,本公开实施例提供的应用程序运行控制方法,可以应用于多应用程序同步运行的应用场景。更具体地,例如图像编辑、视频特效制作等应用场景下。如图1所示,本公开实施例提供的方法,可以应用于终端设备,例如个人电脑等。在图像编辑、视频特效制作等需要多程序同步运行的应用场景下,终端设备的操作系统内,在运行图像编辑程序的同时,还会以后台运行的方式运行其他程序,例如浏览器程序。在实际运行过程中,当终端设备将图像编辑程序(图中示为程序P1)的程序界面(图中示为程序界面A)显示在操作系统界面的最上层时,该图像编辑程序的程序界面具有输入焦点,之后通过响应用户输入的输入信息,可以实现对该图像编辑程序的操作。而当接收到用户输入的切换操作后,终端设备对图像编辑程序和浏览器程序进行切换显示,将浏览器程序(图中示为程序P2)的程序界面(图中示为程序界面B)显示在操作系统界面的最上层,此时,该浏览器程序的程序界面具有输入焦点,之后通过响应用户输入的输入信息,可以实现对该浏览器程序的操作。从而实现多程序之间的同步运行和协调工作,例如将浏览器程序内的图片,通过剪切板复制至图像编辑程序。
现有技术中,以图形编辑程序为例,图形编辑程序会对编辑后的图像进行实时的预览显示,使操作者能够实时的观察到图像编辑的效果,从而提高图像编辑的质量和效率。由于该过程需要占用终端设备大量的计算资源进行实时的图像渲染,因此,导致终端设备的计算资源占用率较高,在此情况下,当用户需要切换至其他程序时,例如图1中所示的浏览器程序,则会出现由于系统资源不足而导致的浏览器程序的卡顿、运行速度慢等问题,影响浏览器程序的正常运行。本公开实施例提供一种应用程序运行控制方法以解决上述问题。
参考图2,图2为本公开实施例提供的应用程序运行控制方法的流程示意图一。本实施例的方法可以应用在终端设备中,该应用程序运行控制方法包括:
步骤S101:检测操作系统的指示信息,操作系统内运行有第一应用程序和第二应用程序,指示信息用于指示接收输入信息的输入焦点。
示例性地,本实施例提供的应用程序运行控制方法的执行主体为终端设备,例如为个人电脑、平板电脑等。终端设备内安装有操作系统,例如视窗(Windows)操作系统、安卓(Android)操作系统等。基于操作系统,在操作系统运行相应的应用程序。其中,终端设备的操作系统内至少运行有第一应用程序和第二应用程序,第一应用程序和第二应用程序分别具有可显示在操作系统界面内的程序界面,具体可参见图1中所示的图像编辑程序和浏览器程序。当然,可以理解的是,第一应用程序和第二应用程序还可以是其他的应用程序,例如文件管理程序、其他图像编辑程序或者操作系统中自带的程序,此处不再一一举例赘述,第一应用程序和第二应用程序可根据需要配置。
进一步地,操作系统能够生成指示信息,指示信息用于指示接收输入信息的输入焦点,一种具体实现方式中,指示信息为操作系统界面内的焦点(Focus),用于指示接收输入信息的程序、组件。焦点也称为输入焦点,在操作系统界面内,通常具有输入焦点的程序界面,会被显示于操作系统界面的最上层,当应用程序的程序界面具有输入焦点时,可以通过终端设备的人机接口接收输入信息,从而实现对该具有输入焦点的应用程序的操作。
更具体地,以视窗(Windows)操作系统为例,视窗操作系统是一个以消息为导向的系统,应用程序只能被动地等待用户按键的消息,不能主动地去读键盘的状态,也就是说,每当键盘上有个键被按下,操作系统就会发出一个按键消息给窗口,告诉它某个键被按下去了,只要鼠标移动一下,系统也会发出相应的消息,并把鼠标的坐标信息传给窗口。视窗操作系统可以同时执行许多程序,采用输入焦点(input focus)可以解决这个问题。示例性地,比如当某个界面或窗口取得输入焦点,它不但会被提升到屏幕的最前面,颜色也会有所不同,所有的键盘消息就会导向该窗口,该界面或窗口也成为“活动窗口”。
进一步地,示例性地,当应用程序运行后,操作系统会为当前在前台运行的运行程序的程序界面赋予输入焦点,相应的,当输入焦点发生变化时,操作系统也会对输入焦点进行跟踪,而获得相应的窗口指针。在不同的操作系统中,对输入焦点的检测的实现方式不同,但具体实现方式为本领域技术人员知晓的现有技术,此处不再赘述。
步骤S102:根据指示信息,在输入焦点由第一应用程序转移至第二应用程序之后,将第一应用程序当前的应用帧率设置为目标应用帧率,其中,应用帧率表征应用程序的界面刷新率,目标应用帧率小于第一应用程序当前的应用帧率。
示例性地,在根据指示信息所表征的输入焦点,当检测到输入焦点由第一应用程序转移至第二应用程序后,说明输入焦点发生了转移,即用户将第一应用程序由“前台运行”切换为“后台运行”,而将第二应用程序由“后台运行”切换为“前台运行”,此种情况下,对切换至后台的第一应用程序的应用帧率进行调节,降低当前的运行帧率至目标运行帧率。例如,第一应用程序在正常前台运行(具有输入焦点)的情况下,正常的应用帧率为30赫兹(Hz),即第一应用程序的界面刷新率为30Hz,则当第一应用程序被切换至后台运行时(失去输入焦点),将其应用频率设置为1赫兹(Hz),即第一应用程序的界面刷新率为1Hz,从而降低第一应用程序界面显示所需的计算资源开销。
其中,在一种可能的实现方式中,如图3所示,步骤S102的具体实现方式包括:
步骤S1021:在输入焦点由第一应用程序转移至第二应用程序之后,获取第二应用程序的程序类型。
步骤S1022:基于第二应用程序的程序类型,确定目标应用帧率。
步骤S1023:将第一应用程序当前的第一应用帧率设置为目标应用帧率。
示例性地,输入焦点由第一应用程序转移至第二应用程序,是终端设备接收并响应用户输入的切换操作的结果,表征用户操作目标的改变。在多应用程序协调工作的应用场景下,用户需要切换使用多个应用程序,当由第一应用程序切换至第二应用程序后,为第一应用程序设置的目标应用帧率越低,第一应用程序的资源消耗越低,留给第二应用程序使用的冗余计算资源越多, 然而,在该冗余计算资源超过运行第二应用程序所需的计算资源后,无法进一步地提高第二应用程序的流畅度。同时,在需要切换回第一应用程序时,由于第一应用程序设置的目标应用帧率过低,会导致第一应用程序的响应速度越慢的问题。
示例性地,在输入焦点由第一应用程序转移至第二应用程序之后,可以首先通过获取第二应用程序的程序类型,来确定运行该程序类型的应用程序(即第二应用程序)所需的计算资源量,之后基于终端设备的总计算资源量和该所需的计算资源量的差值,来确定第一应用程序的目标应用帧率。图4为本公开实施例提供的一种确定目标应用帧率的过程示意图,如图4所示,当输入焦点转移后,判断第二应用程序的程序类型,当第二应用程序是第一程序类型,确定帧率系数=0.9,具体地,第一程序类型表征包括:写字板程序、画板程序、计算器程序、图片查看器程序等运行所需的计算资源小于第一预设值的应用程序,帧率系数=0.9,表征第一应用程序的目标应用帧率为第一应用程序当前的应用帧率的90%;类似的,当第二应用程序是第二程序类型,确定帧率系数=0.5,具体地,第二程序类型表征包括:浏览器程序、即时通讯程序等运行所需的计算资源大于第一预设值,但小于第二预设值的应用程序,帧率系数=0.5表征第一应用程序的目标应用帧率为第一应用程序当前的应用帧率的50%;当第二应用程序是第三程序类型,确定帧率系数=0.1,具体地,第三程序类型表征包括:大型图像编辑程序、大型音乐编辑程序等运行所需的计算资源大于第二预设值的应用程序,帧率系数=0.1表征第一应用程序的目标应用帧率为第一应用程序当前的应用帧率的10%。
其中,本实施例中的计算资源,可以包括内存资源、中央处理器(CPU)资源、线程资源、缓存资源、图像处理器(GPU)资源、硬盘资源等一种或多种,不做具体限制。
本实施例中,通过判断接收输入焦点的第二应用程序的程序类型,并根据第二应用程序的程序类型,确定运行第二应用程序所需的目标计算资源量,进而确定第一应用程序的目标应用帧率;从而在保证为第二应用程序预留的计算资源足够的情况下,提高第一应用程序的目标应用帧率,在后续需要切换回第一应用程序时,提高第一应用程序的响应速度,进而提高第一应用程序和第二应用程序进行切换的过程中的整体流畅度。
可选地,在第一应用程序具有至少一种应用功能,在输入焦点由第一应用程序转移至第二应用程序之后,还包括:
步骤S103:停止第一应用程序的至少一种应用功能,应用功能包括视频播放功能和/或音频播放功能。
示例性地,第一应用程序具有至少一个应用功能,例如包括视频播放功能、音频播放功能等,在视频编辑应用程序的应用场景下,例如为视频编辑过程中的视频预览、音频预览等功能。现有技术中,由于视频播放、音频播放等应用功能即使第一应用程序处于非激活状态(失去输入焦点),也会持续运行,导致占用较多的计算资源。在本实施例中,当第一应用程序处于非编辑状态下,将视频播放功能和/或音频播放功能停止,可以进一步地降低第一应用程序的资源占用,减少计算资源浪费。当然,可以理解的是,除了视频播放功能和/或音频播放功能之外,还可以停止其他持续运行的功能,例如视频字幕等,此处不再一一赘述。
进一步地,示例性地,第一应用程序具有目标应用功能和至少一种其他应用功能,如图5所示,步骤S103的具体实现方式包括:
步骤S1031:获取第一应用程序对应的缓冲时长,缓冲时长由暂停第一应用程序的目标应用功能所需的暂停耗时确定。
步骤S1032:在缓冲时长后,同步停止第一应用程序的目标应用功能和至少一种其他应用功能。
示例性地,第一应用程序具有多个应用程序,其中包括目标应用功能和除目标应用功能之外的至少一个其他应用功能。具体地,例如,目标应用功能为视频播放功能,针对图像编辑应用程序,即视频预览功能,而其他应用功能例如音频播放、视频字幕显示等。在实际应用过程中,暂停上述应用功能所需的暂停耗时是不一致的,例如,对于目标应用功能,暂停该目标应用功能需要更长的暂停耗时,例如0.5秒。而暂停其他应用功能则需要较短的暂停耗时,例如0.02秒。也即,可以将暂停耗时较长的应用功能,确定为目标应用功能。暂停耗时是各应用功能对应的预设值,可以通过读取相应的配置文件或预设信息而获得,具体不再赘述。进一步地,上述各应用功能的暂停耗时的差异,是由于应用功能的具体实现过程造成的。例如,对于视频播放功能(视频预览功能),在播放视频的过程中,需要对视频进行解码,再 对解码后的视频帧进行逐帧显示,图6为本公开实施例提供的一种视频播放过程示意图,该视频解码-视频帧播放的过程是异步进行的(即解码时间和播放时间不一致),如图6所示,基于播放目标视频的在时间轴,视频解码先进行,视频帧播放后进行,为保证不出现跳帧,在一般的视频播放场景下,会在暂停视频后,继续将已经解码但未播放的视频帧(图中视为待播放帧)播放完,导致应用程序在显示上会出现“延迟暂停”的现象。在后续恢复视频播放时,从解码时间重新开始解码和播放,避免由于上述已经解码但未播放的视频帧丢失而出现跳帧。然而,在本实施例对应的应用场景下,需要保证第一应用程序的多个应用功能是同步的,例如视频预览功能(视频播放功能)、音频预览功能(音频播放功能)、字幕显示功能等。即第一应用程序对一段编辑后视频进行预览时,需要保证其对应的视频图像、音频以及字幕是同步的。因此,当暂停第一应用程序的各应用功能时,基于暂停目标应用程序所需的时长,确定缓存时长,并在缓存时长后,同步停止第一应用程序的目标应用功能和至少一种其他应用功能。
图7为图5所示实施例中步骤S1031的具体实现方式流程图,如图7所示,示例性地,步骤S1041的具体步骤包括:
步骤S1031A:确定第一应用程序的目标应用功能,目标应用功能为暂停耗时最长的应用功能。
步骤S1031B:根据目标应用功能的暂停耗时,得到第一应用程序对应的缓冲时长。
首先,在第一应用程序当前运行的各应用功能中,根据各应用功能的暂停耗时,将暂停耗时最长的应用功能确定为目标应用功能,其中,各应用功能对应的暂停耗时是预设值,具体获取方式不再赘述。之后,根据该目标应用功能的暂停耗时,确定为第一应用程序对应的缓冲时长,
示例性地,其中,目标应用功能基于依次执行的第一子功能和第二子功能实现,其中,第一子功能为后台处理功能,第二子功能为前台显示功能,图8为图5所示实施例中步骤S1032的具体实现方式流程图,如图8所示,示例性地,步骤S1032的具体步骤包括:
步骤S1032A:向目标应用功能发送第一停止指令,停止目标应用功能的第一子功能。
步骤S1032B:在缓冲时长后,向目标应用功能和其他应用功能发送第二停止指令,停止目标应用功能的第二子功能和其他应用功能。
示例性地,以视频播放功能为例,视频播放功能基于依次执行的解码功能(第一子功能)和渲染功能(第二子功能)实现。其中,解码功能为后台处理功能,其中,后台处理功能是指不在应用程序界面的前端进行显示的功能。而渲染功能为前台显示功能,对应的,前台显示功能是指在应用程序界面的前端进行显示的功能。图9为本公开实施例提供的一种暂停应用功能的过程示意图,如图9所示,示例性地,终端设备在暂停目标应用功能和至少一个其他应用功能的过程中,首先向目标应用功能发送第一停止指令,停止第一子功能,例如停止解码功能,即不再生成新的待播放视频帧,此时,参考图9中示出的时间轴,在向目标应用功能发送第一停止指令的T1时刻,目标视频中的解码位置P1和播放位置P2如图9中所示,二者相隔若干待播放视频帧。之后,在缓冲时长后,在T2时刻,向目标应用功能和其他应用功能发送第二停止指令,此时,待播放视频帧(几乎)由第二子功能(渲染功能)消费完毕,目标视频中的解码位置P1和播放位置P2如图9中所示,二者(几乎)重合,此时,停止第二子功能和其他应用功能,由于其他应用功能(例如音频播放功能、字幕显示功能)的暂停耗时较短,可以实现瞬间停止,因此,实现了第一应用程序的多个应用功能的同步暂停(在P2时刻同时停止),提高多个应用功能之间的同步性。
在本实施例中,通过检测操作系统的指示信息,操作系统内运行有第一应用程序和第二应用程序,指示信息用于指示接收输入信息的输入焦点;根据指示信息,在输入焦点由第一应用程序转移至第二应用程序之后,将第一应用程序当前的应用帧率设置为目标应用帧率,其中,应用帧率表征应用程序的界面刷新率,目标应用帧率小于第一应用程序当前的应用帧率。由于在检测到操作系统的输入焦点由第一应用程序转移至第二应用程序后,对第一应用程序的运行参数进行配置,使第一应用程序以低于当前的应用帧率的目标应用帧率运行,从而释放第一应用程序所占用的计算资源,使第二应用程序能够使用更加充足的计算资源运行,提高第二应用程序的流畅度和运行速度,减少程序卡顿。
参考图10,图10为本公开实施例提供的应用程序运行控制方法的流程 示意图二。本实施例在图2所示实施例的基础上,增加了在第一应用程序内部控制输入焦点的步骤,该应用程序运行控制方法包括:
步骤S201:检测操作系统的指示信息。
步骤S202:当第一应用程序的第二窗口具有输入焦点时,接收针对第一应用程序的第二输入信息,创建第一窗口。
步骤S203:将当前位于第二窗口的输入焦点,转移至第一窗口,并生成焦点信息,焦点信息表征输入角度的转移记录。
示例性地,在第一应用程序内可以创建、开启和关闭一个或多个窗口,图11为本公开实施例提供的一种创建第一窗口的示意图,如图11所示,示例性地,当输入焦点位于第一应用程序(图中示为程序P1)内的第二窗口内时,第二窗口为“活动窗口”,该第二窗口可以接收由用户输入的输入信息,即第二输入信息,更加具体地,该第二输入信息例如为针对组件button_1的触发指令(图中示为手形标识),终端设备响应于该第二输入信息,触发组件button_1,并在第一应用程序内创建一个新的功能窗口,即第一窗口,之后,输入焦点由第二窗口转移至第一窗口,由于第一窗口是在第二窗口的基础上创建的,输入焦点也由第二窗口转移至第一窗口,因此,第二窗口相当于是第一窗口的父窗口。在将当前位于第二窗口的输入焦点,转移至第一窗口,生成表征第一窗口和第二窗口的转移关系的转移记录,即焦点信息。
进一步地,若在第一窗口的基础上,终端设备接收并响应第三输入信息,创建第三窗口,则第一窗口是第三窗口的父窗口,之后进一步更新焦点信息,使焦点信息能够表征输入焦点按照第二窗口-第一窗口-第三窗口的顺序依次转移的转移记录。
步骤S204:显示第一应用程序的第一窗口,并接收针对第一窗口的操作输入信息,操作输入信息用于操作第一窗口内的应用功能。
示例性地,在创建第一窗口并将输入焦点转移从第二窗口转移至第一窗口后,第一窗口作为当前的“活动窗口”,可以接收用户输入的操作输入信息,来执行第一窗口内的应用功能,例如第一窗口用于视频预览,则响应于操作输入信息,实现视频跳转、视频播放速度设置等功能,不再一一举例。需要说明的是,本步骤是可选步骤,接收并响应第一窗口的操作输入信息的具体实现方式,可以根据需要设置,可以在显示第一应用程序的第一窗口后, 执行多种操作(接收多个操作输入指令),或者在不进行任何操作(不接受操作输入指令)的情况下,关闭第一窗口,在该过程中,输入焦点始终位于该第一应用程序的第一窗口内,不会触发应用帧率降低的步骤。
步骤S205:响应针对第一窗口的第一输入信息,关闭第一窗口。
步骤S206:根据焦点信息,确定第一窗口对应的第二窗口,并将输入焦点转移至第二窗口。
示例性地,根据需要,在第一窗口内的相关应用功能执行完毕后,用户输入第一输入信息,来关闭该第一窗口。参考图11所示,第一输入信息例如为针对窗口关闭按钮的触发指令(图中示为手形标识),终端设备响应于该第一输入信息,关闭该第一窗口。之后,需要对第一窗口的输入焦点进行控制,使输入焦点返回第一窗口的父窗口,而不会离开第一应用程序,导致误触发应用帧率降低的问题。具体地,获取之前步骤中生成的焦点信息,该焦点信息中记录了生成该第一窗口时的输入焦点转移记录,通过该焦点信息,可以确定第一窗口的父窗口,也即之前步骤中的第二窗口。一种可能的实现方式中,焦点信息中记录了第一窗口对应的父窗口的窗口指针,通过读取窗口指针,可以快速确定对应的第二窗口。
进一步地,确定第二窗口后,在关闭第一窗口之后或同时,输入焦点从第一窗口转移至第二窗口,使第二窗口成为“活动窗口”,实现输入焦点的逐级回溯,使当前的活动窗口关闭后,输入焦点能够按照第一应用程序中各功能窗口的生成次序,依次进行转移,使输入焦点始终位于第一应用程序内,避免了开启和关闭第一应用程序内的窗口所导致的输入焦点消失,进而导致误触发应用帧率降低的问题。
步骤S207:在输入焦点由第一应用程序转移至第二应用程序之后,将第一应用程序当前的应用帧率设置为目标应用帧率,其中,应用帧率表征应用程序的界面刷新率,目标应用帧率小于第一应用程序当前的应用帧率。
在本实施例中,步骤S201、步骤S207与上述实施例中步骤S101、S102的一致,详细论述请参考图2所示实施例中步骤S101、S102的论述,这里不再赘述。
对应于上文实施例的应用程序运行控制方法,图12为本公开实施例提供的应用程序运行控制装置的结构框图。为了便于说明,仅示出了与本公开实 施例相关的部分。参照图12,应用程序运行控制装置3,包括:
检测模块31,用于检测操作系统的指示信息,操作系统内运行有第一应用程序和第二应用程序,指示信息用于指示接收输入信息的输入焦点。
控制模块32,用于根据指示信息,在输入焦点由第一应用程序转移至第二应用程序之后,将第一应用程序当前的应用帧率设置为目标应用帧率,其中,应用帧率表征应用程序的界面刷新率,目标应用帧率小于第一应用程序当前的应用帧率。
在本公开的一个实施例中,控制模块32,具体用于:在输入焦点由第一应用程序转移至第二应用程序之后,获取第二应用程序的程序类型;基于第二应用程序的程序类型,确定目标应用帧率;将第一应用程序当前的第一应用帧率设置为目标应用帧率。
在本公开的一个实施例中,第一应用程序具有至少一种应用功能,在输入焦点由第一应用程序转移至第二应用程序之后,控制模块32,还用于:停止第一应用程序的至少一种应用功能,应用功能包括视频播放功能和/或音频播放功能。
在本公开的一个实施例中,第一应用程序具有目标应用功能和至少一种其他应用功能,控制模块32在停止第一应用程序的至少一种应用功能时,具体用于:获取第一应用程序对应的缓冲时长,缓冲时长由暂停第一应用程序的目标应用功能所需的暂停耗时确定;在缓冲时长后,同步停止第一应用程序的目标应用功能和至少一种其他应用功能。
在本公开的一个实施例中,控制模块32在获取第一应用程序对应的缓冲时长时,具体用于:确定第一应用程序的目标应用功能,目标应用功能为暂停耗时最长的应用功能;根据目标应用功能的暂停耗时,得到第一应用程序对应的缓冲时长。
在本公开的一个实施例中,目标应用功能基于依次执行的第一子功能和第二子功能实现,其中,第一子功能为后台处理功能,第二子功能为前台显示功能;在缓冲时长后,控制模块32在同步停止第一应用程序的目标应用功能和至少一种其他应用功能时,具体用于:向目标应用功能发送第一停止指令,停止目标应用功能的第一子功能;在缓冲时长后,向目标应用功能和其他应用功能发送第二停止指令,停止目标应用功能的第二子功能和其他应用 功能。
在本公开的一个实施例中,检测模块31,还用于:显示第一应用程序的第一窗口,输入焦点位于第一窗口内;响应于针对第一窗口的第一输入信息,关闭第一窗口,并将输入焦点转移至第一应用程序的第二窗口,其中,第二窗口为第一窗口的上级窗口,上级窗口为输出输入焦点的窗口。
在本公开的一个实施例中,检测模块31在显示第一应用程序的第一窗口之前,还用于:响应于针对第一应用程序的第二输入信息,创建第一窗口;将当前位于第二窗口的输入焦点,转移至第一窗口,并生成焦点信息,焦点信息表征输入角度的转移记录;检测模块31在将输入焦点转移至第一应用程序的第二窗口时,具体用于:根据焦点信息,确定第一窗口对应的第二窗口;将输入焦点转移至第二窗口。
其中,检测模块31和控制模块32连接。本实施例提供的应用程序运行控制装置3可以执行上述方法实施例的技术方案,其实现原理和技术效果类似,本实施例此处不再赘述。
图13为本公开实施例提供的一种电子设备的结构示意图,如图13所示,该电子设备4包括:
处理器41,以及与处理器41通信连接的存储器42;
存储器42存储计算机执行指令;
处理器41执行存储器42存储的计算机执行指令,以实现如图2-图7所示实施例中的应用程序运行控制方法。
其中,可选地,处理器41和存储器42通过总线43连接。
相关说明可以对应参见图2-图7所对应的实施例中的步骤所对应的相关描述和效果进行理解,此处不做过多赘述。
参考图14,其示出了适于用来实现本公开实施例的电子设备900的结构示意图,该电子设备900可以为终端设备或服务器。其中,终端设备可以包括但不限于诸如移动电话、笔记本电脑、数字广播接收器、个人数字助理(Personal Digital Assistant,简称PDA)、平板电脑(Portable Android Device,简称PAD)、便携式多媒体播放器(Portable Media Player,简称PMP)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图14示出的电子设备仅仅是一个示例,不应对本公开实施 例的功能和使用范围带来任何限制。
如图14所示,电子设备900可以包括处理装置(例如中央处理器、图形处理器等)901,其可以根据存储在只读存储器(Read Only Memory,简称ROM)902中的程序或者从存储装置908加载到随机访问存储器(Random Access Memory,简称RAM)903中的程序而执行各种适当的动作和处理。在RAM 903中,还存储有电子设备900操作所需的各种程序和数据。处理装置901、ROM 902以及RAM 903通过总线904彼此相连。输入/输出(I/O)接口905也连接至总线904。
通常,以下装置可以连接至I/O接口905:包括例如触摸屏、触摸板、键盘、鼠标、摄像头、麦克风、加速度计、陀螺仪等的输入装置906;包括例如液晶显示器(Liquid Crystal Display,简称LCD)、扬声器、振动器等的输出装置907;包括例如磁带、硬盘等的存储装置908;以及通信装置909。通信装置909可以允许电子设备900与其他设备进行无线或有线通信以交换数据。虽然图14示出了具有各种装置的电子设备900,但是应理解的是,并不要求实施或具备所有示出的装置。可以替代地实施或具备更多或更少的装置。
特别地,根据本公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信装置909从网络上被下载和安装,或者从存储装置908被安装,或者从ROM 902被安装。在该计算机程序被处理装置901执行时,执行本公开实施例的方法中限定的上述功能。
需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、 光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。
上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。
上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。
可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(Local Area Network,简称LAN)或广域网(Wide Area Network,简称WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以 以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。
描述于本公开实施例中所涉及到的单元可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,单元的名称在某种情况下并不构成对该单元本身的限定,例如,第一获取单元还可以被描述为“获取至少两个网际协议地址的单元”。
本文中以上描述的功能可以至少部分地由一个或多个硬件逻辑部件来执行。例如,非限制性地,可以使用的示范类型的硬件逻辑部件包括:现场可编程门阵列(FPGA)、专用集成电路(ASIC)、专用标准产品(ASSP)、片上系统(SOC)、复杂可编程逻辑设备(CPLD)等等。
在本公开的上下文中,机器可读介质可以是有形的介质,其可以包含或存储以供指令执行系统、装置或设备使用或与指令执行系统、装置或设备结合地使用的程序。机器可读介质可以是机器可读信号介质或机器可读储存介质。机器可读介质可以包括但不限于电子的、磁性的、光学的、电磁的、红外的、或半导体系统、装置或设备,或者上述内容的任何合适组合。机器可读存储介质的更具体示例会包括基于一个或多个线的电气连接、便携式计算机盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或快闪存储器)、光纤、便捷式紧凑盘只读存储器(CD-ROM)、光学储存设备、磁储存设备、或上述内容的任何合适组合。
第一方面,根据本公开的一个或多个实施例,提供了一种应用程序运行控制方法,包括:
检测操作系统的指示信息,所述操作系统内运行有第一应用程序和第二应用程序,所述指示信息用于指示接收输入信息的输入焦点;根据所述指示信息,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,将所述第一应用程序当前的应用帧率设置为目标应用帧率,其中,所述应用帧率表征应用程序的界面刷新率,所述目标应用帧率小于所述第一应用程序当前的应用帧率。
根据本公开的一个或多个实施例,将所述第一应用程序当前的应用帧率设置为目标应用帧率,包括:获取所述第二应用程序的程序类型;基于所述第二应用程序的程序类型,确定所述目标应用帧率;将所述第一应用程序当前的第一应用帧率设置为所述目标应用帧率。
根据本公开的一个或多个实施例,所述第一应用程序具有至少一种应用功能,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,所述方法还包括:停止所述第一应用程序的至少一种所述应用功能,所述应用功能包括视频播放功能和/或音频播放功能。
根据本公开的一个或多个实施例,所述第一应用程序具有目标应用功能和至少一种其他应用功能,停止所述第一应用程序的至少一种所述应用功能,包括:获取所述第一应用程序对应的缓冲时长,所述缓冲时长由暂停所述第一应用程序的目标应用功能所需的暂停耗时确定;在所述缓冲时长后,同步停止所述第一应用程序的目标应用功能和至少一种其他应用功能。
根据本公开的一个或多个实施例,获取所述第一应用程序对应的缓冲时长,包括:确定所述第一应用程序的目标应用功能,所述目标应用功能为暂停耗时最长的应用功能;根据所述目标应用功能的暂停耗时,得到所述第一应用程序对应的缓冲时长。
根据本公开的一个或多个实施例,所述目标应用功能基于依次执行的第一子功能和第二子功能实现,其中,所述第一子功能为后台处理功能,所述第二子功能为前台显示功能;所述在所述缓冲时长后,同步停止所述第一应用程序的目标应用功能和至少一种其他应用功能,包括:向所述目标应用功能发送第一停止指令,停止所述目标应用功能的第一子功能;在所述缓冲时长后,向所述目标应用功能和所述其他应用功能发送第二停止指令,停止所述目标应用功能的第二子功能和所述其他应用功能。
根据本公开的一个或多个实施例,所述方法还包括:显示所述第一应用程序的第一窗口,所述输入焦点位于所述第一窗口内;响应于针对所述第一窗口的第一输入信息,关闭所述第一窗口,并将所述输入焦点转移至所述第一应用程序的第二窗口,其中,所述第二窗口为所述第一窗口的上级窗口,所述上级窗口为输出所述输入焦点的窗口。
根据本公开的一个或多个实施例,在显示所述第一应用程序的第一窗口 之前,还包括:响应于针对所述第一应用程序的第二输入信息,创建所述第一窗口;将当前位于所述第二窗口的输入焦点,转移至所述第一窗口,并生成焦点信息,所述焦点信息表征所述输入角度的转移记录;将所述输入焦点转移至所述第一应用程序的第二窗口,包括:根据所述焦点信息,确定所述第一窗口对应的第二窗口;将所述输入焦点转移至所述第二窗口。
第二方面,根据本公开的一个或多个实施例,提供了一种应用程序运行控制装置,包括:
检测模块,用于检测操作系统的指示信息,所述操作系统内运行有第一应用程序和第二应用程序,所述指示信息用于指示接收输入信息的输入焦点;
控制模块,用于根据所述指示信息,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,将所述第一应用程序当前的应用帧率设置为目标应用帧率,其中,所述应用帧率表征应用程序的界面刷新率,所述目标应用帧率小于所述第一应用程序当前的应用帧率。
根据本公开的一个或多个实施例,所述控制模块,具体用于:在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,获取所述第二应用程序的程序类型;基于所述第二应用程序的程序类型,确定所述目标应用帧率;将所述第一应用程序当前的第一应用帧率设置为所述目标应用帧率。
根据本公开的一个或多个实施例,所述第一应用程序具有至少一种应用功能,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,所述控制模块,还用于:停止所述第一应用程序的至少一种所述应用功能,所述应用功能包括视频播放功能和/或音频播放功能。
根据本公开的一个或多个实施例,所述第一应用程序具有目标应用功能和至少一种其他应用功能,所述控制模块在停止所述第一应用程序的至少一种所述应用功能时,具体用于:获取所述第一应用程序对应的缓冲时长,所述缓冲时长由暂停所述第一应用程序的目标应用功能所需的暂停耗时确定;在所述缓冲时长后,同步停止所述第一应用程序的目标应用功能和至少一种其他应用功能。
根据本公开的一个或多个实施例,所述控制模块在获取所述第一应用程序对应的缓冲时长时,具体用于:确定所述第一应用程序的目标应用功能,所述目标应用功能为暂停耗时最长的应用功能;根据所述目标应用功能的暂 停耗时,得到所述第一应用程序对应的缓冲时长。
根据本公开的一个或多个实施例,所述目标应用功能基于依次执行的第一子功能和第二子功能实现,其中,所述第一子功能为后台处理功能,所述第二子功能为前台显示功能;在所述缓冲时长后,所述控制模块在同步停止所述第一应用程序的目标应用功能和至少一种其他应用功能时,具体用于:向所述目标应用功能发送第一停止指令,停止所述目标应用功能的第一子功能;在所述缓冲时长后,向所述目标应用功能和所述其他应用功能发送第二停止指令,停止所述目标应用功能的第二子功能和所述其他应用功能。
根据本公开的一个或多个实施例,所述检测模块,还用于:显示所述第一应用程序的第一窗口,所述输入焦点位于所述第一窗口内;响应于针对所述第一窗口的第一输入信息,关闭所述第一窗口,并将所述输入焦点转移至所述第一应用程序的第二窗口,其中,所述第二窗口为所述第一窗口的上级窗口,所述上级窗口为输出所述输入焦点的窗口。
根据本公开的一个或多个实施例,所述检测模块在显示所述第一应用程序的第一窗口之前,还用于:响应于针对所述第一应用程序的第二输入信息,创建所述第一窗口;将当前位于所述第二窗口的输入焦点,转移至所述第一窗口,并生成焦点信息,所述焦点信息表征所述输入角度的转移记录;所述检测模块在将所述输入焦点转移至所述第一应用程序的第二窗口时,具体用于:根据所述焦点信息,确定所述第一窗口对应的第二窗口;将所述输入焦点转移至所述第二窗口。
第三方面,根据本公开的一个或多个实施例,提供了一种电子设备,包括:处理器,以及与所述处理器通信连接的存储器;
所述存储器存储计算机执行指令;
所述处理器执行所述存储器存储的计算机执行指令,以实现如上第一方面以及第一方面各种可能的设计所述的应用程序运行控制方法。
第四方面,根据本公开的一个或多个实施例,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如上第一方面以及第一方面各种可能的设计所述的应用程序运行控制方法。
第五方面,本公开实施例提供一种计算机程序产品,包括计算机程序, 该计算机程序被处理器执行时实现如上第一方面以及第一方面各种可能的设计所述的应用程序运行控制方法。
以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。
此外,虽然采用特定次序描绘了各操作,但是这不应当理解为要求这些操作以所示出的特定次序或以顺序次序执行来执行。在一定环境下,多任务和并行处理可能是有利的。同样地,虽然在上面论述中包含了若干具体实现细节,但是这些不应当被解释为对本公开的范围的限制。在单独的实施例的上下文中描述的某些特征还可以组合地实现在单个实施例中。相反地,在单个实施例的上下文中描述的各种特征也可以单独地或以任何合适的子组合的方式实现在多个实施例中。
尽管已经采用特定于结构特征和/或方法逻辑动作的语言描述了本主题,但是应当理解所附权利要求书中所限定的主题未必局限于上面描述的特定特征或动作。相反,上面所描述的特定特征和动作仅仅是实现权利要求书的示例形式。

Claims (12)

  1. 一种应用程序运行控制方法,其特征在于,包括:
    检测操作系统的指示信息,所述操作系统内运行有第一应用程序和第二应用程序,所述指示信息用于指示接收输入信息的输入焦点;
    根据所述指示信息,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,将所述第一应用程序当前的应用帧率设置为目标应用帧率,其中,所述应用帧率表征应用程序的界面刷新率,所述目标应用帧率小于所述第一应用程序当前的应用帧率。
  2. 根据权利要求1所述的方法,其特征在于,所述将所述第一应用程序当前的应用帧率设置为目标应用帧率,包括:
    获取所述第二应用程序的程序类型;
    基于所述第二应用程序的程序类型,确定所述目标应用帧率;
    将所述第一应用程序当前的第一应用帧率设置为所述目标应用帧率。
  3. 根据权利要求1所述的方法,其特征在于,所述第一应用程序具有至少一种应用功能,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,所述方法还包括:
    停止所述第一应用程序的至少一种所述应用功能,所述应用功能包括视频播放功能和/或音频播放功能。
  4. 根据权利要求3所述的方法,其特征在于,所述第一应用程序具有目标应用功能和至少一种其他应用功能,所述停止所述第一应用程序的至少一种所述应用功能,包括:
    获取所述第一应用程序对应的缓冲时长,所述缓冲时长由暂停所述第一应用程序的目标应用功能所需的暂停耗时确定;
    在所述缓冲时长后,同步停止所述第一应用程序的目标应用功能和至少一种其他应用功能。
  5. 根据权利要求4所述的方法,其特征在于,获取所述第一应用程序对应的缓冲时长,包括:
    确定所述第一应用程序的目标应用功能,所述目标应用功能为暂停耗时最长的应用功能;
    根据所述目标应用功能的暂停耗时,得到所述第一应用程序对应的缓冲 时长。
  6. 根据权利要求4所述的方法,其特征在于,所述目标应用功能基于依次执行的第一子功能和第二子功能实现,其中,所述第一子功能为后台处理功能,所述第二子功能为前台显示功能;
    所述在所述缓冲时长后,同步停止所述第一应用程序的目标应用功能和至少一种其他应用功能,包括:
    向所述目标应用功能发送第一停止指令,停止所述目标应用功能的第一子功能;
    在所述缓冲时长后,向所述目标应用功能和所述其他应用功能发送第二停止指令,停止所述目标应用功能的第二子功能和所述其他应用功能。
  7. 根据权利要求1所述的方法,其特征在于,所述方法还包括:
    显示所述第一应用程序的第一窗口,所述输入焦点位于所述第一窗口内;
    响应于针对所述第一窗口的第一输入信息,关闭所述第一窗口,并将所述输入焦点转移至所述第一应用程序的第二窗口,其中,所述第二窗口为所述第一窗口的上级窗口,所述上级窗口为输出所述输入焦点的窗口。
  8. 根据权利要求7所述的方法,其特征在于,在显示所述第一应用程序的第一窗口之前,还包括:
    响应于针对所述第一应用程序的第二输入信息,创建所述第一窗口;
    将当前位于所述第二窗口的输入焦点,转移至所述第一窗口,并生成焦点信息,所述焦点信息表征所述输入角度的转移记录;
    将所述输入焦点转移至所述第一应用程序的第二窗口,包括:
    根据所述焦点信息,确定所述第一窗口对应的第二窗口;
    将所述输入焦点转移至所述第二窗口。
  9. 一种应用程序运行控制装置,其特征在于,包括:
    检测模块,用于检测操作系统的指示信息,所述操作系统内运行有第一应用程序和第二应用程序,所述指示信息用于指示接收输入信息的输入焦点;
    控制模块,用于根据所述指示信息,在所述输入焦点由所述第一应用程序转移至所述第二应用程序之后,将所述第一应用程序当前的应用帧率设置为目标应用帧率,其中,所述应用帧率表征应用程序的界面刷新率,所述目标应用帧率小于所述第一应用程序当前的应用帧率。
  10. 一种电子设备,其特征在于,包括:处理器,以及与所述处理器通信连接的存储器;
    所述存储器存储计算机执行指令;
    所述处理器执行所述存储器存储的计算机执行指令,以实现如权利要求1至8中任一项所述的应用程序运行控制方法。
  11. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有计算机执行指令,当处理器执行所述计算机执行指令时,实现如权利要求1至8任一项所述的应用程序运行控制方法。
  12. 一种计算机程序产品,其特征在于,包括计算机程序,该计算机程序被处理器执行时实现权利要求1至8中任一项所述的应用程序运行控制方法。
PCT/CN2023/132854 2022-12-05 2023-11-21 应用程序运行控制方法、装置、设备及存储介质 WO2024120177A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211552513.4A CN115934227A (zh) 2022-12-05 2022-12-05 应用程序运行控制方法、装置、设备及存储介质
CN202211552513.4 2022-12-05

Publications (1)

Publication Number Publication Date
WO2024120177A1 true WO2024120177A1 (zh) 2024-06-13

Family

ID=86551715

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/132854 WO2024120177A1 (zh) 2022-12-05 2023-11-21 应用程序运行控制方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN115934227A (zh)
WO (1) WO2024120177A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115934227A (zh) * 2022-12-05 2023-04-07 北京字跳网络技术有限公司 应用程序运行控制方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160019194A1 (en) * 2014-07-18 2016-01-21 Qualcomm Innovation Center, Inc. Pausing activities in background browser tabs to save power
CN111583886A (zh) * 2020-04-29 2020-08-25 珠海市魅族科技有限公司 一种屏幕刷新率的调整方法、装置、设备及介质
US20210201732A1 (en) * 2019-12-31 2021-07-01 Micron Technology, Inc. Intelligent adjustment of screen refresh rate
CN113892134A (zh) * 2019-05-31 2022-01-04 大陆汽车有限责任公司 具有优化的性能的多媒体系统
CN115934227A (zh) * 2022-12-05 2023-04-07 北京字跳网络技术有限公司 应用程序运行控制方法、装置、设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160019194A1 (en) * 2014-07-18 2016-01-21 Qualcomm Innovation Center, Inc. Pausing activities in background browser tabs to save power
CN113892134A (zh) * 2019-05-31 2022-01-04 大陆汽车有限责任公司 具有优化的性能的多媒体系统
US20210201732A1 (en) * 2019-12-31 2021-07-01 Micron Technology, Inc. Intelligent adjustment of screen refresh rate
CN111583886A (zh) * 2020-04-29 2020-08-25 珠海市魅族科技有限公司 一种屏幕刷新率的调整方法、装置、设备及介质
CN115934227A (zh) * 2022-12-05 2023-04-07 北京字跳网络技术有限公司 应用程序运行控制方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN115934227A (zh) 2023-04-07

Similar Documents

Publication Publication Date Title
WO2024120177A1 (zh) 应用程序运行控制方法、装置、设备及存储介质
US10708566B2 (en) Method for processing signals with operating state-dependent handling of multimedia attributes and electronic device thereof
US20140068503A1 (en) Screen recording method and apparatus in terminal
CN109275011B (zh) 智能电视运动模式切换的处理方法及装置、用户设备
US10972798B2 (en) Display method and device for attached media information
WO2020253453A1 (zh) 图像切换方法、装置、电子设备及存储介质
CN109996104A (zh) 一种视频播放方法、装置及电子设备
CN110401877B (zh) 视频播放的控制方法、装置、电子设备、及存储介质
CN110377341B (zh) 一种监听无响应异常的方法、装置、介质和电子设备
WO2023273854A9 (zh) 控件显示方法、装置、设备及介质
WO2021073206A1 (zh) 视频预览的方法、装置、存储介质及电子设备
WO2022227931A1 (zh) 录屏交互方法、装置、电子设备及计算机可读存储介质
WO2022242482A1 (zh) 播放控制方法、设备、存储介质及程序产品
WO2020238241A1 (zh) 媒体对象的播放方法、装置、电子设备及存储介质
CN109599133B (zh) 语言音轨的切换方法、装置、计算机设备及存储介质
CN110267088B (zh) 视频播放的控制方法、装置、电子设备、及存储介质
WO2024094130A1 (zh) 内容分享方法、装置、设备、计算机可读存储介质及产品
WO2024021867A1 (zh) 界面切换方法、装置、电子设备、存储介质及程序产品
CN110147283B (zh) 一种显示内容切换显示方法、装置、设备及介质
WO2023061137A1 (zh) 多媒体数据的处理方法、系统及设备
WO2023029821A1 (zh) 视频缓存播放方法、装置、电子设备及存储介质
CN113747226B (zh) 视频展示方法、装置、电子设备及存储介质
CN110225391B (zh) 视频播放的控制方法、装置、电子设备、及存储介质
US20180052786A1 (en) Improvement in sending of multimedia streams
WO2024140126A1 (zh) 在线视频编辑方法、装置、电子设备及存储介质