CN112650465A - Terminal control method and device, terminal and storage medium - Google Patents

Terminal control method and device, terminal and storage medium Download PDF

Info

Publication number
CN112650465A
CN112650465A CN202110037066.8A CN202110037066A CN112650465A CN 112650465 A CN112650465 A CN 112650465A CN 202110037066 A CN202110037066 A CN 202110037066A CN 112650465 A CN112650465 A CN 112650465A
Authority
CN
China
Prior art keywords
task
view
risk
time point
timeout
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110037066.8A
Other languages
Chinese (zh)
Inventor
聂通
韩冰天
张金山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202110037066.8A priority Critical patent/CN112650465A/en
Publication of CN112650465A publication Critical patent/CN112650465A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/14Digital output to display device ; Cooperation and interconnection of the display device with other functional units
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5044Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering hardware capabilities
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Abstract

The disclosure provides a control method and device of a terminal, the terminal and a storage medium. In some embodiments, the present disclosure provides a control method of a terminal, including: determining whether the first task is at risk of timeout before a predetermined starting point in time of the first task; if there is a risk of a timeout, the execution of the first task is started before a predetermined start point in time of the first task and/or more resources are allocated for executing the first task. The present disclosure can improve the user experience.

Description

Terminal control method and device, terminal and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for controlling a terminal, and a storage medium.
Background
An intelligent terminal, for example, a mobile phone, has a display screen, the display screen refreshes display views at regular intervals, the display views to be displayed can be drawn in advance before the display views displayed on the screen are refreshed, the terminal needs to complete the drawing, rendering and other processing of the display views to be displayed in time, so that the display is performed when the screen is refreshed, in some cases, the display views to be displayed need to consume more time for processing due to the reasons such as complexity, and the display views may not be processed yet when the screen is refreshed, causing the screen display to be stuck, and the user experience is not enough.
Disclosure of Invention
The disclosure provides a control method and device of a terminal, the terminal and a storage medium.
The present disclosure adopts the following technical solutions.
In some embodiments, the present disclosure provides a control method of a terminal, including:
determining whether the first task is at risk of timeout before a predetermined starting point in time of the first task;
if there is a risk of a timeout, the execution of the first task is started before a predetermined start point in time of the first task and/or more resources are allocated for executing the first task.
In some embodiments, the present disclosure provides a control apparatus of a terminal, including:
a determining unit, configured to determine whether the first task has a timeout risk before a predetermined time point of the first task;
the control unit starts to execute the first task before the preset time point of the first task and/or allocates more resources for executing the first task if the overtime risk exists. .
In some embodiments, the present disclosure provides a terminal comprising: at least one memory and at least one processor;
the memory is used for storing program codes, and the processor is used for calling the program codes stored in the memory to execute the method.
In some embodiments, the present disclosure provides a storage medium for storing program code for performing the above-described method.
In some embodiments of the present disclosure, a method is provided, where whether a timeout risk exists in a first task is determined before a predetermined start time point of the first task, and if the timeout risk exists, the first task is started to be executed in advance and/or more resources are allocated to the first task, so that a completion time point of the first task is advanced to prevent the first task from being timed out, thereby avoiding affecting a user experience.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and elements are not necessarily drawn to scale.
Fig. 1 is a flowchart of a control method of a terminal according to an embodiment of the present disclosure.
Fig. 2 is a flowchart of another terminal control method according to an embodiment of the present disclosure.
Fig. 3 is a flowchart of another terminal control method according to an embodiment of the present disclosure.
Fig. 4 is an interaction diagram of a thread in a terminal according to an embodiment of the present disclosure.
Fig. 5 is a flowchart of another terminal control method according to an embodiment of the present disclosure.
Fig. 6 is a flowchart of another terminal control method according to an embodiment of the present disclosure.
Fig. 7 is a block diagram of a control device of a terminal according to an embodiment of the present disclosure.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that various steps recited in method embodiments of the present disclosure may be performed in parallel and/or in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units.
It is noted that references to "a" or "an" in this disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that reference to "one or more" unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
The embodiments of the present application will be described in detail below with reference to the accompanying drawings.
An intelligent terminal, such as a mobile phone, often performs some timing tasks periodically during a working process, and in some cases, if a previous timing task is not completed in time, a subsequent timing task may be delayed, which may cause a reduction in user experience.
In some embodiments of the present disclosure, please refer to fig. 1, which proposes a control method of a terminal, including:
s11: before a predetermined starting point in time of the first task, it is determined whether the first task is at risk of a timeout.
In some embodiments, the predetermined starting time point is a preset time point for starting execution of the first task, and before the predetermined starting time point, it is determined whether there is a risk of timeout in the first task, where the determining may be performed by quickly estimating a possible time consumption of the first task, determining whether the possible time consumption of the first task exceeds a preset time threshold, and if the possible time consumption of the first task exceeds the preset time threshold, determining that there is a risk of timeout. The first task may be, for example, a screen refresh task, or a periodic terminal state detection task, which is not limited in this embodiment.
S12: if there is a risk of a timeout, the execution of the first task is started before a predetermined start point in time of the first task and/or more resources are allocated for executing the first task.
In some embodiments, if the first task has a timeout risk, the first task may be executed before the predetermined starting time point, for example, if the predetermined time point is 12 points, the first task may be executed separately at 11 points 50, so as to advance the completion time point of the first task, thereby preventing the first task from being timed out.
In some embodiments of the present disclosure, a method is provided, where whether a timeout risk exists in a first task is determined before a predetermined starting time point of the first task, and if the timeout risk exists, the first task is started to be executed in advance and/or more resources are allocated to the first task, so that a completion time point of the first task is advanced to prevent the first task from being timed out, thereby avoiding affecting a user experience.
In some embodiments of the present disclosure, a method for controlling a terminal is provided, please refer to fig. 2, which includes:
s21: before a predetermined starting point in time of the first task, it is determined whether the first task is at risk of a timeout.
In some embodiments, the description of S11 also applies to S21.
S22: if there is a risk of a timeout, the execution of the first task is started before a predetermined start point in time of the first task and/or more resources are allocated for executing the first task.
In some embodiments, the description for S12 also applies to S22.
S23: if there is no risk of timeout, the first task is executed starting at a predetermined starting time point of the first task.
In some embodiments, the predetermined starting time point is a time point set in advance for executing the first task, and the first task may be executed by waiting until the predetermined starting time point without a risk of timeout.
In some embodiments of the present disclosure, the target task is scheduled to be executed every preset time length; the first task is a target task to be executed next from the present time. In some embodiments, the target task may be a task that needs to be completed periodically, for example, a display view of a screen is refreshed every 16ms, and a real-time battery level is detected every 2 minutes, and the target task may be a task that is executed every preset time within a period of time, for example, a task that is executed every preset time in a terminal screen-on state, a first task is one of the target tasks that are executed periodically, and is a next target task from a current time, and since the target task is executed periodically, the target task is usually executed by the same thread in the terminal, and therefore, when one of the target tasks is overtime, the next target task may not be started or completed on time, and in some embodiments, it is determined whether there is a risk of overtime before the next target task is started, the situation of time-out delay can be prevented, and because the first task is the next target task, whether the first task is time-out or not is not judged early, and the problem of inaccurate judgment can be prevented.
In some embodiments of the present disclosure, the first task is a drawing task of a first view, the first view is a display view scheduled to be drawn at a first screen refresh time point, and the predetermined start time point is the first screen refresh time point. In some embodiments, during the display process of the terminal, the display view (the display view is a view for displaying on the screen) is refreshed at regular intervals, typically when a Vsync (vertical synchronization) signal arrives, the terminal extracts a view to be displayed from the display buffer at a screen refresh time point and starts to draw a next required display view, the drawing and rendering of the display view needs to be completed before the next screen refresh time point arrives, and then the drawing and rendering of the display view is stored in the display buffer, and if the drawing and rendering of the display view is not completed at the next screen refresh time point, the display is stuck and the experience is low.
Referring to fig. 3, the method proposed in some embodiments of the present disclosure may be applied to a refresh process of a screen display view, and a control method of a terminal proposed in some embodiments of the present disclosure includes:
s31: before the first screen refresh time point, it is determined whether there is a risk of timeout for the drawing task of the first view.
In some embodiments, the terminal refreshes the display view of the screen at regular intervals, for example, the display view of the screen is refreshed at a refresh rate of 60Hz every about 16ms, a screen refresh time point exists every 16ms, the first screen refresh time point is any screen refresh time point, for example, the next screen refresh time point may be started from the current time, in the related art, the screen display view is refreshed at each screen refresh time point, a drawing task of the display view required for the next refresh is started, a rendering task is performed after the drawing task is completed, the drawing task and the rendering task of the view to be displayed need to be completed before the next screen refresh, so that the view can be normally displayed at the next refresh time, otherwise, display blockage or errors occur. In some embodiments, the first view is a view scheduled to be drawn at a first screen refresh time point, and it is determined whether a drawing task of the first view is at risk of timeout before the first screen refresh time point arrives, because the drawing task of the display view is usually time-consuming, if the drawing task of the first view is time-out, the first view cannot be displayed normally when being refreshed at the first screen refresh time point.
S32: if there is a risk of timeout, rendering the first view begins before the first screen refresh time point and/or more resources are allocated for rendering the first view.
In some embodiments, if there is a risk of timeout, the drawing of the first view is started in advance before the first screen refresh time point, and more resources such as computing power, memory, cache, and the like may be allocated for drawing the first view, thereby ensuring that the drawing task of the first view can be completed as early as possible, and avoiding the display stuck problem caused by the timeout of the drawing task of the first view. In some embodiments, if there is no risk of a timeout, the drawing of the first view is started at a first screen refresh time point.
In some embodiments of the present disclosure, after completing the drawing task of the second view, before the first screen refresh time point, determining whether there is a risk of timeout for the drawing task of the first view; the second view is a display view scheduled to be drawn at a second screen refresh time point that is a screen refresh time point previous to the first screen refresh time point.
In some embodiments, a display screen of a terminal periodically draws a display view, a Thread executing a task of drawing the display view is the same Thread, taking the terminal of the android system as an example, a UI Thread executes a drawing task of the display view, a second view is a display view which needs to be drawn by the UI Thread before a first view, that is, the display view displayed on the screen needs to be refreshed at a first screen refresh time point, if it is determined before a drawing task of the second view ends that whether there is a timeout risk in the drawing task of the first view may occupy the computing power of the CPU and there is a timeout risk instantly, since the UI Thread does not finish drawing the second view at this time, the drawing task of the first view cannot be started to process, which affects the completion of the drawing task of the second view, and after the drawing task of the second view is finished, and the first screen is in an idle state before the refreshing time point of the first screen, so that whether the drawing task of the first view has overtime risk or not is judged after the drawing task of the second view is finished, the influence on the drawing of the second view is avoided, and a UI Thread can be fully utilized.
In some embodiments of the present disclosure, determining whether a drawing task of the first view is at risk of timeout comprises: determining whether an undisplayed view element exists in the cache; if the view elements which are not displayed exist in the cache, the overtime risk does not exist; or, if there are no visual elements in the cache that are not displayed, there is a risk of timeout.
In some embodiments, in the process of drawing the display view, if the cache stores an undisplayed view element, the undisplayed view element may be directly extracted from the cache, so that input and output interaction with the memory is not required, if the cache does not store the undisplayed view element, the drawing of the view element is required, the layout and style of the display element are read from the configuration file, so that the input and output interaction with the memory is required, and a large amount of time is consumed.
In some embodiments of the present disclosure, the display view of the terminal includes a linear view element; determining whether a rendering task of a first view is at risk of timeout, comprising: determining whether an undisplayed linear view element exists in a cache of linear view controls; if the linear view element which is not displayed does not exist in the cache of the linear view control, the overtime risk exists; or if the linear view element which is not displayed exists in the cache of the linear view control, the timeout risk does not exist.
In some embodiments, the linear view elements may be elements in a linear layout, such as in an android system, the linear view elements may be elements in a ListView layout, the list is typically in a linear layout, and each item in the list may be an element in a linear layout. For the linear layout elements, after the last view element of the filled view is drawn each time by the ListView control, the ListView control continues to monitor the non-displayed view elements and stores the non-displayed view elements in a cache (recycling bin) of the ListView control, if the UI Thread can directly acquire the view elements from the cache, too much time is not consumed when the drawing task of the first view is executed, otherwise, the layout and the attributes of the non-displayed linear view elements need to be read from the configuration file and drawn, and much time is consumed.
In order to better describe the method proposed in the embodiment of the present disclosure, a terminal taking the terminal as an android system is described below with reference to fig. 4 and 5 to use the method proposed in the embodiment of the present disclosure for screen refreshing. FIG. 5 is a flow chart of a control method of a terminal, and FIG. 4 is an interaction diagram of threads in the terminal; the method in the embodiment comprises the following steps:
s41: the UI Thread executes the doFrame drawing display view.
In some embodiments, referring to fig. 4, taking the screen refresh rate of the terminal as 60Hz as an example, a Vsync signal is generated every 16ms for refreshing the display view of the screen, the terminal responds to the Vsync (Vsync) signal and informs the UI Thread to perform the doFrame method so as to draw the display view that needs to be displayed at the next refresh, and after the UI Thread finishes drawing the display view, the UI Thread is handed to the Render Thread to Render the display view, that is, to perform the DrawFrame method.
S42: it is checked whether there is a view in the cache that is not shown.
In some embodiments, taking a list view layout as an example of a display view, after a last view element to be displayed in the display view is drawn, the list view control continues to monitor the view element to be displayed and store the view element in a buffer (recycle bin) of the list view control (corresponding to the Check operation in fig. 4), if an undisplayed view element exists in the buffer, then performing a subsequent doFrame method does not require time-consuming layout of the view element, at this time, step S45 is performed, if there is no undisplayed view in the buffer, time-consuming layout processing is required, that is, there is a timeout risk, and step S43 is performed.
S43: and executing the DOFrame drawing display view in advance.
In some embodiments, referring to fig. 4, the UI Thread starts performing the doFrame before the Vsync signal in the middle of fig. 4 arrives.
S44: more CPU resources are allocated for rendering the display view.
In some embodiments, allocating more CPU resources for executing the doFrame method ahead of time includes binding the UI Thread to the most computationally intensive CPU core.
S45: waiting for the Vsync signal.
In some embodiments, if the buffer stores an undisplayed view element, and there is no risk of timeout, the next Vsync signal is waited, and the doFrame is executed when the next Vsync signal arrives.
In some embodiments, the risk of drawing timeout exists in the display view which needs to be drawn in the next screen refresh is predicted in advance, so that the display view is drawn in advance, and more resources are provided for the display view, and therefore, the problems of frame dropping and display blockage caused by the fact that the processing process of the display view exceeds one screen refresh period in the next screen refresh are prevented, and the idle time of a UI Thread between two screen refresh time points is fully utilized. The method provided in some embodiments of the present disclosure may be used in a process of sliding a list, where elements in the list are linearly arranged, and whether to draw a display view in advance and increase allocation of resources may be determined by judging a cache of a ListView control, the judging process is simple, less in computational effort and fast in response, and a required time is much shorter than a screen refresh period (typically 16ms), which meets a timeliness requirement of screen refresh. The method provided by some embodiments of the disclosure improves the smoothness of sliding of the list using the android system ListView control, reduces the phenomenon of stutter, and improves the use experience of the user.
The following description will be made of some embodiments of the present disclosure with reference to the following examples in which the methods in some embodiments of the present disclosure are used for displaying lists.
And S51, determining a first view needing to be drawn in response to the sliding operation on the list.
In some embodiments, the user slides the list, which indicates that the user needs to view the list content above or below the list, at this time, the display view needs to be updated, and list content not displayed in the current view is displayed, so that a new display view needs to be drawn, and the first view may be a display view that needs to be drawn next time the screen is refreshed.
S51: before the first screen refresh time point, it is determined whether there is a risk of timeout for the drawing task of the first view.
In some embodiments, the first screen refresh time point is a time point of a next screen refresh, for example, a time point of detecting a Vsync signal, the terminal needs to complete the drawing and rendering of the first view before the next screen refresh time point of the first screen refresh time point to ensure the correctness of the display view, and if the total duration of the drawing and rendering of the display view exceeds one screen refresh period due to loading of some complex view elements during the list scrolling process, a frame drop may be caused, which may cause a problem that the user feels stuck. Thus, it is determined whether there is a risk of timeout for the rendering task of the first view. Taking an android terminal as an example, drawing of a display view is executed by a UI Thread, the UI Thread is in an idle state before a next screen refresh time point comes after drawing of the display view, and whether a drawing task of a first view has a timeout risk or not can be determined within the time of the idle state. When judging whether the timeout risk exists, judging can be performed according to whether an undisplayed view element exists in the cache of the ListView control. The list adopts linear layout ListView, after the ListView control draws and fills the last view element to be displayed in the list each time, the ListView control continues to detect the view elements which are not displayed in the list, processes the view elements and then places the view elements in a cache, if the view elements which are not displayed exist in the cache, the UI Thread can be directly extracted from the cache without excessive processing operation, the overtime risk does not exist, if the view elements which are not displayed do not exist in the cache, the UI Thread needs to draw the view elements which are not displayed, more time is consumed, and the overtime risk exists
S53: if there is a risk of timeout, rendering the first view begins before the first screen refresh time point and/or more resources are allocated for rendering the first view.
In some embodiments, still taking an android terminal as an example, the first view starts to be drawn before the first screen refresh time point, and at the same time, more resources can be allocated to the UI Thread for drawing the first view, so that it can be ensured that the first view is drawn in time, and the first view is correctly and timely displayed on the display screen of the terminal, so that the user does not have the problem that the list cannot be normally displayed in the process of sliding the list, and does not feel stuck or drop frames. When the method provided by the embodiment is used for the situation that the user slides the list, the fluency of list sliding can be improved, the blockage is reduced, and the use experience of the user is improved.
In some embodiments of the present disclosure, a control apparatus of a terminal is further provided, as shown in fig. 7, including:
a determining unit 10 for determining whether the first task has a risk of timeout before a predetermined point of time of the first task;
the control unit 20 starts executing the first task before the predetermined point of time of the first task and/or allocates more resources for executing the first task, if there is a risk of timeout.
In some embodiments, the target task is executed every preset time length in a preset mode;
the first task is a target task to be executed next from the current time.
In some embodiments, the first task is a drawing task of a first view, the first view is a display view scheduled to be drawn at a first screen refresh time point, and the predetermined start time point is a first screen refresh time point;
a determination unit 10 for determining, prior to a first screen-swipe time point, whether there is a risk of timeout for the rendering task of the first view,
a control unit 20 for starting to render the first view before the first screen refresh time point and/or allocating more resources for rendering the first view if there is a risk of timeout.
In some embodiments, the determining unit 10 is configured to determine whether there is a risk of timeout for the drawing task of the first view before the first screen refresh time point after the drawing task of the second view is completed; the second view is a display view scheduled to be drawn at a second screen refresh time point that is a screen refresh time point previous to the first screen refresh time point.
In some embodiments, the determining unit is configured to determine whether an undisplayed view element exists in the cache;
if the view elements which are not displayed exist in the cache, the overtime risk does not exist; or the like, or, alternatively,
if there are no visual elements in the cache that are not displayed, there is a risk of timeout.
In some embodiments, the display view of the terminal comprises a linear view element; the determination unit 10 is configured to: determining whether an undisplayed linear view element exists in a cache of linear view controls;
if the linear view element which is not displayed does not exist in the cache of the linear view control, the overtime risk exists; or if the linear view element which is not displayed exists in the cache of the linear view control, the overtime risk does not exist.
In some embodiments, the screen-refresh time point is a time point at which a vertical screen refresh signal is detected.
For the embodiments of the apparatus, since they correspond substantially to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described apparatus embodiments are merely illustrative, wherein the modules described as separate modules may or may not be separate. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The method and apparatus of the present disclosure have been described above based on the embodiments and application examples. In addition, the present disclosure also provides a terminal and a storage medium, which are described below.
Referring now to fig. 8, a schematic diagram of an electronic device (e.g., a terminal device or server) 800 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in the drawings is only an example and should not bring any limitation to the functions and use range of the embodiments of the present disclosure.
The electronic device 800 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM 802, and the RAM803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While the figure illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the clients, servers may communicate using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may interconnect with any form or medium of digital data communication (e.g., a communications network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to perform the methods of the present disclosure as described above.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of an element does not in some cases constitute a limitation on the element itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a control method of a terminal, including:
determining whether the first task is at risk of timeout before a predetermined starting point in time of the first task;
if there is a risk of a timeout, the execution of the first task is started before a predetermined start point in time of the first task and/or more resources are allocated for executing the first task.
According to one or more embodiments of the present disclosure, there is provided a control method of a terminal, which is scheduled to execute a target task once every preset time period;
the first task is a target task to be executed next from the current time.
According to one or more embodiments of the present disclosure, there is provided a control method of a terminal, the first task being a drawing task of a first view, the first view being a display view scheduled to be drawn at a first screen refresh time point, the scheduled start time point being a first screen refresh time point;
the method comprises the following steps:
before the first screen refreshing time point, whether the drawing task of the first view has the overtime risk or not is determined, if the overtime risk exists, the drawing of the first view is started before the first screen refreshing time point, and/or more resources are allocated for drawing the first view.
According to one or more embodiments of the present disclosure, there is provided a control method of a terminal, which determines whether there is a risk of timeout in a drawing task of a first view before a first screen refresh time point after a drawing task of a second view is completed;
the second view is a display view scheduled to be drawn at a second screen refresh time point that is a screen refresh time point previous to the first screen refresh time point.
According to one or more embodiments of the present disclosure, there is provided a control method of a terminal, which determines whether a drawing task of a first view has a timeout risk, including:
determining whether an undisplayed view element exists in the cache;
if the view elements which are not displayed exist in the cache, the overtime risk does not exist; or the like, or, alternatively,
if there are no visual elements in the cache that are not displayed, there is a risk of timeout.
According to one or more embodiments of the present disclosure, there is provided a control method of a terminal, a display view of which includes a linear view element;
determining whether a rendering task of a first view is at risk of timeout, comprising:
determining whether an undisplayed linear view element exists in a cache of linear view controls;
if the linear view element which is not displayed does not exist in the cache of the linear view control, the overtime risk exists; or the like, or, alternatively,
and if the linear view elements which are not displayed exist in the cache of the linear view control, the overtime risk does not exist.
In some embodiments, said allocating further resources comprises: more computing power and/or memory is allocated.
According to one or more embodiments of the present disclosure, there is provided a control apparatus of a terminal, including a determining unit configured to determine whether a first task has a risk of timeout before a predetermined time point of the first task;
the control unit starts to execute the first task before the preset time point of the first task and/or allocates more resources for executing the first task if the overtime risk exists.
According to one or more embodiments of the present disclosure, there is provided a terminal including: at least one memory and at least one processor;
wherein the at least one memory is configured to store program code, and the at least one processor is configured to call the program code stored in the at least one memory to perform the method of any one of the above.
According to one or more embodiments of the present disclosure, there is provided a storage medium for storing program code for performing the above-described method.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims.

Claims (10)

1. A control method of a terminal, comprising:
determining whether the first task is at risk of timeout before a predetermined starting point in time of the first task;
if there is a risk of a timeout, the execution of the first task is started before a predetermined start point in time of the first task and/or more resources are allocated for executing the first task.
2. The method of claim 1,
executing the target task once every preset time length in a preset mode;
the first task is a target task to be executed next from the current time.
3. The method according to any one of claims 1 to 2,
the first task is a drawing task of a first view, the first view is a display view scheduled to be drawn at a first screen refresh time point, and the scheduled starting time point is the first screen refresh time point;
the method comprises the following steps:
and before the first screen refreshing time point, determining whether the drawing task of the first view has a timeout risk, if so, starting to draw the first view before the first screen refreshing time point, and/or allocating more resources for drawing the first view.
4. The method of claim 3, comprising:
after the drawing task of the second view is finished and before the refreshing time point of the first screen, determining whether the drawing task of the first view has overtime risk or not;
the second view is a display view scheduled to be drawn at a second screen refresh time point that is a screen refresh time point previous to the first screen refresh time point.
5. The method of claim 4, wherein determining whether the rendering task of the first view is at risk of a timeout comprises:
determining whether an undisplayed view element exists in the cache;
if the view elements which are not displayed exist in the cache, the overtime risk does not exist; or the like, or, alternatively,
if there are no visual elements in the cache that are not displayed, there is a risk of timeout.
6. The method of claim 5,
the display view of the terminal comprises a linear view element;
determining whether a rendering task of a first view is at risk of timeout, comprising:
determining whether an undisplayed linear view element exists in a cache of linear view controls;
if the linear view element which is not displayed does not exist in the cache of the linear view control, the overtime risk exists; or the like, or, alternatively,
and if the linear view elements which are not displayed exist in the cache of the linear view control, the overtime risk does not exist.
7. The method of claim 1, wherein the allocating the further resources comprises: more computing power and/or memory is allocated.
8. A control apparatus of a terminal, comprising:
a determining unit, configured to determine whether the first task has a timeout risk before a predetermined time point of the first task;
the control unit starts to execute the first task before the preset time point of the first task and/or allocates more resources for executing the first task if the overtime risk exists.
9. A terminal, comprising:
at least one memory and at least one processor;
wherein the at least one memory is configured to store program code and the at least one processor is configured to invoke the program code stored in the at least one memory to perform the method of any of claims 1 to 7.
10. A storage medium for storing program code for performing the method of any one of claims 1 to 7.
CN202110037066.8A 2021-01-12 2021-01-12 Terminal control method and device, terminal and storage medium Pending CN112650465A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110037066.8A CN112650465A (en) 2021-01-12 2021-01-12 Terminal control method and device, terminal and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110037066.8A CN112650465A (en) 2021-01-12 2021-01-12 Terminal control method and device, terminal and storage medium

Publications (1)

Publication Number Publication Date
CN112650465A true CN112650465A (en) 2021-04-13

Family

ID=75368006

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110037066.8A Pending CN112650465A (en) 2021-01-12 2021-01-12 Terminal control method and device, terminal and storage medium

Country Status (1)

Country Link
CN (1) CN112650465A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114253683A (en) * 2021-11-26 2022-03-29 北京百度网讯科技有限公司 Task processing method and device, electronic equipment and storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101006417A (en) * 2004-12-03 2007-07-25 索尼计算机娱乐公司 Image display device, image display method, and program
DE102013218622A1 (en) * 2012-10-02 2014-04-03 Nvidia Corporation Method for modifying pixel value of image frame displayed on display screen of two-dimensional display device in e.g. system, involves transmitting modified value of pixel to display modified value on display screen
CN103714559A (en) * 2012-10-02 2014-04-09 辉达公司 System, method, and computer program product for providing dynamic display refresh
CN105335364A (en) * 2014-05-29 2016-02-17 优视科技有限公司 Method and apparatus for accelerating slide display of view
CN108073446A (en) * 2016-11-10 2018-05-25 华为技术有限公司 Overtime pre-judging method and device
CN109166005A (en) * 2018-08-13 2019-01-08 虫极科技(北京)有限公司 The processing method of user's order and intelligent vending system
CN109460364A (en) * 2018-11-14 2019-03-12 Oppo广东移动通信有限公司 Application program detection method, device, storage medium and mobile terminal
CN109947519A (en) * 2019-03-27 2019-06-28 努比亚技术有限公司 Hardware-accelerated control method, terminal and computer readable storage medium
CN110659082A (en) * 2019-09-11 2020-01-07 Oppo(重庆)智能科技有限公司 Application program interface display method and device, terminal and storage medium
CN111240817A (en) * 2020-01-06 2020-06-05 北京小米移动软件有限公司 Resource scheduling method, resource scheduling apparatus, and storage medium
CN111340681A (en) * 2020-02-10 2020-06-26 青岛海信宽带多媒体技术有限公司 Image processing method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101006417A (en) * 2004-12-03 2007-07-25 索尼计算机娱乐公司 Image display device, image display method, and program
DE102013218622A1 (en) * 2012-10-02 2014-04-03 Nvidia Corporation Method for modifying pixel value of image frame displayed on display screen of two-dimensional display device in e.g. system, involves transmitting modified value of pixel to display modified value on display screen
CN103714559A (en) * 2012-10-02 2014-04-09 辉达公司 System, method, and computer program product for providing dynamic display refresh
CN105335364A (en) * 2014-05-29 2016-02-17 优视科技有限公司 Method and apparatus for accelerating slide display of view
CN108073446A (en) * 2016-11-10 2018-05-25 华为技术有限公司 Overtime pre-judging method and device
CN109166005A (en) * 2018-08-13 2019-01-08 虫极科技(北京)有限公司 The processing method of user's order and intelligent vending system
CN109460364A (en) * 2018-11-14 2019-03-12 Oppo广东移动通信有限公司 Application program detection method, device, storage medium and mobile terminal
CN109947519A (en) * 2019-03-27 2019-06-28 努比亚技术有限公司 Hardware-accelerated control method, terminal and computer readable storage medium
CN110659082A (en) * 2019-09-11 2020-01-07 Oppo(重庆)智能科技有限公司 Application program interface display method and device, terminal and storage medium
CN111240817A (en) * 2020-01-06 2020-06-05 北京小米移动软件有限公司 Resource scheduling method, resource scheduling apparatus, and storage medium
CN111340681A (en) * 2020-02-10 2020-06-26 青岛海信宽带多媒体技术有限公司 Image processing method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114253683A (en) * 2021-11-26 2022-03-29 北京百度网讯科技有限公司 Task processing method and device, electronic equipment and storage medium
CN114253683B (en) * 2021-11-26 2022-11-01 北京百度网讯科技有限公司 Task processing method and device, electronic equipment and storage medium
US11640319B1 (en) 2021-11-26 2023-05-02 Beijing Baidu Netcom Science Technology Co., Ltd. Task processing method and apparatus, electronic device and storage medium

Similar Documents

Publication Publication Date Title
CN111475298B (en) Task processing method, device, equipment and storage medium
CN109857486B (en) Method, device, equipment and medium for processing program page data
CN112256223B (en) Method and device for adjusting display fluency and electronic equipment
CN111488185B (en) Page data processing method, device, electronic equipment and readable medium
US20220353551A1 (en) Live broadcast room page loading method and apparatus, and terminal, server and storage medium
CN109614195B (en) Method, device and equipment for preloading list items and storage medium
CN110633434B (en) Page caching method and device, electronic equipment and storage medium
US10768947B2 (en) Method for interface refresh synchronization,terminal device, and non-transitory computer-readable storage medium
CN110647702B (en) Picture preloading method and device, electronic equipment and readable medium
CN110706675A (en) Information display method and device
CN111310632B (en) Terminal control method, device, terminal and storage medium
CN111258736B (en) Information processing method and device and electronic equipment
CN114699767A (en) Game data processing method, device, medium and electronic equipment
CN110633433B (en) Page caching method and device, electronic equipment and storage medium
CN111796827B (en) Bullet screen drawing method, device, equipment and storage medium
CN112650465A (en) Terminal control method and device, terminal and storage medium
CN110765386A (en) Webpage image monitoring method and device, electronic equipment and readable storage medium
CN110768861A (en) Method, device, medium and electronic equipment for obtaining overtime threshold
CN111427637A (en) Page rendering method and device
CN111367783B (en) Application program testing method and device and electronic equipment
CN112867119B (en) Terminal control method, device, terminal and storage medium
CN110221892B (en) Method, device, medium and electronic equipment for scrolling window information
CN113918002A (en) Frequency modulation method, frequency modulation device, storage medium and electronic equipment
CN112064287A (en) Water use control method and device for washing machine, electronic equipment and storage medium
CN111949325B (en) Display method and device and electronic equipment

Legal Events

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