Interface rendering optimization method, equipment, storage medium, device and product
By controlling the rewriting and rendering timing of the chart class, the problem of degradation of rendering performance in the existing technology is solved, and more efficient rendering effect and readability are achieved.
Patent Information
- Application Number
- CN202410851904.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2044-06-28
AI Technical Summary
In the prior art, the Chart module based on the Qt framework cannot realize custom rendering due to the pursuit of universality and performance balance when implementing signal tracking, resulting in a decline in rendering performance when signal data changes drastically, especially in the case of multiple line segments. good.
By tracking session data, rewrite the drawing logic of the chart class using the data model, draw scatter plots and line charts according to rendering requests and timing, implement custom charts and timelines, downsampling and managing line segment data, and improve rendering efficiency and effect.
It improves the readability and efficiency of rendering, controls the flash frame rate of the chart, and solves the problems of degraded rendering performance and poor effect in the prior art.
Smart Images

Figure CN118426772B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an interface rendering optimization method, equipment, storage medium, device and product. Background Art
[0002] In the field of numerical control systems, signal tracking of the human-machine interface is usually based on the Chart module of the Qt framework. According to the settings of signal tracking (such as line shape (dashed line, solid line, etc.), line color, data magnification, data offset, line width, etc.), the data of each cycle is visualized on the Chart view. Because the current technology is implemented based on the open source Chart module of the Qt framework, its biggest advantage is actually convenience and versatility, but the disadvantage is that it is not customizable. In the signal tracking module, the problem is highlighted: in order to achieve a balance between versatility and performance, the Chart module is defined as automatically using solid lines if hardware acceleration is used. This leads to either downgrading the requirements or not using hardware acceleration when using existing technologies. When the signal data changes drastically, if there are multiple line segments on the chart, the performance of the Chart module will drop significantly. Summary of the invention
[0003] The main purpose of this application is to provide an interface rendering optimization method, equipment, storage medium, device and product, aiming to solve the technical problem in the prior art that the existing chart module cannot realize customized rendering, resulting in reduced rendering performance and poor rendering effect.
[0004] To achieve the above object, the present application provides an interface rendering optimization method, which comprises the following steps:
[0005] Tracking session data, and rewriting the chart class required for drawing and rendering corresponding to the session data through the data model to obtain drawing logic;
[0006] Draw a scatter plot and a line plot according to the rendering request, the drawing logic, and the session data;
[0007] The interface rendering is completed according to the rendering timing, the scatter plot and the line plot.
[0008] Optionally, the step of tracking session data and rewriting a chart class required for drawing and rendering corresponding to the session data through a data model to obtain drawing logic includes:
[0009] Tracking session data, and organizing the session data and inputting it into a data model for data visualization view tracking, and determining a chart class required for drawing and rendering corresponding to the session data;
[0010] The chart class is rewritten to obtain drawing logic.
[0011] Optionally, the step of drawing a scatter graph and a line graph according to the rendering request, the drawing logic, and the session data includes:
[0012] Get the rendering request;
[0013] Determine a custom chart and a custom timeline according to the rendering request and the drawing logic;
[0014] A scatter graph and a line graph are drawn according to the custom chart, the custom timeline, and the session data.
[0015] Optionally, the step of completing interface rendering according to the rendering timing, the scatter plot, and the line graph includes:
[0016] Determine line segment drawing data according to the scatter plot and the line graph;
[0017] Determine a downsampling start time according to the custom time axis, and manage the line segment drawing data according to the downsampling start time to obtain target line segment drawing data;
[0018] The interface rendering is completed according to the rendering timing and the target line segment drawing data.
[0019] Optionally, the step of determining the downsampling start time according to the custom time axis, managing the line segment drawing data according to the downsampling start time, and obtaining the target line segment drawing data includes:
[0020] Compare the sliding time window corresponding to the custom time axis with a preset threshold to obtain a comparison result;
[0021] The downsampling start time is determined according to the comparison result, and the line segment drawing data is managed according to the downsampling start time to obtain the target line segment drawing data.
[0022] Optionally, the step of completing interface rendering according to the rendering timing and the target line segment drawing data includes:
[0023] Acquire the line segment drawing data to be rendered from the target line segment drawing data according to the rendering timing and the downsampling start time;
[0024] The interface rendering is completed according to the line segment drawing data to be rendered.
[0025] In addition, to achieve the above-mentioned purpose, the present application also provides an interface rendering optimization device, the interface rendering optimization device comprising:
[0026] A logic determination module, used for tracking session data, and rewriting the chart class required for drawing and rendering corresponding to the session data through a data model to obtain drawing logic;
[0027] A chart drawing module, used for drawing a scatter graph and a line graph according to a rendering request, the drawing logic and the session data;
[0028] The interface rendering module is used to complete the interface rendering according to the rendering timing, the scatter plot and the line graph.
[0029] In addition, to achieve the above-mentioned purpose, the present application also proposes a computer program product, which includes an interface rendering optimization program, and when the interface rendering optimization program is executed by a processor, it implements the steps of the interface rendering optimization method described above.
[0030] In addition, to achieve the above-mentioned purpose, the present application also proposes an interface rendering optimization device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the interface rendering optimization method described above.
[0031] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the interface rendering optimization method described above are implemented.
[0032] One or more technical solutions proposed in this application have at least the following technical effects:
[0033] This application tracks session data and rewrites the chart class required for drawing and rendering corresponding to the session data through a data model to obtain drawing logic; draws scatter graphs and line graphs according to rendering requests, the drawing logic, and the session data; and completes interface rendering according to rendering timing, the scatter graph, and the line graph. Compared with the prior art, the existing chart module cannot achieve customized rendering, resulting in reduced rendering performance and poor rendering effect. This application first rewrites the chart class and draws various line graphs and scatter graphs, and renders them according to the rendering timing, which improves readability, and can control the chart refresh frame rate, improve rendering efficiency and rendering effect. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0035] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0036] Figure 1 A flowchart of the first embodiment of the interface rendering optimization method of the present application is provided;
[0037] Figure 2 A diagram of a chart class provided in the first embodiment of the interface rendering optimization method of the present application;
[0038] Figure 3 A rendering logic diagram provided for the second embodiment of the interface rendering optimization method of the present application;
[0039] Figure 4 This is a schematic diagram of the module structure of the interface rendering optimization device according to an embodiment of the present application;
[0040] Figure 5 This is a schematic diagram of the device structure of the hardware operating environment involved in the interface rendering optimization method in the embodiment of the present application.
[0041] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0042] It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0043] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0044] The main solution of the embodiment of the present application is: tracking session data, and rewriting the chart class required for drawing and rendering corresponding to the session data through the data model to obtain the drawing logic; drawing a scatter graph and a line graph according to the rendering request and the drawing logic and the session data; completing the interface rendering according to the rendering timing, the scatter graph and the line graph.
[0045] In this embodiment, for ease of description, the following description is made with the computing service device as the execution entity.
[0046] Since the existing chart modules in the prior art cannot implement customized rendering, the rendering performance is reduced and the rendering effect is poor.
[0047] This application provides a solution to control the rendering timing and improve the rendering efficiency and rendering effect by rewriting the chart class.
[0048] From the above embodiments, it can be seen that the present application obtains the drawing logic by tracking the session data and rewriting the chart class required for drawing and rendering corresponding to the session data through the data model; draws a scatter graph and a line graph according to the rendering request, the drawing logic and the session data; and completes the interface rendering according to the rendering timing, the scatter graph and the line graph. Compared with the prior art, the existing chart module cannot realize customized rendering, resulting in reduced rendering performance and poor rendering effect. The present application improves readability by rewriting the chart class first and drawing various line graphs and scatter graphs, and rendering by rendering timing, and can control the chart refresh frame rate, improve rendering efficiency and rendering effect.
[0049] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a tablet computer, a personal computer, a mobile phone, etc., or an electronic device capable of realizing the above functions, including a device of an interface rendering optimization system, etc. The following takes a computer as an example to illustrate this embodiment and the following embodiments.
[0050] Based on this, the embodiment of the present application provides an interface rendering optimization method, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the interface rendering optimization method of the present application.
[0051] In this embodiment, the interface rendering optimization method includes steps S10 to S30:
[0052] Step S10, tracking session data, and rewriting the chart class required for drawing and rendering corresponding to the session data through the data model to obtain drawing logic.
[0053] It should be noted that the session data includes relevant session data such as business suspension, parameter declaration, tracking data source, saving as business, stopping business, security layer, memory disk space assessment, etc. The data model can refer to data sorting for session data, determining the chart class required for the visualization view, and rewriting the chart class to obtain the chart class drawing logic.
[0054] It can be understood that the chart drawing logic refers to the drawing logic for graphics and lines.
[0055] In a feasible implementation, the step S10 further includes: tracking session data, organizing the session data and inputting it into a data model for data visualization view tracking, determining a chart class required for drawing and rendering corresponding to the session data; and rewriting the chart class to obtain drawing logic.
[0056] It should be noted that by tracking the session data and organizing the session data and inputting it into the data model to track the data visualization view, the chart class required for drawing and rendering is determined, and the chart class is rewritten to obtain the drawing logic.
[0057] It should be understood that Plot and chartView are decoupled; ChartView of the Chart module is bound to the axis implementation, that is, coupled; this application uses the QQuickPaintedItem class to implement custom charts (hereinafter referred to as CustomPlot), replacing the ChartView class of the Chart module; CustomPlot does not draw the chart axis, but puts the axis down to qml for self-implementation. Compared with the technical solution based on QChart in the prior art, it can only traverse each line segment object and call replacePoints to refresh the data, and a render will be performed after the call of repalcePoints, which means that if the number of line segments increases, the number of render requests for a resampling operation is N (the number of line segments). This application uniformly organizes the line segment data, determines the line segment data that needs to be rendered in the end, and then renders it. Therefore, it is necessary to rewrite the chart class that needs to be rendered, so as to determine the rendering and drawing logic, so as to facilitate rapid rendering according to the session data in the later stage.
[0058] Step S20: Draw a scatter plot and a line plot according to the rendering request, the drawing logic, and the session data.
[0059] It should be noted that the rendering request may be a request triggered at a preset fixed time or a request triggered manually. The session data is drawn in a scatter plot and a line graph through the triggered rendering request and the drawing logic.
[0060] In the specific implementation, to further illustrate the process of drawing line graphs and scatter graphs in this application, please refer to Figure 2 The diagram of the chart class drawing is shown, in which the technical solution of the present application first rewrites the chart class, hereinafter referred to as CustomPlot, which inherits QQuickPaintedItem, uses QPainter in the paint event of this class to draw data of various Series, and uses setRenderTarget(QQuickPaintedItem::FrameBufferObject) to set the rendering object to FBO, and exposes the renderReqest() interface to create LineSeries and ScatterSeries classes, and the DataManager module is decomposed into BaseSeries, so that the upstream only generates data and does not need an extra layer of data management module, which improves readability and makes access deployment lightweight.
[0061] Step S30, completing interface rendering according to the rendering timing, the scatter plot and the line graph.
[0062] It should be noted that the rendering timing can be controlled by the view module. By handing over the rendering timing to the View, the refresh frame rate of the chart can be controlled by the View, and after all the line segment data are loaded, all line segments can be rendered once, which significantly improves the rendering capability.
[0063] In the specific implementation, interface rendering is completed through rendering timing, scatter plots and line graphs.
[0064] This embodiment tracks session data and rewrites the chart class required for drawing and rendering corresponding to the session data through a data model to obtain drawing logic; draws scatter graphs and line graphs according to rendering requests, the drawing logic, and the session data; and completes interface rendering according to rendering timing, the scatter graph, and the line graph. Compared with the prior art, the existing chart module cannot realize customized rendering, resulting in reduced rendering performance and poor rendering effect. This embodiment rewrites the chart class first and draws various line graphs and scatter graphs, and renders according to the rendering timing, thereby improving readability, and being able to control the chart refresh frame rate, improving rendering efficiency and rendering effect.
[0065] Based on the above Figure 1 The first embodiment shown in the present application proposes a second embodiment of the interface rendering optimization method of the present application; based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as the above-mentioned first embodiment can be referred to the above introduction and will not be repeated later.
[0066] In this embodiment, the step S20 also includes: obtaining a rendering request; determining a custom chart and a custom timeline according to the rendering request and the drawing logic; and drawing a scatter plot and a line graph according to the custom chart, the custom timeline, and the session data.
[0067] It should be noted that after receiving the rendering request, the rendering parameters are determined by the business information contained in the rendering request, the chart class is rewritten in combination with the drawing logic, and the scatter chart and line chart are determined by pulling data. The custom timeline stores the time and data points on the xy axis, and determines the drawing time through the time-axis value, thereby improving the drawing effect.
[0068] In the specific implementation, a rendering request is obtained; a custom chart and a custom timeline are determined according to the rendering request and the drawing logic; and a scatter chart and a line chart are drawn according to the custom chart, the custom timeline, and the session data.
[0069] In this embodiment, the step S30 also includes: determining the line segment drawing data according to the scatter plot and the line graph; determining the downsampling start time according to the custom timeline, and managing the line segment drawing data according to the downsampling start time to obtain the target line segment drawing data; completing the interface rendering according to the rendering timing and the target line segment drawing data.
[0070] It should be noted that the line drawing data is determined by the scatter plot and the line graph, and the downsampling start time is determined by the custom timeline. When downsampling is turned on, the target line drawing data is determined by the downsampling start time, wherein the target line drawing data refers to the stored data determined from the scatter plot and the line graph by the downsampling start time, and the target line drawing data is determined by the stored scatter plot and the line graph.
[0071] In the specific implementation, the line segment drawing data is determined according to the scatter plot and the line graph; the downsampling start time is determined according to the custom timeline, and the line segment drawing data is managed according to the downsampling start time to obtain the target line segment drawing data; the interface rendering is completed according to the rendering timing and the target line segment drawing data.
[0072] Furthermore, the step of determining the downsampling start time according to the custom time axis, managing the line segment drawing data according to the downsampling start time, and obtaining target line segment drawing data includes: comparing the sliding time window corresponding to the custom time axis with a preset threshold to obtain a comparison result; determining the downsampling start time according to the comparison result, and managing the line segment drawing data according to the downsampling start time to obtain target line segment drawing data.
[0073] It should be noted that the reference Figure 2 , Series has a QHash container to store the time-axis value, and when the point of the current sliding time window exceeds a set threshold, the downsampling function will be automatically turned on. The preset threshold can be the set maximum time data point, wherein the sliding time window corresponding to the custom time axis is compared with the preset threshold to obtain a comparison result. When the comparison result shows that the point of the current sliding time window exceeds the preset threshold, the time point corresponding to the current time window is determined to be the downsampling start time, and the line segment drawing data is managed according to the downsampling start time to obtain the target line segment drawing data.
[0074] In the specific implementation, the sliding time window corresponding to the custom time axis is compared with the preset threshold to obtain a comparison result; the downsampling start time is determined according to the comparison result, and the line segment drawing data is managed according to the downsampling start time to obtain the target line segment drawing data.
[0075] Furthermore, the step of completing interface rendering according to the rendering timing and the target line segment drawing data includes: obtaining line segment drawing data to be rendered from the target line segment drawing data according to the rendering timing and the downsampling start time; and completing interface rendering according to the line segment drawing data to be rendered.
[0076] It should be noted that since the rendering timing in this application is handed over to the View, the refresh frame rate of the chart can be controlled by the View, and all line segments can be rendered once after all line segment data are loaded, which significantly improves the rendering capability. The rendering timing can refer to the rendering time and the refresh frame rate of the chart.
[0077] It is understandable that the present application obtains the line segment drawing data to be rendered from the target line segment drawing data through the rendering time and the downsampling start time, and completes the interface rendering through the chart refresh frame rate and the line segment drawing data to be rendered.
[0078] In the specific implementation, refer to Figure 3 The rendering logic diagram shown, after determining the target line segment drawing data, the refresh frame rate of the chart and the line segment drawing data to be rendered are determined through the xy axis drawing logic and rendering timing, and the data is refreshed to the screen through the refresh frame rate of the chart and the line segment drawing data to be rendered to complete the rendering.
[0079] This embodiment tracks session data and rewrites the chart class required for drawing and rendering corresponding to the session data through a data model to obtain drawing logic; draws scatter graphs and line graphs according to rendering requests, the drawing logic, and the session data; and completes interface rendering according to rendering timing, the scatter graph, and the line graph. Compared with the prior art, the existing chart module cannot realize customized rendering, resulting in reduced rendering performance and poor rendering effect. This embodiment rewrites the chart class first and draws various line graphs and scatter graphs, and renders according to the rendering timing, thereby improving readability, and being able to control the chart refresh frame rate, improving rendering efficiency and rendering effect.
[0080] This application also provides an interface rendering optimization device, please refer to Figure 4 , the interface rendering optimization device comprises:
[0081] The logic determination module 10 is used to track the session data and rewrite the chart class required for drawing and rendering corresponding to the session data through the data model to obtain the drawing logic;
[0082] A chart drawing module 20, used for drawing a scatter graph and a line graph according to a rendering request, the drawing logic and the session data;
[0083] The interface rendering module 30 is used to complete the interface rendering according to the rendering timing, the scatter plot and the line graph.
[0084] Furthermore, the logic determination module 10 is also used to track session data, organize the session data and input it into the data model for data visualization view tracking, determine the chart class required for drawing and rendering corresponding to the session data; rewrite the chart class to obtain drawing logic.
[0085] Furthermore, the chart drawing module 20 is also used to obtain a rendering request; determine a custom chart and a custom timeline according to the rendering request and the drawing logic; and draw a scatter chart and a line chart according to the custom chart, the custom timeline, and the session data.
[0086] Furthermore, the interface rendering module 30 is also used to determine the line segment drawing data based on the scatter plot and the line graph; determine the downsampling start time based on the custom timeline, and manage the line segment drawing data according to the downsampling start time to obtain target line segment drawing data; complete the interface rendering according to the rendering timing and the target line segment drawing data.
[0087] Furthermore, the interface rendering module 30 is also used to compare the sliding time window corresponding to the custom time axis with a preset threshold to obtain a comparison result; determine the downsampling start time according to the comparison result, and manage the line segment drawing data according to the downsampling start time to obtain the target line segment drawing data.
[0088] Furthermore, the interface rendering module 30 is also used to obtain the line segment drawing data to be rendered from the target line segment drawing data according to the rendering timing and the downsampling start time; and complete the interface rendering according to the line segment drawing data to be rendered.
[0089] The interface rendering optimization device provided by the present application adopts the interface rendering optimization method in the above embodiment, which can solve the technical problem of interface rendering optimization. Compared with the prior art, the beneficial effects of the interface rendering optimization device provided by the present application are the same as the beneficial effects of the interface rendering optimization method provided by the above embodiment, and the other technical features in the interface rendering optimization device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0090] The present application provides an interface rendering optimization device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the interface rendering optimization method in the above-mentioned first embodiment.
[0091] Reference below Figure 5 , which shows a schematic diagram of the structure of an interface rendering optimization device suitable for implementing an embodiment of the present application. The interface rendering optimization device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 5 The interface rendering optimization device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0092] like Figure 5 As shown, the interface rendering optimization device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the interface rendering optimization device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touchpad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the interface rendering optimization device to communicate wirelessly or wired with other devices to exchange data. Although the figure shows an interface rendering optimization device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0093] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0094] The interface rendering optimization device provided by the present application adopts the interface rendering optimization method in the above embodiment to solve the technical problem of interface rendering optimization. Compared with the prior art, the beneficial effects of the interface rendering optimization device provided by the present application are the same as the beneficial effects of the interface rendering optimization method provided by the above embodiment, and the other technical features in the interface rendering optimization device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0095] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0096] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0097] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the interface rendering optimization method in the above-mentioned embodiment.
[0098] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0099] The above-mentioned computer-readable storage medium may be included in the interface rendering optimization device; or it may exist independently without being assembled into the interface rendering optimization device.
[0100] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the interface rendering optimization device, the interface rendering optimization device: When the interface rendering optimization device is executed, the interface rendering optimization device: tracks session data, and rewrites the chart class required for drawing and rendering corresponding to the session data through the data model to obtain the drawing logic; draws a scatter graph and a line graph according to the rendering request, the drawing logic, and the session data; completes the interface rendering according to the rendering timing, the scatter graph, and the line graph.
[0101] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0103] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0104] The readable storage medium provided in this application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned interface rendering optimization method, and can solve the technical problems of interface rendering optimization. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as the beneficial effects of the interface rendering optimization method provided in the above-mentioned embodiment, and will not be repeated here.
[0105] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for optimizing interface rendering, It is characterized in that The interface rendering optimization method comprises the following steps: Tracking session data, and rewriting the chart class required for drawing and rendering corresponding to the session data through the data model to obtain drawing logic; Draw a scatter plot and a line plot according to the rendering request, the drawing logic, and the session data, wherein the scatter plot and line plot drawing process implements a custom chart by using the QQuickPaintedItem class, rewrites the chart class, and the chart class inherits QQuickPaintedItem. In the paint event of the chart class, QPainter is used to draw data of various Series, and setRenderTarget(QQuickPaintedItem::FrameBufferObject) is used to set the rendering object to FBO, and the renderReqest() interface is exposed, LineSeries and ScatterSeries classes are created, and the DataManager module is decomposed into BaseSeries; Complete interface rendering according to the rendering timing, the scatter plot and the line plot; The step of drawing a scatter graph and a line graph according to the rendering request, the drawing logic, and the session data includes: Get the rendering request; Determine a custom chart and a custom timeline according to the rendering request and the drawing logic; Draw a scatter plot and a line plot according to the custom chart, the custom timeline, and the session data; The step of completing interface rendering according to the rendering timing, the scatter plot, and the line graph includes: Determine line segment drawing data according to the scatter plot and the line graph; Compare the sliding time window corresponding to the custom time axis with a preset threshold to obtain a comparison result; Determine a downsampling start time according to the comparison result, and manage the line segment drawing data according to the downsampling start time to obtain target line segment drawing data; Complete interface rendering according to the rendering timing and the target line segment drawing data; The step of tracking session data and rewriting the chart class required for drawing and rendering corresponding to the session data through the data model to obtain the drawing logic includes: Tracking session data, and organizing the session data and inputting it into a data model for data visualization view tracking, and determining a chart class required for drawing and rendering corresponding to the session data; The chart class is rewritten to obtain drawing logic.
2. The interface rendering optimization method according to claim 1, It is characterized in that The step of completing interface rendering according to the rendering timing and the target line segment drawing data includes: Acquire the line segment drawing data to be rendered from the target line segment drawing data according to the rendering timing and the downsampling start time; The interface rendering is completed according to the line segment drawing data to be rendered.
3. An interface rendering optimization device, It is characterized in that The interface rendering optimization device includes: a memory, a processor, and an interface rendering optimization program stored in the memory and executable on the processor. When the interface rendering optimization program is executed by the processor, the interface rendering optimization method according to any one of claims 1 or 2 is implemented.
4. A storage medium, It is characterized in that The storage medium stores an interface rendering optimization program, and when the interface rendering optimization program is executed by the processor, the interface rendering optimization method according to any one of claims 1 or 2 is implemented.
5. An interface rendering optimization device, It is characterized in that The interface rendering optimization device comprises: A logic determination module, used to track session data and rewrite the chart class required for drawing and rendering corresponding to the session data through a data model to obtain drawing logic; A chart drawing module, used for drawing scatter plots and line graphs according to a rendering request, the drawing logic and the session data, wherein the scatter plot and line graph drawing process implements a custom chart by using the QQuickPaintedItem class, rewrites the chart class, and the chart class inherits QQuickPaintedItem. In the paint event of the chart class, QPainter is used to draw data of various Series, and setRenderTarget(QQuickPaintedItem::FrameBufferObject) is used to set the rendering object to FBO, and the renderReqest() interface is exposed, LineSeries and ScatterSeries classes are created, and the DataManager module is decomposed into BaseSeries; An interface rendering module, used to complete interface rendering according to the rendering timing, the scatter plot and the line graph; The step of drawing a scatter graph and a line graph according to the rendering request, the drawing logic, and the session data includes: Get the rendering request; Determine a custom chart and a custom timeline according to the rendering request and the drawing logic; Draw a scatter plot and a line plot according to the custom chart, the custom timeline, and the session data; The step of completing interface rendering according to the rendering timing, the scatter plot, and the line graph includes: Determine line segment drawing data according to the scatter plot and the line graph; Compare the sliding time window corresponding to the custom time axis with a preset threshold to obtain a comparison result; Determine a downsampling start time according to the comparison result, and manage the line segment drawing data according to the downsampling start time to obtain target line segment drawing data; Complete interface rendering according to the rendering timing and the target line segment drawing data; The step of tracking session data and rewriting the chart class required for drawing and rendering corresponding to the session data through the data model to obtain the drawing logic includes: Tracking session data, and organizing the session data and inputting it into a data model for data visualization view tracking, and determining a chart class required for drawing and rendering corresponding to the session data; The chart class is rewritten to obtain drawing logic.
6. A computer program product, It is characterized in that The computer program product includes an interface rendering optimization program, and when the interface rendering optimization program is executed by a processor, the steps of the interface rendering optimization method according to any one of claims 1 or 2 are implemented.
