Terminal control method, device, terminal and storage medium
By determining in advance whether the task has a timeout risk and executing the task in advance on the smart terminal, and allocating more resources, the processing delay problem during screen refresh is solved, and the user experience and system fluency is improved.
Patent Information
- Application Number
- CN202110037066.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-12
- Publication Date
- 2024-12-03
- Estimated Expiration
- 2041-01-12
AI Technical Summary
The processing delay caused by the complex display view when the smart terminal refreshes the screen, which may cause the screen to be stuttered and affect the user experience.
Determine whether there is a timeout risk before the task is scheduled to start time. If it exists, start the task in advance and allocate more resources to ensure that the task is completed within the scheduled time.
Through early execution and resource allocation, task timeouts are avoided, user experience is improved, and lags are reduced during screen refresh.
Smart Images

Figure CN112650465B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a terminal control method, device, terminal and storage medium. Background Art
[0002] A smart terminal, such as a mobile phone, has a display screen. The display screen refreshes the display view at regular intervals. Before refreshing the display view displayed on the screen, the display view to be displayed will be drawn in advance. The terminal needs to complete the drawing and rendering of the display view to be displayed in a timely manner so that it can be displayed when the screen is refreshed. In some cases, the display view that needs to be displayed may take a long time to process due to its complexity. The display view may not have been processed when the screen is refreshed, causing the screen display to be stuck and the user experience to be insufficient. Summary of the invention
[0003] The present disclosure provides a terminal control method, device, terminal and storage medium.
[0004] The present disclosure adopts the following technical solutions.
[0005] In some embodiments, the present disclosure provides a terminal control method, including:
[0006] Before a scheduled start time of the first task, determining whether the first task has a risk of overtime;
[0007] If there is a risk of timeout, the first task is started before the scheduled start time of the first task, and / or more resources are allocated for executing the first task.
[0008] In some embodiments, the present disclosure provides a control device of a terminal, including:
[0009] a determination unit, configured to determine whether the first task has a risk of timeout before a scheduled time point of the first task;
[0010] The control unit, if there is a risk of timeout, starts executing the first task before a predetermined time point of the first task, and / or allocates more resources for executing the first task.
[0011] In some embodiments, the present disclosure provides a terminal, comprising: at least one memory and at least one processor;
[0012] The memory is used to store program codes, and the processor is used to call the program codes stored in the memory to execute the above method.
[0013] In some embodiments, the present disclosure provides a storage medium for storing program code, and the program code is used to execute the above method.
[0014] The method proposed in some embodiments of the present disclosure first determines whether the first task has a timeout risk before the scheduled start time of the first task. If there is a timeout risk, the first task is started in advance and / or more resources are allocated to the execution of the first task, so that the completion time of the first task is advanced to prevent the first task from timing out, thereby avoiding affecting the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that components and elements are not necessarily drawn to scale.
[0016] Figure 1 It is a flowchart of a terminal control method according to an embodiment of the present disclosure.
[0017] Figure 2 The present invention is a flowchart of another terminal control method according to an embodiment of the present invention.
[0018] Figure 3 The present invention is a flowchart of another terminal control method according to an embodiment of the present invention.
[0019] Figure 4 This is a schematic diagram of the interaction of threads in a terminal according to an embodiment of the present disclosure.
[0020] Figure 5 The present invention is a flowchart of another terminal control method according to an embodiment of the present invention.
[0021] Figure 6 The present invention is a flowchart of another terminal control method according to an embodiment of the present invention.
[0022] Figure 7 It is a composition diagram of a control device of a terminal according to an embodiment of the present disclosure.
[0023] Figure 8 It is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0025] It should be understood that the various steps described in the method embodiments of the present disclosure can be performed in sequence and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0026] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "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". The relevant definitions of other terms will be given in the following description.
[0027] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0028] It should be noted that the modification of “one” mentioned in the present disclosure is illustrative rather than restrictive, and those skilled in the art should understand that it should be understood as “one or more” unless otherwise clearly indicated in the context.
[0029] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0030] The solution provided by the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
[0031] Smart terminals, such as mobile phones, often periodically execute some scheduled tasks during their working process. In some cases, if the previous scheduled task is not completed in time, the next scheduled task may be delayed, resulting in a decrease in user experience.
[0032] In some embodiments of the present disclosure, please refer to Figure 1 , a terminal control method is proposed, including:
[0033] S11: Before the scheduled start time of the first task, determine whether the first task has a risk of timeout.
[0034] In some embodiments, the predetermined start time point is a pre-set time point for starting to execute the first task. Before the predetermined start time point, it is determined whether the first task has a timeout risk. The determination method may be to first quickly estimate the possible time consumption of the first task, and determine whether the possible time consumption of the first task exceeds a pre-set time threshold. If it exceeds, it is considered that there is a timeout risk. In some embodiments, the complexity of the first task may also be evaluated. If the complexity of the first task exceeds the complexity threshold, it is considered that there is a timeout risk. The first task may be, for example, a screen refresh task, or a periodic terminal status detection task, etc., which is not limited in this embodiment.
[0035] S12: If there is a risk of timeout, start executing the first task before the scheduled start time of the first task, and / or allocate more resources for executing the first task.
[0036] In some embodiments, if there is a risk of timeout for the first task, the first task can be started before the scheduled start time. For example, if the scheduled time is 12 o'clock, it can be started at 11:50, so that the completion time of the first task is advanced to prevent the first task from timing out. In addition, when executing the first task, more resources can be allocated to the execution of the first task, such as allocating more processor computing power, allocating more memory, allocating more storage space, setting a higher priority for the first task, etc., which can shorten the time required to complete the first task.
[0037] In the method proposed in some embodiments of the present disclosure, it is first determined whether the first task has a timeout risk before the scheduled start time of the first task. If there is a timeout risk, the first task is started in advance and / or more resources are allocated to the execution of the first task, so that the completion time of the first task is advanced to prevent the first task from timing out, thereby avoiding affecting the user experience.
[0038] In some embodiments of the present disclosure, a terminal control method is proposed, please refer to Figure 2 ,include:
[0039] S21: Before the scheduled start time of the first task, determine whether the first task has a timeout risk.
[0040] In some embodiments, the description of S11 is also applicable to S21.
[0041] S22: If there is a risk of timeout, start executing the first task before the scheduled start time of the first task, and / or allocate more resources for executing the first task.
[0042] In some embodiments, the description of S12 is also applicable to S22.
[0043] S23: If there is no timeout risk, start executing the first task at the scheduled start time of the first task.
[0044] In some embodiments, the scheduled start time point is a pre-set time point for executing the first task. In the absence of a timeout risk, the first task can be executed until the scheduled start time point.
[0045] In some embodiments of the present disclosure, it is scheduled to execute a target task every preset time; the first task is the next target task to be executed from the current moment. In some embodiments, the target task can be a task that needs to be completed periodically, such as refreshing the display view of the screen every 16ms, and detecting the real-time power of the battery every 2 minutes. The target task can be a task that is executed every preset time within a period of time, such as a task that is executed every preset time in the terminal screen state. The first task is one of the target tasks that are executed periodically, and is the next target task starting from the current moment. Since the target task is executed periodically, it is usually executed by the same thread in the terminal. Therefore, when one of the target tasks times out, it may cause the next target task to fail to start or complete on time. In some embodiments, judging whether there is a timeout risk before the next target task starts can prevent timeout delays, and because the first task is the next target task, it is not too early to judge whether the first task has timed out, which can prevent inaccurate judgments.
[0046] In some embodiments of the present disclosure, the first task is a drawing task of the first view, the first view is a display view scheduled to be drawn at a first screen refresh time point, and the scheduled start time point is the first screen refresh time point. In some embodiments, during the display process of the terminal, the display view is refreshed once every certain period of time (the display view is a view used to be displayed on the screen), usually when the Vsync (vertical synchronization) signal arrives, and at the screen refresh time point, the terminal extracts the view to be displayed from the display cache, and starts drawing the display view required next time. The drawing and rendering of the display view need to be completed before the next screen refresh time point arrives, and then stored in the display cache. If the drawing and rendering of the display view are not completed at the next screen refresh time point, it will cause display jamming, which is a low user experience.
[0047] The method proposed in some embodiments of the present disclosure can be used for refreshing the screen display view. Figure 3 In some embodiments of the present disclosure, a terminal control method is proposed, including:
[0048] S31: Before a first screen refresh time point, determine whether a drawing task of a first view has a timeout risk.
[0049] In some embodiments, the terminal refreshes the display view of the screen at regular intervals. For example, if the refresh rate is 60 Hz, the display view of the screen is refreshed every approximately 16 ms. There is a screen refresh time point every 16 ms. The first screen refresh time point is any screen refresh time point, for example, it can be the next screen refresh time point starting from the current moment. In the related art, the screen display view is refreshed at each screen refresh time point, and the drawing task of the display view required for the next refresh is started. After the drawing task is completed, the rendering task is performed. Before the next screen refresh, the drawing task and rendering task of the view to be displayed need to be completed, so that it can be displayed normally at the next refresh, otherwise there will be display jamming or errors. In some embodiments, the first view is a view scheduled to be drawn at the first screen refresh time point. Before the first screen refresh time point arrives, it is first determined whether the drawing task of the first view has a timeout risk, because the drawing task of the display view is usually time-consuming. If the drawing task of the first view times out, it will not be displayed normally when it is refreshed at the first screen refresh time point.
[0050] S32: If there is a timeout risk, start drawing the first view before the first screen refresh time point, and / or allocate more resources for drawing the first view.
[0051] In some embodiments, if there is a risk of timeout, the first view is drawn before the first screen refresh time point, and more computing power, memory, cache and other resources can be allocated for drawing the first view, so as to ensure that the drawing task of the first view can be completed as soon as possible, and avoid the display jamming problem caused by the timeout of the drawing task of the first view. In some embodiments, if there is no risk of timeout, the first view is drawn at the first screen refresh time point.
[0052] In some embodiments of the present disclosure, after completing the drawing task of the second view and before the first screen refresh time point, it is determined whether the drawing task of the first view has a risk of timeout; the second view is a display view scheduled to be drawn at the second screen refresh time point, and the second screen refresh time point is a screen refresh time point before the first screen refresh time point.
[0053] In some embodiments, the display screen of the terminal periodically draws the display view, and the thread that executes the task of drawing the display view is the same thread. Taking the terminal of the Android system as an example, the drawing task of the display view is executed by the UI Thread thread, and the second view is the display view before the first view that needs to be drawn by the UI Thread thread, that is, the display view displayed on the screen needs to be refreshed at the first screen refresh time point. If it is judged whether there is a timeout risk for the drawing task of the first view before the drawing task of the second view is completed, it may occupy the computing power of the CPU, and even if there is a timeout risk, since the UI Thread thread has not yet completed drawing the second view at this time, it cannot start processing the drawing task of the first view, affecting the completion of the drawing task of the second view. After completing the drawing task of the second view, the UI Thread thread is in an idle state before the first screen refresh time point. Therefore, it waits for the drawing task of the second view to be completed before judging whether there is a timeout risk for the drawing task of the first view, so as to avoid affecting the drawing of the second view and make full use of the UI Thread thread.
[0054] In some embodiments of the present disclosure, determining whether a drawing task of a first view faces a risk of timeout includes: determining whether there are undisplayed view elements in a cache; if there are undisplayed view elements in the cache, there is no risk of timeout; or, if there are no undisplayed visual elements in the cache, there is a risk of timeout.
[0055] In some embodiments, during the process of drawing the display view, if there are undisplayed view elements stored in the cache, the undisplayed view elements can be directly extracted from the cache, thereby eliminating the need for input and output interaction with the memory. If there are no undisplayed view elements in the cache, the view elements need to be drawn, and the layout and style of the display elements need to be read from the configuration file, etc., which requires input and output interaction with the memory and consumes a lot of time. Therefore, based on whether there are undisplayed view elements stored in the cache, it is possible to quickly determine whether the drawing task of the first view is at risk of timeout, without the need to accurately determine the specific time consumption of the drawing task of the first view, thereby reducing the amount of calculation and improving the response speed.
[0056] In some embodiments of the present disclosure, the display view of the terminal includes a linear view element; determining whether there is a risk of timeout for the drawing task of the first view includes: determining whether there are undisplayed linear view elements in the cache of the linear view control; if there are no undisplayed linear view elements in the cache of the linear view control, there is a risk of timeout; or, if there are undisplayed linear view elements in the cache of the linear view control, there is no risk of timeout.
[0057] In some embodiments, the linear view element may be an element using a linear layout. Taking the Android system as an example, the linear view element may be an element using a ListView layout. The list usually uses a linear layout, and each item in the list may be an element in the linear layout. For elements using a linear layout, the ListView control will continue to monitor undisplayed view elements and store them in the cache (RecycleBin) of the ListView control after drawing and filling the last view element of the view each time. If the UI Thread can directly obtain the view element from the cache, it will not consume too much time when executing the drawing task of the first view. Otherwise, it is necessary to read the layout and properties of the undisplayed linear view element from the configuration file and draw it, which takes more time.
[0058] In order to better illustrate the method proposed in the embodiment of the present disclosure, the following Figure 4 and attached Figure 5 , the method proposed in the embodiment of the present disclosure is used for screen refreshing, taking the terminal as an Android system terminal. Figure 5 is a flow chart of the terminal control method, Figure 4 is an interaction diagram of threads in a terminal; the method in this embodiment includes:
[0059] S41: UI Thread executes doFrame to draw the display view.
[0060] In some embodiments, please combine the attached Figure 4 For example, if the screen refresh rate of the terminal is 60Hz, a Vsync signal is generated every 16ms to refresh the display view of the screen. The terminal responds to Vsync (see Figure 4 The left Vsync) signal notifies the UI Thread to execute the doFrame method to draw the display view that needs to be displayed at the next refresh. After the UI Thread completes the drawing of the display view, it is handed over to the Render Thread thread to render the display view, that is, to execute the DrawFrame method.
[0061] S42: Check whether there is a view that is not displayed in the cache.
[0062] In some embodiments, taking the display view using the ListView layout as an example, after the ListView control draws the last view element to be displayed in the display view, it will continue to monitor the view elements to be displayed and store them in the cache (RecycleBin) of the ListView control (corresponding to the attached Figure 4Check operation in), if there are undisplayed view elements in the cache, then the subsequent execution of the doFrame method does not need to spend time on layout of the view elements, and step S45 is executed at this time. If there are no undisplayed views in the cache, then layout processing is required and time-consuming, that is, there is a risk of timeout, and step S43 is executed.
[0063] S43: Execute doFrame in advance to draw the display view.
[0064] In some embodiments, reference Figure 4 , UI Thread in Figure 4 doFrame starts executing before the middle Vsync signal arrives.
[0065] S44: Allocate more CPU resources for drawing the display view.
[0066] In some embodiments, allocating more CPU resources for executing the doFrame method in advance includes binding the UI Thread to the CPU core with the strongest computing power.
[0067] S45: Waiting for Vsync signal.
[0068] In some embodiments, if there are undisplayed view elements stored in the cache and there is no risk of timeout, the next Vsync signal is waited for and doFrame is executed when the next Vsync signal arrives.
[0069] In some embodiments, it is predicted in advance that there is a risk of drawing timeout for the display view that needs to be drawn when the next screen is refreshed, so the display view is drawn in advance and more resources are provided for it, so as to prevent the problem of frame drop and display jamming caused by the display view processing exceeding one screen refresh cycle when the next screen is refreshed, and make full use of the idle time of the UI Thread thread between two screen refresh time points. The method proposed in some embodiments of the present disclosure can be used in the process of sliding a list. The elements in the list adopt a linear layout. The cache of the ListView control can be judged to determine whether it is necessary to draw the display view in advance and increase the allocation of resources. The judgment process is simple, the computing power consumption is small, the response is fast, and the time required is much less than the screen refresh cycle (usually 16ms), which meets the timeliness requirements of the screen refresh. The method proposed in some embodiments of the present disclosure improves the smoothness of sliding a list using the Android system ListView control, reduces the jamming phenomenon, and improves the user experience.
[0070] The following uses the method in some embodiments of the present disclosure for displaying a list as an example to further illustrate the method in some embodiments of the present disclosure.
[0071] S51: In response to a sliding operation on the list, determining a first view that needs to be drawn.
[0072] In some embodiments, the user slides the list, indicating that the user needs to view the list content above or below the list. At this time, the display view needs to be updated to display the list content that is not displayed in the current view, so a new display view needs to be drawn. The first view can be the display view that needs to be drawn the next time the screen is refreshed.
[0073] S51: Before a first screen refresh time point, determine whether a drawing task of a first view has a timeout risk.
[0074] In some embodiments, the first screen refresh time point is the time point of the next screen refresh, for example, the time point when the Vsync signal is detected. 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 correct display view. If the total time of drawing and rendering the display view exceeds one screen refresh cycle due to the loading of some complex view elements during the list scrolling process, it will cause frame drops, causing the user to feel stuck. Therefore, it is determined whether the drawing task of the first view has a timeout risk. Taking the Android terminal as an example, the drawing of the display view is executed by the UI Thread thread. After the UI Thread thread draws the display view, it is in an idle state before the next screen refresh time point arrives. It can be determined during the idle state whether the drawing task of the first view has a timeout risk. When judging whether there is a timeout risk, it can be judged based on whether there are undisplayed view elements in the cache of the ListView control. The list uses a linear layout ListView. Each time the ListView control draws and fills the last view element that needs to be displayed in the list, it will continue to detect the view elements that are not displayed in the list, process them and put them in the cache. If there are undisplayed view elements in the cache, the UIThread thread can directly extract them from the cache without doing too much processing, and there is no risk of timeout. If there are no undisplayed view elements in the cache, the UI Thread thread needs to draw the undisplayed view elements, which takes a long time and there is a risk of timeout.
[0075] S53: If there is a timeout risk, start drawing the first view before the first screen refresh time point, and / or allocate more resources for drawing the first view.
[0076] In some embodiments, still taking the Android terminal as an example, the first view is drawn before the first screen refresh time point, and more resources can be allocated to the UI Thread thread for drawing the first view, so that the first view can be drawn in time, and the first view can be correctly and timely displayed on the display screen of the terminal, so that the user will not encounter the problem of the list not being displayed normally during the sliding list, and will not feel stuck or dropped frames. When the method proposed in this embodiment is used in the scenario where the user slides the list, it can improve the smoothness of the list sliding, reduce stuck, and improve the user experience.
[0077] In some embodiments of the present disclosure, a control device for a terminal is also provided, such as Figure 7 As shown, including:
[0078] A determination unit 10, configured to determine whether the first task has a risk of timeout before a predetermined time point of the first task;
[0079] The control unit 20 starts executing the first task before a predetermined time point of the first task if there is a timeout risk, and / or allocates more resources for executing the first task.
[0080] In some embodiments, the target task is scheduled to be performed once every preset time period;
[0081] The first task is the next target task to be executed starting from the current moment.
[0082] 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 scheduled start time point is the first screen refresh time point;
[0083] The determining unit 10 is used to determine whether there is a timeout risk for the drawing task of the first view before the first screen refresh time point.
[0084] The control unit 20 is configured to start drawing the first view before the first screen refresh time point if there is a timeout risk, and / or allocate more resources for drawing the first view.
[0085] In some embodiments, the determination unit 10 is used to determine whether there is a risk of timeout in the drawing task of the first view after completing the drawing task of the second view and before the first screen refresh time point; the second view is a display view scheduled to be drawn at the second screen refresh time point, and the second screen refresh time point is a screen refresh time point before the first screen refresh time point.
[0086] In some embodiments, the determining unit is used to determine whether there are undisplayed view elements in the cache;
[0087] If there are undisplayed view elements in the cache, there is no risk of timeout; or,
[0088] If the undisplayed visual elements are not present in the cache, there is a risk of timeout.
[0089] In some embodiments, the display view of the terminal includes a linear view element; the determination unit 10 is used to: determine whether there is an undisplayed linear view element in the cache of the linear view control;
[0090] If there are no undisplayed linear view elements in the cache of the linear view control, there is a risk of timeout; or, if there are undisplayed linear view elements in the cache of the linear view control, there is no risk of timeout.
[0091] In some embodiments, the screen refresh time point is the time point when the vertical screen refresh signal is detected.
[0092] For the embodiments of the device, since they basically correspond to the method embodiments, the relevant parts refer to the partial description of the method embodiments. The device embodiments described above are merely illustrative, wherein the modules described as separation modules may or may not be separated. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of the present embodiment. Those of ordinary skill in the art can understand and implement without paying creative work.
[0093] The method and device of the present disclosure are 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.
[0094] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 800 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. The electronic device shown in the figure is only an example and should not bring any limitation to the functions and scope of use of the embodiment of the present disclosure.
[0095] The electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 801, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 802 or a program loaded from a storage device 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.
[0096] Typically, the following devices may be connected to the I / O interface 805: input devices 806 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; output devices 807 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; storage devices 808 including, for example, a magnetic tape, a hard disk, etc.; and communication devices 809. The communication device 809 may allow the electronic device 800 to communicate with other devices wirelessly or by wire to exchange data. Although the electronic device 800 with various devices is shown in the figure, it should be understood that it is not required to implement or have all the devices shown. More or fewer devices may be implemented or have alternatively.
[0097] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, 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. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 809, or installed from a storage device 808, or installed from a ROM 802. When the computer program is executed by the processing device 801, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0098] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above 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. More specific examples of 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), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The 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 conjunction with an instruction execution system, apparatus 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.
[0099] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0100] The computer-readable medium may be included in the electronic device, or may exist independently without being installed in the electronic device.
[0101] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device executes the method of the present disclosure.
[0102] 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. In cases involving 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0103] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0104] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, wherein the name of a unit does not, in some cases, limit the unit itself.
[0105] The functions described above herein 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 chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0106] In the context of the present disclosure, 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.
[0107] According to one or more embodiments of the present disclosure, a terminal control method is provided, including:
[0108] Before a scheduled start time of the first task, determining whether the first task has a risk of overtime;
[0109] If there is a risk of timeout, the first task is started before the scheduled start time of the first task, and / or more resources are allocated for executing the first task.
[0110] According to one or more embodiments of the present disclosure, a terminal control method is provided, which is scheduled to execute a target task once every preset time period;
[0111] The first task is the next target task to be executed starting from the current moment.
[0112] According to one or more embodiments of the present disclosure, a terminal control method is provided, wherein 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 start time point is the first screen refresh time point;
[0113] The method comprises:
[0114] Before the first screen refresh time point, determine whether there is a timeout risk for the drawing task of the first view. If there is a timeout risk, start drawing the first view before the first screen refresh time point, and / or allocate more resources for drawing the first view.
[0115] According to one or more embodiments of the present disclosure, a terminal control method is provided, which determines whether there is a timeout risk for the drawing task of the first view after completing the drawing task of the second view and before the first screen refresh time point;
[0116] The second view is a display view scheduled to be drawn at a second screen refresh time point, and the second screen refresh time point is a screen refresh time point before the first screen refresh time point.
[0117] According to one or more embodiments of the present disclosure, a terminal control method is provided, which determines whether a drawing task of a first view has a timeout risk, including:
[0118] Determine if there are any undisplayed view elements in the cache;
[0119] If there are undisplayed view elements in the cache, there is no risk of timeout; or,
[0120] If the undisplayed visual elements are not present in the cache, there is a risk of timeout.
[0121] According to one or more embodiments of the present disclosure, a control method of a terminal is provided, wherein a display view of the terminal includes a linear view element;
[0122] Determine whether the drawing task of the first view has a risk of timeout, including:
[0123] Determine whether there are undisplayed linear view elements in the cache of the linear view control;
[0124] If there is no undisplayed linear view element in the cache of the linear view control, there is a risk of timeout; or,
[0125] If there are undisplayed linear view elements in the cache of the linear view control, there is no risk of timeout.
[0126] In some embodiments, allocating more resources includes: allocating more computing power and / or memory.
[0127] According to one or more embodiments of the present disclosure, there is provided a control device of a terminal, wherein a determination unit is configured to determine whether a first task has a timeout risk before a predetermined time point of the first task;
[0128] The control unit starts executing the first task before a predetermined time point of the first task if there is a risk of timeout, and / or allocates more resources for executing the first task.
[0129] 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;
[0130] The at least one memory is used to store program codes, and the at least one processor is used to call the program codes stored in the at least one memory to execute any one of the above methods.
[0131] According to one or more embodiments of the present disclosure, a storage medium is provided, wherein the storage medium is used to store program code, and the program code is used to execute the above method.
[0132] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0133] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0134] Although the subject matter has been described in language specific to structural features and / or methodological logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A terminal control method, characterized in that: include: Before the scheduled start time of the first task, determining whether the first task has a timeout risk, including: after UIThread completes the drawing task of the second view and before the first screen refresh time, UI Thread determines whether the drawing task of the first view has a timeout risk, wherein the first task is a drawing task of the first view, the first view is a display view scheduled to be drawn at the first screen refresh time, the scheduled start time is the first screen refresh time, the second view is a display view scheduled to be drawn at the second screen refresh time, and the second screen refresh time is a screen refresh time before the first screen refresh time; If there is a risk of timeout, start executing the first task before the scheduled start time of the first task, and / or allocate more resources to execute the first task, including: if there is a risk of timeout, start drawing the first view by the UI Thread before the first screen refresh time, and / or allocate more resources to the UI Thread for drawing the first view.
2. The method according to claim 1, characterized in that Schedule the target task to be executed once every preset time period; The first task is the next target task to be executed starting from the current moment.
3. The method according to claim 1, characterized in that: Determine whether the drawing task of the first view has a risk of timeout, including: Determine if there are any undisplayed view elements in the cache; If there are undisplayed view elements in the cache, there is no risk of timeout; or, If the undisplayed visual elements are not present in the cache, there is a risk of timeout.
4. The method according to claim 3, characterized in that The display view of the terminal includes linear view elements; Determine whether the drawing task of the first view has a risk of timeout, including: Determine whether there are undisplayed linear view elements in the cache of the linear view control; If there is no undisplayed linear view element in the cache of the linear view control, there is a risk of timeout; or, If there are undisplayed linear view elements in the cache of the linear view control, there is no risk of timeout.
5. The method according to claim 1, characterized in that The allocating more resources includes: allocating more computing power and / or memory.
6. A terminal control device, characterized in that: include: a determining unit, configured to determine whether the first task has a timeout risk before a scheduled time point of the first task, comprising: after the UI Thread completes the drawing task of the second view and before a first screen refresh time point, the UI Thread determines whether the drawing task of the first view has a timeout risk, wherein the first task is a drawing task of the first view, the first view is a display view scheduled to be drawn at the first screen refresh time point, the scheduled start time point is the first screen refresh time point, the second view is a display view scheduled to be drawn at a second screen refresh time point, and the second screen refresh time point is a screen refresh time point before the first screen refresh time point; A control unit is used to start executing the first task before a predetermined time point of the first task if there is a risk of timeout, and / or to allocate more resources for executing the first task, including: if there is a risk of timeout, the UI Thread starts drawing the first view before a first screen refresh time point, and / or to allocate more resources to the UI Thread for drawing the first view.
7. A terminal, comprising: at least one memory and at least one processor; The at least one memory is used to store program codes, and the at least one processor is used to call the program codes stored in the at least one memory to execute the method according to any one of claims 1 to 5.
8. A storage medium for storing a program code, wherein the program code is used to execute the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Image display device, image display method, and program
CN101006417A
System, method, and computer program product for providing dynamic display refresh
CN103714559A
Method and apparatus for accelerating slide display of view
CN105335364A
Timeout prejudgment method and device
CN108073446A
User order processing method and intelligent selling system
CN109166005A
