Data switching method and device during display space change
Through the caching mechanism and display type switching method, the problem of interface lag when displaying a large amount of data is solved, and the interface fluency and user experience are improved.
Patent Information
- Application Number
- CN202311547230.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-17
- Publication Date
- 2025-05-30
AI Technical Summary
When the prior art displays a large amount of data, it leads to problems such as stuttering when displaying the interface, not moving smoothly, dragging, and untimely interface response.
By obtaining the timing interval to be displayed, the corresponding tasks and instructions are written to the cache, and the display type is switched according to the change in the display size, the corresponding tasks or instructions are obtained from the cache for display, and the data in the cache is updated according to the change in the timing interval.
It reduces the delay in data acquisition, avoids data overlap, improves interface fluency and user experience, and realizes dynamic switching of different displayed data.
Smart Images

Figure CN120066625A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data display, and in particular to a method and apparatus for data switching when the display space changes. Background Art
[0002] A Human Machine Interface (HMI) can present internal system data and data relationships on a screen, specifically in a dynamic or static manner. In the field of graphics processing unit (GPU) or other chip R & D, chip developers can understand the system operation status by observing and analyzing the graphical display of chip operation data, so as to discover problems or verify new features. However, due to the huge amount of chip instruction data, the interface rendering takes a long time, and high requirements are imposed on the smoothness and timeliness during data display and switching in the HMI.
[0003] Because the amount of data to be displayed is large and there is a lot of information to be shown, currently, there is a trend for HMI interfaces to become larger and more numerous, by using a larger display screen or by splicing multiple display screens to meet the display requirements of more data. However, screen hardware is limited by cost and space, and it is impossible to increase indefinitely with the increase of information. Therefore, only part of the data is displayed in the screen space, and a software mechanism is used to switch the display data in the screen space by changing the size and area of the display control, so as to increase the displayed information volume, which is also an efficient expansion method.
[0004] On the other hand, in similar chip performance analysis software such as GPU, a large amount of data needs to be processed during data analysis, and there is a strong correlation and timing between the data. However, the planar space and the layout space of the tool window are limited, and displaying too much information at the same position and the same time will cause interface overlap and compression, resulting in unrecognizability. Therefore, it is also necessary to switch the display data to solve the problem of unrecognizability caused by interface overlap or compression.
[0005] On the other hand, in order to more intuitively display data to users, the data can also be processed by statistical analysis or graphing, etc., and displayed in different forms. However, the calculation and analysis of a large amount of data may cause interface lag, and when changing different display forms, it is also necessary to change the display content in the display space.
[0006] In the above scenarios, when changing or switching a large amount of display data, it will cause situations such as interface lag, unsmooth movement, ghosting, and untimely interface response during interface display.
[0007] In view of this, how to overcome the defects existing in the prior art and solve the problem of poor display effect caused by the change of display data in the prior art is a problem to be solved in this technical field. Summary of the Invention
[0008] In view of the above defects or improvement requirements of the prior art, the present invention solves the problem of poor display effect caused by the change of display data.
[0009] The embodiments of the present invention adopt the following technical solutions:
[0010] In a first aspect, the present invention provides a data switching method when the display space changes, specifically: obtaining the timing interval to be displayed, writing the tasks corresponding to the timing interval and the instructions included in the tasks into the cache; obtaining the change in the display size, switching the display type according to the changed display size, obtaining the tasks or instructions in the corresponding timing interval in the cache according to the display type, and displaying the obtained tasks or instructions; wherein, the display type includes: displaying task data and displaying instruction data; obtaining the change in the timing interval, obtaining the tasks or instructions in the changed timing interval from the cache, displaying the obtained tasks or instructions, and updating the tasks and instructions in the cache according to the changed timing interval.
[0011] Preferably, the step of writing the tasks corresponding to the timing interval and the instructions included in the tasks into the cache specifically includes: using the timing interval to be displayed as the current timing interval, obtaining the tasks and instructions in the current timing interval, the previous timing interval of the current timing interval, and the next timing interval of the current timing interval from the data source; associating each obtained task with the instructions included in the corresponding task, and caching the associated tasks and instructions respectively according to the timing interval where they are located.
[0012] Preferably, the step of associating each obtained task with the instructions included in the corresponding task specifically includes: setting a unique task ID for each task, setting the same instruction ID for the instructions included in each task, and associating the task ID of each task with the instruction ID of the instructions in the corresponding task, so as to find the corresponding instruction ID through the task ID.
[0013] Preferably, the step of writing the tasks corresponding to the timing interval and the instructions included in the tasks into the cache specifically includes: when the number of instructions and / or tasks in the timing interval is greater than the specified display quantity threshold, dividing the instructions and / or tasks in the timing interval into at least two batches, and writing the instructions and / or tasks in each batch into the cache respectively.
[0014] Preferably, the switching of the display type according to the changed display size specifically includes: when the magnification ratio of the display size is greater than the magnification threshold, switching the display type to display instruction data; when the reduction ratio of the display size is less than the reduction threshold, switching the display type to display task data; when the magnification ratio of the display size is less than or equal to the magnification threshold, or the reduction ratio of the display size is greater than or equal to the reduction threshold, the current display type is not switched.
[0015] Preferably, when the display type is switched, the switching of the display type according to the changed display size further includes: putting the cache where the data corresponding to the display type before switching is located into sleep, and activating the cache where the data corresponding to the display type after switching is located.
[0016] Preferably, obtaining the tasks or instructions in the corresponding time series interval in the cache according to the display type and displaying the obtained tasks or instructions specifically includes: when the display type is display task data, obtaining all the tasks in the time series interval to be displayed from the cache and displaying the tasks in the order of the time series interval; when the display type is display instruction data, obtaining all the instructions in the time series interval to be displayed from the cache and displaying the instructions in the order of the time series interval.
[0017] Preferably, obtaining the tasks or instructions in the changed time series interval from the cache specifically includes: judging whether the cache contains the tasks and / or instructions in the changed time series interval according to the start time series and the end time series of all the time series intervals in the cache; when the cache contains the tasks and / or instructions in the changed time series interval, obtaining the tasks and instructions in the changed time series interval from the cache; when the cache does not contain the tasks and / or instructions in the changed time series interval, requesting the tasks and instructions in the corresponding time series interval from the data source, caching them, and then obtaining the tasks and instructions in the corresponding time series interval from the cache.
[0018] Preferably, updating the tasks and instructions in the cache according to the changed time series interval specifically includes: using the changed time series interval, the previous time series interval of the changed time series interval, and the next time series interval of the changed time series interval as the time series intervals to be cached, and judging whether any of the time series intervals to be cached is the same as or adjacent to any of the time series intervals in the cache; when the judgment passes, obtaining the instructions or tasks in one or more time series intervals to be cached that are not in the cache, and writing the obtained tasks and instructions into the cache; when the judgment fails, clearing all the data in the cache, obtaining the tasks and instructions in all the time series intervals to be cached, and writing the obtained tasks and instructions into the cache.
[0019] On the other hand, the present invention provides a data switching device for displaying spatial changes, specifically including at least one processor and a memory. The at least one processor and the memory are connected through a data bus. The memory stores instructions executable by the at least one processor. After the instructions are executed by the processor, they are used to complete the data switching method for displaying spatial changes in the first aspect.
[0020] Compared with the prior art, the beneficial effects of the present invention are as follows: caching the data to be displayed according to the required display time sequence interval, and updating the data in the cache according to the change of the time sequence interval to reduce the latency of data acquisition.
[0021] In the preferred solution, the data of the previous time sequence interval and the next time sequence interval are also cached to further reduce the latency of data acquisition. On the other hand, the tasks and the data in the tasks are displayed separately according to the display size to avoid data overlap; and the display type is automatically switched according to the change of the display size to match the viewing needs of different ranges. Through the method provided by the present invention, the dynamic switching of different display data can be completed according to the change of the display requirement, and the interface fluency and user experience are improved relying on the data preprocessing and caching mechanism. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments of the present invention. Obviously, the following described drawings are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 It is a flowchart of a data switching method for displaying spatial changes provided by an embodiment of the present invention;
[0024] Figure 2 It is a schematic diagram of the display type switching process in the method provided by an embodiment of the present invention;
[0025] Figure 3 It is another flowchart of a data switching method for displaying spatial changes provided by an embodiment of the present invention;
[0026] Figure 4 It is a schematic diagram of the process of acquiring the data to be displayed in the method provided by an embodiment of the present invention;
[0027] Figure 5 It is a schematic diagram of the display type switching process in the method provided by an embodiment of the present invention;
[0028] Figure 6 It is a schematic diagram of the tasks to be displayed in a certain actual scenario in the method provided by an embodiment of the present invention;
[0029] Figure 7 It is a task instruction diagram that needs to be displayed in a certain actual scenario in the method provided by the embodiment of the present invention;
[0030] Figure 8 It is a schematic diagram of the cache activation process when the display type is switched in the method provided by the embodiment of the present invention;
[0031] Figure 9 It is a flowchart of another data switching method when the display space changes provided by the embodiment of the present invention;
[0032] Figure 10 It is a flowchart of another data switching method when the display space changes provided by the embodiment of the present invention;
[0033] Figure 11 It is a schematic diagram of a data cache update method in the method provided by the embodiment of the present invention;
[0034] Figure 12 It is a schematic diagram of the structure of a data switching device when the display space changes provided by the embodiment of the present invention;
[0035] Among them, the reference numerals are as follows:
[0036] 11: Processor; 12: Memory. Detailed implementation manners
[0037] In order to make the purpose, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0038] The present invention is an architecture of a specific function system. Therefore, in specific embodiments, the functional logical relationships of each structural module are mainly described, and the specific software and hardware implementation manners are not limited.
[0039] In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other. The present invention will be described in detail below with reference to the drawings and embodiments.
[0040] When a large amount of data is displayed, it is usually impossible to clearly display all the data in the limited screen display space. Therefore, when data is displayed, only part of the data is displayed in the current display control, and the user changes the display space by means of dragging, zooming, menu selection, etc. to realize the switching of the displayed data. The change of the display space and the data switching will trigger the redrawing of the HMI, and the redrawing of a large amount of data will cause problems such as visual incoherence or untimely HMI response during the change.
[0041] In an embodiment of the present invention, the display process of the running data in the GPU chip performance analysis scenario is taken as an example for illustration. In actual implementation, the method provided by the embodiment of the present invention can be applied to various different types of data display scenarios, and the method provided by the embodiment of the present invention can be adaptively adjusted during the implementation process.
[0042] The process of GPU rendering a picture can be divided into multiple rendering tasks, and a single rendering task is composed of a very large number of instruction sets. When analyzing the GPU performance, the granularity of concern can be divided into tasks and instructions from large to small.
[0043] In the general cognitive process, usually the overall summary information is recognized first, then the summary is preliminarily analyzed, and then the local detailed information is viewed at a fixed point. When analyzing the GPU running data, usually the overall situation of the task is viewed first. When it is necessary to analyze the instruction set inside the task, the instruction form is immediately switched at the same position on the interface. For the convenience of repeatedly comparing and analyzing the data, this switching is also required to be repeated. Therefore, when performing data display, it is necessary to be able to recognize the user's operation intention and make corresponding responses in the display space.
[0044] In order to avoid the problem of unsmooth display caused by the display of a large amount of data in the above process, the embodiment of the present invention provides a data switching method when the display space changes, which can complete the switching between different data information according to the user's needs on a limited interface space.
[0045] As Figure 1 shown, the specific steps of the data switching method provided by the embodiment of the present invention are as follows.
[0046] Step 101: Obtain the time series interval to be displayed, and write the corresponding tasks and instructions included in the tasks in the time series interval into the cache.
[0047] In general implementation scenarios where a large amount of data needs to be saved and displayed, the data source is usually a disk, and remote storage or cloud storage may even be used. However, the data read and write speeds of these methods are relatively slow and cannot meet the real-time data acquisition requirements when the display space changes. To avoid delays caused by the acquisition of a large amount of data, the data that needs to be displayed and the data predicted to be displayed can be pre-acquired from the data source, and a memory with a faster read and write speed can be used to cache this data to improve the data acquisition speed and reduce the display delay caused by data acquisition. The data predicted to be displayed in the cache can be determined according to actual needs. For example, data with a time proximity to the currently displayed data, data with a business connection to the currently displayed data, data that needs to be compared with the currently displayed data, etc. In the scenario of GPU performance data display, within the same timing interval, two types of data, namely tasks and instructions, need to be switched and displayed. Therefore, two data caches for tasks and instructions also need to be included in the cache. Since the two types of data are independently displayed and need to be repeatedly switched, the two types of data can be independently cached using the same caching mechanism.
[0048] Timing is the time dimension of GPU pipeline processing. Any rendering process occurs in the order of timing. Therefore, when displaying in the display space, the tasks and instructions also need to be arranged in the corresponding order according to the sequence of timing. It takes millions of timings to complete a rendered image, and each timing contains a lot of information. Displaying all the timing content at once will not only exceed the display capacity of the interface but also cause a large delay or lag in interface drawing. Therefore, each time of display, the user can first select a timing interval, and only cache and display the tasks and instructions in the selected timing interval to save cache resources and reduce the amount of data to be processed during display. In actual implementation, the timing interval can be determined according to the display resolution specified by the user, the display font size, the number of tasks and instructions included in each timing, etc., to obtain the best visual presentation effect.
[0049] In some implementation manners, to further improve the real-time performance of data display, the data in the cache can also be preprocessed in various ways. For example, converting the data format to match the data format of the display control, pre-screening the data to remove invalid data, performing statistical analysis on the data to generate corresponding statistical analysis images, performing business analysis on the data to obtain the data that needs to be emphasized and displayed, etc., and pre-typesetting all the data to be displayed into picture data to reduce the flicker during refreshing using mechanisms such as double buffering.
[0050] Step 102: Obtain the change in the display size, switch the display type according to the changed display size, obtain the tasks or instructions in the corresponding timing interval in the cache according to the display type, and display the obtained tasks or instructions.
[0051] To prevent information confusion or unclear interface caused by displaying multiple types of data in the same interface space simultaneously, in the method provided by the embodiments of the present invention, only one type of data is displayed in the display space at the same time, and other data is not displayed. In actual implementation, the display type can be used to control the type of data to be displayed.
[0052] During the actual data query process, the user will send zoom-in and zoom-out instructions through operations such as mouse wheel operation or screen button operation to adjust the display size of the current time series interval. Since different types of data represent different data ranges, when the display size changes, in order to facilitate the user to view, the display type can be switched according to the change of the display size. When the display size is larger, large-grained data is displayed, and when the display size is smaller, small-grained data is displayed, so as to present the data type that conforms to the current display size to the user.
[0053] In the scenario of GPU performance data display, the data to be displayed includes tasks and instructions. Correspondingly, the display types include: displaying task data and displaying instruction data. Since instructions are included in tasks, tasks are large-grained data and instructions are small-grained data. When the display size is larger, large-grained task data is displayed, and when the display size is smaller, small-grained instruction data is displayed. As Figure 2 shown, when the user issues a zoom-in instruction, the display size changes from small to large, and the display switches from large-grained task data to small-grained data instruction with more details; when the user issues a zoom-out instruction, the display size changes from large to small, and the display switches from small-grained execution data to large-grained data task with fewer details.
[0054] When the display type changes, it is necessary to obtain the corresponding type of data in the cache according to the display type, ignore other types of data, and implement a fast response feedback mechanism during the switch through the cache. When the display type switches to instructions, instruction data is obtained from the cache; when the display type switches to task information, task data is obtained from the cache. After obtaining the corresponding type of data, the display content after the change of the display size is generated according to the obtained data, and the original display data in the display space is cleared, so as to realize the switch of the display type controlled by the change of the display size.
[0055] Step 103: Obtain the change of the time series interval, obtain the tasks or instructions in the changed time series interval from the cache, display the obtained tasks or instructions, and update the tasks and instructions in the cache according to the changed time series interval.
[0056] In the actual data query process, in addition to the change in display size, the user will also send a left / right movement instruction for the display area by dragging the screen left / right or dragging the scroll bar, etc., to adjust the time series interval for display. When the time series interval changes, it is also necessary to obtain the data of the corresponding time series interval from the cache and display the data in the changed time series interval according to the display type.
[0057] When the time series interval changes by moving left / right, the change mode of the time series interval is continuous, that is, the changed time series interval is adjacent to the currently displayed time series interval. In the data cache of the embodiments of the present invention, the data corresponding to the time series interval not only includes the data within the time series interval that needs to be displayed currently, but may also include the data of adjacent time series intervals. When performing data acquisition, it is also possible to directly obtain the data in the adjacent time series interval after the change from the cache, thereby avoiding the delay caused by data acquisition.
[0058] After steps 101 to 103 provided in the embodiments of the present invention, it is possible to achieve the fast switching efficiency of data when the display space changes through the cache and data type switching, so as to accelerate the interface response speed, improve the interface smoothness, and enhance the user experience.
[0059] In step 101, an appropriate cache policy can be selected according to the characteristics of the service and data to achieve the prediction of cached data. In some actual scenarios, such as Figure 3 shown, the following method can be used to cache the tasks and instructions included in the tasks corresponding to the time series interval.
[0060] Step 201: Use the time series interval to be displayed as the current time series interval, and obtain the tasks and instructions in the current time series interval, the previous time series interval of the current time series interval, and the next time series interval of the current time series interval from the data source.
[0061] In the GPU performance data display scenario, when the user queries tasks and instructions, they usually also view the data of adjacent time series intervals of the selected time series interval according to the time series. To meet the data viewing needs in this scenario, the data of adjacent time series intervals can also be pre-cached. As Figure 4 shown, the cache contains the tasks and instructions in the current time series interval, the previous time series interval of the current time series interval, and the next time series interval of the current time series interval. Figure 4Among them, the dashed arrows represent the message flow of data requests, and the solid arrows represent the data flow returned in response to data requests. Since the cache contains the data of tasks and instructions in the current time series interval, when switching tasks and instructions, the corresponding data can be directly obtained from the cache and quickly responded to, enabling the user to immediately view the data through the HMI without waiting too long. After the user completes the data query for the current time series interval and needs to continue querying the data for the adjacent time series interval, since the cache also contains the corresponding data, the corresponding data can also be directly obtained from the cache without having to obtain the data from the data source with a slower read and write speed.
[0062] Step 202: Associate each obtained task with the instructions included in the corresponding task, and cache the associated tasks and instructions respectively according to the time series intervals they belong to.
[0063] In the GPU performance data display scenario, only the data of one time series interval is viewed each time, and the tasks and instructions in the same time series interval need to be displayed separately. To facilitate data reading during display, in the method provided by the embodiments of the present invention, the data in each time series interval is cached separately, and the tasks and instructions in each time series interval are cached separately.
[0064] In step 102, when the display size changes, the switching display of tasks and instructions needs to be performed. To conveniently find the corresponding instruction data through the currently displayed task data, or find the corresponding task data according to the currently displayed instruction data, it is also necessary to associate the separately cached task and instruction data. In actual implementation, an appropriate association method can be selected according to business needs and data characteristics, such as associating through key values, IDs, etc.
[0065] In a certain actual scenario, IDs are used to associate tasks and instructions. A unique task ID (taskID) is set for each task, and the same instruction ID (instructionID) is set for the instructions included in each task. The task ID of each task is associated with the instruction ID of the instructions in the corresponding task to facilitate finding the corresponding instruction ID through the task ID. In the above process, all the instructions within each task are bound to the same instructionID, that is: all the instructions bound to the same instructionID belong to the task bound to the same taskID. Through this method, a certain task can find all the instructions in the task through the taskID, or find the task where a certain instruction is located according to the instructionID of the instruction, so as to simply and quickly complete the switching between the two types of data, so as to present different corresponding task data or instruction data according to the user behavior captured by the interface.
[0066] After performing steps 201 to 202 provided in the embodiments of the present invention, the caching of the required data can be completed.
[0067] In some other actual scenarios, even if the timing intervals are divided, the amount of data in each timing interval is still very large. To avoid data processing latency or cache capacity tension caused by excessive data volume, the data in the same timing interval can also be cut into several batches, and the data processing and caching are performed in batches. Specifically: when the number of instructions and / or tasks in the timing interval is greater than the specified display quantity threshold, the instructions and / or tasks in the timing interval are divided into at least two batches, and the instructions and / or tasks in each batch are respectively written into the cache. In some embodiments, the batch division method can be determined according to actual needs, such as dividing according to time periods, dividing according to the type of tasks or instructions, etc.
[0068] When the user views the GPU performance data, the display size can be enlarged or reduced by operating the mouse wheel state, etc. Therefore, the mouse wheel state of the user can be captured to determine whether to enlarge or reduce the display size, so as to determine whether the display type is to display the task information of large particles or the instruction information of small particles. During the change of the display size, as Figure 5 shown, the switching of the display type can be completed in the following manner.
[0069] (1) When the magnification ratio of the display size is greater than the magnification threshold, the display type is switched to display instruction data.
[0070] When the display size of the data is enlarged, the content of the display information is enlarged proportionally in the fixed display space, and the number of particles that can be displayed in the unit display space becomes smaller, and smaller granularity data can be displayed, presenting more detailed information. In the scenario of viewing GPU performance data, the display type changes from displaying task data to displaying instruction data.
[0071] (2) When the reduction ratio of the display size is less than the reduction threshold, the display type is switched to task instruction data.
[0072] When the display size of the data is reduced, the content of the display information is reduced proportionally in the fixed display space, and the number of particles that can be displayed in the unit display space becomes larger, but too detailed information cannot be displayed, and only relatively general task information can be displayed.
[0073] (3) When the magnification ratio of the display size is less than or equal to the magnification threshold, or the reduction ratio of the display size is greater than or equal to the reduction threshold, the current display type is not switched.
[0074] In some embodiments, the task information and the instruction information are respectively applicable to different display sizes. Therefore, it is not necessary to switch the display type every time the user zooms in or out the range. Instead, the display type is switched only when the zoom-in or zoom-out range exceeds the threshold. The zoom-in and zoom-out within the threshold range only change the size or layout of the displayed content, without changing the display type.
[0075] In a certain actual scenario, multiple tasks need to be displayed in each time series interval, and each task contains multiple instructions. For example, Figure 6 and Figure 7 shown, the task IDs of the task data are respectively: A, B, C, D, E, and F. Among them, the instruction ID bound to task A is 1, the instruction ID bound to task B is 2, and the instruction ID bound to task C is 3. When the magnification ratio of the display size exceeds the magnification threshold, the display task data in Figure 6 is switched to the display instruction data in Figure 7 to display more detailed information; when the reduction ratio of the display size exceeds the reduction threshold, the display instruction data in Figure 7 is switched to the display task data in Figure 6 to display a larger range of information; when the change in the display size does not exceed the corresponding threshold, the current display type is not changed.
[0076] In the method provided by the embodiments of the present invention, the task data and the instruction data are respectively cached. When switching, only the change of the interface display data is performed, and the two types of data in the cache are still saved. For example, Figure 8 shown, when switching, the cache where the data corresponding to the display type before switching is located is put into sleep, and the cache where the data corresponding to the display type after switching is located is activated. Figure 8 In, the dotted line represents the sleep data stream, and the solid line represents the activated data stream. By this way, the content of the previous display type can be quickly restored when switching back, without consuming too much performance. Specifically: when the display type is to display task data, all tasks in the time series interval to be displayed are obtained from the cache, and the tasks are displayed in the order of the tasks in the time series interval; when the display type is to display instruction data, all instructions in the time series interval to be displayed are obtained from the cache, and the instructions are displayed in the order of the instructions in the time series interval.
[0077] When performing data query, in addition to the change in the display size, the user will also change the time series interval. For example, Figure 9 shown, the following method can be used to obtain the tasks or instructions in the changed time series interval from the cache.
[0078] Step 301: According to the start time series and the end time series of all time series intervals in the cache, determine whether the cache contains the tasks and / or instructions in the changed time series interval.
[0079] In the method provided by the embodiment of the present invention, in addition to the data of the current timing interval, the cache also includes the data of the previous timing interval and the data of the next timing interval. Since the timing intervals in the cache are continuous, the start timing of the data of the earliest timing interval and the end timing of the data of the last timing interval can be used to determine whether the timing interval to be currently displayed exists in the cache.
[0080] Step 302: When the cache contains the tasks and / or instructions in the changed timing interval, obtain the tasks and instructions in the changed timing interval from the cache.
[0081] In a general scenario, the user needs to view the coherent running state of the GPU pipeline. For example, move forward or backward around the entire display timing interval, and sequentially view adjacent timing intervals in chronological order. When the user changes the timing interval by panning forward and backward or scrolling, and changes the timing interval to be viewed from the current timing interval to an adjacent timing interval, the data of the timing interval to be displayed exists in the cache. Therefore, only the data needs to be directly obtained from the cache.
[0082] In some scenarios, due to different display sizes, all the data in the timing interval may not be able to be completely displayed in the display space at one time. Therefore, when obtaining data from the cache, the cache can split the data in the timing interval according to the current display size, and only provide the data that can be displayed at one time in the current display space. When the display size changes or the display space moves, then obtain other data that needs to be displayed.
[0083] In some scenarios, the data is cached in batches. When obtaining data, the data in the cache can also be obtained in batches, so as to further improve the data reading and writing efficiency by using methods such as data block access.
[0084] Step 303: When the cache does not contain the tasks and / or instructions in the changed timing interval, request the tasks and instructions of the corresponding timing interval from the data source, cache them, and then obtain the tasks and instructions in the corresponding timing interval from the cache.
[0085] However, in some scenarios, the user may jump the timing interval to be viewed to a timing interval that is not adjacent to the current timing interval by means of input or clicking. At this time, the required data does not exist in the cache, and it is still necessary to obtain the required data from the data source to construct the cache data of the corresponding timing interval, and then obtain the data of the corresponding timing interval from the cache for display.
[0086] After steps 301 to 303 provided in the embodiment of the present invention, the data of the timing interval to be displayed can be obtained from the cache.
[0087] Since the cache capacity is limited, the data to be displayed will change according to the display requirements. As Figure 10 shown, it is also necessary to update the tasks and instructions in the cache according to the changed timing interval.
[0088] Step 401: Use the changed timing interval, the previous timing interval of the changed timing interval, and the next timing interval of the changed timing interval as the timing intervals to be cached, and determine whether any of the timing intervals to be cached is the same as or adjacent to any of the timing intervals in the cache.
[0089] To facilitate determining whether the required timing interval exists in the cache by the start timing and end timing of all timing intervals in the cache, when updating the cache, it is necessary to ensure that all timing intervals in the cache are continuous. In the method provided by the embodiments of the present invention, to facilitate the change of the timing space during sequential query, the data of the current timing interval, the previous timing interval of the current timing interval, and the next timing interval of the current timing interval will be saved in the cache for use. After the change of the timing space, it is also necessary to add the changed timing interval, the previous timing interval of the changed timing interval, and the next timing interval of the changed timing interval to the cache. Therefore, when updating the cache, it is necessary to determine whether the above-mentioned all timing intervals overlap or are continuous.
[0090] Step 402: When the determination is passed, obtain the instructions or tasks in one or more timing intervals to be cached that are not in the cache, and write the obtained tasks and instructions into the cache.
[0091] In a certain scenario, the time series interval before the change is interval 2, and at this time, intervals 1, 2, and 3 already exist in the cache; when the time series interval after the change is interval 3, the time series intervals to be added to the cache are intervals 2, 3, and 4, and the time series intervals to be added to the cache overlap with the time series intervals already in the cache; when the time series interval after the change is interval 4, the time series intervals to be added to the cache are intervals 3, 4, and 5, and the time series intervals to be added to the cache overlap with the time series intervals already in the cache; when the time series interval after the change is interval 5, the time series intervals to be added to the cache are intervals 4, 5, and 6, and the time series intervals to be added to the cache are adjacent to the time series intervals already in the cache. At this time, only the time series intervals that do not yet exist in the cache need to be obtained, and the corresponding time series intervals are added to the cache, so that the continuous time series intervals to be viewed can be included in the cache. In the above scenario, when the time series interval after the change is interval 3, interval 4 is added, and the time series intervals in the cache are updated to intervals 1 - 4; when the time series interval after the change is interval 4, intervals 4 and 5 are added, and the time series intervals in the cache are updated to intervals 1 to 5; when the time series interval after the change is interval 5, intervals 4, 5, and 6 are added, and the time series intervals in the cache are updated to intervals 1 - 6. It can be seen from the above examples that by updating in this way, the time series intervals in the cache can be ensured to be continuous.
[0092] Step 403: When the determination fails, clear all the data in the cache, obtain the tasks and instructions in all the time series intervals to be cached, and write the obtained tasks and instructions into the cache.
[0093] In a certain scenario, the time series interval before the change is interval 2, and at this time, intervals 1, 2, and 3 already exist in the cache; when the time series interval after the change is interval 7, the time series intervals to be added to the cache are intervals 6, 7, and 8, and the time series intervals to be added to the cache have no intersection with the time series intervals already in the cache. At this time, as Figure 11 shown, in order to ensure the continuity of the time series intervals, it is necessary to clear all the original cache data, then query from the data source, and construct new cache data. Figure 11 In, the dashed arrow represents the message flow of the data request, and the solid arrow represents the data flow returned in response to the data request. In the above scenario, when the time series interval after the change is interval 7, the existing intervals 1 to 3 in the cache are cleared, and intervals 6, 7, and 8 are added. The time series intervals in the cache are updated from intervals 1 to 3 to intervals 6 to 8, and the continuity of the time series intervals in the cache can still be ensured.
[0094] After steps 401 to 403 provided in the embodiments of the present invention, the data in the cache can be updated to ensure that the required data always exists in the cache.
[0095] Further, since the task data and the instruction data are cached separately in the embodiments of the present invention, when adding and clearing the cache, both the task data and the instruction data need to be updated and cleared synchronously.
[0096] In actual implementation, if the user requests data continuously forward or backward around a certain time series interval on the interface without performing the operation of clearing all data in the cache in step 403, the data in the cache data will gradually accumulate, resulting in an increase in cache resource consumption and even exceeding the maximum cache capacity that can be used. To avoid this problem, in actual implementation, an appropriate update policy can be selected as needed to update the data in the cache, such as: the least recently used policy, the least frequently used policy, the timeout elimination policy, etc. To ensure the continuity of the time series intervals in the cache, preferably, when the number of time series intervals in the cache is greater than the specified cache quantity threshold, the time series interval farthest from the currently displayed time series interval is eliminated to retain a continuous time series space.
[0097] In the method provided by the embodiments of the present invention, the user does not directly obtain the task or instruction data, but obtains the corresponding data from the cache. When multiple users need to access simultaneously, to make full use of the data in the cache, avoid repeated data acquisition, and avoid occupying too much cache resources, multiple users can share the same set of cache data. In this scenario, the time series intervals required to be displayed by different users are very likely to be discontinuous. To avoid conflicts in data cleaning between different users, the start time and end time of all time series intervals in the cache can be recorded as a cache time series table, and it is retrieved from the cache according to the cache time series table whether there is a time series interval required by the user. When the time series intervals are discontinuous, first, it is judged whether the number of time series intervals in the cache is greater than the specified cache quantity threshold. When it is not greater than the cache quantity threshold, the cache is not cleared, and only corresponding records are added to the cache time series table; when it is greater than the cache quantity threshold, the elimination of the time series intervals is completed according to parameters such as the access time, the number of included time series intervals, and the distance from the currently displayed time series interval of each group of continuous time series intervals.
[0098] The data switching method when the display space changes provided by the embodiments of the present invention reduces the delay caused by directly reading and writing a large amount of data from the data source through data caching, ensures that the current display type can meet the display requirements of the current display size through the switching of the display type, and ensures that the required display data can still be quickly obtained after the change of the time series interval through cache update. This method balances data display and data processing, ensuring that the data can be displayed in a timely manner without consuming too high computer hardware performance.
[0099] Based on the data switching method when the display space changes provided in the above embodiments, the present invention further provides a data switching device according to the display space change for implementing the above method, such as Figure 12 shown, which is a schematic diagram of the device architecture of an embodiment of the present invention. The data switching device according to the display space change of the embodiment of the present invention includes one or more processors 11 and a memory 12. Among them, Figure 12 one processor 11 is taken as an example in
[0100] The processor 11 and the memory 12 can be connected through a bus or other means, Figure 12 Taking the connection through the bus as an example in
[0101] As a non-volatile computer-readable storage medium for a data switching method when the display space changes, the memory 12 can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as the data switching method when the display space changes in the embodiment. The processor 11 executes various functional applications and data processing of the data switching device according to the display space change by running the non-volatile software programs, instructions, and modules stored in the memory 12, that is, implementing the data switching method when the display space changes in the embodiment.
[0102] The memory 12 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other non-volatile solid-state storage devices. In some embodiments, the memory 12 may optionally include a memory remotely set relative to the processor 11, and these remote memories can be connected to the processor 11 through a network. Examples of the above network include but are not limited to the Internet, an enterprise intranet, a local area network, a mobile communication network, and their combinations.
[0103] The program instructions / modules are stored in the memory 12 and, when executed by one or more processors 11, execute the data switching method when the display space changes in the above embodiments. For example, execute the Figure 1 , Figure 2 and Figure 3 and other steps shown in
[0104] Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the embodiments can be completed by instructing relevant hardware through a program, and this program can be stored in a computer-readable storage medium. The storage medium may include: Read Only Memory (ROM), Random Access Memory (RAM), magnetic disk, optical disk, etc.
[0105] The above are only the preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A data switching method for displaying spatial changes, characterized in that, it includes: Obtain the time series interval to be displayed, and write the tasks corresponding to the time series interval and the instructions included in the tasks into the cache; Obtain the change in the display size, switch the display type according to the changed display size, obtain the tasks or instructions in the corresponding time series interval in the cache according to the display type, and display the obtained tasks or instructions; wherein, the display types include: displaying task data and displaying instruction data; Obtain the change in the time series interval, obtain the tasks or instructions in the changed time series interval from the cache, display the obtained tasks or instructions, and update the tasks and instructions in the cache according to the changed time series interval.
2. The data switching method for displaying spatial changes according to claim 1, characterized in that, The step of writing the tasks corresponding to the time series interval and the instructions included in the tasks into the cache includes: Taking the time series interval to be displayed as the current time series interval, and obtaining the tasks and instructions in the current time series interval, the previous time series interval of the current time series interval, and the next time series interval of the current time series interval from the data source; Associate each obtained task with the instructions included in the corresponding task, and cache the associated tasks and instructions respectively according to the time series interval where they are located.
3. The data switching method for displaying spatial changes according to claim 2, characterized in that, The step of associating each obtained task with the instructions included in the corresponding task includes: Set a unique task ID for each task, set the same instruction ID for the instructions included in each task, and associate the task ID of each task with the instruction ID of the instructions in the corresponding task, so as to find the corresponding instruction ID through the task ID.
4. The data switching method for displaying spatial changes according to claim 1, characterized in that, The step of writing the tasks corresponding to the time series interval and the instructions included in the tasks into the cache includes: When the number of instructions and / or tasks in the time series interval is greater than the specified display quantity threshold, divide the instructions and / or tasks in the time series interval into at least two batches, and write the instructions and / or tasks in each batch into the cache respectively.
5. The data switching method for displaying spatial changes according to claim 1, characterized in that, The step of switching the display type according to the changed display size includes: When the magnification ratio of the display size is greater than the magnification threshold, switch the display type to display instruction data; When the reduction ratio of the display size is less than the reduction threshold, switch the display type to display task data; When the magnification ratio of the display size is less than or equal to the magnification threshold, or the reduction ratio of the display size is greater than or equal to the reduction threshold, do not switch the current display type.
6. The data switching method for displaying spatial changes according to claim 5, characterized in that, When the display type is switched, the step of switching the display type according to the changed display size further includes: Put the cache where the data corresponding to the display type before switching is located into sleep, and activate the cache where the data corresponding to the display type after switching is located.
7. The data switching method when the display space changes according to any one of claims 1 to 6, wherein, the obtaining of the tasks or instructions in the corresponding time sequence interval in the cache according to the display type and the display of the obtained tasks or instructions include: when the display type is to display task data, all the tasks in the time sequence interval to be displayed are obtained from the cache, and the tasks are displayed in the order of the tasks in the time sequence interval; when the display type is to display instruction data, all the instructions in the time sequence interval to be displayed are obtained from the cache, and the instructions are displayed in the order of the instructions in the time sequence interval.
8. The data switching method when the display space changes according to any one of claims 1 to 6, wherein, the obtaining of the tasks or instructions in the changed time sequence interval from the cache includes: judging whether the tasks and / or instructions in the changed time sequence interval are included in the cache according to the start time sequence and the end time sequence of all the time sequence intervals in the cache; when the tasks and / or instructions in the changed time sequence interval are included in the cache, the tasks and instructions in the changed time sequence interval are obtained from the cache; when the tasks and / or instructions in the changed time sequence interval are not included in the cache, the tasks and instructions in the corresponding time sequence interval are requested from the data source, cached, and then the tasks and instructions in the corresponding time sequence interval are obtained from the cache.
9. The data switching method when the display space changes according to any one of claims 1 to 6, wherein, the updating of the tasks and instructions in the cache according to the changed time sequence interval includes: taking the changed time sequence interval, the previous time sequence interval of the changed time sequence interval, and the next time sequence interval of the changed time sequence interval as the time sequence intervals to be cached, and judging whether any one of the time sequence intervals to be cached is the same as or adjacent to any one of the time sequence intervals in the cache; when the judgment passes, the instructions or tasks in one or more of the time sequence intervals to be cached that are not in the cache are obtained, and the obtained tasks and instructions are written into the cache; when the judgment fails, all the data in the cache is cleared, the tasks and instructions in all the time sequence intervals to be cached are obtained, and the obtained tasks and instructions are written into the cache.
10. A data switching device when the display space changes, wherein: it includes at least one processor and a memory, the at least one processor and the memory are connected through a data bus, the memory stores instructions executable by the at least one processor, and after the instructions are executed by the processor, they are used to complete the data switching method when the display space changes according to any one of claims 1 to 9.