WO2020135399A1 - 列表滑动的性能优化方法及装置 - Google Patents

列表滑动的性能优化方法及装置 Download PDF

Info

Publication number
WO2020135399A1
WO2020135399A1 PCT/CN2019/127830 CN2019127830W WO2020135399A1 WO 2020135399 A1 WO2020135399 A1 WO 2020135399A1 CN 2019127830 W CN2019127830 W CN 2019127830W WO 2020135399 A1 WO2020135399 A1 WO 2020135399A1
Authority
WO
WIPO (PCT)
Prior art keywords
list
sliding
performance optimization
terminal device
rate value
Prior art date
Application number
PCT/CN2019/127830
Other languages
English (en)
French (fr)
Inventor
孟希羲
姜伟刚
季双双
楼振华
施超
Original Assignee
中移(杭州)信息技术有限公司
中国移动通信集团有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中移(杭州)信息技术有限公司, 中国移动通信集团有限公司 filed Critical 中移(杭州)信息技术有限公司
Publication of WO2020135399A1 publication Critical patent/WO2020135399A1/zh

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/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Definitions

  • the present disclosure relates to the field of communication technology, and in particular to a method and device for optimizing the performance of list sliding.
  • the display effect of various application interfaces in mobile terminals is becoming more and more realistic, more and more data can be displayed, and the structure of the displayed data is becoming more and more complicated.
  • the information content is more or the information content is more complicated, it is usually presented in the form of a list.
  • presentation content such as tables may reduce the presentation of tables during optimization; it can also be optimized by stopping asynchronous data loading, for example, stopping asynchronous data loading when a slip is detected.
  • the purpose of the present disclosure is to provide a method and device for optimizing the performance of list sliding to improve the quality of the performance optimization of list sliding, and can be applied to terminals with different performances.
  • the present disclosure provides a performance optimization method for list sliding, including:
  • the sliding distance is the moving distance of the list when the list is continuously refreshed twice
  • the sliding frame rate is the reciprocal of the time interval during which the list is continuously refreshed twice
  • the first performance optimization strategy is used for performance optimization; the first performance optimization strategy includes at least one of the following processing tasks: stopping time-consuming calculation processing, Stop asynchronous thread loading and stop timing calculation logic.
  • the method further includes:
  • a second performance optimization strategy is used for performance optimization; the second performance optimization strategy includes at least one of the following processing tasks: time-consuming calculation processing , Asynchronous thread loading, timing calculation logic.
  • determining the maximum sliding rate value of the list on the terminal device includes:
  • the maximum sliding rate value of the list on the terminal device is determined according to the product of the sliding distance of the list and the sliding frame rate.
  • obtaining the sliding distance of the list on the terminal device includes:
  • the time interval for the list to be continuously refreshed twice is obtained as follows:
  • a timer is used to obtain a time interval for the list to be continuously refreshed twice.
  • the present disclosure provides a performance optimization device for list sliding, including:
  • An obtaining unit configured to obtain a sliding distance and a sliding frame rate of the list on the terminal device, the sliding distance being the moving distance of the list when the list is continuously refreshed twice, and the sliding frame rate of the list being continuously refreshed twice Reciprocal of the time interval;
  • a determining unit configured to determine the maximum sliding rate value of the list on the terminal device according to the sliding distance and the sliding frame rate acquired by the acquiring unit;
  • the processing unit is configured to use a first performance optimization strategy to perform performance optimization when it is determined that the list sliding rate value on the terminal device is greater than the maximum sliding rate value;
  • the first performance optimization strategy includes at least one of the following processing tasks: stop Time-consuming calculation processing, stop loading of asynchronous threads, and stop timing calculation logic.
  • processing unit is also used to:
  • the second performance optimization strategy is used for performance optimization; the second performance optimization strategy includes at least one of the following processing tasks: time-consuming calculation processing , Asynchronous thread loading, timing calculation logic.
  • the determining unit is specifically configured to determine the maximum sliding rate value of the list on the terminal device according to the sliding distance and the sliding frame rate as follows:
  • the maximum sliding rate value of the list on the terminal device is determined according to the product of the sliding distance of the list and the sliding frame rate.
  • the obtaining unit is specifically configured to obtain the sliding distance of the list on the terminal device as follows:
  • the time interval for the list to be continuously refreshed twice is obtained as follows:
  • a timer is used to obtain a time interval for the list to be continuously refreshed twice.
  • the present disclosure provides a performance optimization device for list sliding, including:
  • Memory used to store program instructions
  • the processor is configured to call the program instructions stored in the memory and execute the method according to the first aspect according to the obtained program.
  • the present disclosure provides a computer-readable storage medium that stores computer instructions, and when the computer instructions run on a computer, causes the computer to perform the method of the first aspect.
  • the present disclosure provides a method and device for optimizing the performance of list sliding, obtaining the sliding distance and sliding frame rate of the list on the terminal device, determining the maximum sliding rate value of the list on the terminal device according to the sliding distance and the sliding frame rate, and determining the terminal
  • the list sliding rate value on the device is greater than the maximum sliding rate value.
  • the first performance optimization strategy is used for performance optimization. By determining the maximum sliding rate value corresponding to different terminals, the performance of different terminals can be optimized and the performance optimization of list sliding can be improved. Quality, which in turn improves the user experience.
  • FIG. 1 is a flowchart of a method for optimizing the performance of list sliding provided by an embodiment of the present application
  • FIG. 2 is a data curve diagram of a rate and a frame rate provided by an embodiment of the present application
  • FIG. 3 is a structural block diagram of an apparatus for optimizing performance of list sliding provided by an embodiment of the present application
  • FIG. 4 is a schematic diagram of another performance optimization device for list sliding provided by an embodiment of the present application.
  • the scenarios applicable to the optimization method for list sliding performance are relatively fixed, and cannot be dynamically adjusted according to different business scenarios, nor can they be dynamically adjusted according to the performance of different terminals.
  • the embodiments of the present application provide a method and device for optimizing the performance of list sliding, by determining the maximum sliding rate value corresponding to different terminals, and performing performance optimization when the sliding rate value is greater than the maximum sliding rate value, so as to be able to target Optimize the performance of different terminals to improve the quality of performance optimization.
  • FIG. 1 is a flowchart of a method for optimizing the performance of list sliding provided by an embodiment of the present application.
  • the method includes:
  • the sliding distance (distance) is the moving distance of the list when the list is continuously refreshed twice on the terminal device
  • the frame rate (FPs) is the reciprocal of the time interval ( ⁇ T) when the list is continuously refreshed twice.
  • S102 Determine the maximum sliding rate value of the list on the terminal device according to the sliding distance and the sliding frame rate.
  • the maximum sliding rate value V max of the list may be determined according to the sliding distance (distance) and the sliding frame rate (FPs) of the list.
  • V max distance ⁇ FPs.
  • the rate and frame rate can be calculated according to the above formula. As shown in Table 1, the data records of different rates and frame rates are shown in Table 1.
  • the frame rate when the frame rate is greater than 55 frames, the user feels smoother when using the frame rate, and when the frame rate is less than 55 frames, the user feels more stuck when using the sense. Therefore, in the embodiment of the present application, the frame rate can be 55 frames The value is defined as the maximum slip rate value.
  • V max in the embodiment of the present application may be used as a rate threshold.
  • step S103 Determine whether the sliding rate value of the list is greater than the maximum sliding rate value. If it is greater, perform step S104, and if less, perform step S105.
  • the first performance optimization strategy is at least one of the following processing tasks: stopping time-consuming calculation processing, stopping asynchronous thread loading, and stopping timing calculation logic.
  • the second performance optimization strategy is at least one of the following processing tasks: time-consuming calculation processing, asynchronous thread loading, and timing calculation logic.
  • first performance optimization strategy and the second performance optimization strategy are relative strategies.
  • the rate value of the list sliding is less than the threshold (ie, the maximum sliding rate value)
  • time-consuming calculation processing asynchronous thread loading, timing calculation logic, etc. can be resumed.
  • Time-consuming calculation processing includes: time format conversion, picture drawing and some other special complex calculations.
  • the timestamp data 1532342550000 is converted into a specific date "2018-07-2318:42:30", or into a relative time format such as "one minute ago” and "one week ago”.
  • Picture drawing refers to the process of reading a picture file and rendering it to the screen for display.
  • the process includes decoding, scaling, and drawing of the picture. It takes a long time for a large picture.
  • asynchronous thread loading mainly refers to pictures, audio and video data, because these data are relatively large, in order not to block the main thread will use asynchronous thread loading, but a large amount of data download will also consume the central processor (Central Processing Unit, CPU), which causes the sliding frame rate to drop.
  • CPU Central Processing Unit
  • Timing calculation logic mainly refers to some component styles that implement carousel through timers.
  • the timer rotation can be stopped to reduce the consumption of CPU and graphics processing unit (GPU), and when the sliding rate slows down, the timer is resumed.
  • determining the maximum sliding rate value of the list on the terminal device according to the sliding distance and the sliding frame rate includes:
  • the maximum sliding rate value of the list on the terminal device is determined according to the product of the sliding distance of the list and the sliding frame rate.
  • the sliding frame rate is 55 frames, that is, the frame rate that the user perceives as smooth.
  • obtaining the sliding distance of the list on the terminal device may include: obtaining the sliding distance of the list using a sliding detector.
  • the time interval for the list to be refreshed twice can be obtained as follows: use a timer to obtain the time interval for the list to be refreshed twice.
  • a list sliding detector may be used to detect the direction and distance of the list sliding.
  • the time interval can be detected by the timer, and then the sliding frame rate can be obtained.
  • the frequency of the timer can be consistent with the frequency of the screen refresh, that is, 60 times/second.
  • the rate V is the sliding distance (the number of pixels) divided by the time interval between two timer callbacks, and the time interval between the two timer callbacks is the time interval between two consecutive refreshes of the list.
  • the frame rate FPs is 1 divided by the time interval between two timer callbacks.
  • the performance optimization method for list sliding provided by the embodiments of the present application can calculate the maximum sliding rate value according to the monitoring result by monitoring the sliding rate, that is, the frame rate data, and use the maximum sliding rate value as the threshold Compare with the current sliding rate to determine whether to stop the time-consuming calculation process, whether to stop the asynchronous thread loading, and whether to calculate the logic regularly, so that the sliding performance can be optimized according to different terminals and the user experience can be improved.
  • FIG. 3 is a structural block diagram of a performance optimization device for list sliding provided by an embodiment of the present disclosure, including: an obtaining unit 101, a determining unit 102, and a processing unit 103.
  • the obtaining unit 101 is used to obtain the sliding distance and sliding frame rate of the list on the terminal device.
  • the sliding distance is the moving distance of the list when the list is continuously refreshed twice
  • the sliding frame rate is the reciprocal of the time interval during which the list is continuously refreshed twice.
  • the determining unit 102 is configured to determine the maximum sliding rate value of the list on the terminal device according to the sliding distance and the sliding frame rate acquired by the acquiring unit 101.
  • the processing unit 103 is configured to adopt the first performance optimization strategy to perform performance optimization when it is determined that the list sliding rate value on the terminal device is greater than the maximum sliding rate value.
  • the first performance optimization strategy includes at least one of the following processing tasks: stopping time-consuming calculation processing, stopping asynchronous thread loading, and stopping timing calculation logic.
  • processing unit 103 is also used to:
  • the second performance optimization strategy is adopted to perform performance optimization.
  • the second performance optimization strategy includes at least one of the following processing tasks: time-consuming calculation processing, asynchronous thread loading, and timing calculation logic.
  • the determining unit 102 is specifically configured to determine the maximum sliding rate value of the list on the terminal device according to the sliding distance and the sliding frame rate as follows:
  • the maximum sliding rate value of the list on the terminal device is determined according to the product of the sliding distance of the list and the sliding frame rate.
  • the obtaining unit 101 is specifically configured to obtain the sliding distance of the list on the terminal device as follows:
  • time interval for the list to be continuously refreshed twice can be obtained by using a timer to obtain the time interval for the list to be continuously refreshed twice.
  • An embodiment of the present application also provides another performance optimization device for list sliding. As shown in FIG. 4, the device includes:
  • the memory 202 is used to store program instructions.
  • the transceiver 201 is used to receive and send performance optimization instructions for list sliding.
  • the processor 200 is configured to call program instructions stored in the memory, and execute any method flow described in the embodiments of the present application according to the obtained program according to the instructions received by the transceiver 201.
  • the processor 200 is used to implement the method executed by the determining unit (102) and the processing unit (103) shown in FIG.
  • the bus architecture may include any number of interconnected buses and bridges. Specifically, one or more processors represented by the processor 200 and various circuits of the memory represented by the memory 202 are linked together.
  • the bus architecture can also link various other circuits such as peripheral devices, voltage regulators, and power management circuits, etc., which are well known in the art, and therefore, they will not be further described in this article.
  • the bus interface provides an interface.
  • the transceiver 201 may be a plurality of elements, including a transmitter and a transceiver, and provides a unit for communicating with various other devices on a transmission medium.
  • the processor 200 is responsible for managing the bus architecture and general processing, and the memory 202 may store data used by the processor 200 when performing operations.
  • the processor 200 may be a central processing unit (CPU), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA), or a complex programmable logic device (Complex Programmable Logic Device, CPLD ).
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • FPGA field programmable gate array
  • CPLD Complex Programmable Logic Device
  • An embodiment of the present application also provides a computer storage medium for storing computer program instructions used by any of the devices described in the above embodiments of the present application, which includes instructions for performing any of the methods provided by the above embodiments of the present application program of.
  • the computer storage medium may be any available medium or data storage device that can be accessed by the computer, including but not limited to magnetic storage (such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.), optical storage (such as compact disc (CD), digital universal disc (Digital Versatile Disc, DVD), Blu-ray disc (Blu-ray Disc, BD), high-definition universal disc (High-Definition Versatile Disc, HVD), etc.), and semiconductor memory ( For example, read-only memory (Read-Only Memory, ROM), erasable programmable read-only memory (Erasable Programmable ROM, EPROM), electrically erasable programmable read-only memory (Electrically EPROM, EEPROM), non-volatile memory (NAND FLASH), Solid State Disk (SSD), etc.
  • magnetic storage such as floppy disk, hard disk, magnetic tape, magneto-optical disk (MO), etc.
  • optical storage Such as compact disc (CD), digital universal disc (
  • the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present disclosure may employ computer-usable storage media (including but not limited to disk storage, compact disk read-only memory (CD-ROM), CD-ROM), optical media in which one or more computer-usable program codes are included. The form of a computer program product implemented on a memory, etc.).
  • each flow and/or block in the flowchart and/or block diagram and a combination of the flow and/or block in the flowchart and/or block diagram may be implemented by computer program instructions.
  • These computer program instructions can be provided to the processor of a general-purpose computer, special-purpose computer, embedded processing machine, or other programmable data processing device to produce a machine that enables the generation of instructions executed by the processor of the computer or other programmable data processing device
  • These computer program instructions may also be stored in a computer readable memory that can guide a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instructions
  • the device implements the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operating steps are performed on the computer or other programmable device to produce computer-implemented processing, which is executed on the computer or other programmable device
  • the instructions provide steps for implementing the functions specified in one block or multiple blocks of the flowchart one flow or multiple flows and/or block diagrams.
  • the embodiments described in the embodiments of the present disclosure may be implemented by hardware, software, firmware, middleware, microcode, or a combination thereof.
  • the processing unit can be implemented in one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processor (Digital Signal Processing, DSP), digital signal processing device (DSP Device, DSPD), programmable Logic Device (Programmable Logic Device, PLD), Field Programmable Gate Array (Field-Programmable Gate Array, FPGA), general-purpose processor, controller, microcontroller, microprocessor, others for performing the functions described in this disclosure Electronic unit or its combination.
  • ASIC Application Specific Integrated Circuits
  • DSP Digital Signal Processing
  • DSP Device digital signal processing device
  • DPD digital signal processing device
  • PLD programmable Logic Device
  • Field Programmable Gate Array Field-Programmable Gate Array
  • FPGA Field-Programmable Gate Array
  • the technology described in the embodiments of the present disclosure may be implemented through modules (e.g., procedures, functions, etc.) that perform the functions described in the embodiments of the present disclosure.
  • the software codes can be stored in memory and executed by the processor.
  • the memory may be implemented in the processor or external to the processor.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

一种列表滑动的性能优化方法及装置,获取终端设备上列表的滑动距离以及滑动帧率(S101),依据滑动距离以及滑动帧率,确定终端设备上列表的最大滑动速率值(S102),并在确定终端设备上的列表滑动速率值大于最大滑动速率值(S103),采用第一性能优化策略进行性能优化(S104)。

Description

列表滑动的性能优化方法及装置
相关申请的交叉引用
本申请主张在2018年12月24日在中国提交的中国专利申请号No.201811585416.9的优先权,其全部内容通过引用包含于此。
技术领域
本公开涉及通信技术领域,尤其涉及一种列表滑动的性能优化方法及装置。
背景技术
随着移动终端的不断普及,移动终端中各类应用界面的显示效果也越来越逼真,所能显示的数据也越来越多,所显示数据的结构也越来越复杂。在信息内容较多或信息内容比较复杂时通常都会采用列表的形式呈现。
如果信息内容设计的比较复杂,在性能比较差的终端上就可能会出现卡顿的现象,因此出现了一些性能优化的方法,例如,使用较少的视图层级,即原来可能用附图、文字以及表格等呈现内容,在优化时可能减少表格的呈现方式;也可以通过停止异步数据加载来优化,例如,在检测到滑动时就停止异步数据加载等。
目前的这些优化方法适用的场景都比较固定,并且仅是对于性能较差的终端优化效果可能会明显一些。
发明内容
本公开的目的是提供一种列表滑动的性能优化方法及装置,以提高列表滑动的性能优化质量,并且能够适用于不同性能的终端。
本公开的目的是通过以下技术方案实现的:
第一方面,本公开提供一种列表滑动的性能优化方法,包括:
获取终端设备上列表的滑动距离以及滑动帧率,所述滑动距离为所述列表连续刷新两次时列表的移动距离,所述滑动帧率为所述列表连续刷新两次 的时间间隔的倒数;
依据所述滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值;
若确定终端设备上的列表滑动速率值大于所述最大滑动速率值,则采用第一性能优化策略进行性能优化;所述第一性能优化策略包括如下至少一项处理任务:停止耗时计算处理、停止异步线程加载、停止定时计算逻辑。
可选的,所述方法还包括:
若确定所述终端设备上的列表滑动速率值小于所述最大滑动速率值,则采用第二性能优化策略进行性能优化;所述第二性能优化策略包括如下至少一项处理任务:耗时计算处理、异步线程加载、定时计算逻辑。
可选的,依据所述滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值,包括:
依据所述列表的滑动距离与滑动帧率的乘积,确定所述终端设备上列表的最大滑动速率值。
可选的,获取终端设备上列表的滑动距离,包括:
利用滑动探测器获取列表的滑动距离;
所述列表连续刷新两次的时间间隔利用如下方式得到:
利用定时器获取所述列表连续刷新两次的时间间隔。
第二方面,本公开提供一种列表滑动的性能优化装置,包括:
获取单元,用于获取终端设备上列表的滑动距离以及滑动帧率,所述滑动距离为所述列表连续刷新两次时列表的移动距离,所述滑动帧率为所述列表连续刷新两次的时间间隔的倒数;
确定单元,用于依据所述获取单元获取的滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值;
处理单元,用于在确定终端设备上的列表滑动速率值大于所述最大滑动速率值时,采用第一性能优化策略进行性能优化;所述第一性能优化策略包括如下至少一项处理任务:停止耗时计算处理、停止异步线程加载、停止定时计算逻辑。
可选的,所述处理单元还用于:
在确定所述终端设备上的列表滑动速率值小于所述最大滑动速率值时,采用第二性能优化策略进行性能优化;所述第二性能优化策略包括如下至少一项处理任务:耗时计算处理、异步线程加载、定时计算逻辑。
可选的,所述确定单元具体用于按如下方式依据所述滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值:
依据所述列表的滑动距离与滑动帧率的乘积,确定所述终端设备上列表的最大滑动速率值。
可选的,获取单元具体用于按如下方式获取终端设备上列表的滑动距离:
利用滑动探测器获取列表的滑动距离;
所述列表连续刷新两次的时间间隔利用如下方式得到:
利用定时器获取所述列表连续刷新两次的时间间隔。
第三方面,本公开提供一种列表滑动的性能优化装置,包括:
存储器,用于存储程序指令;
处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行如第一方面所述的方法。
第四方面,本公开提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行第一方面所述的方法。
本公开提供一种列表滑动的性能优化方法及装置,获取终端设备上列表的滑动距离以及滑动帧率,依据滑动距离以及滑动帧率,确定终端设备上列表的最大滑动速率值,并在确定终端设备上的列表滑动速率值大于最大滑动速率值,采用第一性能优化策略进行性能优化,通过确定不同终端对应的最大滑动速率值,使得能够针对不同终端的性能进行优化,提高列表滑动的性能优化质量,进而提升用户体验。
附图说明
图1为本申请实施例提供一种列表滑动的性能优化方法流程图;
图2为本申请实施例提供一种速率与帧率的数据曲线图;
图3为本申请实施例提供一种列表滑动的性能优化装置的结构框图;
图4为本申请实施例提供另一种列表滑动的性能优化装置的示意图。
具体实施方式
下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分实施例,并不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本公开保护的范围。
目前,针对列表滑动性能的优化方法适用的场景都比较固定,不能根据不同的业务场景进行动态调整,更不能中根据不同终端的性能进行动态调整。
有鉴于此,本申请实施例提供一种列表滑动的性能优化方法及装置,通过确定不同终端对应的最大滑动速率值,并在滑动速率值大于最大滑动速率值时,进行性能优化,从而能够针对不同终端的性能进行优化,提高性能优化的质量。
其中,需要理解的是,在下文的描述中,“第一”、“第二”等词汇,仅用于区分描述的目的,而不能理解为指示或暗示相对重要性,也不能理解为指示或暗示顺序。
如图1所示为本申请实施例提供的一种列表滑动的性能优化方法流程图,参阅图1所示,该方法包括:
S101:获取终端设备上列表的滑动距离以及滑动帧率。
具体的,滑动距离(distance)为终端设备上列表连续刷新两次时列表的移动距离,帧率(FPs)为列表连续刷新两次的时间间隔(ΔT)的倒数。
S102:依据滑动距离以及滑动帧率,确定终端设备上列表的最大滑动速率值。
本申请实施例中,可根据列表的滑动距离(distance)以及滑动的帧率(FPs)确定列表的最大滑动速率值V max
具体的,滑动速率
Figure PCTCN2019127830-appb-000001
帧率
Figure PCTCN2019127830-appb-000002
因此,由上面两个公式可知:V max=distance×FPs。
按照上述公式可计算出速率以及帧率,如表1所示为不同速率以及帧率 的数据记录,参照表1所示。
表1速率以及帧率数据记录表
Figure PCTCN2019127830-appb-000003
由表1可知:在帧率大于55帧时,用户使用感知比较流畅,在帧率小于55帧时,用户使用感知比较卡顿,因此,本申请实施例中可将帧率为55帧的速率值定义为最大滑动速率值。
也就是说,对于不同性能的终端而言,所对应的最大滑动速率值均不同。
当FPs=55,即:V max=55×distance。
将表1转换为曲线图,可清晰的确定最大滑动速率值所对应的帧率,如图2所示为本申请实施例提供的一种最大滑动速率值的曲线图,参阅图2所示。
由图2可知:最大滑动速率V max=1.5pix/ms,可理解为一秒滑动一屏幕的数据。
在本申请实施例中,可将屏幕(列表)连续刷新两次的频率设置为60次/秒,即T=1/60。
需要理解的是,本申请实施例中的最大滑动速率V max可作为速率阈值。
S103:判断列表的滑动速率值是否大于最大滑动速率值,若大于则执行步骤S104,若小于则执行步骤S105。
S104:若确定终端设备上的列表滑动速率值大于最大滑动速率值,则采用第一性能优化策略进行性能优化。
具体的,第一性能优化策略如下至少一项处理任务:停止耗时计算处理、停止异步线程加载、停止定时计算逻辑。
本申请实施例中,当列表滑动的速率值大于阈值(即最大滑动速率值)时,可停止耗时计算处理、停止异步线程加载、停止定时计算逻辑等任务。
S105:若确定终端设备上的列表滑动速率值小于最大滑动速率值,则采用第二性能优化策略进行性能优化。
具体的,第二性能优化策略如下至少一项处理任务:耗时计算处理、异步线程加载、定时计算逻辑。
需要理解的是,第一性能优化策略与第二性能优化策略为相对的策略。
本申请实施例中,当列表滑动的速率值小于阈值(即最大滑动速率值)时,可恢复耗时计算处理、异步线程加载、定时计算逻辑等。
以下将对上述所列举的“耗时计算处理”、“异步线程加载”、“定时计算逻辑”进行详细说明。
(1)、耗时计算处理包括:时间格式转化,图片绘制以及一些其他的特殊的复杂计算。
例如,将时间戳数据1532342550000转换为具体的日期“2018-07-2318:42:30”,或是转换为“一分钟前”、“一周前”等的相对时间格式。
图片绘制指的是把读取图片文件并渲染到屏幕上展示的过程,该过程包括图片的解码、缩放、绘制三个步骤,对于一张大图片耗时是非常长的。
针对这些耗时较多的计算,当滑动速率大于V max时可以选择停止计算,直接使用缓存或是默认展位图展示,因为用户在快速滑动时本身就看不清这些信息,所在滑动速度较快时可不加载耗时信息来提升滑动性能。
并且在滑动速率慢下来,也就是用户真正关心数据时,再恢复当前可见屏幕内的数据计算,即恢复停止的处理任务。
(2)、异步线程加载:主要指图片、音视频数据,由于这些数据都比较大,为了不阻塞主线程都会采用异步线程加载,但是大量的数据下载也会消耗中央处理器(Central Processing Unit,CPU),从而导致滑动帧率下降。
针对该场景,当滑动速率大于V max时可以停止异步线程加载,减少CPU的消耗,当滑动速率慢下来时,再恢复当前可见屏幕内的数据异步加载。
(3)、定时计算逻辑:主要指的是一些通过定时器实现轮播的组件样式。当滑动速率大于V max时可以停止定时器轮播,减少CPU、图形处理器(Graphics  Processing Unit,GPU)的消耗,当滑动速率慢下来时,再恢复定时器。
进一步的,本申请实施例中依据滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值,包括:
依据列表的滑动距离与滑动帧率的乘积,确定终端设备上列表的最大滑动速率值。
具体的,在确定最大滑动速率值时,滑动帧率为55帧,即用户感知流畅的帧率。
更进一步的,获取终端设备上列表的滑动距离,可包括:利用滑动探测器获取列表的滑动距离。
列表连续刷新两次的时间间隔利用如下方式得到:利用定时器获取列表连续刷新两次的时间间隔。
具体的,本申请实施例中可通过列表滑动探测器,检测列表滑动的方向以及滑动的距离。
并且可通过定时器检测时间间隔,进而得到滑动帧率。定时器的频率可与屏幕刷新的频率一致,即60次/秒。
可以理解的是,速率V即为滑动距离(像素个数)除以两次定时器回调的时间间隔,两次定时器回调的时间间隔即为列表连续刷新两次的时间间隔。
帧率FPs即为1除以两次定时器回调的时间间隔。
本申请实施例所提供的列表滑动的性能优化方法相对于目前的性能优化方法,可通过监测滑动速率即帧率数据,根据监测结果计算出最大滑动速率值,并将该最大滑动速率值作为阈值与当前滑动速率进行比较,判断是否停止耗时计算处理、是否停止异步线程加载、是否定时计算逻辑,从而能够根据不同终端对滑动性能进行优化,提升用户体验。
基于与上述一种列表滑动的性能优化方法实施例相同的构思,本公开实施例还提供一种列表滑动的性能优化装置。图3所示为本公开实施例提供的一种列表滑动的性能优化装置的结构框图,包括:获取单元101、确定单元102、处理单元103。
获取单元101,用于获取终端设备上列表的滑动距离以及滑动帧率,滑动距离为列表连续刷新两次时列表的移动距离,滑动帧率为列表连续刷新两次 的时间间隔的倒数。
确定单元102,用于依据获取单元101获取的滑动距离以及滑动帧率,确定终端设备上列表的最大滑动速率值。
处理单元103,用于在确定终端设备上的列表滑动速率值大于最大滑动速率值时,采用第一性能优化策略进行性能优化。
第一性能优化策略包括如下至少一项处理任务:停止耗时计算处理、停止异步线程加载、停止定时计算逻辑。
进一步的,处理单元103还用于:
在确定终端设备上的列表滑动速率值小于最大滑动速率值时,采用第二性能优化策略进行性能优化。
第二性能优化策略包括如下至少一项处理任务:耗时计算处理、异步线程加载、定时计算逻辑。
具体的,确定单元102具体用于按如下方式依据滑动距离以及滑动帧率,确定终端设备上列表的最大滑动速率值:
依据列表的滑动距离与滑动帧率的乘积,确定终端设备上列表的最大滑动速率值。
更进一步的,获取单元101具体用于按如下方式获取终端设备上列表的滑动距离:
利用滑动探测器获取列表的滑动距离。
并且,列表连续刷新两次的时间间隔利用如下方式得到:利用定时器获取列表连续刷新两次的时间间隔。
需要说明的是,本公开实施例中上述涉及的列表滑动的性能优化装置中各个单元的功能实现可以进一步参照相关方法实施例的描述,在此不再赘述。
本申请实施例还提供另外一种列表滑动的性能优化装置,如图4所示,该装置包括:
存储器202,用于存储程序指令。
收发机201,用于接收和发送的列表滑动的性能优化指令。
处理器200,用于调用所述存储器中存储的程序指令,根据收发机201接收到的指令按照获得的程序执行本申请实施例所述的任一方法流程。处理器 200用于实现图3所示的确定单元(102)、处理单元(103)所执行的方法。
其中,在图4中,总线架构可以包括任意数量的互联的总线和桥,具体由处理器200代表的一个或多个处理器和存储器202代表的存储器的各种电路链接在一起。总线架构还可以将诸如外围设备、稳压器和功率管理电路等之类的各种其他电路链接在一起,这些都是本领域所公知的,因此,本文不再对其进行进一步描述。总线接口提供接口。
收发机201可以是多个元件,即包括发送机和收发机,提供用于在传输介质上与各种其他装置通信的单元。
处理器200负责管理总线架构和通常的处理,存储器202可以存储处理器200在执行操作时所使用的数据。
处理器200可以是中央处理器(CPU)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或复杂可编程逻辑器件(Complex Programmable Logic Device,CPLD)。
本申请实施例还提供了一种计算机存储介质,用于储存为上述本申请实施例中所述的任一装置所用的计算机程序指令,其包含用于执行上述本申请实施例提供的任一方法的程序。
所述计算机存储介质可以是计算机能够存取的任何可用介质或数据存储设备,包括但不限于磁性存储器(例如软盘、硬盘、磁带、磁光盘(magneto-optical disk,MO)等)、光学存储器(例如光盘(Compact Disk,CD)、数字通用光盘(Digital Versatile Disc,DVD)、蓝光光碟(Blu-ray Disc,BD)、高清通用光盘(High-Definition Versatile Disc,HVD)等)、以及半导体存储器(例如只读存储器(Read-Only Memory,ROM)、可擦除可编程只读存储器(Erasable Programmable ROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)、非易失性存储器(NAND FLASH)、固态硬盘(Solid State Disk,SSD))等。
本领域内的技术人员应明白,本公开的实施例可提供为方法、系统、或计算机程序产品。因此,本公开可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本公开可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存 储器、光盘只读储存器(Compact Disc Read-Only Memory,CD-ROM)、光学存储器等)上实施的计算机程序产品的形式。
本公开是参照根据本公开实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本公开的可选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括可选实施例以及落入本公开范围的所有变更和修改。
可以理解的是,本公开实施例描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(Application Specific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable Logic Device,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本公开所述功能的其它电子单元或其组合中。
对于软件实现,可通过执行本公开实施例所述功能的模块(例如过程、函 数等)来实现本公开实施例所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。
显然,本领域的技术人员可以对本公开进行各种改动和变型而不脱离本公开的精神和范围。这样,倘若本公开的这些修改和变型属于本公开权利要求及其等同技术的范围之内,则本公开也意图包含这些改动和变型在内。

Claims (10)

  1. 一种列表滑动的性能优化方法,包括:
    获取终端设备上列表的滑动距离以及滑动帧率,所述滑动距离为所述列表连续刷新两次时列表的移动距离,所述滑动帧率为所述列表连续刷新两次的时间间隔的倒数;
    依据所述滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值;
    若确定终端设备上的列表滑动速率值大于所述最大滑动速率值,则采用第一性能优化策略进行性能优化;所述第一性能优化策略包括如下至少一项处理任务:停止耗时计算处理、停止异步线程加载、停止定时计算逻辑。
  2. 如权利要求1所述的方法,还包括:
    若确定所述终端设备上的列表滑动速率值小于所述最大滑动速率值,则采用第二性能优化策略进行性能优化;所述第二性能优化策略包括如下至少一项处理任务:耗时计算处理、异步线程加载、定时计算逻辑。
  3. 如权利要求1所述的方法,其中,依据所述滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值,包括:
    依据所述列表的滑动距离与滑动帧率的乘积,确定所述终端设备上列表的最大滑动速率值。
  4. 如权利要求1所述的方法,其中,获取终端设备上列表的滑动距离,包括:
    利用滑动探测器获取列表的滑动距离;
    所述列表连续刷新两次的时间间隔利用如下方式得到:
    利用定时器获取所述列表连续刷新两次的时间间隔。
  5. 一种列表滑动的性能优化装置,包括:
    获取单元,用于获取终端设备上列表的滑动距离以及滑动帧率,所述滑动距离为所述列表连续刷新两次时列表的移动距离,所述滑动帧率为所述列表连续刷新两次的时间间隔的倒数;
    确定单元,用于依据所述获取单元获取的滑动距离以及所述滑动帧率, 确定终端设备上列表的最大滑动速率值;
    处理单元,用于在确定终端设备上的列表滑动速率值大于所述最大滑动速率值时,采用第一性能优化策略进行性能优化;所述第一性能优化策略包括如下至少一项处理任务:停止耗时计算处理、停止异步线程加载、停止定时计算逻辑。
  6. 如权利要求5所述的装置,其中,所述处理单元还用于:
    在确定所述终端设备上的列表滑动速率值小于所述最大滑动速率值时,采用第二性能优化策略进行性能优化;所述第二性能优化策略包括如下至少一项处理任务:耗时计算处理、异步线程加载、定时计算逻辑。
  7. 如权利要求5所述的装置,其中,所述确定单元具体用于按如下方式依据所述滑动距离以及所述滑动帧率,确定终端设备上列表的最大滑动速率值:
    依据所述列表的滑动距离与滑动帧率的乘积,确定所述终端设备上列表的最大滑动速率值。
  8. 如权利要求5所述的装置,其中,获取单元具体用于按如下方式获取终端设备上列表的滑动距离:
    利用滑动探测器获取列表的滑动距离;
    所述列表连续刷新两次的时间间隔利用如下方式得到:
    利用定时器获取所述列表连续刷新两次的时间间隔。
  9. 一种列表滑动的性能优化装置,包括:
    存储器,用于存储程序指令;
    处理器,用于调用所述存储器中存储的程序指令,按照获得的程序执行权利要求1~4任一项所述的方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机指令,当所述计算机指令在计算机上运行时,使得计算机执行权利要求1~4任一项所述的方法。
PCT/CN2019/127830 2018-12-24 2019-12-24 列表滑动的性能优化方法及装置 WO2020135399A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811585416.9 2018-12-24
CN201811585416.9A CN111352555A (zh) 2018-12-24 2018-12-24 一种列表滑动的性能优化方法及装置

Publications (1)

Publication Number Publication Date
WO2020135399A1 true WO2020135399A1 (zh) 2020-07-02

Family

ID=71126896

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/127830 WO2020135399A1 (zh) 2018-12-24 2019-12-24 列表滑动的性能优化方法及装置

Country Status (2)

Country Link
CN (1) CN111352555A (zh)
WO (1) WO2020135399A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114327194A (zh) * 2021-12-30 2022-04-12 展讯通信(上海)有限公司 列表滑动的控制方法、装置及终端

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101336407A (zh) * 2005-12-08 2008-12-31 苹果公司 响应于在索引符号的列表上移动接触点的列表滚动
CN104021067A (zh) * 2014-05-28 2014-09-03 广东欧珀移动通信有限公司 移动终端的滑动性能检测方法、装置及移动终端
CN104881221A (zh) * 2015-05-27 2015-09-02 上海与德通讯技术有限公司 一种滑动控制方法及触控终端
CN106227445A (zh) * 2016-07-14 2016-12-14 乐视控股(北京)有限公司 显示控制方法、装置及终端
CN108710464A (zh) * 2018-06-04 2018-10-26 Oppo(重庆)智能科技有限公司 移动终端、控制方法及其存储介质

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102542583A (zh) * 2010-12-24 2012-07-04 北京金山软件有限公司 一种二维画面中环境效果的显示方法和显示装置
CN103455355B (zh) * 2013-09-05 2017-02-22 南京朗睿软件科技有限公司 安卓设备及其适配器视图的异步数据加载方法及装置
JP6289126B2 (ja) * 2014-01-29 2018-03-07 オリンパス株式会社 走査型内視鏡装置とその制御方法
CN104035668A (zh) * 2014-06-24 2014-09-10 广州金山网络科技有限公司 一种异步加载数据滑动性能的优化方法及系统、移动终端
CN105892831A (zh) * 2016-04-29 2016-08-24 青岛海信移动通信技术股份有限公司 一种移动终端的列表数据的滑动显示方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101336407A (zh) * 2005-12-08 2008-12-31 苹果公司 响应于在索引符号的列表上移动接触点的列表滚动
CN104021067A (zh) * 2014-05-28 2014-09-03 广东欧珀移动通信有限公司 移动终端的滑动性能检测方法、装置及移动终端
CN104881221A (zh) * 2015-05-27 2015-09-02 上海与德通讯技术有限公司 一种滑动控制方法及触控终端
CN106227445A (zh) * 2016-07-14 2016-12-14 乐视控股(北京)有限公司 显示控制方法、装置及终端
CN108710464A (zh) * 2018-06-04 2018-10-26 Oppo(重庆)智能科技有限公司 移动终端、控制方法及其存储介质

Also Published As

Publication number Publication date
CN111352555A (zh) 2020-06-30

Similar Documents

Publication Publication Date Title
US9251552B2 (en) Method and apparatus for managing image data for presentation on a display
WO2015180444A1 (zh) 调整屏幕刷新率的方法、终端及计算机存储介质
KR102419927B1 (ko) 디스플레이 성능 제어
US9030481B2 (en) Method and apparatus for reducing power usage during video presentation on a display
TWI686768B (zh) 在移動設備上動畫展現圖像的方法和裝置
TWI661354B (zh) 資訊信息的展示方法和裝置
TWI553550B (zh) 用以發送命令至目標裝置之技術
TW201913375A (zh) 電子裝置及螢幕刷新頻率的調整方法
US8947420B2 (en) Processing image content for content motion or touch input
US9564108B2 (en) Video frame processing on a mobile operating system
US20180082340A1 (en) Pausing an advertisement
WO2021008427A1 (zh) 图像合成方法、装置、电子设备及存储介质
WO2020107999A1 (zh) 一种图像数据的传输方法及智能电视
US20140092109A1 (en) Computer system and method for gpu driver-generated interpolated frames
WO2020062069A1 (en) Frame composition alignment to target frame rate for janks reduction
WO2020135399A1 (zh) 列表滑动的性能优化方法及装置
WO2021000220A1 (en) Methods and apparatus for dynamic jank reduction
WO2023160240A1 (zh) 投屏控制方法、装置、电子设备和计算机可读存储介质
WO2023083064A1 (zh) 视频处理方法、装置、电子设备及可读存储介质
TW201601543A (zh) 視頻顯示方法和裝置
CN110928587A (zh) 控制方法和控制装置
TW202226809A (zh) 對應用層渲染的智慧管理
US20210358079A1 (en) Methods and apparatus for adaptive rendering
WO2018058368A1 (zh) 系统性能提升方法、系统性能提升装置及显示装置
WO2021056364A1 (en) Methods and apparatus to facilitate frame per second rate switching via touch event signals

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19903900

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19903900

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19903900

Country of ref document: EP

Kind code of ref document: A1