CN117130774A - Thread acceleration processing method and device - Google Patents
Thread acceleration processing method and device Download PDFInfo
- Publication number
- CN117130774A CN117130774A CN202310493154.8A CN202310493154A CN117130774A CN 117130774 A CN117130774 A CN 117130774A CN 202310493154 A CN202310493154 A CN 202310493154A CN 117130774 A CN117130774 A CN 117130774A
- Authority
- CN
- China
- Prior art keywords
- thread
- rendering
- electronic device
- layer
- main
- 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.)
- Granted
Links
- 230000001133 acceleration Effects 0.000 title claims abstract description 48
- 238000003672 processing method Methods 0.000 title claims abstract description 10
- 238000009877 rendering Methods 0.000 claims abstract description 355
- 238000000034 method Methods 0.000 claims abstract description 83
- 238000012545 processing Methods 0.000 claims description 84
- 230000006870 function Effects 0.000 claims description 52
- 230000015654 memory Effects 0.000 claims description 34
- 230000015572 biosynthetic process Effects 0.000 claims description 30
- 238000003786 synthesis reaction Methods 0.000 claims description 30
- 239000000872 buffer Substances 0.000 claims description 19
- 238000003780 insertion Methods 0.000 claims description 11
- 230000037431 insertion Effects 0.000 claims description 11
- 238000004590 computer program Methods 0.000 claims description 10
- 230000004044 response Effects 0.000 claims description 6
- 230000002618 waking effect Effects 0.000 claims description 4
- 230000008569 process Effects 0.000 description 30
- 238000010586 diagram Methods 0.000 description 22
- 238000004891 communication Methods 0.000 description 20
- 238000007726 management method Methods 0.000 description 17
- 238000005516 engineering process Methods 0.000 description 9
- 238000013461 design Methods 0.000 description 8
- 238000010295 mobile communication Methods 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 230000005236 sound signal Effects 0.000 description 7
- 238000013468 resource allocation Methods 0.000 description 6
- 239000000203 mixture Substances 0.000 description 5
- 229920001621 AMOLED Polymers 0.000 description 4
- 238000013528 artificial neural network Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000006073 displacement reaction Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000013500 data storage Methods 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000003321 amplification Effects 0.000 description 1
- 230000003416 augmentation Effects 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000001149 cognitive effect Effects 0.000 description 1
- 238000004040 coloring Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000007774 longterm Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 238000003199 nucleic acid amplification method Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000002096 quantum dot Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000002194 synthesizing effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5027—Allocation 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/5038—Allocation 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 the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T1/00—General purpose image data processing
- G06T1/20—Processor architectures; Processor configuration, e.g. pipelining
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/47—End-user applications
- H04N21/478—Supplemental services, e.g. displaying phone caller identification, shopping application
- H04N21/4788—Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Multimedia (AREA)
- Signal Processing (AREA)
- Image Generation (AREA)
- Telephone Function (AREA)
Abstract
Description
技术领域Technical field
本申请涉及终端领域,尤其涉及一种线程加速处理方法和装置。The present application relates to the field of terminals, and in particular, to a thread acceleration processing method and device.
背景技术Background technique
随着电子技术的发展,电子设备(如手机、平板电脑或智能手表等)的功能越来越多。例如,电子设备中安装有各类应用程序,电子设备可以通过各类应用程序,实现多种功能。With the development of electronic technology, electronic devices (such as mobile phones, tablets or smart watches, etc.) have more and more functions. For example, electronic devices are installed with various applications, and the electronic devices can implement various functions through various applications.
目前,电子设备上运行的应用程序可以自定义关键线程,关键线程可以包括主线程和渲染线程。当关键线程的资源调配不足时,会导致应用程序丢帧从而发生卡顿,用户体验差。因此,如何识别这些关键线程并及时调度资源,避免应用程序发生卡顿成为一个亟待解决的问题。Currently, applications running on electronic devices can customize key threads, and key threads can include the main thread and the rendering thread. When the resource allocation of key threads is insufficient, it will cause the application to lose frames and cause lag, resulting in poor user experience. Therefore, how to identify these key threads and schedule resources in time to avoid application lag has become an urgent problem to be solved.
发明内容Contents of the invention
本申请实施例提供一种线程加速处理方法和装置,能够避免应用程序发生卡顿,可以提高用户体验。Embodiments of the present application provide a thread acceleration processing method and device, which can avoid application lags and improve user experience.
第一方面,本申请实施例提供一种线程加速处理方法,应用于电子设备,包括:电子设备接收用户在第一应用的界面上的第一操作,第一操作用于触发电子设备显示目标信息;电子设备获取渲染线程的线程标识,渲染线程用于执行图层渲染得到渲染后的图层,渲染后的图层与目标信息对应;电子设备根据渲染线程的线程标识确定与渲染线程具有唤醒关系的主线程;电子设备对渲染线程和主线程进行加速处理。In a first aspect, embodiments of the present application provide a thread acceleration processing method, which is applied to an electronic device, including: the electronic device receives a first operation by a user on an interface of a first application, and the first operation is used to trigger the electronic device to display target information. ; The electronic device obtains the thread identification of the rendering thread, and the rendering thread is used to perform layer rendering to obtain the rendered layer. The rendered layer corresponds to the target information; the electronic device determines that it has a wake-up relationship with the rendering thread based on the thread identification of the rendering thread. The main thread; the electronic device accelerates the rendering thread and the main thread.
基于本申请实施例提供的方法,电子设备接收到用于触发电子设备显示目标信息的第一操作后,可以获取渲染线程的线程标识,并可以根据渲染线程的线程标识确定与渲染线程具有唤醒关系的主线程,进而对渲染线程和主线程进行加速处理,可以避免渲染线程和主线程处理速度慢导致丢帧和卡顿,从而可以提升用户体验。Based on the method provided by the embodiments of the present application, after the electronic device receives the first operation for triggering the electronic device to display target information, it can obtain the thread identifier of the rendering thread, and can determine that it has a wake-up relationship with the rendering thread based on the thread identifier of the rendering thread. The main thread is used to accelerate the rendering thread and the main thread, which can avoid frame drops and freezes caused by slow processing speeds of the rendering thread and the main thread, thereby improving the user experience.
在一种可能的实现方式中,加速处理包括以下至少一项:将渲染线程和主线程从第一优先级调度组调整至第二优先级调度组,第二优先级调度组中的线程的调度优先级高于第一优先级调度组中的线程;对渲染线程和主线程进行提频处理;提高渲染线程和主线程的线程优先级。这样,电子设备可以优先调度渲染线程和主线程执行相应的任务,可以避免渲染线程和主线程处理速度慢导致丢帧和卡顿,从而可以提升用户体验。In a possible implementation, the acceleration process includes at least one of the following: adjusting the rendering thread and the main thread from the first priority scheduling group to the second priority scheduling group, and scheduling the threads in the second priority scheduling group Threads with a priority higher than the first priority scheduling group; increase the frequency of the rendering thread and the main thread; increase the thread priority of the rendering thread and the main thread. In this way, the electronic device can prioritize the rendering thread and the main thread to perform corresponding tasks, which can avoid frame drops and freezes caused by slow processing speeds of the rendering thread and the main thread, thus improving the user experience.
在一种可能的实现方式中,电子设备获取渲染线程的线程标识之前,方法还包括:电子设备在渲染线程对应的入队列函数的插入点中插入插桩函数;电子设备获取渲染线程的线程标识包括:当电子设备执行到入队列函数的插入点时,获取插桩信息,插桩信息包括渲染线程的线程标识。这样,电子设备可以通过“插桩”的方法获取渲染线程的线程标识,再根据渲染线程的线程标识确定与渲染线程具有唤醒关系的主线程,进而对渲染线程和主线程进行加速处理,可以避免渲染线程和主线程处理速度慢导致丢帧和卡顿,从而可以提升用户体验。In a possible implementation, before the electronic device obtains the thread identification of the rendering thread, the method also includes: the electronic device inserts an instrumentation function into the insertion point of the queue function corresponding to the rendering thread; the electronic device obtains the thread identification of the rendering thread. Including: when the electronic device executes the insertion point of the queue function, the instrumentation information is obtained, and the instrumentation information includes the thread identification of the rendering thread. In this way, the electronic device can obtain the thread identifier of the rendering thread through the "instrumentation" method, and then determine the main thread that has a wake-up relationship with the rendering thread based on the thread identifier of the rendering thread, and then accelerate the rendering thread and the main thread, which can avoid Slow processing speeds of the rendering thread and main thread lead to frame drops and freezes, which can improve the user experience.
在一种可能的实现方式中,电子设备根据渲染线程的线程标识确定与渲染线程具有唤醒关系的主线程包括:电子设备基于当前绘帧周期记录的重要事件信息,以渲染线程为起点,追溯当前绘帧周期中具有唤醒关系的至少一个线程,重要事件信息包括线程与线程之间的唤醒事件,唤醒关系用于表示线程之间唤醒与被唤醒的关系;电子设备根据至少一个线程之间的唤醒关系确定至少一条目标路径;电子设备根据至少一条目标路径确定主线程,主线程是至少一条目标路径中作为路径终点次数最多的线程。如此,可以确定出主线程,进而可以对主线程进行加速处理,可以避免主线程处理速度慢导致丢帧和卡顿,从而可以提升用户体验。In one possible implementation, the electronic device determines the main thread that has a wake-up relationship with the rendering thread based on the thread identifier of the rendering thread, including: the electronic device traces the current situation based on the important event information recorded in the current drawing frame cycle, starting from the rendering thread. At least one thread with a wake-up relationship in the frame cycle. Important event information includes wake-up events between threads. The wake-up relationship is used to represent the relationship between wake-up and wake-up between threads; the electronic device is based on the wake-up between at least one thread. The relationship determines at least one target path; the electronic device determines the main thread based on at least one target path, and the main thread is the thread that serves as the end point of the path the most times in at least one target path. In this way, the main thread can be determined, and the main thread can be accelerated to avoid frame drops and freezes caused by slow processing speed of the main thread, thereby improving the user experience.
在一种可能的实现方式中,重要事件信息还包括被唤醒线程对应的处理器的标识,被唤醒线程对应的调度组,被唤醒线程在处理器上的运行时长,被唤醒线程在处理器上的运行频率中的至少一项,被唤醒线程包括渲染线程和主线程;电子设备对渲染线程和主线程进行加速处理包括:电子设备根据被唤醒线程对应的处理器的标识,被唤醒线程对应的调度组,被唤醒线程在处理器上的运行时长,被唤醒线程在处理器上的运行频率中的至少一项对渲染线程和主线程进行加速处理。例如,若加速处理前,根据重要事件信息确定渲染线程和主线程对应的调度组为第一优先级调度组,可以将渲染线程和主线程从第一优先级调度组(例如,CFS调度组)调整至第二优先级调度组(例如,VIP调度组),第二优先级调度组中的线程的调度优先级高于第一优先级调度组中的线程。电子设备可以优先为第二优先级调度组中的线程分配处理资源。又例如,假设处理器的频率可以包括1.0GHz、1.5GHz、2.0GHz。若加速处理前,根据重要事件信息确定渲染线程和主线程对应的处理器的频率为1.0GHz,可以将渲染线程和主线程对应的处理器的频率提高到1.5GHz或2.0GHz,从而可以提高渲染线程和主线程的执行效率。In a possible implementation, the important event information also includes the identifier of the processor corresponding to the awakened thread, the scheduling group corresponding to the awakened thread, the running time of the awakened thread on the processor, the number of seconds the awakened thread has been running on the processor At least one of the running frequencies, the awakened thread includes the rendering thread and the main thread; the electronic device's acceleration of the rendering thread and the main thread includes: the electronic device, according to the identifier of the processor corresponding to the awakened thread, At least one of the scheduling group, the running time of the awakened thread on the processor, and the running frequency of the awakened thread on the processor accelerates the rendering thread and the main thread. For example, if the scheduling group corresponding to the rendering thread and the main thread is determined to be the first priority scheduling group based on important event information before acceleration processing, the rendering thread and the main thread can be moved from the first priority scheduling group (for example, CFS scheduling group) Adjust to the second priority scheduling group (eg, VIP scheduling group), and the scheduling priority of the threads in the second priority scheduling group is higher than the threads in the first priority scheduling group. The electronic device may preferentially allocate processing resources to threads in the second priority scheduling group. For another example, assume that the frequency of the processor may include 1.0GHz, 1.5GHz, and 2.0GHz. If before acceleration processing, the frequency of the processor corresponding to the rendering thread and the main thread is determined to be 1.0GHz based on important event information, the frequency of the processor corresponding to the rendering thread and the main thread can be increased to 1.5GHz or 2.0GHz, thereby improving the rendering efficiency. The execution efficiency of threads and main threads.
在一种可能的实现方式中,方法还包括:当电子设备追溯到被内核线程或者系统中断或者应用线程唤醒的线程时,不再继续追溯。In a possible implementation, the method also includes: when the electronic device traces back to a thread that is interrupted by a kernel thread or a system or woken up by an application thread, the trace is no longer continued.
在一种可能的实现方式中,方法还包括:电子设备将渲染线程的线程标识与标准线程标识进行比对;渲染线程的线程标识与标准线程标识不同。可以理解的是,若当前获取到的渲染线程的RTID与预设表格中的RTID相同,则表示当前获取到的渲染线程是标准渲染线程,由于标准渲染线程有相应的加速方案,无需再执行加速吹了。这样,可以避免对标准渲染线程执行重复的加速处理。In a possible implementation, the method further includes: the electronic device compares the thread identifier of the rendering thread with a standard thread identifier; the thread identifier of the rendering thread is different from the standard thread identifier. It can be understood that if the RTID of the currently obtained rendering thread is the same as the RTID in the preset table, it means that the currently obtained rendering thread is a standard rendering thread. Since the standard rendering thread has a corresponding acceleration solution, there is no need to perform acceleration. Blow. This avoids repeated acceleration processing of the standard rendering thread.
在一种可能的实现方式中,渲染线程的线程标识是第一应用自定义的线程标识。In a possible implementation, the thread ID of the rendering thread is a thread ID customized by the first application.
在一种可能的实现方式中,渲染线程包括:弹幕渲染线程、导航渲染线程、游戏渲染线程、小程序渲染线程中的至少一种。这样,可以避免导航、弹幕、游戏、小程序等绘帧场景下的丢帧问题,从而提升用户体验。In a possible implementation, the rendering thread includes: at least one of a barrage rendering thread, a navigation rendering thread, a game rendering thread, and a mini program rendering thread. In this way, frame dropping problems in frame-drawing scenarios such as navigation, barrage, games, and mini programs can be avoided, thereby improving the user experience.
在一种可能的实现方式中,渲染线程为弹幕渲染线程的情况下,渲染后的图层为弹幕图层;渲染线程为导航渲染线程的情况下,渲染后的图层为导航图层;渲染线程为游戏渲染线程的情况下,渲染后的图层为游戏图层;渲染线程为小程序渲染线程的情况下,渲染后的图层为小程序图层。这样,可以避免导航、弹幕、游戏、小程序等绘帧场景下的丢帧问题,从而提升用户体验。In one possible implementation, when the rendering thread is the barrage rendering thread, the rendered layer is the barrage layer; when the rendering thread is the navigation rendering thread, the rendered layer is the navigation layer. ; When the rendering thread is a game rendering thread, the rendered layer is the game layer; when the rendering thread is a mini program rendering thread, the rendered layer is the mini program layer. In this way, frame dropping problems in frame-drawing scenarios such as navigation, barrage, games, and mini programs can be avoided, thereby improving the user experience.
在一种可能的实现方式中,渲染线程用于对目标信息执行渲染处理包括:渲染线程用于执行图层绘制和图层渲染得到渲染后的图层。即渲染线程可以执行图层绘制和图层渲染。In a possible implementation manner, the rendering thread is used to perform rendering processing on the target information, including: the rendering thread is used to perform layer drawing and layer rendering to obtain a rendered layer. That is, the rendering thread can perform layer drawing and layer rendering.
在一种可能的实现方式中,电子设备包括渲染线程识别模块、消息处理模块、主线程识别模块和关键线程加速模块;电子设备获取渲染线程的线程标识包括:渲染线程识别模块预先在渲染线程对应的入队列函数的插入点中插入插桩函数;当执行到入队列函数的插入点时,渲染线程识别模块获取插桩信息,插桩信息包括渲染线程的线程标识;电子设备根据渲染线程的线程标识确定与渲染线程具有唤醒关系的主线程包括:渲染线程识别模块向消息处理模块发送渲染线程的线程标识;消息处理模块向主线程识别模块发送渲染线程的线程标识;主线程识别模块根据渲染线程的线程标识确定与渲染线程具有唤醒关系的主线程;电子设备根据渲染线程的线程标识和主线程的线程标识,对渲染线程和主线程进行加速处理包括:主线程识别模块向关键线程加速模块发送关键线程组信息,关键线程组信息包括渲染线程的线程标识和主线程的线程标识;关键线程加速模块对关键线程组进行加速处理,关键线程组包括渲染线程和主线程。这样,电子设备可以优先调度渲染线程和主线程执行相应的任务,可以避免渲染线程和主线程处理速度慢导致丢帧和卡顿,从而可以提升用户体验。In a possible implementation, the electronic device includes a rendering thread identification module, a message processing module, a main thread identification module and a key thread acceleration module; the electronic device obtains the thread identifier of the rendering thread including: the rendering thread identification module pre-registers the rendering thread corresponding to The instrumentation function is inserted into the insertion point of the queue function; when the insertion point of the queue function is executed, the rendering thread identification module obtains the instrumentation information, and the instrumentation information includes the thread identification of the rendering thread; the electronic device determines the thread ID of the rendering thread according to the thread ID of the rendering thread. The identification of the main thread that has a wake-up relationship with the rendering thread includes: the rendering thread identification module sends the thread identification of the rendering thread to the message processing module; the message processing module sends the thread identification of the rendering thread to the main thread identification module; the main thread identification module determines the thread identification of the rendering thread according to the rendering thread The thread identification determines the main thread that has a wake-up relationship with the rendering thread; the electronic device accelerates the rendering thread and the main thread according to the thread identification of the rendering thread and the thread identification of the main thread, including: the main thread identification module sends a message to the key thread acceleration module Key thread group information, the key thread group information includes the thread ID of the rendering thread and the thread ID of the main thread; the key thread acceleration module accelerates the key thread group, and the key thread group includes the rendering thread and the main thread. In this way, the electronic device can prioritize the rendering thread and the main thread to perform corresponding tasks, which can avoid frame drops and freezes caused by slow processing speeds of the rendering thread and the main thread, thus improving the user experience.
在一种可能的实现方式中,电子设备还包括图层处理模块和图像合成系统,电子设备获取渲染线程的线程标识之前,方法还包括:响应于用户的操作,主线程向图层处理模块发送创建图层请求;图层处理模块向图像合成系统发送获取缓冲区队列的请求;图像合成系统向图层处理模块返回图层对应的缓冲区队列;图层处理模块向主线程返回图层的属性信息。In a possible implementation, the electronic device also includes a layer processing module and an image synthesis system. Before the electronic device obtains the thread identifier of the rendering thread, the method further includes: in response to the user's operation, the main thread sends a message to the layer processing module. Create a layer request; the layer processing module sends a request to obtain the buffer queue to the image composition system; the image composition system returns the buffer queue corresponding to the layer to the layer processing module; the layer processing module returns the properties of the layer to the main thread information.
在一种可能的实现方式中,方法还包括:主线程向图像合成系统请求垂直同步信号;图像合成系统向主线程返回垂直同步信号;主线程唤醒渲染线程;渲染线程绘制渲染图像。In a possible implementation, the method also includes: the main thread requests a vertical synchronization signal from the image synthesis system; the image synthesis system returns the vertical synchronization signal to the main thread; the main thread wakes up the rendering thread; and the rendering thread draws the rendering image.
在一种可能的实现方式中,方法还包括:渲染线程向图像合成系统发送请求缓存命令;图像合成系统向渲染线程发送用于指示缓存出队的指令;渲染线程将绘制渲染好后的图像存入缓冲区队列。In a possible implementation, the method also includes: the rendering thread sends a cache request command to the image synthesis system; the image synthesis system sends an instruction to the rendering thread to instruct the cache to dequeue; the rendering thread draws the rendered image into the cache into the buffer queue.
第二方面,本申请提供一种芯片系统,该芯片系统包括一个或多个接口电路和一个或多个处理器。该接口电路和处理器通过线路互联。上述芯片系统可以应用于包括通信模块和存储器的电子设备。该接口电路用于从电子设备的存储器接收信号,并向处理器发送接收到的信号,该信号包括存储器中存储的计算机指令。当处理器执行该计算机指令时,电子设备可以执行如第一方面及其任一种可能的设计方式所述的方法。In a second aspect, the present application provides a chip system, which includes one or more interface circuits and one or more processors. The interface circuit and the processor are interconnected through lines. The above chip system can be applied to electronic devices including communication modules and memories. The interface circuit is configured to receive signals from the memory of the electronic device and send the received signals to the processor, the signals including computer instructions stored in the memory. When the processor executes the computer instructions, the electronic device can perform the method described in the first aspect and any possible design manner thereof.
第三方面,本申请提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令。当计算机指令在电子设备(如手机)上运行时,使得该电子设备执行如第一方面及其任一种可能的设计方式所述的方法。In a third aspect, the present application provides a computer-readable storage medium that includes computer instructions. When the computer instructions are run on an electronic device (such as a mobile phone), the electronic device is caused to execute the method described in the first aspect and any possible design manner thereof.
第四方面,本申请提供一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面及其任一种可能的设计方式所述的方法。In a fourth aspect, the present application provides a computer program product, which when the computer program product is run on a computer, causes the computer to execute the method described in the first aspect and any possible design manner thereof.
第五方面,本申请实施例提供了一种线程加速处理装置,包括处理器,处理器和存储器耦合,存储器存储有程序指令,当存储器存储的程序指令被处理器执行时使得所述装置实现上述第一方面及其任一种可能的设计方式所述的方法。所述装置可以为电子设备或服务器设备;或可以为电子设备或服务器设备中的一个组成部分,如芯片。In the fifth aspect, embodiments of the present application provide a thread acceleration processing device, which includes a processor. The processor is coupled to a memory. The memory stores program instructions. When the program instructions stored in the memory are executed by the processor, the device achieves the above. The method described in the first aspect and any possible design method thereof. The device may be an electronic device or a server device; or may be a component of the electronic device or the server device, such as a chip.
第六方面,本申请实施例提供了一种线程加速处理装置,所述装置可以按照功能划分为不同的逻辑单元或模块,各单元或模块执行不同的功能,以使得所述装置执行上述第一方面及其任一种可能的设计方式所述的方法。In the sixth aspect, embodiments of the present application provide a thread acceleration processing device. The device can be divided into different logical units or modules according to functions, and each unit or module performs different functions, so that the device performs the above-mentioned first step. Aspects and methods described in any possible design method.
可以理解地,上述提供的第二方面所述的芯片系统,第三方面所述的计算机可读存储介质,第四方面所述的计算机程序产品及第五方面、第六方面所述的装置所能达到的有益效果,可参考如第一方面及其任一种可能的设计方式中的有益效果,此处不再赘述。It can be understood that the chip system described in the second aspect, the computer-readable storage medium described in the third aspect, the computer program product described in the fourth aspect, and the devices described in the fifth and sixth aspects provided above are The beneficial effects that can be achieved can be referred to the beneficial effects in the first aspect and any possible design method thereof, which will not be described again here.
基于本申请实施例提供的方法,电子设备接收到用于触发电子设备显示目标信息的第一操作后,可以获取渲染线程的线程标识,并可以根据渲染线程的线程标识确定与渲染线程具有唤醒关系的主线程,进而对渲染线程和主线程进行加速处理,可以避免渲染线程和主线程处理速度慢导致丢帧和卡顿,从而可以提升用户体验。Based on the method provided by the embodiments of the present application, after the electronic device receives the first operation for triggering the electronic device to display target information, it can obtain the thread identifier of the rendering thread, and can determine that it has a wake-up relationship with the rendering thread based on the thread identifier of the rendering thread. The main thread is used to accelerate the rendering thread and the main thread, which can avoid frame drops and freezes caused by slow processing speeds of the rendering thread and the main thread, thereby improving the user experience.
附图说明Description of the drawings
图1为现有技术的一种界面显示处理流程的示意图;Figure 1 is a schematic diagram of an interface display processing flow in the prior art;
图2为现有技术的一种界面显示示意图;Figure 2 is a schematic diagram of an interface display in the prior art;
图3为现有技术的一种界面显示处理流程的示意图;Figure 3 is a schematic diagram of an interface display processing flow in the prior art;
图4为现有技术的一种界面显示示意图;Figure 4 is a schematic diagram of an interface display in the prior art;
图5为本申请实施例提供的一种电子设备的硬件结构示意图;Figure 5 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application;
图6为本申请实施例提供的一种电子设备的软件架构示意图;Figure 6 is a schematic diagram of the software architecture of an electronic device provided by an embodiment of the present application;
图7为本申请实施例提供的一种适用场景示意图;Figure 7 is a schematic diagram of an applicable scenario provided by the embodiment of the present application;
图8为本申请实施例提供的一种模块间的交互示意图;Figure 8 is a schematic diagram of interaction between modules provided by an embodiment of the present application;
图9为本申请实施例提供的一种图层的示意图;Figure 9 is a schematic diagram of a layer provided by an embodiment of the present application;
图10为本申请实施例提供的一种渲染线程、入队列函数和插桩函数的关系示意图;Figure 10 is a schematic diagram of the relationship between a rendering thread, a queue function and an instrumentation function provided by an embodiment of the present application;
图11为本申请实施例提供的一种线程间的唤醒关系示意图;Figure 11 is a schematic diagram of a wake-up relationship between threads provided by an embodiment of the present application;
图12为本申请实施例提供的又一种线程间的唤醒关系示意图;Figure 12 is a schematic diagram of another wake-up relationship between threads provided by an embodiment of the present application;
图13为本申请实施例提供的一种加速处理的示意图;Figure 13 is a schematic diagram of an acceleration process provided by an embodiment of the present application;
图14为本申请实施例提供的又一种加速处理的示意图;Figure 14 is a schematic diagram of another acceleration process provided by the embodiment of the present application;
图15为本申请实施例提供的一种界面显示处理流程的示意图;Figure 15 is a schematic diagram of an interface display processing flow provided by an embodiment of the present application;
图16为本申请实施例提供的一种界面显示示意图;Figure 16 is a schematic diagram of an interface display provided by an embodiment of the present application;
图17为本申请实施例提供的一种芯片系统的结构示意图。Figure 17 is a schematic structural diagram of a chip system provided by an embodiment of the present application.
具体实施方式Detailed ways
为了下述各实施例的描述清楚简洁,首先给出相关概念或技术的简要介绍:In order to describe the following embodiments clearly and concisely, a brief introduction to related concepts or technologies is first given:
帧:是指界面显示中最小单位的单幅画面。一帧可以理解为一副静止的画面,快速连续地显示多个相连的帧可以形成物体运动的假象。帧率是指在1秒钟时间里刷新图片的帧数,也可以理解为终端设备中图形处理器每秒钟刷新画面的次数。高的帧率可以得到更流畅和更逼真的动画。每秒钟帧数越多,所显示的动作就会越流畅。Frame: refers to the smallest unit of a single picture in the interface display. A frame can be understood as a still picture, and displaying multiple connected frames in rapid succession can create the illusion of object movement. The frame rate refers to the number of frames that refresh the picture in one second. It can also be understood as the number of times the graphics processor in the terminal device refreshes the picture per second. A high frame rate results in smoother and more realistic animations. The more frames per second, the smoother the action shown will be.
需要说明的是,界面显示帧前通常需要经过绘制、渲染、合成等过程。It should be noted that the interface usually needs to go through processes such as drawing, rendering, and synthesis before displaying frames.
帧绘制:是指显示界面的图片绘制。显示界面可以由一个或多个视图组成,各个视图可以由视图系统的可视控件绘制,各个视图由子视图组成,一个子视图对应视图中的一个小部件,例如,其中的一个子视图对应图片视图中的一个符号。Frame drawing: refers to the picture drawing of the display interface. The display interface can be composed of one or more views. Each view can be drawn by the visual control of the view system. Each view is composed of subviews. One subview corresponds to a widget in the view. For example, one of the subviews corresponds to the picture view. a symbol in .
帧渲染:是将绘制后的视图进行着色操作或增加3D效果等。例如:3D效果可以是灯光效果、阴影效果和纹理效果等。Frame rendering: It is to perform coloring operations on the drawn view or add 3D effects, etc. For example: 3D effects can be lighting effects, shadow effects, texture effects, etc.
帧合成:是将多个上述一个或多个渲染后的视图合成为显示界面的过程。Frame synthesis: It is the process of synthesizing multiple rendered views of one or more of the above into a display interface.
线程(thread):线程是操作系统能够进行运算调度的最小单位。它被包含在进程之中,是进程中的实际运作单位。一条线程指的是进程中一个单一顺序的控制流,一个进程中可以并发多个线程,并且每条线程并行执行不同的任务。线程是独立调度和分派的基本单位。线程可以为操作系统内核调度的内核线程;也可以为由用户进程自行调度的用户线程;或者由内核与用户进程进行混合调度的线程。Thread: A thread is the smallest unit that the operating system can perform operation scheduling. It is included in the process and is the actual operating unit in the process. A thread refers to a single sequential control flow in a process. Multiple threads can run concurrently in a process, and each thread performs different tasks in parallel. Threads are the basic unit of independent scheduling and dispatch. The thread can be a kernel thread scheduled by the operating system kernel; it can also be a user thread scheduled by the user process; or a thread scheduled by a mixture of kernel and user processes.
渲染线程:用于执行帧绘制和/或帧渲染的线程。Rendering thread: A thread used to perform frame drawing and/or frame rendering.
主线程:用于创建或唤醒渲染线程的线程。Main thread: The thread used to create or wake up the rendering thread.
目前,电子设备上运行的应用程序可以自定义关键线程,关键线程可以包括主线程和渲染线程。当这些关键线程的资源调配不足时,会导致应用程序丢帧从而发生卡顿,用户体验差。因此,如何识别这些关键线程并及时调度资源,避免应用程序发生卡顿成为一个亟待解决的问题。Currently, applications running on electronic devices can customize key threads, and key threads can include the main thread and the rendering thread. When the resource allocation of these key threads is insufficient, it will cause the application to lose frames and cause lag, resulting in poor user experience. Therefore, how to identify these key threads and schedule resources in time to avoid application lag has become an urgent problem to be solved.
示例性的,图1为一种电子设备的弹幕显示处理流程的示意图。按照时间顺序,电子设备显示的内容依次对应于帧1、帧2、帧3。电子设备可以基于垂直同步(Vsync)信号进行显示,以对图像的绘制、渲染、合成和屏幕刷新显示等流程进行同步。For example, FIG. 1 is a schematic diagram of a barrage display processing flow of an electronic device. In chronological order, the content displayed by the electronic device corresponds to frame 1, frame 2, and frame 3. Electronic devices can display based on vertical synchronization (Vsync) signals to synchronize processes such as image drawing, rendering, synthesis, and screen refresh display.
以帧1的显示为例,首先,视频应用的弹幕图层对应的主线程可以对帧1进行绘制,视频应用的弹幕图层对应的渲染线程(例如,线程205)可以对帧1进行渲染。帧1绘制渲染完成后,电子设备的渲染线程将绘制渲染好的帧1发送至图像合成系统(例如,SurfaceFlinger,SF)。图像合成系统对绘制渲染好的帧1进行合成。帧1完成合成后,电子设备可以通过调用内核层启动显示驱动,在屏幕(显示屏)显示帧1对应的内容。帧3类似于帧1的过程也进行合成和显示,此处不再赘述。需要说明的是,渲染线程(线程205)在渲染帧1和帧3时,很长时间内处于运行(Running)状态,因此可以顺利渲染帧1和帧3(可以分别在一个Vsync周期内完成帧1或帧3的渲染),并发送至图像合成系统。但是,当渲染线程(线程205)渲染帧2时,由于渲染线程(线程205)很长时间内处于等待执行(Runnable)状态,无法在一个Vsync周期内完成帧2的渲染,需要在多个Vsync周期内完成渲染,导致帧2无法及时合成和显示,继而导致弹幕发生卡顿。Taking the display of frame 1 as an example, first, the main thread corresponding to the barrage layer of the video application can draw frame 1, and the rendering thread (for example, thread 205) corresponding to the barrage layer of the video application can draw frame 1. render. After the drawing and rendering of frame 1 is completed, the rendering thread of the electronic device sends the rendered frame 1 to the image synthesis system (for example, SurfaceFlinger, SF). The image synthesis system synthesizes the rendered frame 1. After frame 1 is synthesized, the electronic device can start the display driver by calling the kernel layer to display the content corresponding to frame 1 on the screen (display). Frame 3 is also synthesized and displayed in a process similar to that of frame 1, which will not be described again here. It should be noted that the rendering thread (thread 205) is in the running state for a long time when rendering frame 1 and frame 3, so frame 1 and frame 3 can be rendered smoothly (the frames can be completed within one Vsync cycle respectively). 1 or frame 3) and sent to the image composition system. However, when the rendering thread (thread 205) renders frame 2, because the rendering thread (thread 205) is in the waiting execution (Runnable) state for a long time, the rendering of frame 2 cannot be completed in one Vsync cycle, and it needs to be executed in multiple Vsync cycles. The rendering was completed within the cycle, resulting in frame 2 being unable to be synthesized and displayed in time, which in turn caused the barrage to freeze.
例如,如图2所示,电子设备可以为手机,手机可以运行视频应用程序。如图2中的(a)所示,手机可以显示视频界面1001,视频界面1001可以包括弹幕1002、弹幕1004、视频人物1003以及其他视频内容(例如,悬崖)。弹幕(弹幕1002、弹幕1004)可以随着视频的播放进度滚动显示。For example, as shown in Figure 2, the electronic device can be a mobile phone, and the mobile phone can run a video application. As shown in (a) of Figure 2, the mobile phone can display a video interface 1001, and the video interface 1001 can include barrage 1002, barrage 1004, video characters 1003, and other video content (for example, cliff). Danmaku (danmaku 1002, barrage 1004) can be scrolled and displayed along with the video playback progress.
在视频播放过程中,若弹幕图层的关键线程(例如,渲染线程)的资源调配不足,弹幕会发生卡顿。如图2中的(b)所示,随着视频播放进度的变化,手机可以从视频界面1001切换到视频界面1005,视频内容发生变化,例如视频人物1003的显示位置生变化。然而弹幕1002和弹幕1004还显示在原来的位置,即弹幕显示出现卡顿,影响用户体验。During video playback, if the resource allocation of the key threads of the barrage layer (for example, the rendering thread) is insufficient, the barrage will freeze. As shown in (b) of Figure 2, as the video playback progress changes, the mobile phone can switch from the video interface 1001 to the video interface 1005, and the video content changes, for example, the display position of the video character 1003 changes. However, barrage 1002 and barrage 1004 are still displayed in their original positions, that is, the barrage display is stuck, which affects the user experience.
又例如,图3为一种电子设备的地图应用的显示处理流程的示意图。按照时间顺序,电子设备显示的内容依次对应于帧1、帧2、帧3。电子设备可以基于Vsync信号进行显示,以对图像的绘制、渲染、合成和屏幕刷新显示等流程进行同步。As another example, FIG. 3 is a schematic diagram of a display processing flow of a map application of an electronic device. In chronological order, the content displayed by the electronic device corresponds to frame 1, frame 2, and frame 3. Electronic devices can display based on Vsync signals to synchronize processes such as image drawing, rendering, synthesis, and screen refresh display.
地图应用的导航图层对应的主线程和渲染线程(例如,线程GL MAP)对帧1和帧2的绘制、渲染和合成过程可以参考图1的相关描述。需要说明的是,导航图层对应的渲染线程(例如,线程GL MAP)渲染帧1和帧2时,渲染线程(线程GL MAP)很长时间内处于运行(Running)状态,因此可以顺利渲染帧1和帧2并发送至图像合成系统。但是,当渲染线程(线程205)渲染帧3时,由于渲染线程(线程GL MAP)很长时间内处于等待执行(Runnable)状态,即渲染线程(线程GL MAP)的资源调配不足,导致渲染线程(线程GL MAP)无法及时完成帧3渲染(无法在一个Vsync周期内完成帧3的渲染,需要在多个Vsync周期内完成渲染),导致帧3无法及时合成和显示,继而导致地图应用的显示界面发生卡顿。For the main thread and rendering thread (for example, thread GL MAP) corresponding to the navigation layer of the map application, the drawing, rendering and synthesis process of frame 1 and frame 2 can refer to the relevant description in Figure 1. It should be noted that when the rendering thread (for example, thread GL MAP) corresponding to the navigation layer renders frame 1 and frame 2, the rendering thread (thread GL MAP) is in the running state for a long time, so the frame can be rendered smoothly. 1 and frame 2 and sent to the image synthesis system. However, when the rendering thread (thread 205) renders frame 3, because the rendering thread (thread GL MAP) is in the waiting execution (Runnable) state for a long time, that is, the rendering thread (thread GL MAP) has insufficient resource allocation, resulting in the rendering thread (Thread GL MAP) cannot complete the rendering of frame 3 in time (the rendering of frame 3 cannot be completed in one Vsync cycle and needs to be completed in multiple Vsync cycles), resulting in the failure of frame 3 to be synthesized and displayed in time, which in turn causes the display of the map application The interface is stuck.
例如,如图4所示,电子设备可以为手机,手机可以运行地图应用。如图4中的(a)所示,手机可以显示路线选择界面4001,路线选择界面4001可以包括开始步行导航控件4002。响应于用户点击开始步行导航控件4002的操作,若步行导航图层对应的关键线程(例如,渲染线程)的资源调配不足,如图4中的(b)所示,地图应用发生卡顿,显示卡顿界面4003,无法及时显示步行导航界面,影响用户体验。For example, as shown in Figure 4, the electronic device can be a mobile phone, and the mobile phone can run a map application. As shown in (a) of FIG. 4 , the mobile phone may display a route selection interface 4001 , and the route selection interface 4001 may include a start walking navigation control 4002 . In response to the user clicking to start the operation of the walking navigation control 4002, if the resource allocation of the key thread (for example, the rendering thread) corresponding to the walking navigation layer is insufficient, as shown in (b) of Figure 4, the map application will freeze and display Interface lag 4003, the walking navigation interface cannot be displayed in time, affecting the user experience.
相关技术中,标准的主线程(UIThread)和渲染线程(RenderThread)有固定的线程名称,可以通过线程名称识别并进行加速处理。例如,的主线程名称为cent.tmgp.sgame,/>的主线程名称为tv.danmaku.bili。主线程可以在创建应用进程时进行加速处理。渲染线程的名称例如可以为RenderThread。可以遍历应用程序的进程下的全部线程,通过线程名称识别渲染线程并进行加速处理。In related technologies, the standard main thread (UIThread) and rendering thread (RenderThread) have fixed thread names, which can be identified and accelerated by the thread name. For example, The main thread name is cent.tmgp.sgame,/> The main thread name is tv.danmaku.bili. The main thread can be used to speed up processing when creating application processes. The name of the rendering thread may be, for example, RenderThread. You can traverse all threads under the application process, identify the rendering thread by thread name and accelerate processing.
然而,应用程序自定义的主线程、渲染线程等,由于线程名字不固定无法识别和进行加速处理。例如,上述视频应用和地图应用自定义的渲染线程Thread-205和GL-Map,由于线程名字不固定无法识别和加速。However, application-customized main threads, rendering threads, etc. cannot be recognized and accelerated because the thread names are not fixed. For example, the custom rendering threads Thread-205 and GL-Map of the video application and map application mentioned above cannot be recognized and accelerated because the thread names are not fixed.
本申请实施例提供一种线程加速处理方法和装置,针对应用程序的实际运行状态,可以精准识别应用程序自定义的用于绘帧的关键线程,关键线程可以包括主线程和渲染线程。并且,可以对识别出的关键线程按需进行资源调配加速,减少丢帧,避免应用程序发生卡顿,可以提高用户体验。Embodiments of the present application provide a thread acceleration processing method and device, which can accurately identify key threads customized by the application program for drawing frames based on the actual running status of the application program. The key threads may include the main thread and the rendering thread. In addition, resource allocation and acceleration can be performed on the identified key threads on demand, reducing frame loss, avoiding application lags, and improving user experience.
本申请实施例可以应用于滑动、导航、弹幕、游戏、小程序(例如,WebView小程序)等绘帧场景,可以避免滑动、导航、弹幕、游戏、WebView小程序等绘帧场景下的丢帧问题,从而提升用户体验。Embodiments of the present application can be applied to frame-drawing scenarios such as sliding, navigation, barrage, games, and applets (for example, WebView applets), and can avoid errors in frame-drawing scenarios such as sliding, navigation, barrage, games, and WebView applets. Frame loss problem to improve user experience.
图5为本申请实施例提供的一种电子设备100的结构示意图。FIG. 5 is a schematic structural diagram of an electronic device 100 provided by an embodiment of the present application.
如图5所示,电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriber identification module,SIM)卡接口195等。As shown in FIG. 5 , the electronic device 100 may include a processor 110 , an external memory interface 120 , an internal memory 121 , a universal serial bus (USB) interface 130 , a charging management module 140 , a power management module 141 , and a battery 142 , Antenna 1, Antenna 2, mobile communication module 150, wireless communication module 160, audio module 170, speaker 170A, receiver 170B, microphone 170C, headphone interface 170D, sensor module 180, button 190, motor 191, indicator 192, camera 193 , display screen 194, and subscriber identification module (subscriber identification module, SIM) card interface 195, etc.
其中,传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Among them, the sensor module 180 may include a pressure sensor 180A, a gyro sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, and an environment. Light sensor 180L, bone conduction sensor 180M, etc.
可以理解的是,本实施例示意的结构并不构成对电子设备100的具体限定。在另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device 100 . In other embodiments, the electronic device 100 may include more or fewer components than illustrated, some components may be combined, some components may be separated, or components may be arranged differently. The components illustrated may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (application processor, AP), a modem processor, a graphics processing unit (GPU), an image signal processor ( image signal processor (ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, and/or neural-network processing unit (NPU), etc. . Among them, different processing units can be independent devices or integrated in one or more processors.
控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100 . The controller can generate operation control signals based on the instruction operation code and timing signals to complete the control of fetching and executing instructions.
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in processor 110 is cache memory. This memory may hold instructions or data that have been recently used or recycled by processor 110 . If the processor 110 needs to use the instructions or data again, it can be called directly from the memory. Repeated access is avoided and the waiting time of the processor 110 is reduced, thus improving the efficiency of the system.
在一些实施例中,处理器110可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, processor 110 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I2C) interface, an integrated circuit built-in audio (inter-integrated circuitsound, I2S) interface, a pulse code modulation (PCM) interface, and a universal asynchronous receiver (universal asynchronous receiver) /transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (subscriber identity module, SIM) interface, and/or Universal serial bus (USB) interface, etc.
可以理解的是,本实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationships between the modules illustrated in this embodiment are only schematic illustrations and do not constitute a structural limitation of the electronic device 100 . In other embodiments, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.
充电管理模块140用于从充电器接收充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备供电。The charging management module 140 is used to receive charging input from the charger. While the charging management module 140 charges the battery 142, it can also provide power to the electronic device through the power management module 141.
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, internal memory 121, external memory, display screen 194, camera 193, wireless communication module 160, etc. In some other embodiments, the power management module 141 may also be provided in the processor 110 . In other embodiments, the power management module 141 and the charging management module 140 may also be provided in the same device.
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。例如:可以将天线1复用为无线局域网的分集天线。Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 may be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example: Antenna 1 can be reused as a diversity antenna for a wireless LAN.
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(low noise amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。The mobile communication module 150 can provide solutions for wireless communication including 2G/3G/4G/5G applied on the electronic device 100 . The mobile communication module 150 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves through the antenna 1, perform filtering, amplification and other processing on the received electromagnetic waves, and transmit them to the modem processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modem processor and convert it into electromagnetic waves through the antenna 1 for radiation.
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。A modem processor may include a modulator and a demodulator. Among them, the modulator is used to modulate the low-frequency baseband signal to be sent into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After the low-frequency baseband signal is processed by the baseband processor, it is passed to the application processor. The application processor outputs sound signals through audio devices (not limited to speaker 170A, receiver 170B, etc.), or displays images or videos through display screen 194.
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The wireless communication module 160 can provide applications on the electronic device 100 including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) network), Bluetooth (bluetooth, BT), and global navigation satellite system. (global navigation satellite system, GNSS), frequency modulation (FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions. The wireless communication module 160 may be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2 , frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110 . The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves through the antenna 2 for radiation.
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。所述无线通信技术可以包括全球移动通讯系统(global system for mobile communications,GSM),通用分组无线服务(general packet radio service,GPRS),码分多址接入(codedivision multiple access,CDMA),宽带码分多址(wideband code division multipleaccess,WCDMA),时分码分多址(time-division code division multiple access,TD-SCDMA),长期演进(long term evolution,LTE),BT,GNSS,WLAN,NFC,FM,和/或IR技术等。所述GNSS可以包括全球卫星定位系统(global positioning system,GPS),全球导航卫星系统(global navigation satellite system,GLONASS),北斗卫星导航系统(beidounavigation satellite system,BDS),准天顶卫星系统(quasi-zenith satellitesystem,QZSS)和/或星基增强系统(satellite based augmentation systems,SBAS)。In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (codedivision multiple access, CDMA), broadband code Wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM , and/or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou satellite navigation system (beidounavigation satellite system, BDS), quasi-zenith satellite system (quasi- zenith satellitesystem (QZSS) and/or satellite based augmentation systems (SBAS).
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements display functions through a GPU, a display screen 194, an application processor, and the like. The GPU is an image processing microprocessor and is connected to the display screen 194 and the application processor. GPUs are used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or alter display information.
显示屏194用于显示图像,视频等。该显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),发光二极管(light-emitting diode,LED),有机发光二极管(organic light-emitting diode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrix organic light emitting diode,AMOLED),柔性发光二极管(flex light-emitting diode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot light emitting diodes,QLED)等。The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can use a liquid crystal display (LCD), a light-emitting diode (LED), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active matrix Organic light-emitting diode (active-matrix organic light emitting diode, AMOLED), flexible light-emitting diode (flex light-emitting diode, FLED), Miniled, MicroLed, Micro-oLed, quantum dot light emitting diode (QLED) )wait.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。ISP用于处理摄像头193反馈的数据。摄像头193用于捕获静态图像或视频。数字信号处理器用于处理数字信号,除了可以处理数字图像信号,还可以处理其他数字信号。视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(moving picture experts group,MPEG)1,MPEG2,MPEG3,MPEG4等。The electronic device 100 can implement the shooting function through an ISP, a camera 193, a video codec, a GPU, a display screen 194, an application processor, and the like. The ISP is used to process the data fed back by the camera 193. Camera 193 is used to capture still images or video. Digital signal processors are used to process digital signals. In addition to digital image signals, they can also process other digital signals. Video codecs are used to compress or decompress digital video. Electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in multiple encoding formats, such as moving picture experts group (moving picture experts group, MPEG) 1, MPEG2, MPEG3, MPEG4, etc.
摄像头193可以包括1~N个。例如电子设备可以包括2个前置摄像头和4个后置摄像头。NPU为神经网络(neural-network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。The cameras 193 may include 1 to N cameras. For example, the electronic device may include 2 front cameras and 4 rear cameras. NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and can continuously learn by itself. Intelligent cognitive applications of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, etc.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。例如,在本申请实施例中,处理器110可以通过执行存储在内部存储器121中的指令,内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100 . The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. Such as saving music, videos, etc. files in external memory card. Internal memory 121 may be used to store computer executable program code, which includes instructions. The processor 110 executes instructions stored in the internal memory 121 to execute various functional applications and data processing of the electronic device 100 . For example, in the embodiment of the present application, the processor 110 can execute instructions stored in the internal memory 121, and the internal memory 121 can include a program storage area and a data storage area. Among them, the stored program area can store an operating system, at least one application program required for a function (such as a sound playback function, an image playback function, etc.). The storage data area may store data created during use of the electronic device 100 (such as audio data, phone book, etc.). In addition, the internal memory 121 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, universal flash storage (UFS), etc.
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 can implement audio functions through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D, and the application processor. Such as music playback, recording, etc.
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。音频模块170还可以用于对音频信号编码和解码。扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。耳机接口170D用于连接有线耳机。The audio module 170 is used to convert digital audio information into analog audio signal output, and is also used to convert analog audio input into digital audio signals. Audio module 170 may also be used to encode and decode audio signals. Speaker 170A, also called "speaker", is used to convert audio electrical signals into sound signals. Receiver 170B, also called "earpiece", is used to convert audio electrical signals into sound signals. Microphone 170C, also called "microphone" or "microphone", is used to convert sound signals into electrical signals. The headphone interface 170D is used to connect wired headphones.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。SIM卡接口195可以支持Nano SIM卡,Micro SIM卡,SIM卡等。The buttons 190 include a power button, a volume button, etc. Key 190 may be a mechanical key. It can also be a touch button. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 . The motor 191 can generate vibration prompts. The motor 191 can be used for vibration prompts for incoming calls and can also be used for touch vibration feedback. The indicator 192 may be an indicator light, which may be used to indicate charging status, power changes, or may be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect a SIM card. The SIM card can be connected to or separated from the electronic device 100 by inserting it into the SIM card interface 195 or pulling it out from the SIM card interface 195 . The electronic device 100 can support 1 or N SIM card interfaces, where N is a positive integer greater than 1. SIM card interface 195 can support Nano SIM card, Micro SIM card, SIM card, etc.
以下实施例中的方法均可以在具有上述硬件结构的电子设备100中实现。The methods in the following embodiments can all be implemented in the electronic device 100 with the above hardware structure.
上述电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明电子设备100的软件结构。The software system of the above-mentioned electronic device 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture. This embodiment of the present invention takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device 100 .
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过接口通信。在一些实施例中,Android系统可以包括应用程序层,应用程序框架层,内核层和硬件层。需要说明的是,本申请实施例以Android系统举例来说明,在其他操作系统中(例如鸿蒙系统,IOS系统等),只要各个功能模块实现的功能和本申请的实施例类似也能实现本申请的方案。The layered architecture divides the software into several layers, and each layer has clear roles and division of labor. The layers communicate through interfaces. In some embodiments, the Android system may include an application layer, an application framework layer, a kernel layer and a hardware layer. It should be noted that the embodiments of the present application are illustrated by taking the Android system as an example. In other operating systems (such as Hongmeng system, IOS system, etc.), as long as the functions implemented by each functional module are similar to those of the embodiments of the present application, the present application can also be implemented. plan.
其中,应用程序层可以包括一系列应用程序包。Among them, the application layer can include a series of application packages.
如图6所示,应用程序包可以包括视频,游戏,地图,WLAN,音乐,短信息,图库,通话,导航等。当然,应用程序层还可以包括其他应用程序包,例如蓝牙,日历,相机,设置等应用程序,本申请不做限定。As shown in Figure 6, application packages can include videos, games, maps, WLAN, music, short messages, galleries, calls, navigation, etc. Of course, the application layer may also include other application packages, such as Bluetooth, calendar, camera, settings and other applications, which are not limited in this application.
应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。例如可以包括活动管理器、窗口管理器,内容提供器,视图系统,资源管理器,通知管理器等,本申请实施例对此不做任何限制。The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions. For example, it may include an activity manager, a window manager, a content provider, a view system, a resource manager, a notification manager, etc. This embodiment of the present application does not impose any restrictions on this.
本申请实施例中,应用程序框架层还可以包括图层处理模块、图像合成系统、渲染线程识别模块等。In the embodiment of this application, the application framework layer may also include a layer processing module, an image synthesis system, a rendering thread identification module, etc.
其中,图层处理模块可以执行图层创建、图层绘制等处理。Among them, the layer processing module can perform layer creation, layer drawing and other processing.
图像合成系统用于控制图像合成,以及产生垂直同步(veticalsynchronization,Vsync)信号。The image synthesis system is used to control image synthesis and generate vertical synchronization (veticalsynchronization, Vsync) signals.
渲染线程识别模块用于识别当前绘帧周期中的渲染线程,例如可以包括渲染线程1和渲染线程2。The rendering thread identification module is used to identify rendering threads in the current drawing frame cycle, which may include rendering thread 1 and rendering thread 2, for example.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动(图中未示出)。内核层还可以包括实时(real time,RT)调度器、贵宾(veryimportant person,VIP)调度器、完全公平调度(completely fair scheduler,CFS)调度器/能量感知(energy aware scheduler,EAS)调度器等。The kernel layer is the layer between hardware and software. The kernel layer contains at least a display driver, camera driver, audio driver, and sensor driver (not shown in the figure). The kernel layer can also include real time (RT) scheduler, VIP (very important person, VIP) scheduler, completely fair scheduler (CFS) scheduler/energy aware scheduler (EAS) scheduler, etc. .
本申请实施例中,内核层还可以包括消息处理模块、主线程识别模块、关键线程加速模块。In the embodiment of this application, the kernel layer may also include a message processing module, a main thread identification module, and a key thread acceleration module.
消息处理模块用于从渲染线程识别模块接收通知消息。其中,通知消息中可以包括渲染线程识别模块识别到的渲染线程的线程标识。消息处理模块可以将渲染线程的线程标识发送至主线程识别模块。The message processing module is used to receive notification messages from the rendering thread identification module. The notification message may include the thread identifier of the rendering thread identified by the rendering thread identification module. The message processing module may send the thread identification of the rendering thread to the main thread identification module.
主线程识别模块可以基于当前绘帧周期记录的重要事件信息,追溯当前绘帧周期中运行的线程与渲染线程的唤醒关系。再基于当前绘帧周期中运行的线程与渲染线程的唤醒关系,确定当前绘帧周期中的主线程。主线程识别模块可以向关键线程加速模块发送渲染线程的线程标识和主线程的线程标识。渲染线程的线程标识例如可以为RTID(renderthread identity),主线程的线程标识例如可以为UTID(user interface threadidentity)。The main thread identification module can trace the awakening relationship between the threads running in the current drawing frame cycle and the rendering thread based on the important event information recorded in the current drawing frame cycle. Then based on the wake-up relationship between the thread running in the current drawing frame cycle and the rendering thread, the main thread in the current drawing frame cycle is determined. The main thread identification module may send the thread identification of the rendering thread and the thread identification of the main thread to the key thread acceleration module. The thread identity of the rendering thread may be, for example, RTID (renderthread identity), and the thread identity of the main thread may be, for example, UTID (user interface threadidentity).
关键线程加速模块可以根据渲染线程的RTID和主线程的UTID对渲染线程和主线程进行资源调配,实现对渲染线程和主线程的加速处理。The key thread acceleration module can allocate resources to the rendering thread and the main thread based on the RTID of the rendering thread and the UTID of the main thread to achieve accelerated processing of the rendering thread and the main thread.
硬件层包括中央处理器(central processing unit/processor,CPU)、GPU、双倍速率同步动态随机存取存储器(double data rate SDRAM(synchronous dynamic random-access memory),DDR SDRAM)等。当然,硬件层还可以包括其他硬件,例如,显示器、摄像头等。The hardware layer includes central processing unit/processor (CPU), GPU, double data rate synchronous dynamic random access memory (double data rate SDRAM (synchronous dynamic random-access memory), DDR SDRAM), etc. Of course, the hardware layer can also include other hardware, such as displays, cameras, etc.
Android系统还可以包括其他层(图中未示出),例如安卓运行时(Androidruntime)和系统库,硬件抽象层(hardware abstraction layer,HAL)等,本申请不做限定。The Android system may also include other layers (not shown in the figure), such as Android runtime and system libraries, hardware abstraction layer (HAL), etc., which are not limited in this application.
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), 3D graphics processing library (for example: OpenGL ES), 2D graphics engine (for example: SGL), etc.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
OpenGL ES用于实现三维图形绘图,图像渲染,合成,和图层处理等。OpenGL ES is used to implement three-dimensional graphics drawing, image rendering, composition, and layer processing.
SGL是2D绘图的绘图引擎。SGL is a drawing engine for 2D drawing.
安卓运行时(Android Runtime)包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。Android Runtime includes core libraries and virtual machines. The Android runtime is responsible for the scheduling and management of the Android system. The core library contains two parts: one is the functional functions that need to be called by the Java language, and the other is the core library of Android. The application layer and application framework layer run in virtual machines. The virtual machine executes the java files of the application layer and application framework layer into binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection and other functions.
HAL层是对Linux内核驱动程序的封装,向上提供接口,屏蔽低层硬件的实现细节。The HAL layer encapsulates the Linux kernel driver, provides an interface upwards, and shields the implementation details of the low-level hardware.
下面对本申请实施例提供的线程加速处理方法所涉及的软件模块和模块间的交互进行说明。The following describes the software modules involved in the thread acceleration processing method provided by the embodiment of the present application and the interaction between the modules.
如图6所示,渲染线程识别模块可以识别当前绘帧周期中的渲染线程,例如可以包括渲染线程1和渲染线程2。渲染线程识别模块识别到当前绘帧周期中的渲染线程后,可以通过系统调用向内核层的消息处理模块发送通知消息,通知消息中可以包括渲染线程识别模块识别到的渲染线程的RTID。消息处理模块可以将渲染线程的RTID发送至主线程识别模块,主线程识别模块可以基于当前绘帧周期记录的重要事件信息,追溯当前绘帧周期中运行的线程与渲染线程的唤醒关系。再基于当前绘帧周期中运行的线程与渲染线程的唤醒关系,确定当前绘帧周期中的主线程。而后,主线程识别模块可以向关键线程加速模块发送渲染线程的RTID和主线程的UTID,关键线程加速模块可以根据渲染线程的RTID和主线程的UTID对渲染线程和主线程进行资源调配,实现对渲染线程和主线程的加速处理,从而避免应用程序丢帧导致应用卡顿的问题,可以提高用户体验。As shown in Figure 6, the rendering thread identification module can identify the rendering threads in the current drawing frame cycle, which may include rendering thread 1 and rendering thread 2, for example. After the rendering thread identification module identifies the rendering thread in the current drawing frame cycle, it can send a notification message to the message processing module of the kernel layer through a system call. The notification message can include the RTID of the rendering thread identified by the rendering thread identification module. The message processing module can send the RTID of the rendering thread to the main thread identification module. The main thread identification module can trace the awakening relationship between the threads running in the current drawing frame period and the rendering thread based on the important event information recorded in the current drawing frame period. Then based on the wake-up relationship between the thread running in the current drawing frame cycle and the rendering thread, the main thread in the current drawing frame cycle is determined. Then, the main thread identification module can send the RTID of the rendering thread and the UTID of the main thread to the key thread acceleration module. The key thread acceleration module can allocate resources between the rendering thread and the main thread based on the RTID of the rendering thread and the UTID of the main thread to achieve Accelerate processing of the rendering thread and the main thread to avoid the problem of application lag caused by frame loss, which can improve the user experience.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
其中,在本申请的描述中,各术语及英文缩略语,如唤醒关系、目标路径、绘帧周期等,均为方便描述而给出的示例性举例,不应对本申请构成任何限定。本申请并不排除在已有或未来的协议中定义其它能够实现相同或相似功能的术语的可能。Among them, in the description of this application, various terms and English abbreviations, such as wake-up relationship, target path, frame period, etc., are illustrative examples given for convenience of description and should not constitute any limitation on this application. This application does not exclude the possibility of defining other terms that can achieve the same or similar functions in existing or future agreements.
其中,在本申请的描述中,除非另有说明,“至少一个”是指一个或多个,“多个”是指两个或多于两个。另外,为了便于清楚描述本申请实施例的技术方案,在本申请的实施例中,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。Among them, in the description of this application, unless otherwise specified, "at least one" refers to one or more, and "plurality" refers to two or more than two. In addition, in order to facilitate a clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, words such as “first” and “second” are used to distinguish identical or similar items with basically the same functions and effects. Those skilled in the art can understand that words such as "first" and "second" do not limit the number and execution order, and words such as "first" and "second" do not limit the number and execution order.
下面结合附图对本申请实施例提供的应用场景进行举例说明。The application scenarios provided by the embodiments of the present application are illustrated below with reference to the accompanying drawings.
示例性的,如图7中的(a)所示,电子设备可以在视频应用的视频播放的界面701接收用户开始播放的操作(例如,用户点击播放按钮702的操作),电子设备响应于用户的操作进行帧绘制、渲染、合成等过程,对视频内容和弹幕内容进行显示。For example, as shown in (a) of FIG. 7 , the electronic device may receive the user's operation to start playing (for example, the user's operation of clicking the play button 702 ) on the video playback interface 701 of the video application, and the electronic device responds to the user's operation. The operation performs frame drawing, rendering, synthesis and other processes to display video content and barrage content.
如图7中的(b)所示,电子设备可以在地图应用的路线选择界面703接收用户开始导航的操作(例如,用户点击开始步行导航按钮704的操作),电子设备响应于用户的操作进行帧绘制、渲染、合成等过程,对步行导航界面进行显示。As shown in (b) of FIG. 7 , the electronic device can receive the user's operation to start navigation (for example, the user clicks the start walking navigation button 704 ) on the route selection interface 703 of the map application, and the electronic device responds to the user's operation. Frame drawing, rendering, synthesis and other processes are used to display the walking navigation interface.
如图7中的(c)所示,电子设备可以在微信的显示界面705接收用户打开小程序的操作(例如,用户点击小程序入口706的操作),电子设备响应于用户的操作进行帧绘制、渲染、合成等过程,对小程序的界面进行显示。As shown in (c) in Figure 7, electronic devices can The display interface 705 receives the user's operation of opening the applet (for example, the user's operation of clicking the applet entrance 706). The electronic device responds to the user's operation by performing processes such as frame drawing, rendering, and synthesis to display the interface of the applet.
如图7中的(d)所示,电子设备可以在图库应用的显示界面707接收用户滑动的操作(例如,用户向上滑动或向下滑动的操作),电子设备响应于用户的操作进行帧绘制、渲染、合成等过程,对滑动后的界面进行显示。As shown in (d) of Figure 7 , the electronic device can receive the user's sliding operation (for example, the user's sliding up or sliding down operation) on the display interface 707 of the gallery application, and the electronic device performs frame drawing in response to the user's operation. , rendering, synthesis and other processes to display the sliding interface.
应理解的,本申请实施例提供的应用场景还可以包括其他应用程序的其他界面,用户的操作还可以包括其他操作(例如,双击、三击等),本申请实施例对应用场景和用户的操作不做具体限定。It should be understood that the application scenarios provided by the embodiments of the present application may also include other interfaces of other applications, and the user's operations may also include other operations (for example, double-click, triple-click, etc.). The operation is not specifically limited.
为方便理解,下面结合图8对本申请实施例提供的线程加速处理方法中涉及的各个模块之间交互的过程进行说明。For ease of understanding, the interaction process between various modules involved in the thread acceleration processing method provided by the embodiment of the present application will be described below with reference to FIG. 8 .
其中,本申请实施例提供的数据处理方法涉及的模块可以包括:应用程序的主线程和渲染线程、应用框架层的图层处理模块、图像合成系统(Surfaceflinger)、渲染线程识别模块、内核层的消息处理模块、主线程识别模块和关键线程加速模块。Among them, the modules involved in the data processing method provided by the embodiment of the present application may include: the main thread and rendering thread of the application program, the layer processing module of the application framework layer, the image synthesis system (Surfaceflinger), the rendering thread identification module, the kernel layer Message processing module, main thread identification module and key thread acceleration module.
801、电子设备接收用户在第一应用的界面上的第一操作,响应于第一操作,第一应用的主线程向应用框架层的图层处理模块发送创建图层请求。801. The electronic device receives the user's first operation on the interface of the first application. In response to the first operation, the main thread of the first application sends a create layer request to the layer processing module of the application framework layer.
其中,第一应用可以包括视频应用、导航应用、社交应用、搜索引擎应用等,本申请不做限定。The first application may include video applications, navigation applications, social networking applications, search engine applications, etc., which are not limited in this application.
其中,第一操作用于触发电子设备显示目标信息。目标信息例如可以包括弹幕信息、导航信息、游戏信息、小程序信息等。第一操作可以包括点击、滑动等操作,本申请不做限定。The first operation is used to trigger the electronic device to display the target information. Target information may include, for example, barrage information, navigation information, game information, mini-program information, etc. The first operation may include click, slide and other operations, which are not limited in this application.
示例性的,以第一应用为视频应用为例,如图7中的(a)所示,响应于用户点击播放按钮702的操作(第一操作的一种示例),视频应用的主线程可以向应用框架层图层处理模块发送图层创建请求。其中,图层创建请求可以包括图层对象和图层对应的缓冲区队列的ID。Exemplarily, taking the first application as a video application, as shown in (a) of Figure 7 , in response to the user clicking the play button 702 (an example of the first operation), the main thread of the video application can Send a layer creation request to the application framework layer layer processing module. The layer creation request may include the layer object and the ID of the buffer queue corresponding to the layer.
示例性的,如图9中的(a)所示,待创建的图层可以包括弹幕图层,如图9中的(b)所示,待创建的图层可以包括视频图层。当然,待创建的图层还可以包括其他图层,例如程序窗口图层、台标图层等,本申请不做限定。For example, as shown in (a) of Figure 9 , the layer to be created may include a barrage layer, and as shown in (b) of Figure 9 , the layer to be created may include a video layer. Of course, the layers to be created may also include other layers, such as program window layers, station logo layers, etc., which are not limited in this application.
802、应用框架层的图层处理模块向Surfaceflinger发送获取缓冲区队列(BufferQueue)请求。802. The layer processing module of the application framework layer sends a request to obtain the buffer queue (BufferQueue) to Surfaceflinger.
其中,获取BufferQueue请求用于请求Surfaceflinger为图层分配BufferQueue。获取BufferQueue请求中可以携带图层对应的缓冲区队列的ID。Among them, the Get BufferQueue request is used to request Surfaceflinger to allocate a BufferQueue for the layer. Get the ID of the buffer queue corresponding to the layer that can be carried in the BufferQueue request.
803、Surfaceflinger向图层处理模块返回图层对应的BufferQueue。803. Surfaceflinger returns the BufferQueue corresponding to the layer to the layer processing module.
可以理解的是,不同图层可以对应不同的BufferQueue。It is understandable that different layers can correspond to different BufferQueue.
例如,弹幕图层可以对应BufferQueue 1,BufferQueue 1中可以包括一个或多个buffer。视频图层可以对应BufferQueue 2,BufferQueue 2中可以包括一个或多个buffer。BufferQueue1与BufferQueue 2不同。For example, the barrage layer can correspond to BufferQueue 1, and BufferQueue 1 can include one or more buffers. The video layer can correspond to BufferQueue 2, and BufferQueue 2 can include one or more buffers. BufferQueue1 is different from BufferQueue2.
804、图层处理模块向主线程返回图层的属性信息。804. The layer processing module returns the attribute information of the layer to the main thread.
其中,图层的属性信息包括但不限于高度、宽度、中心坐标、缩放属性以及旋转属性等。Among them, the attribute information of the layer includes but is not limited to height, width, center coordinates, scaling attributes, rotation attributes, etc.
805、主线程向Surfaceflinger请求Vsync信号。805. The main thread requests the Vsync signal from Surfaceflinger.
其中,Vsync信号可以是Vsync-APP,Vsync-APP用于触发绘制渲染流程。Among them, the Vsync signal can be Vsync-APP, and Vsync-APP is used to trigger the drawing and rendering process.
806、Surfaceflinger向主线程返回Vsync信号。806. Surfaceflinger returns the Vsync signal to the main thread.
主线程接收到Vsync信号后,可以根据Vsync信号的时间戳计算帧间隔。例如,主线程可以计算此次接收的Vsync-APP信号的时间戳与上一次接收的Vsync-APP信号的时间戳的差值,该差值为前一帧绘制渲染对应的帧间隔。主线程还可以计算位移量,位移量为帧间隔与速度的乘积。主线程可以基于预先存储的速度曲线确定速度。After the main thread receives the Vsync signal, it can calculate the frame interval based on the timestamp of the Vsync signal. For example, the main thread can calculate the difference between the timestamp of the Vsync-APP signal received this time and the timestamp of the Vsync-APP signal received last time. The difference is the frame interval corresponding to the previous frame rendering. The main thread can also calculate the displacement, which is the product of the frame interval and the speed. The main thread can determine the speed based on a pre-stored speed profile.
807、主线程唤醒渲染线程。807. The main thread wakes up the rendering thread.
主线程可以将帧间隔和当前帧的位移量发送至渲染线程,以唤醒渲染线程。渲染线程被唤醒后,开始绘制渲染图像。The main thread can send the frame interval and the displacement of the current frame to the rendering thread to wake up the rendering thread. After the rendering thread is awakened, it starts drawing the rendered image.
需要说明的是,应用程序(第一应用)的渲染线程的名称可以是应用程序自定义的。例如,视频应用可以自定义弹幕图层的渲染线程的名称是线程205。又例如,导航应用可以自定义导航图层的渲染线程的名称是线程205。It should be noted that the name of the rendering thread of the application (first application) may be customized by the application. For example, a video application can customize the name of the rendering thread of the barrage layer to be thread 205. For another example, the navigation application can customize the name of the rendering thread of the navigation layer to be thread 205.
808、渲染线程绘制渲染图像。808. The rendering thread draws the rendering image.
渲染线程用于执行图层渲染得到渲染后的图层,渲染后的图层与目标信息对应。The rendering thread is used to perform layer rendering to obtain a rendered layer, which corresponds to the target information.
示例性的,在渲染线程为弹幕渲染线程的情况下,渲染后的图层为弹幕图层;渲染线程为导航渲染线程的情况下,渲染后的图层为导航图层;渲染线程为游戏渲染线程的情况下,渲染后的图层为游戏图层;渲染线程为小程序渲染线程的情况下,渲染后的图层为小程序图层。For example, when the rendering thread is a barrage rendering thread, the rendered layer is a barrage layer; when the rendering thread is a navigation rendering thread, the rendered layer is a navigation layer; the rendering thread is In the case of the game rendering thread, the rendered layer is the game layer; in the case of the rendering thread being the applet rendering thread, the rendered layer is the applet layer.
809、渲染线程向Surfaceflinger发送请求缓存命令。809. The rendering thread sends a request cache command to Surfaceflinger.
其中,请求缓存命令用于向Surfaceflinger请求缓存,以存储绘制渲染后的图像。Among them, the request cache command is used to request cache from Surfaceflinger to store the rendered image.
810、Surfaceflinger向渲染线程发送用于指示缓存出队的指令。810. Surfaceflinger sends an instruction to the rendering thread to instruct the cache to dequeue.
Surfaceflinger在接收到渲染线程发送的请求缓存命令后,可以预留出存储绘制渲染后图像的空间,并向渲染线程发送用于指示缓存出队的指令。After receiving the request cache command sent by the rendering thread, Surfaceflinger can reserve space to store the rendered image and send an instruction to the rendering thread to instruct the cache to dequeue.
811、渲染线程将绘制渲染好后的图像存入缓冲区队列。811. The rendering thread stores the rendered image in the buffer queue.
渲染线程接收到用于指示缓存出队的指令后,根据位移量绘制渲染图像,并通过调用入队列(queueBuffer)函数将绘制渲染好后的图像存入缓冲区队列(BufferQueue)。缓冲区队列也可以称为缓存队列,本申请不做限定。After the rendering thread receives the instruction to instruct the cache to dequeue, it draws the rendered image according to the displacement, and stores the drawn and rendered image into the buffer queue (BufferQueue) by calling the queue (queueBuffer) function. The buffer queue can also be called a cache queue, which is not limited in this application.
进一步的,渲染线程通知Surfaceflinger从BufferQueue中读取渲染数据。Surfaceflinger可以对渲染数据进行合成。完成合成后,电子设备可以通过调用内核层启动显示驱动,在屏幕(显示屏)显示渲染合成的帧对应的内容。Further, the rendering thread notifies Surfaceflinger to read rendering data from the BufferQueue. Surfaceflinger can synthesize rendering data. After the synthesis is completed, the electronic device can start the display driver by calling the kernel layer to display the content corresponding to the rendered synthesized frame on the screen (display screen).
812、渲染线程识别模块获取渲染线程信息。812. The rendering thread identification module obtains rendering thread information.
本申请实施例中,电子设备可以通过渲染线程识别模块获取渲染线程的线程标识。渲染线程识别模块可以通过在入队列(queueBuffer)函数中“插桩”,即预先在queueBuffer函数的插入点中插入插桩函数,当执行到queueBuffer函数的插入点,则执行插桩函数,进而可以实时获取渲染线程的线程标识。其中,queueBuffer函数用于提交渲染图像,即将渲染图像填充到缓冲区队列(BufferQueue)中。In this embodiment of the present application, the electronic device can obtain the thread identifier of the rendering thread through the rendering thread identification module. The rendering thread identification module can "instrument" in the queue (queueBuffer) function, that is, insert the instrumentation function into the insertion point of the queueBuffer function in advance. When the insertion point of the queueBuffer function is executed, the instrumentation function is executed, and then the instrumentation function can be executed. Get the thread ID of the rendering thread in real time. Among them, the queueBuffer function is used to submit the rendered image, that is, to fill the rendered image into the buffer queue (BufferQueue).
示例性的,如图10所示,渲染线程被主线程唤醒后,可以执行帧渲染操作得到渲染数据。例如,渲染线程可以在前一个Vsync周期对帧1执行渲染操作得到渲染数据并存入缓冲区队列中。在后一个Vsync周期对帧2执行渲染操作得到渲染数据并存入缓冲区队列中。当渲染线程将渲染数据存入缓冲区队列时,通过在缓冲区队列的插入点中插入的插桩函数,可以实时获取渲染线程的线程标识。For example, as shown in Figure 10, after the rendering thread is awakened by the main thread, it can perform a frame rendering operation to obtain rendering data. For example, the rendering thread can perform a rendering operation on frame 1 in the previous Vsync cycle to obtain rendering data and store it in the buffer queue. In the next Vsync cycle, the rendering operation is performed on frame 2 to obtain the rendering data and stored in the buffer queue. When the rendering thread stores rendering data into the buffer queue, the thread ID of the rendering thread can be obtained in real time through the instrumentation function inserted into the insertion point of the buffer queue.
在一种可能的设计中,电子设备可以对通过“插桩”获取到的渲染线程的线程标识进行过滤处理。例如,电子设备可以将当前获取到的渲染线程的RTID与预设表格中的RTID进行比对。其中,预设表格中存储标准线程的名称。若当前获取到的渲染线程的RTID与预设表格中的RTID相同,则过滤当前获取到的渲染线程,无需对当前获取到的渲染线程进行追溯和加速处理,即不执行下述步骤813—817。若当前获取到的渲染线程的RTID与预设表格中的RTID不同,则对当前获取到的渲染线程进行追溯和加速处理,即继续执行下述步骤813—817。In one possible design, the electronic device can filter the thread identifier of the rendering thread obtained through "instrumentation". For example, the electronic device may compare the currently obtained RTID of the rendering thread with the RTID in the preset table. Among them, the name of the standard thread is stored in the preset table. If the RTID of the currently obtained rendering thread is the same as the RTID in the preset table, then the currently obtained rendering thread is filtered, and there is no need to trace and accelerate the currently obtained rendering thread, that is, the following steps 813-817 are not performed. . If the currently obtained RTID of the rendering thread is different from the RTID in the preset table, the currently obtained rendering thread is traced and accelerated, that is, the following steps 813-817 are continued.
可以理解的是,若当前获取到的渲染线程的RTID与预设表格中的RTID相同,则表示当前获取到的渲染线程是标准渲染线程,由于标准渲染线程有相应的加速方案,因此无需再执行下述步骤813—817。这样,可以避免对标准渲染线程执行重复的加速处理。It can be understood that if the RTID of the currently obtained rendering thread is the same as the RTID in the preset table, it means that the currently obtained rendering thread is a standard rendering thread. Since the standard rendering thread has a corresponding acceleration scheme, there is no need to execute it again. Steps 813-817 are described below. This avoids repeated acceleration processing of the standard rendering thread.
813、渲染线程识别模块向内核层的消息处理模块发送渲染线程信息。813. The rendering thread identification module sends the rendering thread information to the message processing module of the kernel layer.
渲染线程信息可以包括渲染线程的RTID。The rendering thread information may include the RTID of the rendering thread.
814、消息处理模块向主线程识别模块发送渲染线程信息。814. The message processing module sends the rendering thread information to the main thread identification module.
内核层的消息处理模块接收到渲染线程信息后,可以向主线程识别模块发送渲染线程信息。After receiving the rendering thread information, the message processing module of the kernel layer can send the rendering thread information to the main thread identification module.
815、主线程识别模块根据渲染线程的线程标识确定与该渲染线程具有唤醒关系的主线程。815. The main thread identification module determines the main thread that has a wake-up relationship with the rendering thread according to the thread identifier of the rendering thread.
在一种可能的设计中,主线程识别模块可以基于当前绘帧周期记录的重要事件信息,追溯当前绘帧周期中运行的线程与渲染线程的唤醒关系,基于唤醒关系确定主线程。In one possible design, the main thread identification module can trace the wake-up relationship between the threads running in the current draw frame cycle and the rendering thread based on the important event information recorded in the current draw frame cycle, and determine the main thread based on the wake-up relationship.
其中,当前绘帧周期可以是指当前帧(例如,帧1)对应的queueBuffer函数的执行时刻和下一帧(例如,帧2)对应的queueBuffer函数的执行时刻之间的时间。或者,当前绘帧周期可以是指当前帧(例如,帧1)对应的Vsync信号和下一帧(例如,帧2)对应的Vsync信号之间的时间。The current drawing frame period may refer to the time between the execution time of the queueBuffer function corresponding to the current frame (for example, frame 1) and the execution time of the queueBuffer function corresponding to the next frame (for example, frame 2). Alternatively, the current frame period may refer to the time between the Vsync signal corresponding to the current frame (eg, frame 1) and the Vsync signal corresponding to the next frame (eg, frame 2).
在每个绘帧周期中电子设备可以执行多个线程,在该多个线程执行过程中,电子设备可以记录重要事件信息。电子设备可以通过内核层的调度事件采集模块记录重要事件信息,主线程识别模块可以从调度事件采集模块获取重要事件信息。其中,重要事件信息可以包括线程与线程之间的唤醒事件。线程与线程之间的唤醒事件可以包括正在运行的线程唤醒休眠中的线程,正在运行的线程创建线程并唤醒被创建的线程。In each frame cycle, the electronic device can execute multiple threads, and during the execution of the multiple threads, the electronic device can record important event information. The electronic device can record important event information through the scheduling event collection module of the kernel layer, and the main thread identification module can obtain important event information from the scheduling event collection module. Among them, important event information may include wake-up events between threads. Wake-up events between threads can include a running thread waking up a sleeping thread, a running thread creating a thread and waking up the created thread.
示例性地,电子设备的主线程识别模块可以通过唤醒参数/函数(例如SCHED_WAKING)得到正在运行的线程唤醒的休眠中的线程,可以通过唤醒新线程参数/函数(例如SCHED_PROCESS_FORK)得到正在运行的线程创建线程并唤醒被创建的线程。For example, the main thread identification module of the electronic device can obtain the sleeping thread awakened by the running thread through the wake-up parameter/function (such as SCHED_WAKING), and can obtain the running thread through the wake-up new thread parameter/function (such as SCHED_PROCESS_FORK). Create a thread and wake up the created thread.
可选的,上述重要事件信息还可以包括被唤醒线程的进程标识(process id,PID)、被唤醒线程对应的调度组、被唤醒线程对应的时间戳(线程被唤醒的时间)、被唤醒线程对应的处理器的标识、被唤醒线程在处理器上运行时长、运行频率等信息。其中,被唤醒线程包括渲染线程和主线程。Optionally, the above important event information may also include the process identification (process id, PID) of the awakened thread, the scheduling group corresponding to the awakened thread, the timestamp corresponding to the awakened thread (the time when the thread was awakened), the awakened thread The identification of the corresponding processor, the length of time the awakened thread has been running on the processor, the running frequency and other information. Among them, the awakened threads include rendering threads and main threads.
电子设备的主线程识别模块可以以渲染线程为起点,采用追溯(回溯)的方法,确定出具有唤醒关系的多个线程。当追溯到被内核线程或者系统中断唤醒的线程时,电子设备不再追溯。电子设备根据多个线程之间的唤醒关系得到多个线程的执行次序,根据该多个线程的执行次序,确定目标路径。其中,多个线程的执行次序可以是按照唤醒时间从后到前(从晚到早)排列。The main thread identification module of the electronic device can use the rendering thread as a starting point and use a traceback (backtracking) method to determine multiple threads with a wake-up relationship. When tracing back to a thread awakened by a kernel thread or a system interrupt, the electronic device no longer traces back. The electronic device obtains the execution order of the multiple threads based on the wake-up relationship between the multiple threads, and determines the target path based on the execution order of the multiple threads. The execution order of the multiple threads may be arranged from back to front (from late to early) according to the wake-up time.
需要说明的是,目标路径可以包括至少一条(一条或多条)。每条目标路径的起点可以是渲染线程,每条目标路径的终点可以是被内核线程或者系统中断或者应用线程唤醒的线程。It should be noted that the target path may include at least one (one or more). The starting point of each target path can be a rendering thread, and the end point of each target path can be a thread that is interrupted by a kernel thread or system, or awakened by an application thread.
示例性地,图11示出了一条目标路径(第一目标路径)的示意图。如图11所示,唤醒渲染线程的线程为线程B,且渲染线程在时间点t2被线程B唤醒(即线程B在时间点t2唤醒了线程A),唤醒线程B的线程为线程A,且线程B在时间点t1被线程A唤醒。若线程A被内核线程或者系统中断唤醒,则电子设备不再追溯。其中,时间点t2晚于时间点t1。第一目标路径可以包括渲染线程、线程B、线程A。第一目标路径的起点为渲染线程,终点为线程A。Exemplarily, FIG. 11 shows a schematic diagram of a target path (first target path). As shown in Figure 11, the thread that wakes up the rendering thread is thread B, and the rendering thread is awakened by thread B at time point t2 (that is, thread B wakes up thread A at time point t2). The thread that wakes up thread B is thread A, and Thread B is awakened by thread A at time point t1. If thread A is awakened by a kernel thread or a system interrupt, the electronic device will no longer trace back. Among them, time point t2 is later than time point t1. The first target path may include the rendering thread, thread B, and thread A. The starting point of the first target path is the rendering thread and the end point is thread A.
另外,若在上述图11中,线程B除唤醒渲染线程之外,还唤醒线程D,由于线程D是以渲染线程为起点时无法追溯到的线程,因此线程D不包含在第一目标路径中。In addition, in Figure 11 above, thread B not only wakes up the rendering thread, but also wakes up thread D. Since thread D is a thread that cannot be traced back to the rendering thread as the starting point, thread D is not included in the first target path. .
示例性地,图12示出了又一条目标路径(第二目标路径)的示意图。如图12所示,渲染线程可以在时间点t4被线程C唤醒,线程C可以在时间点t5被渲染线程唤醒,渲染线程可以在时间点t6被线程A唤醒。应该理解的是,渲染线程在时间点t5唤醒线程C后可以进入休眠状态,再在时间点t4被线程C重新唤醒。若线程A被内核线程或者系统中断唤醒,则电子设备不再追溯。其中,时间点t4晚于时间点t5,时间点t5晚于时间点t6。第二目标路径可以包括渲染线程、线程C、渲染线程、线程A。第一目标路径的起点为渲染线程,终点为线程A。Exemplarily, FIG. 12 shows a schematic diagram of yet another target path (the second target path). As shown in Figure 12, the rendering thread can be awakened by thread C at time point t4, thread C can be awakened by the rendering thread at time point t5, and the rendering thread can be awakened by thread A at time point t6. It should be understood that the rendering thread can enter the dormant state after waking up thread C at time point t5, and then be reawakened by thread C at time point t4. If thread A is awakened by a kernel thread or a system interrupt, the electronic device will no longer trace back. Among them, time point t4 is later than time point t5, and time point t5 is later than time point t6. The second target path may include rendering thread, thread C, rendering thread, thread A. The starting point of the first target path is the rendering thread and the end point is thread A.
电子设备可以根据至少一条目标路径确定主线程。主线程是至少一条目标路径中作为终点的次数最多的线程。The electronic device may determine the main thread based on at least one target path. The main thread is the thread that serves as the end point most often on at least one target path.
示例性的,若至少一条目标路径包括如图11所示的第一目标路径和如图12所示的第二目标路径,由于第一目标路径和第二目标路径的终点都为线程A,因此线程A为主线程。For example, if at least one target path includes the first target path as shown in Figure 11 and the second target path as shown in Figure 12, since the end points of the first target path and the second target path are both thread A, therefore Thread A is the main thread.
816、主线程识别模块向关键线程加速模块发送关键线程组信息。816. The main thread identification module sends key thread group information to the key thread acceleration module.
其中,关键线程组信息用于指示关键线程组,关键线程组可以包括渲染线程和主线程。The key thread group information is used to indicate the key thread group, and the key thread group may include a rendering thread and a main thread.
示例性的,关键线程组信息可以包括渲染线程的线程标识和主线程的线程标识。For example, the key thread group information may include the thread ID of the rendering thread and the thread ID of the main thread.
817、关键线程加速模块对关键线程组进行加速。817. The key thread acceleration module accelerates key thread groups.
关键线程加速模块可以根据重要事件信息,确定渲染线程和主线程对应的调度组、处理器的标识、在处理器上的运行时长、运行频率等信息,根据上述信息对渲染线程和主线程进行加速处理。The key thread acceleration module can determine the scheduling group corresponding to the rendering thread and the main thread, the identifier of the processor, the running time on the processor, the running frequency and other information based on important event information, and accelerate the rendering thread and the main thread based on the above information. deal with.
关键线程加速模块对渲染线程和主线程进行加速处理可以包括以下至少一项:The key thread acceleration module's acceleration of the rendering thread and main thread can include at least one of the following:
1)、提高渲染线程和主线程对应的调度组的优先级。例如,若加速处理前,根据重要事件信息确定渲染线程和主线程对应的调度组为第一优先级调度组,可以将渲染线程和主线程从第一优先级调度组(例如,CFS调度组)调整至第二优先级调度组(例如,VIP调度组),第二优先级调度组中的线程的调度优先级高于第一优先级调度组中的线程。电子设备可以优先为第二优先级调度组中的线程分配处理资源。如此,电子设备可以优先调度第二优先级调度组中的线程执行相应的任务。1). Increase the priority of the scheduling group corresponding to the rendering thread and the main thread. For example, if the scheduling group corresponding to the rendering thread and the main thread is determined to be the first priority scheduling group based on important event information before acceleration processing, the rendering thread and the main thread can be moved from the first priority scheduling group (for example, CFS scheduling group) Adjust to the second priority scheduling group (eg, VIP scheduling group), and the scheduling priority of the threads in the second priority scheduling group is higher than the threads in the first priority scheduling group. The electronic device may preferentially allocate processing resources to threads in the second priority scheduling group. In this way, the electronic device can prioritize threads in the second priority scheduling group to execute corresponding tasks.
2)、对渲染线程和主线程进行提频处理。2). Increase the frequency of the rendering thread and main thread.
关键线程加速模块可以提高渲染线程和主线程的对应的处理器的频率,从而提高渲染线程和主线程的执行效率。示例性的,假设处理器的频率可以包括1.0GHz、1.5GHz、2.0GHz。若加速处理前,根据重要事件信息确定渲染线程和主线程对应的处理器的频率为1.0GHz,可以将渲染线程和主线程对应的处理器的频率提高到1.5GHz或2.0GHz。The key thread acceleration module can increase the frequency of the corresponding processors of the rendering thread and the main thread, thereby improving the execution efficiency of the rendering thread and the main thread. For example, it is assumed that the frequency of the processor may include 1.0GHz, 1.5GHz, and 2.0GHz. If the frequency of the processor corresponding to the rendering thread and the main thread is determined to be 1.0GHz based on important event information before acceleration processing, the frequency of the processor corresponding to the rendering thread and the main thread can be increased to 1.5GHz or 2.0GHz.
可选的,可以为渲染线程和主线程分配更高计算能力的处理器,从而提高渲染线程和主线程的执行效率。例如,若加速处理前,根据重要事件信息确定渲染线程和主线程对应第一CPU,第一CPU的频率为1.0GHz,可以将渲染线程和主线程重新分配到第二CPU,第二CPU的频率为1.5GHz或2.0GHz。Optionally, a processor with higher computing power can be allocated to the rendering thread and the main thread, thereby improving the execution efficiency of the rendering thread and the main thread. For example, if before acceleration processing, it is determined based on important event information that the rendering thread and the main thread correspond to the first CPU and the frequency of the first CPU is 1.0GHz, the rendering thread and the main thread can be reallocated to the second CPU and the frequency of the second CPU for 1.5GHz or 2.0GHz.
3)、提高渲染线程和主线程的线程优先级。3). Increase the thread priority of the rendering thread and the main thread.
即可以将渲染线程和主线程在调度组中的优先级提高。例如,若加速处理前,渲染线程和主线程的线程优先级为第三优先级,可以将渲染线程和主线程从第三优先级调高到第四优先级,第四优先级高于第三优先级,同一调度组中第四优先级的线程先于第三优先级的线程执行。That is, the priority of the rendering thread and the main thread in the scheduling group can be increased. For example, if the thread priority of the rendering thread and the main thread is the third priority before acceleration processing, the rendering thread and the main thread can be raised from the third priority to the fourth priority, and the fourth priority is higher than the third priority. Priority, the fourth priority thread in the same scheduling group executes before the third priority thread.
示例性的,如图13所示,可以设置渲染线程和/或主线程的调度组为VIP调度组,而非CFS调度组。应理解,实时(real time,RT)调度组的处理性能高于VIP调度组,VIP调度组的处理性能高于完全公平调度(completely fair scheduler,CFS)调度组。进一步的,可以设置渲染线程和/或主线程对应的处理器为大核处理器。应理解,大核处理器的处理速度高于中核处理器,中核处理器的处理速度高于小核处理器。再进一步的,可以对渲染线程和/或主线程进行提频处理。再进一步的,可以设置渲染线程和/或主线程的线程优先级为高。For example, as shown in Figure 13, the scheduling group of the rendering thread and/or the main thread can be set to the VIP scheduling group instead of the CFS scheduling group. It should be understood that the processing performance of the real time (RT) scheduling group is higher than that of the VIP scheduling group, and the processing performance of the VIP scheduling group is higher than that of the completely fair scheduler (CFS) scheduling group. Further, the processor corresponding to the rendering thread and/or the main thread can be set to a large-core processor. It should be understood that a large-core processor has a higher processing speed than a mid-core processor, and a mid-core processor has a higher processing speed than a small-core processor. Furthermore, the frequency of the rendering thread and/or the main thread can be increased. Furthermore, you can set the thread priority of the rendering thread and/or the main thread to high.
或者,如图14所示,可以设置渲染线程和/或主线程的调度组为VIP调度组,而非CFS调度组。进一步的,可以对渲染线程和/或主线程进行提频处理。再进一步的,可以设置渲染线程和/或主线程的线程优先级为高。Alternatively, as shown in Figure 14, the scheduling group of the rendering thread and/or the main thread can be set to the VIP scheduling group instead of the CFS scheduling group. Further, the rendering thread and/or the main thread can be increased in frequency. Furthermore, you can set the thread priority of the rendering thread and/or the main thread to high.
应该理解的是,在弹幕显示、导航显示或用户持续滑动界面的场景中,帧绘制、渲染、合成等过程可以一直进行,步骤808-步骤817可以循环执行。在弹幕显示关闭(关闭弹幕)、导航显示关闭(关闭导航)或停止滑动界面的场景中,步骤808-步骤817可以不再执行。It should be understood that in scenarios where barrage display, navigation display, or the user continues to slide the interface, processes such as frame drawing, rendering, and synthesis can be carried out all the time, and steps 808 to 817 can be executed in a loop. In a scenario where the barrage display is turned off (the barrage is turned off), the navigation display is turned off (the navigation is turned off), or the sliding interface is stopped, steps 808 to 817 may no longer be executed.
基于本申请实施例提供的方法,通过识别渲染线程和主线程,进而为渲染线程和主线程精准调配资源,可以避免丢帧和卡顿,从而可以提升用户体验。Based on the method provided by the embodiments of this application, by identifying the rendering thread and the main thread, and then accurately allocating resources to the rendering thread and the main thread, frame loss and lag can be avoided, thereby improving the user experience.
以视频应用为例,经过试验验证,采用本申请实施例提供的方案对视频应用的弹幕图层对应的渲染线程和主线程进行识别并加速后,如图15所示,可以明显减少渲染线程(例如,线程205)处于runnable状态的时间。如表1所示,在功耗增加较小(电流增大较小从而功耗增加较小)的情况下可以明显提升帧率(平均每秒可以提升4帧),减少丢帧,避免卡顿。如图16中的(a)和(b)所示,相较于图2,弹幕图层的弹幕1002和弹幕1004可以随着视频播放滚动显示,不再卡顿,从而可以提升用户体验。Taking the video application as an example, after experimental verification, after using the solution provided by the embodiment of the present application to identify and accelerate the rendering thread and main thread corresponding to the barrage layer of the video application, as shown in Figure 15, the number of rendering threads can be significantly reduced The time (for example, thread 205) is in the runnable state. As shown in Table 1, when the increase in power consumption is small (the increase in current is small and the increase in power consumption is small), the frame rate can be significantly increased (an average increase of 4 frames per second), frame loss can be reduced, and lags can be avoided. . As shown in (a) and (b) in Figure 16, compared with Figure 2, the barrage 1002 and barrage 1004 of the barrage layer can be scrolled and displayed as the video plays, without any lag, thus improving the user experience. experience.
表1Table 1
本申请一些实施例提供了一种电子设备,该电子设备可以包括:触摸屏、存储器和一个或多个处理器。该触摸屏、存储器和处理器耦合。该存储器用于存储计算机程序代码,该计算机程序代码包括计算机指令。当处理器执行计算机指令时,电子设备可执行上述方法实施例中电子设备执行的各个功能或者步骤。该电子设备的结构可以参考图5所示的电子设备100的结构。Some embodiments of the present application provide an electronic device, which may include a touch screen, a memory, and one or more processors. The touch screen, memory and processor are coupled. The memory is used to store computer program code, which includes computer instructions. When the processor executes computer instructions, the electronic device may perform various functions or steps performed by the electronic device in the above method embodiments. The structure of the electronic device may refer to the structure of the electronic device 100 shown in FIG. 5 .
本申请实施例还提供一种芯片系统(例如,片上系统(system on a chip,SoC)),如图17所示,该芯片系统包括至少一个处理器1701和至少一个接口电路1702。处理器1701和接口电路1702可通过线路互联。例如,接口电路1702可用于从其它装置(例如电子设备的存储器)接收信号。又例如,接口电路1702可用于向其它装置(例如处理器1701或者电子设备的触摸屏)发送信号。示例性的,接口电路1702可读取存储器中存储的指令,并将该指令发送给处理器1701。当所述指令被处理器1701执行时,可使得电子设备执行上述实施例中的各个步骤。当然,该芯片系统还可以包含其他分立器件,本申请实施例对此不作具体限定。An embodiment of the present application also provides a chip system (for example, a system on a chip (SoC)). As shown in FIG. 17 , the chip system includes at least one processor 1701 and at least one interface circuit 1702 . The processor 1701 and the interface circuit 1702 may be interconnected by wires. For example, interface circuitry 1702 may be used to receive signals from other devices, such as memory of an electronic device. As another example, interface circuit 1702 may be used to send signals to other devices, such as processor 1701 or a touch screen of an electronic device. For example, the interface circuit 1702 can read instructions stored in the memory and send the instructions to the processor 1701. When the instructions are executed by the processor 1701, the electronic device can be caused to perform various steps in the above embodiments. Of course, the chip system may also include other discrete devices, which are not specifically limited in the embodiments of this application.
本申请实施例还提供一种计算机可读存储介质,该计算机可读存储介质包括计算机指令,当所述计算机指令在上述电子设备上运行时,使得该电子设备执行上述方法实施例中电子设备(例如,手机)执行的各个功能或者步骤。Embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium includes computer instructions. When the computer instructions are run on the above-mentioned electronic device, the electronic device causes the electronic device to execute the electronic device in the above method embodiment ( For example, each function or step performed by a mobile phone).
本申请实施例还提供一种计算机程序产品,当所述计算机程序产品在电子设备上运行时,使得所述电子设备执行上述方法实施例中电子设备(例如,手机)执行的各个功能或者步骤。Embodiments of the present application also provide a computer program product. When the computer program product is run on an electronic device, it causes the electronic device to perform various functions or steps performed by the electronic device (for example, a mobile phone) in the above method embodiments.
通过以上实施方式的描述,所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。Through the description of the above embodiments, those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above functional modules is used as an example. In practical applications, the above functions can be allocated according to needs. Different functional modules are completed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个装置,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other division methods, for example, multiple units or components may be The combination can either be integrated into another device, or some features can be omitted, or not implemented. On the other hand, the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是一个物理单元或多个物理单元,即可以位于一个地方,或者也可以分布到多个不同地方。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated. The components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present application can be integrated into one processing unit, each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software functional units.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该软件产品存储在一个存储介质中,包括若干指令用以使得一个设备(可以是单片机,芯片等)或处理器(processor)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program codes.
以上内容,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何在本申请揭露的技术范围内的变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above contents are only specific implementation modes of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be covered by the protection scope of the present application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims (18)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410874388.1A CN118963985A (en) | 2023-04-28 | 2023-04-28 | A thread acceleration processing method and device |
CN202310493154.8A CN117130774B (en) | 2023-04-28 | 2023-04-28 | Thread acceleration processing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202310493154.8A CN117130774B (en) | 2023-04-28 | 2023-04-28 | Thread acceleration processing method and device |
Related Child Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410874388.1A Division CN118963985A (en) | 2023-04-28 | 2023-04-28 | A thread acceleration processing method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117130774A true CN117130774A (en) | 2023-11-28 |
CN117130774B CN117130774B (en) | 2024-07-12 |
Family
ID=88855349
Family Applications (2)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410874388.1A Pending CN118963985A (en) | 2023-04-28 | 2023-04-28 | A thread acceleration processing method and device |
CN202310493154.8A Active CN117130774B (en) | 2023-04-28 | 2023-04-28 | Thread acceleration processing method and device |
Family Applications Before (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410874388.1A Pending CN118963985A (en) | 2023-04-28 | 2023-04-28 | A thread acceleration processing method and device |
Country Status (1)
Country | Link |
---|---|
CN (2) | CN118963985A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118092728A (en) * | 2024-04-08 | 2024-05-28 | 荣耀终端有限公司 | Rendering method and electronic equipment |
CN119248430A (en) * | 2024-01-22 | 2025-01-03 | 荣耀终端有限公司 | Processing method, related device, electronic device and computer readable storage medium |
WO2025119288A1 (en) * | 2023-12-08 | 2025-06-12 | 华为技术有限公司 | Camera request processing method and related apparatus |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170161865A1 (en) * | 2013-10-28 | 2017-06-08 | Vmware, Inc. | Method and System to Virtualize Graphic Processing Services |
CN106843859A (en) * | 2016-12-31 | 2017-06-13 | 歌尔科技有限公司 | The method for drafting and device and a kind of virtual reality device of a kind of virtual reality scenario |
US20180322605A1 (en) * | 2017-05-04 | 2018-11-08 | Facebook, Inc. | Asynchronous ui framework |
CN110347947A (en) * | 2019-06-17 | 2019-10-18 | 阿里巴巴集团控股有限公司 | A kind of page rendering method and device |
CN111240926A (en) * | 2019-12-31 | 2020-06-05 | 苏州极光无限信息技术有限公司 | IOS stuck monitoring method and system |
CN111739136A (en) * | 2019-06-14 | 2020-10-02 | 腾讯科技(深圳)有限公司 | Rendering method, computer device, and storage medium |
CN111813520A (en) * | 2020-07-01 | 2020-10-23 | Oppo广东移动通信有限公司 | Thread scheduling method, device, storage medium and electronic device |
CN113051047A (en) * | 2021-03-03 | 2021-06-29 | 惠州Tcl移动通信有限公司 | Method and device for identifying drawing thread of android system, mobile terminal and storage medium |
US20220100512A1 (en) * | 2021-12-10 | 2022-03-31 | Intel Corporation | Deterministic replay of a multi-threaded trace on a multi-threaded processor |
US20220180528A1 (en) * | 2020-02-10 | 2022-06-09 | Nvidia Corporation | Disentanglement of image attributes using a neural network |
CN115016706A (en) * | 2021-12-31 | 2022-09-06 | 荣耀终端有限公司 | A thread scheduling method and electronic device |
CN115017002A (en) * | 2021-12-22 | 2022-09-06 | 荣耀终端有限公司 | Frequency prediction method and frequency prediction device |
US20230058935A1 (en) * | 2021-08-18 | 2023-02-23 | Micron Technology, Inc. | Managing return parameter allocation |
CN115802092A (en) * | 2022-11-18 | 2023-03-14 | 中船重工鹏力(南京)大气海洋信息系统有限公司 | Multi-window display method based on interaction priority |
-
2023
- 2023-04-28 CN CN202410874388.1A patent/CN118963985A/en active Pending
- 2023-04-28 CN CN202310493154.8A patent/CN117130774B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170161865A1 (en) * | 2013-10-28 | 2017-06-08 | Vmware, Inc. | Method and System to Virtualize Graphic Processing Services |
CN106843859A (en) * | 2016-12-31 | 2017-06-13 | 歌尔科技有限公司 | The method for drafting and device and a kind of virtual reality device of a kind of virtual reality scenario |
US20180322605A1 (en) * | 2017-05-04 | 2018-11-08 | Facebook, Inc. | Asynchronous ui framework |
CN111739136A (en) * | 2019-06-14 | 2020-10-02 | 腾讯科技(深圳)有限公司 | Rendering method, computer device, and storage medium |
CN110347947A (en) * | 2019-06-17 | 2019-10-18 | 阿里巴巴集团控股有限公司 | A kind of page rendering method and device |
CN111240926A (en) * | 2019-12-31 | 2020-06-05 | 苏州极光无限信息技术有限公司 | IOS stuck monitoring method and system |
US20220180528A1 (en) * | 2020-02-10 | 2022-06-09 | Nvidia Corporation | Disentanglement of image attributes using a neural network |
CN111813520A (en) * | 2020-07-01 | 2020-10-23 | Oppo广东移动通信有限公司 | Thread scheduling method, device, storage medium and electronic device |
CN113051047A (en) * | 2021-03-03 | 2021-06-29 | 惠州Tcl移动通信有限公司 | Method and device for identifying drawing thread of android system, mobile terminal and storage medium |
US20230058935A1 (en) * | 2021-08-18 | 2023-02-23 | Micron Technology, Inc. | Managing return parameter allocation |
US20220100512A1 (en) * | 2021-12-10 | 2022-03-31 | Intel Corporation | Deterministic replay of a multi-threaded trace on a multi-threaded processor |
CN115017002A (en) * | 2021-12-22 | 2022-09-06 | 荣耀终端有限公司 | Frequency prediction method and frequency prediction device |
CN115016706A (en) * | 2021-12-31 | 2022-09-06 | 荣耀终端有限公司 | A thread scheduling method and electronic device |
CN115802092A (en) * | 2022-11-18 | 2023-03-14 | 中船重工鹏力(南京)大气海洋信息系统有限公司 | Multi-window display method based on interaction priority |
Non-Patent Citations (3)
Title |
---|
JOHN E. STONE 等: "Immersive Molecular Visualization with Omnidirectional Stereoscopic Ray Tracing and Remote Rendering", 《2016 IEEE INTERNATIONAL PARALLEL AND DISTRIBUTED PROCESSING SYMPOSIUM WORKSHOPS (IPDPSW)》, 4 August 2016 (2016-08-04), pages 1048 - 1057 * |
付仲良 等: "一种三维天际线快速提取和显示算法", 《测绘地理信息》, vol. 47, no. 3, 5 January 2022 (2022-01-05), pages 96 - 99 * |
王丽 等: "深度学习编译器模型训练负载均衡优化方法", 《计算机科学与探索》, 16 February 2023 (2023-02-16), pages 1 - 18 * |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2025119288A1 (en) * | 2023-12-08 | 2025-06-12 | 华为技术有限公司 | Camera request processing method and related apparatus |
CN119248430A (en) * | 2024-01-22 | 2025-01-03 | 荣耀终端有限公司 | Processing method, related device, electronic device and computer readable storage medium |
CN118092728A (en) * | 2024-04-08 | 2024-05-28 | 荣耀终端有限公司 | Rendering method and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN118963985A (en) | 2024-11-15 |
CN117130774B (en) | 2024-07-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114092595B (en) | An image processing method and electronic device | |
US11573829B2 (en) | Task processing method and apparatus, terminal, and computer readable storage medium | |
CN113726950B (en) | An image processing method and electronic device | |
CN117130774B (en) | Thread acceleration processing method and device | |
CN113553130B (en) | Method for executing drawing operation by application and electronic equipment | |
CN114531519B (en) | A control method and electronic device based on vertical synchronization signal | |
CN114816607A (en) | Information screen display method, terminal equipment and chip | |
WO2023005751A1 (en) | Rendering method and electronic device | |
CN115629884A (en) | Thread scheduling method, electronic device and storage medium | |
CN116450363B (en) | Resource scheduling method and electronic device | |
CN115291919B (en) | Packet searching method and related device | |
CN116257235B (en) | Drawing method and electronic equipment | |
CN116700578B (en) | Layer synthesis method, electronic device and storage medium | |
CN117407127A (en) | Thread scheduling method and electronic equipment | |
WO2023051036A1 (en) | Method and apparatus for loading shader | |
CN116414336A (en) | Frame rate switching method and device | |
CN116414337A (en) | Frame rate switching method and device | |
CN117724825B (en) | Interface display method and electronic equipment | |
CN114860354B (en) | List loading method and electronic equipment | |
CN115712745B (en) | Method, system and electronic device for acquiring user annotation data | |
WO2023124225A9 (en) | Frame rate switching method and apparatus | |
WO2023124227A1 (en) | Frame rate switching method and device | |
CN118445006A (en) | Interface display method and related equipment | |
WO2025010897A1 (en) | Image processing method and electronic device | |
CN116077940A (en) | Drawing processing method and related device in game application |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |