Interface display method and related device
Quickly switch between coroutine view and thread view of interface display method and device, displaying the running information of coroutine and threads, solving the analysis problems caused by the short life cycle and large number of coroutines in multi-core processors, and improving tuning efficiency and accuracy.
Patent Information
- Application Number
- PCT/CN2024/071557
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-26
- Filing Date
- 2024-01-10
- Publication Date
- 2024-12-05
AI Technical Summary
In a multi-core processor environment, coroutines have short life cycles and numerous quantities, making it difficult to quickly locate and analyze performance problems. Traditional tuning methods lack efficient and in-depth observation and analysis capabilities, resulting in low tuning efficiency.
Provides an interface display method and device, which displays the operation information of coroutines and threads through the rapid switching and jump of coroutines and threads, including coroutines, status, kernel scheduling information and processor usage, helping users Deeply discover and locate problems in user mode and kernel mode.
It realizes in-depth analysis and tuning of coroutines and threads, improves tuning efficiency, provides more accurate CPU resource usage, and helps users quickly identify and solve coroutines and thread problems.
Smart Images

Figure CN2024071557_05122024_PF_FP_ABST
Abstract
Description
Interface display method and related equipment
[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on May 26, 2023, with application number 202310611424.0 and invention name “An interface display method and related equipment”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present disclosure relates to the field of computer technology, and in particular to an interface display method and related devices. Background Art
[0003] As Moore's Law slows, multi-core processors are becoming mainstream. To better utilize the computing power of multi-core processors, a common approach is to develop multi-threaded programs. To improve business performance, a large number of concurrent threads may be set up within a single business process. Multiple concurrent threads are executed sequentially within time slices using a round-robin scheduling method.
[0004] Currently, a thread can execute one or more coroutine tasks. Within the thread's time slice, multiple coroutine tasks assigned to the thread are scheduled for execution. However, coroutines have a short lifecycle, and a large number of coroutines are generated during application execution.
[0005] Therefore, how to quickly locate the problematic coroutine / thread and avoid being bogged down in a large amount of profiling information is also a difficult problem faced by users.
[0006] Summary of the Invention
[0007] The present disclosure provides an interface display method and related devices for realizing the jump display of the coroutine interface and the thread interface, thereby enabling users to deeply discover and locate problematic coroutines / threads at different levels (such as user state and kernel state).
[0008] The first aspect of the present disclosure provides an interface display method, which can be applied to scenarios such as coroutine / thread tuning. The method can be executed by an interface display device, or by a component of the interface display device (such as a processor, a chip, or a chip system, etc.). The method includes: displaying a first interface; displaying a second interface in response to a first operation of the user on the first interface; the first interface includes the first running information of at least one coroutine, and the second interface includes the second running information of the first coroutine in at least one coroutine on the thread; or the first interface includes the second running information of the first coroutine in at least one coroutine on the thread, and the second interface includes the first running information of at least one coroutine. The at least one coroutine includes the first coroutine and other coroutines, or at least one coroutine is the first coroutine.
[0009] In the present disclosure, the first operation can realize the rapid switching / jump display of the coroutine interface and the thread interface, thereby allowing the user to deeply discover and locate problematic coroutines / threads at different levels (such as user state and kernel state).
[0010] Optionally, in a possible implementation of the first aspect, the first running information includes at least one of the following: the number of at least one coroutine, different states of at least one coroutine at the application level, and duration of different states.
[0011] In this possible implementation, the first running information includes related information such as the coroutine state and the running time of the corresponding state. In this step, the timing of the relevant coroutines in different states is checked to provide developers with overhead information such as coroutine creation and scheduling, and to identify problematic coroutines (such as coroutines with large granularity and long running time, coroutines that are never executed after creation, and coroutines that are blocked for a long time).
[0012] Optionally, in a possible implementation of the first aspect, the above-mentioned second running information includes at least one of the following: kernel scheduling information and a first time slice of the thread corresponding to the first coroutine; the kernel scheduling information includes at least one of the following: different states of the thread corresponding to the first coroutine in the kernel state, the duration of different states, and processor information used by the thread corresponding to the first coroutine; the first time slice is used to reflect the time projection of the first coroutine on the thread.
[0013] In this possible implementation, the user-mode coroutine scheduling information and the kernel-mode thread scheduling information are integrated and displayed, so that the analysis of the time when the coroutine actually uses kernel resources is more accurate.
[0014] Optionally, in a possible implementation of the first aspect, the above steps: before displaying the first interface, the method also includes: displaying a third interface, the third interface including: the change process of the number of multiple coroutines in different states at the application level over time; displaying the first interface includes: displaying the first interface in response to the user's second operation on the third interface.
[0015] In this possible implementation, the execution status of the coroutine is displayed in layers according to the overall coroutine running information of the application (i.e., the content displayed in the third interface), the coroutine running information, and the thread running information, helping developers to quickly understand the macro and micro running status of the application.
[0016] Optionally, in a possible implementation manner of the first aspect, the second operation is used to determine a first time interval selected in the third interface, and the first interface displays operation information corresponding to the first time interval.
[0017] In this possible implementation, the first interface corresponding to the first time interval selected by the user can be displayed, thereby helping developers to more accurately determine the precise information of the actual processor usage in a certain execution time slice of the coroutine.
[0018] Optionally, in a possible implementation of the first aspect, the above step: before displaying the first interface, the method further includes: obtaining performance analysis data during the operation of the application, the performance analysis data being used to obtain the first operation information and the second operation information.
[0019] In this possible implementation, the performance analysis data obtained during the application's execution can provide users with coroutine / thread execution information, application parallelization execution summary, etc. This allows developers to view and analyze application-level coroutine information based on the performance analysis data.
[0020] Optionally, in a possible implementation of the first aspect, the first operation is an operation on the first coroutine in the first interface.
[0021] In this possible implementation, the user can view the coroutine view or the thread view corresponding to the coroutine through the first operation, thereby facilitating the user to analyze or handle coroutine / thread problems from different angles and improving tuning efficiency.
[0022] Optionally, in a possible implementation of the first aspect, the second interface is used by the user to analyze and process problems of the coroutine / thread.
[0023] In this possible implementation, by responding to the user's first operation, the thread view and the coroutine view are switched to each other, and then the coroutine / thread problem is analyzed or processed according to different views, thereby improving the tuning efficiency.
[0024] A second aspect of the present disclosure provides an interface display device that can be applied to scenarios such as coroutine / thread tuning. The interface display device includes: a display unit for displaying a first interface; the display unit is further configured to display a second interface in response to a user's first operation on the first interface; the first interface includes first running information of at least one coroutine, and the second interface includes second running information of the first coroutine in at least one coroutine on a thread; or the first interface includes second running information of the first coroutine in at least one coroutine on a thread, and the second interface includes the first running information of the at least one coroutine.
[0025] Optionally, in a possible implementation manner of the second aspect, the first running information includes at least one of the following: the number of at least one coroutine, different states of at least one coroutine at the application level, and duration of different states.
[0026] Optionally, in a possible implementation of the second aspect, the above-mentioned second running information includes at least one of the following: kernel scheduling information and a first time slice of the thread corresponding to the first coroutine; the kernel scheduling information includes at least one of the following: different states of the thread corresponding to the first coroutine in the kernel state, the duration of different states, and processor information used by the thread corresponding to the first coroutine; the first time slice is used to reflect the time projection of the first coroutine on the thread.
[0027] Optionally, in a possible implementation of the second aspect, the above-mentioned display unit is also used to display a third interface, and the third interface includes: the change process of the number of multiple coroutines in different states at the application level over time; the display unit is used to display the first interface, including: a display unit, specifically used to display the first interface in response to the user's second operation on the third interface.
[0028] Optionally, in a possible implementation manner of the second aspect, the second operation is used to determine a first time interval selected in the third interface, and the first interface displays operation information corresponding to the first time interval.
[0029] Optionally, in a possible implementation of the second aspect, the interface display device further includes: an acquisition unit, configured to acquire performance analysis data during the operation of the application, wherein the performance analysis data is used to acquire the first operation information and the second operation information.
[0030] Optionally, in a possible implementation of the second aspect, the first operation is an operation on the first coroutine in the first interface.
[0031] Optionally, in a possible implementation of the second aspect, the second interface is used by the user to analyze and process problems of the coroutine / thread.
[0032] The third aspect of the present disclosure provides an interface display device, including: a processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the interface display device implements the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0033] A fourth aspect of the present disclosure provides a computer-readable medium having a computer program or instruction stored thereon. When the computer program or instruction is executed on a computer, the computer executes the method in the aforementioned first aspect or any possible implementation of the first aspect.
[0034] A fifth aspect of the present disclosure provides a computer program product. When the computer program product is executed on a computer, it enables the computer to execute the method in the aforementioned first aspect or any possible implementation of the first aspect.
[0035] A sixth aspect of the present disclosure provides a chip system, which includes at least one processor for supporting an interface display device to implement the functions involved in the above-mentioned first aspect or any possible implementation manner of the first aspect.
[0036] In one possible design, the chip system may also include a memory for storing program instructions and data necessary for the interface display device. The chip system may consist of a single chip or may include a chip and other discrete components. Optionally, the chip system may also include an interface circuit that provides program instructions and / or data to at least one processor.
[0037] Among them, the technical effects brought about by the second, third, fourth, fifth, and sixth aspects or any possible implementation methods thereof can refer to the technical effects brought about by the first aspect or different possible implementation methods of the first aspect, and will not be repeated here.
[0038] It can be seen from the above technical solutions that the present disclosure has the following advantages: after the first interface is displayed, the second interface is displayed in response to the user's first operation on the first interface. Since the first interface is the running information of the coroutine, the second interface is the running information of the thread corresponding to the coroutine. Or the first interface is the running information of the thread corresponding to the coroutine, and the second interface is the running information of the coroutine. Therefore, the jump display of the coroutine interface and the thread interface can be realized through the first operation, so that the user can deeply discover and locate the problematic coroutine / thread at different levels (such as user state and kernel state). BRIEF DESCRIPTION OF THE DRAWINGS
[0039] FIG1 is a schematic diagram of the structure of the system architecture provided by the present disclosure;
[0040] FIG2 is a schematic diagram of the program tuning and observation process provided by the present disclosure;
[0041] FIG3 is a flow chart of an interface display method provided by the present disclosure;
[0042] FIG4A is an example diagram of a first interface provided by the present disclosure;
[0043] FIG4B is another example diagram of the first interface provided by the present disclosure;
[0044] FIG5A is an exemplary diagram of a first operation provided by the present disclosure;
[0045] FIG5B is another exemplary diagram of the first operation provided by the present disclosure;
[0046] FIG6A is an example diagram of a second interface provided by the present disclosure;
[0047] FIG6B is another example diagram of the second interface provided by the present disclosure;
[0048] FIG7 is another schematic flow chart of the interface display method provided by the present disclosure;
[0049] FIG8 is an example diagram of a third interface provided by the present disclosure;
[0050] FIG9 is an exemplary diagram of the second operation provided by the present disclosure;
[0051] FIG10 is a schematic structural diagram of an interface display device provided by the present disclosure;
[0052] FIG11 is another structural schematic diagram of the interface display device provided by the present disclosure. DETAILED DESCRIPTION
[0053] The present disclosure provides an interface display method and related devices for realizing the jump display of the coroutine interface and the thread interface, thereby enabling users to deeply discover and locate problematic coroutines / threads at different levels (such as user state and kernel state).
[0054] To facilitate understanding, the following first introduces the relevant terms and concepts mainly involved in this disclosure.
[0055] 1. Process
[0056] A process can refer to the running activity of a program with certain independent functions, serving as the vehicle for application execution. A process can also be understood as a running instance of an application, a dynamic execution of the application. For example, when a user runs the Notepad program, the user creates a process to house the code that makes up Notepad.exe and the dynamic link libraries it calls. A process is an independent unit used by the system for resource allocation and scheduling. Each process has its own memory space, and different processes are independent of each other. When a process runs in kernel space, it is in kernel state, while when it runs in user space, it is in user state. Specifically, a process can be moved from user state to kernel state through instructions (such as system call instructions).
[0057] 2. Threads
[0058] Threads are created within processes and can share the process's resources. A process contains at least one thread. A thread is the basic unit by which the system allocates processor time resources, or in other words, a unit of independent execution within a process. Threads are concurrency-enabled, meaning that a single process can support multiple concurrent threads. These threads share the process's memory space and can each execute different tasks concurrently. For example, one thread can write a file to disk, while another can receive and respond to user keystrokes without interfering with each other.
[0059] In a computer system, a thread is the basic unit of processor task scheduling and execution, and is scheduled by the operating system kernel.
[0060] 3. Coroutines
[0061] Coroutines are also known as user-mode lightweight threads. They can also be referred to as tasks, jobs, and so on. Coroutine scheduling is entirely controlled and completed in user mode, ultimately dispatching to the operating system kernel thread for execution. Coroutines are not intended to replace threads; rather, they require threads to carry them. In other words, threads are the carrier of coroutines, and multiple coroutines can share a single thread.
[0062] 4. Coroutine layered display
[0063] Coroutine layered display refers to displaying the runtime information of the coroutine from multiple levels, such as overall statistical information, thread-level information, and coroutine-level information.
[0064] 5. Profiling
[0065] Profiling refers to the program runtime information collected during program execution. It can be used to analyze where the program's runtime is primarily consumed, thereby effectively optimizing the program's operating efficiency.
[0066] Before introducing the method and related devices of the present disclosure in conjunction with the accompanying drawings, the system architecture provided by the present disclosure is first described.
[0067] 1 , an embodiment of the present invention provides a system architecture comprising three layers: user layer, kernel layer, and hardware layer.
[0068] Among them, the user layer includes at least one coroutine and a coroutine scheduler that schedules at least one coroutine. The kernel layer includes at least one kernel thread and a kernel scheduler that schedules at least one kernel thread. The hardware layer includes processors, field programmable gate arrays (FPGAs), etc. The above-mentioned processors may include at least one of the following: central processing unit (CPU), graphics processing unit (GPU), neural-network processing unit (NPU), tensor processing unit (TPU) and other XPUs. The coroutine scheduler determines the order in which the coroutines run (each thread can run one at the same time). The thread scheduler is an operating system service that is responsible for allocating CPU time to threads in the ready (Runnable) state.
[0069] In the case where at least one coroutine is multiple coroutines, the multiple coroutines share the time slice allocated to the thread by the operating system, thereby achieving the purpose of fully utilizing the hardware (such as the CPU).
[0070] It is understandable that the user layer may also be referred to as user state or user space, etc. The kernel layer may also be referred to as kernel state or kernel space, etc. The hardware layer may also be referred to as hardware execution unit, etc.
[0071] In addition, Figure 2 shows the user's program tuning and observation process. This process includes: device-side data collection, data analysis and processing, and visual observation.
[0072] Among them, device-side data collection mainly includes: collecting CPU / operating system (OS) scheduling information, coroutine information, etc. Data analysis and processing mainly include: parsing the above-collected data, visualization preprocessing (such as format adjustment, data pairing and completion, information statistics calculation, etc.), etc. Visual observation mainly includes: displaying the above-processed data on the user interface (UI), and interacting with the user through the UI interface, etc. The interface display method provided by the present disclosure is mainly used in the above-mentioned visualization observation process.
[0073] Currently, mainstream modern languages, including Go, Kotlin, C++20, Rust, and Swift, all support coroutines. Coroutines are widely used in development scenarios, including mobile phones and tablets, communication and computing applications, and cloud service applications. Currently, coroutine tuning relies on traditional methods, lacking the ability to efficiently and deeply observe and analyze coroutines. This makes it difficult for developers to identify issues at the coroutine level, resulting in low analysis accuracy, weak connectivity and interaction between threads and coroutines, low tuning efficiency, and a poor tuning experience.
[0074] In order to solve the above technical problems, the present disclosure provides an interface display method. It provides the ability to quickly switch / jump between thread view and coroutine view, so that users can discover and locate coroutine problems in depth layer by layer. Specifically, after the first interface is displayed, the second interface is displayed in response to the user's first operation on the first interface. Since the first interface is the running information of the coroutine, the second interface is the running information of the thread corresponding to the coroutine. Or the first interface is the running information of the thread corresponding to the coroutine, and the second interface is the running information of the coroutine. Therefore, the jump display of the coroutine interface and the thread interface can be realized through the first operation, so that the user can deeply discover and locate the problematic coroutine / thread at different levels (such as user state and kernel state).
[0075] The interface display method provided by the present disclosure is described below. The method can be executed by an interface display device, or by a component of the interface display device (such as a processor, a chip, or a chip system, etc.). The interface display device can be a server or a terminal device. Of course, the method can also be executed by a system consisting of a server and a terminal device. The method can be applied to scenarios such as coroutine / thread tuning.
[0076] The interface display device in the present disclosure may be a server or a terminal device. The server may be a cloud server, a network server, an application server, a management server, etc. The terminal device may be a mobile phone (e.g., a mobile phone with a foldable screen or a mobile phone without a foldable screen), a tablet computer (pad), a portable game console, a personal digital assistant (PDA), a laptop computer, an ultra mobile personal computer (UMPC), a handheld computer, a netbook, an in-vehicle media player, a wearable electronic device, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, and other digital display products.
[0077] Please refer to FIG. 3 , which is a flowchart of an interface display method provided by the present disclosure. The method may include step 301 and step 302 .
[0078] Step 301: Display the first interface.
[0079] In the present disclosure, the interface display device displays a first interface, which may be a tuning interface of an application installed in the interface display device, or an interface of an application installed in other devices and tuned on the electronic device, etc., and is not limited here.
[0080] In one possible implementation, the first interface includes first operation information of at least one coroutine (the first interface in this case can also be understood as a coroutine view). The first operation information includes at least one of the following: the number of the at least one coroutine, different states of the at least one coroutine at the application level, and the duration of different states. The at least one coroutine includes the first coroutine and other coroutines, or the at least one coroutine is the first coroutine.
[0081] The aforementioned states may include at least one of the following: ready state, running state, blocked state, etc. A coroutine in the ready state can be understood as a coroutine to be run, a coroutine in the running state can be understood as a coroutine currently running, and a coroutine in the blocked state can be understood as a coroutine having difficulty running, a scheduling anomaly, etc. The names and meanings of the states in this disclosure can be set according to actual needs and are not specifically limited here.
[0082] Example 1, the first interface in this case can be as shown in Figure 4A, which includes the first running information of at least one coroutine. The at least one coroutine shown in Figure 4A includes t1 and t2, and t1 includes sub-coroutines: t1.1, t1.2 and t1.3. T2 includes sub-coroutines: t2.1 and t2.2. Or it can be understood that coroutine t1 depends on the running results of sub-coroutines t1.1, t1.2 and t1.3, and t2 depends on the execution results of sub-coroutines t2.1 and t2.2. Among them, coroutines t1 and t2 are displayed in different states (such as the ready state, running state and blocked state in Figure 4A) and the corresponding durations of different states.
[0083] It is understandable that FIG4A is only an example. In actual applications, the first interface may further include first running information of a coroutine.
[0084] In another possible implementation, the first interface includes second execution information of a first coroutine in at least one coroutine on a thread (the first interface in this case may also be understood as a thread view). The second execution information includes at least one of the following: kernel scheduling information of the thread corresponding to the first coroutine, a first time slice, and a load condition of the thread executing the coroutine. The at least one coroutine includes the first coroutine and other coroutines, or at least one coroutine is the first coroutine.
[0085] The kernel scheduling information includes at least one of the following: different kernel states of the thread corresponding to the first coroutine, durations of different states, and processor information used by the thread corresponding to the first coroutine. The processor information may include processor hardware information (e.g., frequency, model, serial number, big / small core identifier, etc.), processor runtime, etc.
[0086] Example 2, the first interface in this case can be as shown in Figure 4B, and the first interface includes the second running information of the first coroutine in at least one coroutine on the thread. The first interface shown in Figure 4B includes the kernel scheduling information of the thread and the first time slice (or understood as the time projection of one or more coroutines running on the thread, the load situation of the thread executing the coroutine, etc.). The first time slice of the thread can correspond to at least one coroutine (including the first coroutine). Among them, the kernel scheduling information shows the status of the corresponding thread (such as the runnable state, running state and blocked state in Figure 4B) and the duration corresponding to different states (not shown in Figure 4B). The first time slice includes two states (such as the state of the thread with loaded coroutine and the state of the thread without loaded coroutine in Figure 4B).
[0087] Step 302: Display a second interface in response to a first operation performed by the user on the first interface.
[0088] After the interface display device displays the first interface, the user can perform a first operation on the first interface. Correspondingly, the interface display device displays a second interface in response to the user's first operation on the first interface. The user can be a software user or a user, etc., and the specific details are not limited here. The above-mentioned first interface and / or second interface can be used by the user to analyze and handle problems with coroutines / threads.
[0089] The user in this disclosure may refer to the user, developer, operation and maintenance personnel of the program, etc., and is not limited here.
[0090] In one possible implementation, the second interface includes second execution information of a first coroutine in at least one coroutine on a thread. In another possible implementation, the second interface includes first execution information of at least one coroutine. For a description of the first and second execution information, reference can be made to the description in step 301 above and will not be repeated here.
[0091] When the first interface is a coroutine view, the first operation is an operation on the first coroutine in the first interface. When the first interface is a thread view, the first operation is an operation on the thread time slice in the first interface.
[0092] The operations in the present disclosure (such as the first operation, the subsequent second operation, etc.) can be touch screen operations of the pointer on the display interface, voice operations, air operations, etc., and are not specifically limited here.
[0093] For example, continuing with Example 1 above, the interface display device displays the first interface shown in FIG4A. The user observes that coroutine t2 has been in a running state for a long time and wishes to learn more about the running status of coroutine t2 on the thread. As shown in FIG5A, the user can click (e.g., operation 501) or select (e.g., operation 502) on the running status of coroutine t2 in the first interface. In response to the user's operation, the interface display device displays a second interface as shown in FIG6A. The second interface is used to display the second running information of the thread where coroutine t2 is located. One lane in FIG6A shows the kernel scheduling status of the thread, and another lane shows the first time slice (or the time projection of the coroutine running on the thread, the load status of the thread executing the coroutine, etc.). That is, the user can use the second interface to view the actual CPU utilization of the coroutine at the thread level, view the first time slice of the thread for coroutine t2, and view the kernel scheduling and running information of the thread within the first time slice, and further obtain the actual time that coroutine t2 is using the CPU (i.e., the running status shown in FIG6A).
[0094] In Example 1, users can view the time spent by coroutines in different states. This provides users with overhead information such as coroutine creation and scheduling, allowing users to identify problematic coroutines (such as large-scale and time-consuming coroutines, coroutines that are never executed after creation, and coroutines that are blocked for a long time). It also allows users to jump to the thread load display by the coroutine's running status range. In addition, it also provides on-demand display of coroutine-level visual information, allowing users to focus on and analyze surviving coroutines within a certain time range by selecting a time period, filtering business names, and other means, allowing for a more detailed analysis of the operation of these coroutines.
[0095] Exemplarily, continuing with Example 2 above, the interface display device displays the first interface as shown in FIG4B . The user can view the kernel scheduling information of the thread and the duration of whether the thread is loaded with a coroutine (not shown in the figure) through the first interface shown in FIG4B . As shown in FIG5B , the user clicks (for example, operation 503 ) or selects (for example, operation 504 ) the state of the thread with a loaded coroutine. In response to the user's operation, the interface display device determines that the first coroutine is t2 and displays the second interface as shown in FIG6B . The second interface includes the first running information (for example, the number of coroutines, the different states of the coroutines, and the duration of the different states) of the coroutine t2 loaded on the thread and the sub-coroutines (t2.1 and t2.2) of the coroutine t2. Of course, FIG6B is only an example of the second interface. In actual applications, FIG6B may only display the running information of the first coroutine, or may display the running information of the first coroutine and the sub-coroutine corresponding to the first coroutine, or may display the running information of the coroutines near the timeline, the running information of the coroutines with similar priorities, the running information of the coroutines with similar coroutine identifiers, etc., which are not limited to the specific ones here.
[0096] It is understandable that Figure 5B is just an example of interaction. In actual applications, the interface display device can also provide the user with which coroutines correspond to the first time slice based on Figure 5B, and then determine the first coroutine according to the user's selection operation, thereby displaying the running information of the first coroutine. For example, the first operation includes moving and selecting operations. When the user moves the mouse to the first time slice, the interface will add the coroutine t2 corresponding to the first time slice and other coroutines, and then respond to the user's selection of t2 to display the running information of t2.
[0097] In addition, the first interface and / or the second interface mentioned above are used by the user to analyze and handle problems of the coroutine / thread.
[0098] For threads, users can perform the following analysis and processing through the first interface and / or the second interface: thread load (such as the number of coroutines, scheduling throughput of coroutines, etc.), whether the thread priority issues meet the Quality of Service (QoS) / network Service Level Agreement (SLA) requirements, etc.
[0099] For coroutines, users can perform the following analysis and processing through the first interface and / or the second interface: whether the ratio of the actual execution time of the coroutine to its life cycle is too small, or whether the running time of the coroutine is too long.
[0100] In addition, the timelines of the first interface and the second interface can be shared, that is, the user can observe the running information and tuning information through the shared timeline of the coroutine view and the thread view.
[0101] The interface display method provided by the present disclosure, on the one hand, provides the ability to quickly switch / jump between the thread view and the coroutine view, helping users to quickly switch between the thread level and the coroutine level when observing the coroutine running information, avoiding users from being trapped in a large amount of coroutine information, and helping users to deeply discover and locate coroutine problems layer by layer. On the other hand, the thread view includes the kernel scheduling information of the thread and the scheduling execution information of the coroutine on the thread. That is, the fusion display based on the kernel scheduling information of the thread and the user-state coroutine scheduling information can accurately display the effective running time of the coroutine, helping users to further analyze and locate the problem coroutine. It makes the analysis of the actual use of CPU resources by the coroutine more accurate. The jump display of the coroutine interface and the thread interface can be realized through the first operation, so that users can deeply discover and locate problematic coroutines / threads at different levels (such as user state and kernel state).
[0102] In addition, the aforementioned coroutine view can also integrate the coroutine's individual execution time slices with the execution time slices of its executing thread. This helps users more accurately determine the precise information about the actual CPU usage during a coroutine's execution time slice. The coroutine view can also associate a coroutine's individual execution time slice with its executing thread's priority and quality of service. This helps users accurately determine whether the coroutine's execution priority and quality of service meet expectations.
[0103] The thread view described above helps users quickly check the load and utilization of threads executing coroutines, further identifying potential issues. Because the thread view displays kernel-mode scheduling and execution information for threads actually executing coroutines, combined with information such as CPU frequency and heterogeneous core sizes, it enables more accurate analysis of coroutine execution on threads. It also provides the ability to jump to the coroutine lifecycle using the coroutine's time slice on the thread.
[0104] Furthermore, the interface display device can also display application-level coroutine statistics. Detailed description is given below in conjunction with FIG7 . The process may include steps 701 to 704 .
[0105] Step 701: Acquire performance analysis data during the running of the application.
[0106] In this disclosure, there are multiple ways for an interface display device to obtain performance analysis data. This disclosure only uses the interface display device's own acquisition method as an example for illustration. It is understood that in actual applications, the method may also be receiving data sent by other devices, selecting data from a database, etc., and the specific methods are not limited here.
[0107] The interface display device obtains performance analysis data during the execution of the application. This performance analysis data is used to obtain the operation information of the coroutine and the operation information of the thread corresponding to the coroutine. For example, this performance analysis data is used to obtain the first operation information and the second operation information in the embodiment shown in Figure 3 above. For the description of the first operation information and the second operation information, please refer to the description of the embodiment shown in Figure 3 above, and will not be repeated here.
[0108] The aforementioned performance analysis data can be understood as application profiling information. Furthermore, the performance analysis data can directly include the first and second operating information. Alternatively, the first and second operating information can be obtained by first acquiring a small amount of data and then processing (e.g., supplementing, restoring, counting, or completing) the small amount of data.
[0109] For example, the pseudo code of the coroutine program is as follows:
[0110] The main function creates two coroutines, t1 and t2. T1 creates three coroutines, t1.1, t1.2, and t1.3. T2 creates two coroutines, t2.1 and t2.2. These coroutines can execute concurrently. Because t1 depends on the results of t1.1, t1.2, and t1.3, and t2 depends on the results of t2.1 and t2.2, the main function depends on the results of t1 and t2.
[0111] Step 702: Display the third interface.
[0112] The interface display device may display a third interface, which includes: a process in which the number of multiple coroutines in different states at the application level changes over time.
[0113] Optionally, the user can use the third interface to quickly observe the concurrent execution of coroutines, identify time intervals where potential coroutine concurrency issues exist, and so on.
[0114] Optionally, the information displayed in the third interface can be obtained by processing the profiling information in step 701. For example, the profiling information is imported into the tuning tool for visual display. For example, after the developer imports the profiling information, based on the overall operation of the coroutine application, the operation status of the selected coroutine at the coroutine level can be displayed on demand in the interface through the filtering capability.
[0115] Exemplarily, the third interface displayed by the interface display device is shown in FIG8 . The third interface includes the process of the number of multiple coroutines changing over time in different states at the application level. The overall operation status of the coroutines shown in FIG8 includes the process of the total number of coroutines changing over time, the process of the number of ready coroutines changing over time, the process of the number of running coroutines changing over time, and the process of the number of blocked coroutines changing over time. In order to facilitate the analysis of coroutine / thread problems, there can also be a timeline above the lane in FIG8 , and the timeline can be shared. That is, when observing data at different levels (for example, application level, thread level, coroutine level), the same timeline is used.
[0116] Step 703: Display the first interface in response to the user's second operation on the third interface.
[0117] After the interface display device displays the third interface to the user, the user can perform a second operation on the third interface. Correspondingly, the interface display device displays the first interface in response to the user's second operation on the third interface.
[0118] The second operation is used to determine the first time interval selected in the third interface. It is understandable that the second operation can be a selection operation, an input time interval operation, etc., which is not specifically limited here.
[0119] For example, continuing with the example of FIG8 , the user finds that the number of running coroutines in FIG8 remains unchanged for a long time, that is, the concurrency has not increased.
[0120] As shown in Figure 9, the user performs a selection operation on the running coroutine (for example, operation 901). The first time interval from time point 1 to time point 5 is selected. The interface display device responds to the user's operation and displays the first interface as shown in Figure 4A. The user can then view the time usage of the relevant coroutines in different states according to the first interface shown in Figure 4A, and provide the user with overhead information such as the creation and scheduling of the coroutine, and identify coroutines with problems (such as coroutines with large granularity and long time consumption, coroutines that have not been executed after creation, coroutines that have been blocked for a long time, etc.).
[0121] It is understandable that the above example in which the user views the coroutine view through the second operation on the third interface is just an example. In actual applications, the user can also display the thread view, etc. through operations on the third interface, which is not limited here.
[0122] Step 704: Display the second interface in response to the user's first operation on the first interface.
[0123] Step 704 is similar to step 302 in the aforementioned embodiment and will not be described again here.
[0124] The embodiment shown in FIG7 can be understood as the embodiment shown in FIG3 , in which the interface display device can also obtain performance analysis data and display a third interface before step 301. Step 301 specifically involves displaying the first interface in response to the user's second operation on the third interface.
[0125] The third interface allows users to analyze thread / coroutine issues, such as whether the concurrency of the coroutine meets expectations, or whether the number of ready coroutines remains high for a long time.
[0126] In this embodiment, the user can view the overall operation status of the coroutine through the third interface. On the one hand, the user can view the concurrency of the coroutine and other issues according to the third interface. On the other hand, the user can also jump from the third interface to the coroutine view / thread view through the second operation, and then view the coroutine / thread problems at multiple levels. On the other hand, according to the hierarchical relationship between the overall operation status of the application, the scheduling status of user-mode coroutines and kernel-mode threads, and the operation status of the coroutine level, the execution status of the coroutine is displayed in layers, helping developers to quickly understand the macro and micro operation status of the application.
[0127] The interface display method in the present disclosure is described above, and the interface display device in the present disclosure is described below. The interface display device can be a terminal device or a server, etc., and the specific details are not limited here.
[0128] Referring to FIG. 10 , an embodiment of an interface display device in the present disclosure includes:
[0129] Display unit 1001, used to display the first interface;
[0130] The display unit 1001 is further configured to display a second interface in response to a first operation performed by a user on the first interface;
[0131] The first interface includes first running information of at least one coroutine, and the second interface includes second running information of a first coroutine in the at least one coroutine on a thread; or
[0132] The first interface includes second running information of a first coroutine in at least one coroutine on a thread, and the second interface includes first running information of at least one coroutine.
[0133] Optionally, the first running information includes at least one of the following: the number of at least one coroutine, different states of at least one coroutine at the application level, and duration of different states.
[0134] Optionally, the second running information includes at least one of the following: kernel scheduling information and a first time slice of the thread corresponding to the first coroutine; the kernel scheduling information includes at least one of the following: different states of the thread corresponding to the first coroutine in the kernel state, the duration of different states, and processor information used by the thread corresponding to the first coroutine; the first time slice is used to reflect the time projection of the first coroutine on the thread.
[0135] Optionally, the display unit 1001 is also used to display a third interface, which includes: the change process of the number of multiple coroutines in different states at the application level over time; the display unit 1001 is used to display the first interface, including: the display unit 1001 is specifically used to display the first interface in response to the user's second operation on the third interface.
[0136] Optionally, the second operation is used to determine the first time interval selected in the third interface, and the first interface displays the operation information corresponding to the first time interval.
[0137] Optionally, the interface display device further includes: an acquisition unit 1002, configured to acquire performance analysis data during the running of the application, wherein the performance analysis data is used to acquire the first running information and the second running information.
[0138] Optionally, the first operation is an operation on the first coroutine in the first interface.
[0139] Optionally, the second interface is used for users to analyze and handle problems with coroutines / threads.
[0140] In this embodiment, the operations performed by each unit in the interface display device are similar to those described in the embodiments shown in Figures 1 to 9 above, and will not be repeated here.
[0141] In this embodiment, the display unit 1001 can realize the rapid switching / jump display of the coroutine interface and the thread interface through the user's first operation, thereby allowing the user to deeply discover and locate problematic coroutines / threads at different levels (such as user state and kernel state).
[0142] Referring to FIG11 , a schematic diagram of the structure of another interface display device provided by the present disclosure is shown. The interface display device may include a processor 1101, a memory 1102, and a communication port 1103. The processor 1101, the memory 1102, and the communication port 1103 are interconnected via a circuit. The memory 1102 stores program instructions and data.
[0143] The memory 1102 stores program instructions and data corresponding to the steps executed by the interface display device in the corresponding implementation modes shown in FIG. 1 to FIG. 9 .
[0144] The processor 1101 is configured to execute the steps performed by the interface display device as shown in any of the embodiments shown in FIG. 1 to FIG. 9 .
[0145] The communication port 1103 can be used to receive and send data, and to execute the acquisition-related steps in any of the embodiments shown in FIG. 1 to FIG. 9 .
[0146] In one implementation, the interface display device may include more or fewer components than those shown in FIG. 11 . This disclosure is merely an illustrative description and does not limit this.
[0147] The present disclosure also provides a computer-readable storage medium storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes a method as a possible implementation of the interface display device in the aforementioned embodiment.
[0148] The present disclosure also provides a computer program product (or computer program) storing one or more computers. When the computer program product is executed by the processor, the processor executes the method of the possible implementation of the above-mentioned interface display device.
[0149] The present disclosure also provides a chip system, which includes at least one processor for supporting the functions involved in the possible implementation of the above-mentioned interface display device. Optionally, the chip system also includes an interface circuit that provides program instructions and / or data to at least one processor. In one possible design, the chip system may also include a memory for storing the necessary program instructions and data for the interface display device. The chip system can be composed of a chip or can include a chip and other discrete devices.
[0150] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0151] In the several embodiments provided in the present disclosure, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interfaces, devices or units, which can be electrical, mechanical or other forms.
[0152] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0153] In addition, the functional units in the various embodiments of the present disclosure may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0154] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present disclosure is essentially or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
Claims
1. An interface display method, characterized in that: The method comprises: Display the first interface; In response to a first operation of the user on the first interface, displaying a second interface; The first interface includes first running information of at least one coroutine, and the second interface includes second running information of a first coroutine of the at least one coroutine on a thread; or The first interface includes second running information of a first coroutine of the at least one coroutine on a thread, the second interface includes first running information of the at least one coroutine, and the first coroutine is determined according to the first operation.
2. The method according to claim 1, characterized in that The first running information includes at least one of the following: the number of the at least one coroutine, different states of the at least one coroutine at the application level, and duration of the different states.
3. The method according to claim 1 or 2, characterized in that: The second running information includes at least one of the following: kernel scheduling information and a first time slice of the thread corresponding to the first coroutine; the kernel scheduling information includes at least one of the following: different states of the thread corresponding to the first coroutine in the kernel state, the duration of the different states, and processor information used by the thread corresponding to the first coroutine; the first time slice is used to reflect the time projection of the first coroutine on the thread.
4. The method according to any one of claims 1 to 3, characterized in that Before displaying the first interface, the method further includes: Displaying a third interface, the third interface including: a process in which the number of multiple coroutines in different states at the application level changes over time; The displaying of the first interface includes: In response to a second operation performed by the user on the third interface, the first interface is displayed.
5. The method according to claim 4, characterized in that The second operation is used to determine a first time interval selected in the third interface, and the first interface displays operation information corresponding to the first time interval.
6. The method according to any one of claims 1 to 5, characterized in that Before displaying the first interface, the method further includes: Performance analysis data is obtained during the running of the application, and the performance analysis data is used to obtain the first running information and the second running information.
7. The method according to any one of claims 1 to 6, characterized in that The first operation is an operation on the first coroutine in the first interface.
8. The method according to any one of claims 1 to 7, characterized in that The second interface is used by the user to analyze and process problems of the coroutine / thread.
9. An interface display device, characterized in that: The interface display device comprises: A display unit, used to display a first interface; The display unit is further configured to display a second interface in response to a first operation of a user on the first interface; The first interface includes first running information of at least one coroutine, and the second interface includes second running information of a first coroutine of the at least one coroutine on a thread; or The first interface includes second running information of a first coroutine in the at least one coroutine on a thread, and the second interface includes first running information of the at least one coroutine.
10. The interface display device according to claim 9, characterized in that: The first running information includes at least one of the following: the number of the at least one coroutine, different states of the at least one coroutine at the application level, and duration of the different states.
11. The interface display device according to claim 9 or 10, characterized in that: The second running information includes at least one of the following: kernel scheduling information and a first time slice of the thread corresponding to the first coroutine; the kernel scheduling information includes at least one of the following: different states of the thread corresponding to the first coroutine in the kernel state, the duration of the different states, and processor information used by the thread corresponding to the first coroutine; the first time slice is used to reflect the time projection of the first coroutine on the thread.
12. The interface display device according to any one of claims 9 to 11, characterized in that: The display unit is further used to display a third interface, wherein the third interface includes: a process in which the number of multiple coroutines in different states at the application level changes over time; The display unit is used to display the first interface, including: The display unit is specifically configured to display the first interface in response to a second operation of the user on the third interface.
13. The interface display device according to claim 12, characterized in that: The second operation is used to determine a first time interval selected in the third interface, and the first interface displays operation information corresponding to the first time interval.
14. The interface display device according to any one of claims 9 to 13, characterized in that: The interface display device also includes: The acquisition unit is used to acquire performance analysis data during the operation of the application program, wherein the performance analysis data is used to acquire the first operation information and the second operation information.
15. The interface display device according to any one of claims 9 to 14, characterized in that: The first operation is an operation on the first coroutine in the first interface.
16. The interface display device according to any one of claims 9 to 15, characterized in that: The second interface is used by the user to analyze and process problems of the coroutine / thread.
17. An interface display device, characterized in that: include: A processor, the processor is coupled to a memory, the memory is used to store programs or instructions, when the program or instructions are executed by the processor, the interface display device executes the method as described in any one of claims 1 to 8.
18. A computer storage medium, characterized in that: The method comprises computer instructions, which, when executed on a computer, cause the computer to execute the method according to any one of claims 1 to 8.
19. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Interface display method and related equipment
CN119025198A
Coroutine monitoring method and apparatus
CN106598801A
Design support device and design support method
JP2016146148A
Analysis of thread synchronization events
US20090319996A1
Analysis and timeline visualization of thread activity
US20110099539A1
